diff --git a/src/__tests__/checkout.spec.ts b/src/__tests__/checkout.spec.ts index 9c877ae7b..a61e55c45 100644 --- a/src/__tests__/checkout.spec.ts +++ b/src/__tests__/checkout.spec.ts @@ -543,11 +543,11 @@ describe("Checkout", (): void => { test("Should delete stored paymentMethod", async (): Promise => { scope.delete("/storedPaymentMethods/12321") - .reply(200, { - "id": "123" - }); + .reply(200); + + await expect( + checkoutService.RecurringApi.deleteTokenForStoredPaymentDetails("12321"), + ).resolves.not.toThrowError(); - const deletePaymentMethodResponse = await checkoutService.RecurringApi.deleteTokenForStoredPaymentDetails("12321"); - expect(deletePaymentMethodResponse.id).toEqual("123"); }); }); diff --git a/src/services/balancePlatform/balanceAccountsApi.ts b/src/services/balancePlatform/balanceAccountsApi.ts index fc1f216fe..9c0a3702a 100644 --- a/src/services/balancePlatform/balanceAccountsApi.ts +++ b/src/services/balancePlatform/balanceAccountsApi.ts @@ -14,6 +14,7 @@ import { BalanceAccount } from "../../typings/balancePlatform/models"; import { BalanceAccountInfo } from "../../typings/balancePlatform/models"; import { BalanceAccountUpdateRequest } from "../../typings/balancePlatform/models"; import { BalanceSweepConfigurationsResponse } from "../../typings/balancePlatform/models"; +import { CreateSweepConfigurationV2 } from "../../typings/balancePlatform/models"; import { PaginatedPaymentInstrumentsResponse } from "../../typings/balancePlatform/models"; import { SweepConfigurationV2 } from "../../typings/balancePlatform/models"; import { UpdateSweepConfigurationV2 } from "../../typings/balancePlatform/models"; @@ -190,16 +191,16 @@ export class BalanceAccountsApi extends Service { /** * @summary Create a sweep * @param balanceAccountId {@link string } The unique identifier of the balance account. - * @param sweepConfigurationV2 {@link SweepConfigurationV2 } + * @param createSweepConfigurationV2 {@link CreateSweepConfigurationV2 } * @param requestOptions {@link IRequest.Options} * @return {@link SweepConfigurationV2 } */ - public async createSweep(balanceAccountId: string, sweepConfigurationV2: SweepConfigurationV2, requestOptions?: IRequest.Options): Promise { + public async createSweep(balanceAccountId: string, createSweepConfigurationV2: CreateSweepConfigurationV2, requestOptions?: IRequest.Options): Promise { const endpoint = `${this.baseUrl}/balanceAccounts/{balanceAccountId}/sweeps` .replace("{" + "balanceAccountId" + "}", encodeURIComponent(String(balanceAccountId))); const resource = new Resource(this, endpoint); - const request: SweepConfigurationV2 = ObjectSerializer.serialize(sweepConfigurationV2, "SweepConfigurationV2"); - const response = await getJsonResponse( + const request: CreateSweepConfigurationV2 = ObjectSerializer.serialize(createSweepConfigurationV2, "CreateSweepConfigurationV2"); + const response = await getJsonResponse( resource, request, { ...requestOptions, method: "POST" } diff --git a/src/services/balancePlatform/index.ts b/src/services/balancePlatform/index.ts index 1a2cefbb2..503e43af8 100644 --- a/src/services/balancePlatform/index.ts +++ b/src/services/balancePlatform/index.ts @@ -17,6 +17,7 @@ import { PaymentInstrumentGroupsApi } from "./paymentInstrumentGroupsApi"; import { PaymentInstrumentsApi } from "./paymentInstrumentsApi"; import { PlatformApi } from "./platformApi"; import { TransactionRulesApi } from "./transactionRulesApi"; +import { TransferRoutesApi } from "./transferRoutesApi"; import Service from "../../service"; import Client from "../../client"; @@ -66,4 +67,8 @@ export default class BalancePlatformAPI extends Service { public get TransactionRulesApi() { return new TransactionRulesApi(this.client); } + + public get TransferRoutesApi() { + return new TransferRoutesApi(this.client); + } } diff --git a/src/services/balancePlatform/transferRoutesApi.ts b/src/services/balancePlatform/transferRoutesApi.ts new file mode 100644 index 000000000..00b8e03fa --- /dev/null +++ b/src/services/balancePlatform/transferRoutesApi.ts @@ -0,0 +1,46 @@ +/* + * The version of the OpenAPI document: v2 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +import Client from "../../client"; +import { TransferRouteRequest } from "../../typings/balancePlatform/models"; +import { TransferRouteResponse } from "../../typings/balancePlatform/models"; +import { IRequest } from "../../typings/requestOptions"; +import Resource from "../resource"; +import { ObjectSerializer } from "../../typings/balancePlatform/models"; + +export class TransferRoutesApi extends Service { + + private readonly API_BASEPATH: string = "https://balanceplatform-api-test.adyen.com/bcl/v2"; + private baseUrl: string; + + public constructor(client: Client){ + super(client); + this.baseUrl = this.createBaseUrl(this.API_BASEPATH); + } + + /** + * @summary Calculate transfer routes + * @param transferRouteRequest {@link TransferRouteRequest } + * @param requestOptions {@link IRequest.Options} + * @return {@link TransferRouteResponse } + */ + public async calculateTransferRoutes(transferRouteRequest: TransferRouteRequest, requestOptions?: IRequest.Options): Promise { + const endpoint = `${this.baseUrl}/transferRoutes/calculate`; + const resource = new Resource(this, endpoint); + const request: TransferRouteRequest = ObjectSerializer.serialize(transferRouteRequest, "TransferRouteRequest"); + const response = await getJsonResponse( + resource, + request, + { ...requestOptions, method: "POST" } + ); + return ObjectSerializer.deserialize(response, "TransferRouteResponse"); + } +} diff --git a/src/services/checkout/recurringApi.ts b/src/services/checkout/recurringApi.ts index 229082a9c..26c8c9792 100644 --- a/src/services/checkout/recurringApi.ts +++ b/src/services/checkout/recurringApi.ts @@ -11,7 +11,6 @@ import getJsonResponse from "../../helpers/getJsonResponse"; import Service from "../../service"; import Client from "../../client"; import { ListStoredPaymentMethodsResponse } from "../../typings/checkout/models"; -import { StoredPaymentMethodResource } from "../../typings/checkout/models"; import { IRequest } from "../../typings/requestOptions"; import Resource from "../resource"; import { ObjectSerializer } from "../../typings/checkout/models"; @@ -32,18 +31,16 @@ export class RecurringApi extends Service { * @param shopperReference {@link string } Your reference to uniquely identify this shopper, for example user ID or account ID. Minimum length: 3 characters. > Your reference must not include personally identifiable information (PII), for example name or email address. * @param merchantAccount {@link string } Your merchant account. * @param requestOptions {@link IRequest.Options} - * @return {@link StoredPaymentMethodResource } */ - public async deleteTokenForStoredPaymentDetails(storedPaymentMethodId: string, requestOptions?: IRequest.Options): Promise { + public async deleteTokenForStoredPaymentDetails(storedPaymentMethodId: string, requestOptions?: IRequest.Options): Promise { const endpoint = `${this.baseUrl}/storedPaymentMethods/{storedPaymentMethodId}` .replace("{" + "storedPaymentMethodId" + "}", encodeURIComponent(String(storedPaymentMethodId))); const resource = new Resource(this, endpoint); - const response = await getJsonResponse( + await getJsonResponse( resource, "", { ...requestOptions, method: "DELETE" } ); - return ObjectSerializer.deserialize(response, "StoredPaymentMethodResource"); } /** diff --git a/src/services/legalEntityManagement/pCIQuestionnairesApi.ts b/src/services/legalEntityManagement/pCIQuestionnairesApi.ts index 81e1d3759..a420896c9 100644 --- a/src/services/legalEntityManagement/pCIQuestionnairesApi.ts +++ b/src/services/legalEntityManagement/pCIQuestionnairesApi.ts @@ -70,7 +70,7 @@ export class PCIQuestionnairesApi extends Service { /** * @summary Generate PCI questionnaire - * @param id {@link string } The legal entity ID of the individual who will sign the PCI questionnaire. + * @param id {@link string } The unique identifier of the legal entity to get PCI questionnaire information. * @param generatePciDescriptionRequest {@link GeneratePciDescriptionRequest } * @param requestOptions {@link IRequest.Options} * @return {@link GeneratePciDescriptionResponse } diff --git a/src/services/legalEntityManagement/termsOfServiceApi.ts b/src/services/legalEntityManagement/termsOfServiceApi.ts index 2aeb31723..7bb299f34 100644 --- a/src/services/legalEntityManagement/termsOfServiceApi.ts +++ b/src/services/legalEntityManagement/termsOfServiceApi.ts @@ -32,7 +32,7 @@ export class TermsOfServiceApi extends Service { /** * @summary Get Terms of Service information for a legal entity - * @param id {@link string } The unique identifier of the legal entity. + * @param id {@link string } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. * @param requestOptions {@link IRequest.Options} * @return {@link GetTermsOfServiceAcceptanceInfosResponse } */ @@ -50,7 +50,7 @@ export class TermsOfServiceApi extends Service { /** * @summary Get Terms of Service status - * @param id {@link string } The unique identifier of the legal entity. + * @param id {@link string } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. * @param requestOptions {@link IRequest.Options} * @return {@link CalculateTermsOfServiceStatusResponse } */ @@ -68,7 +68,7 @@ export class TermsOfServiceApi extends Service { /** * @summary Accept Terms of Service - * @param id {@link string } The unique identifier of the legal entity. + * @param id {@link string } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. * @param termsofservicedocumentid {@link string } The unique identifier of the Terms of Service document. * @param acceptTermsOfServiceRequest {@link AcceptTermsOfServiceRequest } * @param requestOptions {@link IRequest.Options} @@ -90,7 +90,7 @@ export class TermsOfServiceApi extends Service { /** * @summary Get Terms of Service document - * @param id {@link string } The unique identifier of the legal entity. + * @param id {@link string } The unique identifier of the legal entity. For sole proprietorships, this is the individual legal entity ID of the owner. * @param getTermsOfServiceDocumentRequest {@link GetTermsOfServiceDocumentRequest } * @param requestOptions {@link IRequest.Options} * @return {@link GetTermsOfServiceDocumentResponse } diff --git a/src/services/management/androidFilesCompanyLevelApi.ts b/src/services/management/androidFilesCompanyLevelApi.ts new file mode 100644 index 000000000..dd6ca89fb --- /dev/null +++ b/src/services/management/androidFilesCompanyLevelApi.ts @@ -0,0 +1,92 @@ +/* + * 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. + */ + +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +import Client from "../../client"; +import { AndroidApp } from "../../typings/management/models"; +import { AndroidAppsResponse } from "../../typings/management/models"; +import { AndroidCertificatesResponse } from "../../typings/management/models"; +import { IRequest } from "../../typings/requestOptions"; +import Resource from "../resource"; +import { ObjectSerializer } from "../../typings/management/models"; + +export class AndroidFilesCompanyLevelApi extends Service { + + private readonly API_BASEPATH: string = "https://management-test.adyen.com/v1"; + private baseUrl: string; + + public constructor(client: Client){ + super(client); + this.baseUrl = this.createBaseUrl(this.API_BASEPATH); + } + + /** + * @summary Get a list of Android apps + * @param companyId {@link string } The unique identifier of the company account. + * @param pageNumber {@link number } The number of the page to fetch. + * @param pageSize {@link number } The number of items to have on a page, maximum 100. The default is 20 items on a page. + * @param packageName {@link string } The package name that uniquely identifies the Android app. + * @param versionCode {@link number } The version number of the app. + * @param requestOptions {@link IRequest.Options} + * @return {@link AndroidAppsResponse } + */ + public async listAndroidApps(companyId: string, requestOptions?: IRequest.Options): Promise { + const endpoint = `${this.baseUrl}/companies/{companyId}/androidApps` + .replace("{" + "companyId" + "}", encodeURIComponent(String(companyId))); + const resource = new Resource(this, endpoint); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "AndroidAppsResponse"); + } + + /** + * @summary Get Android app + * @param companyId {@link string } The unique identifier of the company account. + * @param id {@link string } The unique identifier of the app. + * @param requestOptions {@link IRequest.Options} + * @return {@link AndroidApp } + */ + public async getAndroidApp(companyId: string, id: string, requestOptions?: IRequest.Options): Promise { + const endpoint = `${this.baseUrl}/companies/{companyId}/androidApps/{id}` + .replace("{" + "companyId" + "}", encodeURIComponent(String(companyId))) + .replace("{" + "id" + "}", encodeURIComponent(String(id))); + const resource = new Resource(this, endpoint); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "AndroidApp"); + } + + /** + * @summary Get a list of Android certificates + * @param companyId {@link string } The unique identifier of the company account. + * @param pageNumber {@link number } The number of the page to fetch. + * @param pageSize {@link number } The number of items to have on a page, maximum 100. The default is 20 items on a page. + * @param certificateName {@link string } The name of the certificate. + * @param requestOptions {@link IRequest.Options} + * @return {@link AndroidCertificatesResponse } + */ + public async listAndroidCertificates(companyId: string, requestOptions?: IRequest.Options): Promise { + const endpoint = `${this.baseUrl}/companies/{companyId}/androidCertificates` + .replace("{" + "companyId" + "}", encodeURIComponent(String(companyId))); + const resource = new Resource(this, endpoint); + const response = await getJsonResponse( + resource, + "", + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "AndroidCertificatesResponse"); + } +} diff --git a/src/services/management/index.ts b/src/services/management/index.ts index 710db27e5..859e026f6 100644 --- a/src/services/management/index.ts +++ b/src/services/management/index.ts @@ -16,6 +16,7 @@ import { AccountMerchantLevelApi } from "./accountMerchantLevelApi"; import { AccountStoreLevelApi } from "./accountStoreLevelApi"; import { AllowedOriginsCompanyLevelApi } from "./allowedOriginsCompanyLevelApi"; import { AllowedOriginsMerchantLevelApi } from "./allowedOriginsMerchantLevelApi"; +import { AndroidFilesCompanyLevelApi } from "./androidFilesCompanyLevelApi"; import { ClientKeyCompanyLevelApi } from "./clientKeyCompanyLevelApi"; import { ClientKeyMerchantLevelApi } from "./clientKeyMerchantLevelApi"; import { MyAPICredentialApi } from "./myAPICredentialApi"; @@ -81,6 +82,10 @@ export default class ManagementAPI extends Service { return new AllowedOriginsMerchantLevelApi(this.client); } + public get AndroidFilesCompanyLevelApi() { + return new AndroidFilesCompanyLevelApi(this.client); + } + public get ClientKeyCompanyLevelApi() { return new ClientKeyCompanyLevelApi(this.client); } diff --git a/src/services/management/terminalActionsCompanyLevelApi.ts b/src/services/management/terminalActionsCompanyLevelApi.ts index db9fff80b..95c3f71bb 100644 --- a/src/services/management/terminalActionsCompanyLevelApi.ts +++ b/src/services/management/terminalActionsCompanyLevelApi.ts @@ -10,8 +10,6 @@ import getJsonResponse from "../../helpers/getJsonResponse"; import Service from "../../service"; import Client from "../../client"; -import { AndroidAppsResponse } from "../../typings/management/models"; -import { AndroidCertificatesResponse } from "../../typings/management/models"; import { ExternalTerminalAction } from "../../typings/management/models"; import { ListExternalTerminalActionsResponse } from "../../typings/management/models"; import { IRequest } from "../../typings/requestOptions"; @@ -28,49 +26,6 @@ export class TerminalActionsCompanyLevelApi extends Service { this.baseUrl = this.createBaseUrl(this.API_BASEPATH); } - /** - * @summary Get a list of Android apps - * @param companyId {@link string } The unique identifier of the company account. - * @param pageNumber {@link number } The number of the page to fetch. - * @param pageSize {@link number } The number of items to have on a page, maximum 100. The default is 20 items on a page. - * @param packageName {@link string } The package name that uniquely identifies the Android app. - * @param versionCode {@link number } The version number of the app. - * @param requestOptions {@link IRequest.Options} - * @return {@link AndroidAppsResponse } - */ - public async listAndroidApps(companyId: string, requestOptions?: IRequest.Options): Promise { - const endpoint = `${this.baseUrl}/companies/{companyId}/androidApps` - .replace("{" + "companyId" + "}", encodeURIComponent(String(companyId))); - const resource = new Resource(this, endpoint); - const response = await getJsonResponse( - resource, - "", - { ...requestOptions, method: "GET" } - ); - return ObjectSerializer.deserialize(response, "AndroidAppsResponse"); - } - - /** - * @summary Get a list of Android certificates - * @param companyId {@link string } The unique identifier of the company account. - * @param pageNumber {@link number } The number of the page to fetch. - * @param pageSize {@link number } The number of items to have on a page, maximum 100. The default is 20 items on a page. - * @param certificateName {@link string } The name of the certificate. - * @param requestOptions {@link IRequest.Options} - * @return {@link AndroidCertificatesResponse } - */ - public async listAndroidCertificates(companyId: string, requestOptions?: IRequest.Options): Promise { - const endpoint = `${this.baseUrl}/companies/{companyId}/androidCertificates` - .replace("{" + "companyId" + "}", encodeURIComponent(String(companyId))); - const resource = new Resource(this, endpoint); - const response = await getJsonResponse( - resource, - "", - { ...requestOptions, method: "GET" } - ); - return ObjectSerializer.deserialize(response, "AndroidCertificatesResponse"); - } - /** * @summary Get a list of terminal actions * @param companyId {@link string } The unique identifier of the company account.