UNPKG

@adyen/api-library

Version:

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

123 lines 7.06 kB
"use strict"; /* * The version of the OpenAPI document: v1 * * * 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.PaymentsAppAPI = void 0; const getJsonResponse_1 = __importDefault(require("../helpers/getJsonResponse")); const service_1 = __importDefault(require("../service")); const resource_1 = __importDefault(require("./resource")); const models_1 = require("../typings/paymentsApp/models"); /** * This class is deprecated * * The service has been moved to a different package 'paymentsApp' * @deprecated Use services/paymentsApp/PaymentsAppAPI */ class PaymentsAppAPI extends service_1.default { constructor(client) { super(client); this.API_BASEPATH = "https://management-live.adyen.com/v1"; this.baseUrl = this.createBaseUrl(this.API_BASEPATH); } /** * @deprecated Use services/paymentsApp/PaymentsAppAPI * * @summary Create a boarding token - merchant level * @param merchantId {@link string } The unique identifier of the merchant account. * @param boardingTokenRequest {@link BoardingTokenRequest } * @param requestOptions {@link IRequest.Options } * @return {@link BoardingTokenResponse } */ async generatePaymentsAppBoardingTokenForMerchant(merchantId, boardingTokenRequest, requestOptions) { const endpoint = `${this.baseUrl}/merchants/{merchantId}/generatePaymentsAppBoardingToken` .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId))); const resource = new resource_1.default(this, endpoint); const request = models_1.ObjectSerializer.serialize(boardingTokenRequest, "BoardingTokenRequest", ""); const response = await (0, getJsonResponse_1.default)(resource, request, { ...requestOptions, method: "POST" }); return models_1.ObjectSerializer.deserialize(response, "BoardingTokenResponse", ""); } /** * @deprecated Use services/paymentsApp/PaymentsAppAPI * * @summary Create a boarding token - store level * @param merchantId {@link string } The unique identifier of the merchant account. * @param storeId {@link string } The unique identifier of the store. * @param boardingTokenRequest {@link BoardingTokenRequest } * @param requestOptions {@link IRequest.Options } * @return {@link BoardingTokenResponse } */ async generatePaymentsAppBoardingTokenForStore(merchantId, storeId, boardingTokenRequest, requestOptions) { const endpoint = `${this.baseUrl}/merchants/{merchantId}/stores/{storeId}/generatePaymentsAppBoardingToken` .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId))) .replace("{" + "storeId" + "}", encodeURIComponent(String(storeId))); const resource = new resource_1.default(this, endpoint); const request = models_1.ObjectSerializer.serialize(boardingTokenRequest, "BoardingTokenRequest", ""); const response = await (0, getJsonResponse_1.default)(resource, request, { ...requestOptions, method: "POST" }); return models_1.ObjectSerializer.deserialize(response, "BoardingTokenResponse", ""); } /** * @deprecated Use services/paymentsApp/PaymentsAppAPI * * @summary Get a list of Payments Apps - merchant level * @param merchantId {@link string } The unique identifier of the merchant account. * @param requestOptions {@link IRequest.Options } * @param statuses {@link string } The status of the Payments App. Comma-separated list of one or more values. If no value is provided, the list returns all statuses. Possible values: * **BOARDING** * **BOARDED** * **REVOKED** * @param limit {@link number } The number of items to return. * @param offset {@link number } The number of items to skip. * @return {@link PaymentsAppResponse } */ async listPaymentsAppForMerchant(merchantId, requestOptions) { const endpoint = `${this.baseUrl}/merchants/{merchantId}/paymentsApps` .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId))); const resource = new resource_1.default(this, endpoint); const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "GET" }); return models_1.ObjectSerializer.deserialize(response, "PaymentsAppResponse", ""); } /** * @deprecated Use services/paymentsApp/PaymentsAppAPI * * @summary Get a list of Payments Apps - store level * @param merchantId {@link string } The unique identifier of the merchant account. * @param storeId {@link string } The unique identifier of the store. * @param requestOptions {@link IRequest.Options } * @param statuses {@link string } The status of the Payments App. Comma-separated list of one or more values. If no value is provided, the list returns all statuses. Possible values: * **BOARDING** * **BOARDED** * **REVOKED** * @param limit {@link number } The number of items to return. * @param offset {@link number } The number of items to skip. * @return {@link PaymentsAppResponse } */ async listPaymentsAppForStore(merchantId, storeId, requestOptions) { const endpoint = `${this.baseUrl}/merchants/{merchantId}/stores/{storeId}/paymentsApps` .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId))) .replace("{" + "storeId" + "}", encodeURIComponent(String(storeId))); const resource = new resource_1.default(this, endpoint); const response = await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "GET" }); return models_1.ObjectSerializer.deserialize(response, "PaymentsAppResponse", ""); } /** * @deprecated Use services/paymentsApp/PaymentsAppAPI * * @summary Revoke Payments App instance authentication * @param merchantId {@link string } The unique identifier of the merchant account. * @param installationId {@link string } The unique identifier of the Payments App instance on a device. * @param requestOptions {@link IRequest.Options } */ async revokePaymentsApp(merchantId, installationId, requestOptions) { const endpoint = `${this.baseUrl}/merchants/{merchantId}/paymentsApps/{installationId}/revoke` .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId))) .replace("{" + "installationId" + "}", encodeURIComponent(String(installationId))); const resource = new resource_1.default(this, endpoint); await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "POST" }); } } exports.PaymentsAppAPI = PaymentsAppAPI; exports.default = PaymentsAppAPI; //# sourceMappingURL=paymentsAppApi.js.map