UNPKG

@adyen/api-library

Version:

The Adyen API Library for NodeJS enables you to work with Adyen APIs.

69 lines 3.33 kB
"use strict"; /* * The version of the OpenAPI document: v3 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit this class manually. */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.HostedOnboardingApi = void 0; const getJsonResponse_1 = __importDefault(require("../../helpers/getJsonResponse")); const service_1 = __importDefault(require("../../service")); const resource_1 = __importDefault(require("../resource")); const objectSerializer_1 = require("../../typings/legalEntityManagement/objectSerializer"); /** * API handler for HostedOnboardingApi */ class HostedOnboardingApi extends service_1.default { constructor(client) { super(client); this.API_BASEPATH = "https://kyc-test.adyen.com/lem/v3"; this.baseUrl = this.createBaseUrl(this.API_BASEPATH); } /** * @summary Get a link to an Adyen-hosted onboarding page * @param id {@link string } The unique identifier of the legal entity * @param onboardingLinkInfo {@link OnboardingLinkInfo } * @param requestOptions {@link IRequest.Options } * @return {@link OnboardingLink } */ async getLinkToAdyenhostedOnboardingPage(id, onboardingLinkInfo, requestOptions) { const endpoint = `${this.baseUrl}/legalEntities/{id}/onboardingLinks` .replace("{" + "id" + "}", encodeURIComponent(String(id))); const resource = new resource_1.default(this, endpoint); const request = objectSerializer_1.ObjectSerializer.serialize(onboardingLinkInfo, "OnboardingLinkInfo"); const response = await (0, getJsonResponse_1.default)(resource, request, { ...requestOptions, method: "POST" }); return objectSerializer_1.ObjectSerializer.deserialize(response, "OnboardingLink"); } /** * @summary Get an onboarding link theme * @param id {@link string } The unique identifier of the theme * @param requestOptions {@link IRequest.Options } * @return {@link OnboardingTheme } */ async getOnboardingLinkTheme(id, requestOptions) { const endpoint = `${this.baseUrl}/themes/{id}` .replace("{" + "id" + "}", encodeURIComponent(String(id))); const resource = new resource_1.default(this, endpoint); const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "GET" }); return objectSerializer_1.ObjectSerializer.deserialize(response, "OnboardingTheme"); } /** * @summary Get a list of hosted onboarding page themes * @param requestOptions {@link IRequest.Options } * @return {@link OnboardingThemes } */ async listHostedOnboardingPageThemes(requestOptions) { const endpoint = `${this.baseUrl}/themes`; const resource = new resource_1.default(this, endpoint); const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "GET" }); return objectSerializer_1.ObjectSerializer.deserialize(response, "OnboardingThemes"); } } exports.HostedOnboardingApi = HostedOnboardingApi; //# sourceMappingURL=hostedOnboardingApi.js.map