UNPKG

bc-payments-sdk

Version:

BetterCommerce's Payments NodeJS SDK is a complete solution for storefront clients that integrate payments. `bc-payments-sdk` is a single point interface for storefront clients for interacting with payment gateways.

20 lines (19 loc) 782 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GiftCard = void 0; const api_1 = require("./api"); const RequestMethod_1 = require("../../constants/enums/RequestMethod"); const Endpoints_1 = require("../../constants/Endpoints"); class GiftCard { /** * Redeems a gift card after successful payment * @param orderId - The order ID * @param data - Gift card information * @returns Promise with redemption result */ static async redeem(data, { headers, cookies }) { const redeemResult = await api_1.Api.call(`giftcard/gift-cards/redeem`, RequestMethod_1.RequestMethod.POST, data, headers, cookies, true, Endpoints_1.Endpoints.Base.APIS_URL); return redeemResult; } } exports.GiftCard = GiftCard;