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.

27 lines (26 loc) 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.B2B = void 0; const api_1 = require("./api"); const RequestMethod_1 = require("../../constants/enums/RequestMethod"); /** * Class {B2B} includes methods for interacting with the B2B API. * * The B2B API allows retrieval of company details associated with a specific user ID. */ class B2B { /** * Retrieves the company details by user id. * * @param data - The data which contains the user id * @param {headers, cookies} - The headers and cookies to pass to the request * @returns The company details * * API Reference - https://api20.bettercommerce.io/swagger/ui/index#!/B2B/B2BGetCompanyDetailByUserId */ static async getCompanyDetailsByUserId(data, { headers, cookies }) { const companyDetailsResult = await api_1.Api.call(`api/v2/commerce/b2b/${data === null || data === void 0 ? void 0 : data.userId}/company`, RequestMethod_1.RequestMethod.GET, null, headers, cookies); return companyDetailsResult; } } exports.B2B = B2B;