UNPKG

@adyen/api-library

Version:

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

104 lines 5.95 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.PayoutSettingsMerchantLevelApi = 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/management/objectSerializer"); /** * API handler for PayoutSettingsMerchantLevelApi */ class PayoutSettingsMerchantLevelApi extends service_1.default { constructor(client) { super(client); this.API_BASEPATH = "https://management-test.adyen.com/v3"; this.baseUrl = this.createBaseUrl(this.API_BASEPATH); } /** * @summary Add a payout setting * @param merchantId {@link string } The unique identifier of the merchant account. * @param payoutSettingsRequest {@link PayoutSettingsRequest } * @param requestOptions {@link IRequest.Options } * @return {@link PayoutSettings } */ async addPayoutSetting(merchantId, payoutSettingsRequest, requestOptions) { const endpoint = `${this.baseUrl}/merchants/{merchantId}/payoutSettings` .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId))); const resource = new resource_1.default(this, endpoint); const request = objectSerializer_1.ObjectSerializer.serialize(payoutSettingsRequest, "PayoutSettingsRequest"); const response = await (0, getJsonResponse_1.default)(resource, request, { ...requestOptions, method: "POST" }); return objectSerializer_1.ObjectSerializer.deserialize(response, "PayoutSettings"); } /** * @summary Delete a payout setting * @param merchantId {@link string } The unique identifier of the merchant account. * @param payoutSettingsId {@link string } The unique identifier of the payout setting. * @param requestOptions {@link IRequest.Options } * @return {@link void } */ async deletePayoutSetting(merchantId, payoutSettingsId, requestOptions) { const endpoint = `${this.baseUrl}/merchants/{merchantId}/payoutSettings/{payoutSettingsId}` .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId))) .replace("{" + "payoutSettingsId" + "}", encodeURIComponent(String(payoutSettingsId))); const resource = new resource_1.default(this, endpoint); await (0, getJsonResponse_1.default)(resource, "", { ...requestOptions, method: "DELETE" }); } /** * @summary Get a payout setting * @param merchantId {@link string } The unique identifier of the merchant account. * @param payoutSettingsId {@link string } The unique identifier of the payout setting. * @param requestOptions {@link IRequest.Options } * @return {@link PayoutSettings } */ async getPayoutSetting(merchantId, payoutSettingsId, requestOptions) { const endpoint = `${this.baseUrl}/merchants/{merchantId}/payoutSettings/{payoutSettingsId}` .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId))) .replace("{" + "payoutSettingsId" + "}", encodeURIComponent(String(payoutSettingsId))); 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, "PayoutSettings"); } /** * @summary Get a list of payout settings * @param merchantId {@link string } The unique identifier of the merchant account. * @param requestOptions {@link IRequest.Options } * @return {@link PayoutSettingsResponse } */ async listPayoutSettings(merchantId, requestOptions) { const endpoint = `${this.baseUrl}/merchants/{merchantId}/payoutSettings` .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 objectSerializer_1.ObjectSerializer.deserialize(response, "PayoutSettingsResponse"); } /** * @summary Update a payout setting * @param merchantId {@link string } The unique identifier of the merchant account. * @param payoutSettingsId {@link string } The unique identifier of the payout setting. * @param updatePayoutSettingsRequest {@link UpdatePayoutSettingsRequest } * @param requestOptions {@link IRequest.Options } * @return {@link PayoutSettings } */ async updatePayoutSetting(merchantId, payoutSettingsId, updatePayoutSettingsRequest, requestOptions) { const endpoint = `${this.baseUrl}/merchants/{merchantId}/payoutSettings/{payoutSettingsId}` .replace("{" + "merchantId" + "}", encodeURIComponent(String(merchantId))) .replace("{" + "payoutSettingsId" + "}", encodeURIComponent(String(payoutSettingsId))); const resource = new resource_1.default(this, endpoint); const request = objectSerializer_1.ObjectSerializer.serialize(updatePayoutSettingsRequest, "UpdatePayoutSettingsRequest"); const response = await (0, getJsonResponse_1.default)(resource, request, { ...requestOptions, method: "PATCH" }); return objectSerializer_1.ObjectSerializer.deserialize(response, "PayoutSettings"); } } exports.PayoutSettingsMerchantLevelApi = PayoutSettingsMerchantLevelApi; //# sourceMappingURL=payoutSettingsMerchantLevelApi.js.map