diff --git a/Makefile b/Makefile index 4c1ea5d82..01c4adf45 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ generator:=typescript-node openapi-generator-cli:=docker run --user $(shell id -u):$(shell id -g) --rm -v ${PWD}:/local -w /local openapitools/openapi-generator-cli:v5.4.0 -services:=checkout storedValue terminalManagement payments recurring payouts management platformsAccount platformsFund platformsNotificationConfiguration platformsHostedOnboardingPage +services:=checkout storedValue terminalManagement payments recurring payouts management balancePlatform platformsAccount platformsFund platformsNotificationConfiguration platformsHostedOnboardingPage # Generate models (for each service) models: $(services) @@ -12,6 +12,7 @@ payments: spec=PaymentService-v68 recurring: spec=RecurringService-v68 payouts: spec=PayoutService-v68 management: spec=ManagementService-v1 +balancePlatform: spec=BalancePlatformService-v2 platformsAccount: spec=AccountService-v6 platformsFund: spec=FundService-v6 platformsNotificationConfiguration: spec=NotificationConfigurationService-v6 diff --git a/src/__mocks__/base.ts b/src/__mocks__/base.ts index 882760590..75731d67d 100644 --- a/src/__mocks__/base.ts +++ b/src/__mocks__/base.ts @@ -47,6 +47,7 @@ export const createClient = (apiKey = process.env.ADYEN_API_KEY): Client => { config.paymentEndpoint = Client.PAYMENT_API_ENDPOINT_TEST; config.storedValueEndpoint = Client.STOREDVALUE_API_ENDPOINT_TEST; config.managementEndpoint = Client.MANAGEMENT_API_ENDPOINT_TEST; + config.balancePlatformEndpoint = Client.BALANCE_PLATFORM_API_ENDPOINT_TEST; return new Client({ config }); }; diff --git a/src/__tests__/balancePlatform.spec.ts b/src/__tests__/balancePlatform.spec.ts new file mode 100644 index 000000000..affbf474b --- /dev/null +++ b/src/__tests__/balancePlatform.spec.ts @@ -0,0 +1,759 @@ +import nock from "nock"; +import Client from "../client"; +import { createClient } from "../__mocks__/base"; +import BalancePlatform from "../services/balancePlatform"; +import * as models from "../typings/balancePlatform/models"; +import { AccountHolderUpdate } from "../services/balancePlaftform/accountHolders"; +import { SweepConfigurationV2Create, SweepConfigurationV2Update } from "../services/balancePlaftform/balanceAccounts"; + +let client: Client; +let balancePlatform: BalancePlatform; +let scope: nock.Scope; + +beforeEach((): void => { + if (!nock.isActive()) { + nock.activate(); + } + client = createClient(); + scope = nock(`${client.config.balancePlatformEndpoint}/${Client.BALANCE_PLATFORM_API_VERSION}`); + balancePlatform = new BalancePlatform(client); +}); + +afterEach(() => { + nock.cleanAll(); +}); + +describe("Balance Platform", (): void => { + const balanceAccountId = "BA32272223222B59CZ3T52DKZ"; + const sweepId = "SWPC4227C224555B5FTD2NT2JV4WN5"; + const paymentInstrumentId = "PI32272223222B5CMD3MQ3HXX"; + const paymentInstrumentGroupId = "PG3227C223222B5CMD3FJFKGZ"; + + describe("AccountHolders", (): void => { + it("should support POST /accountHolders", async (): Promise => { + scope.post("/accountHolders") + .reply(200, { + "balancePlatform": "YOUR_BALANCE_PLATFORM", + "contactDetails": { + "email": "s.hopper@example.com", + "phone": { + "number": "+315551231234", + "type": "Mobile" + }, + "address": { + "city": "Amsterdam", + "country": "NL", + "street": "Brannan Street", + "houseNumberOrName": "274", + "postalCode": "1020CD" + } + }, + "description": "S.Hopper - Staff 123", + "legalEntityId": "LE322KT223222D5FJ7THR293F", + "id": "AH3227C223222B5CMD2SXFKGT", + "status": "active" + }); + const request: models.AccountHolderInfo = { + "balancePlatform": "YOUR_BALANCE_PLATFORM", + "description": "S.Hopper - Staff 123", + "legalEntityId": "LE322KT223222D5FJ7THR293F", + "contactDetails": { + "email": "s.hopper@example.com", + "phone": { + "number": "+315551231234", + "type": models.Phone.TypeEnum.Mobile + }, + "address": { + "city": "Amsterdam", + "country": "NL", + "street": "Brannan Street", + "houseNumberOrName": "274", + "postalCode": "1020CD" + } + } + }; + + const response: models.AccountHolder = await balancePlatform.AccountHolders.create(request); + + expect(response.id).toBe("AH3227C223222B5CMD2SXFKGT"); + expect(response.legalEntityId).toBe("LE322KT223222D5FJ7THR293F"); + }); + + it("should support GET /accountHolders/{id}", async (): Promise => { + scope.get("/accountHolders/AH32272223222B5CM4MWJ892H") + .reply(200, { + "balancePlatform": "YOUR_BALANCE_PLATFORM", + "contactDetails": { + "address": { + "city": "Amsterdam", + "country": "NL", + "houseNumberOrName": "274", + "postalCode": "1020CD", + "street": "Brannan Street" + }, + "email": "s.hopper@example.com", + "phone": { + "number": "+315551231234", + "type": "Mobile" + } + }, + "description": "S.Hopper - Staff 123", + "id": "AH32272223222B5CM4MWJ892H", + "status": "Active" + }); + + const response: models.AccountHolder = await balancePlatform.AccountHolders.retrieve("AH32272223222B5CM4MWJ892H"); + + expect(response.id).toBe("AH32272223222B5CM4MWJ892H"); + expect(response.balancePlatform).toBe("YOUR_BALANCE_PLATFORM"); + }); + + it("should support PATCH /accountHolders/{id}", async (): Promise => { + scope.patch("/accountHolders/AH32272223222B5CM4MWJ892H") + .reply(200, { + "balancePlatform": "YOUR_BALANCE_PLATFORM", + "contactDetails": { + "address": { + "city": "Amsterdam", + "country": "NL", + "houseNumberOrName": "274", + "postalCode": "1020CD", + "street": "Brannan Street" + }, + "email": "s.hopper@example.com", + "phone": { + "number": "+315551231234", + "type": "Mobile" + } + }, + "description": "S.Hopper - Staff 123", + "id": "AH32272223222B5CM4MWJ892H", + "status": "Suspended" + }); + const request: AccountHolderUpdate = { + status: models.AccountHolder.StatusEnum.Suspended, + legalEntityId: "LE322KT223222D5FJ7THR293F", + }; + + const response: models.AccountHolder = await balancePlatform.AccountHolders.update('AH32272223222B5CM4MWJ892H', request); + + expect(response.status).toBe("Suspended"); + }); + + it("should support GET /accountHolders/{id}/balanceAccounts", async (): Promise => { + scope.get("/accountHolders/AH32272223222B5CM4MWJ892H/balanceAccounts?limit=5&offset=10") + .reply(200, { + "balanceAccounts": [ + { + "accountHolderId": "AH32272223222B59K6ZKBBFNQ", + "defaultCurrencyCode": "EUR", + "id": "BA32272223222B59K6ZXHBFN6", + "status": "Active" + }, + { + "accountHolderId": "AH32272223222B59K6ZKBBFNQ", + "defaultCurrencyCode": "EUR", + "id": "BA32272223222B59K72CKBFNJ", + "status": "Active" + }, + { + "accountHolderId": "AH32272223222B59K6ZKBBFNQ", + "defaultCurrencyCode": "EUR", + "id": "BA32272223222B5BRR27B2M7G", + "status": "Active" + } + ], + "hasNext": true, + "hasPrevious": false + }); + + const response: models.PaginatedBalanceAccountsResponse = await balancePlatform.AccountHolders.listBalanceAccounts("AH32272223222B5CM4MWJ892H", { + params: { + "limit": "5", + "offset": "10" + } + }); + + expect(response.balanceAccounts[0].id).toBe("BA32272223222B59K6ZXHBFN6"); + }); + }); + + describe("BalanceAccounts", (): void => { + it("should support POST /balanceAccounts", async (): Promise => { + scope.post("/balanceAccounts") + .reply(200, { + "accountHolderId": "AH32272223222B59K6ZKBBFNQ", + "defaultCurrencyCode": "EUR", + "reference": "S.Hopper - Main balance account", + "balances": [ + { + "available": 0, + "balance": 0, + "currency": "EUR", + "reserved": 0 + } + ], + "id": balanceAccountId, + "status": "active" + }); + const request: models.BalanceAccountInfo = { + "accountHolderId": "AH32272223222B59K6ZKBBFNQ", + "description": "S.Hopper - Main balance account" + }; + + const response: models.BalanceAccount = await balancePlatform.BalanceAccounts.create(request); + + expect(response.id).toBe(balanceAccountId); + }); + + it("should support GET /balanceAccounts/{balanceAccountId}/sweeps", async (): Promise => { + scope.get(`/balanceAccounts/${balanceAccountId}/sweeps`) + .reply(200, { + "hasNext": false, + "hasPrevious": false, + "sweeps": [ + { + "id": sweepId, + "schedule": { + "type": "daily" + }, + "status": "active", + "targetAmount": { + "currency": "EUR", + "value": 0 + }, + "triggerAmount": { + "currency": "EUR", + "value": 0 + }, + "type": "push", + "counterparty": { + "balanceAccountId": "BA32272223222B5FTD2KR6TJD" + }, + "currency": "EUR" + } + ] + }); + + const response: models.BalanceSweepConfigurationsResponse = await balancePlatform.BalanceAccounts.listSweeps(balanceAccountId); + + expect(response.hasNext).toBeFalsy(); + expect(response.sweeps.length).toBe(1); + }); + + it("should support POST /balanceAccounts/{balanceAccountId}/sweeps", async (): Promise => { + scope.post(`/balanceAccounts/${balanceAccountId}/sweeps`) + .reply(200, { + "id": sweepId, + "counterparty": { + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" + }, + "triggerAmount": { + "currency": "EUR", + "value": 50000 + }, + "currency": "EUR", + "schedule": { + "type": "balance" + }, + "type": "pull", + "status": "active" + }); + const request: SweepConfigurationV2Create = { + "counterparty": { + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" + }, + "triggerAmount": { + "currency": "EUR", + "value": 50000 + }, + "currency": "EUR", + "schedule": { + "type": models.SweepSchedule.TypeEnum.Balance + }, + "type": models.SweepConfigurationV2.TypeEnum.Pull, + "status": models.SweepConfigurationV2.StatusEnum.Active + }; + + const response: models.SweepConfigurationV2 = await balancePlatform.BalanceAccounts.createSweep(balanceAccountId, request); + + expect(response.id).toBe(sweepId); + expect(response.triggerAmount!.value).toBe(50000); + }); + + it("should support DELETE /balanceAccounts/{balanceAccountId}/sweeps/{sweepId}", async (): Promise => { + scope.delete(`/balanceAccounts/${balanceAccountId}/sweeps/${sweepId}`).reply(204); + + await balancePlatform.BalanceAccounts.deleteSweep(balanceAccountId, sweepId); + }); + + it("should support GET /balanceAccounts/{balanceAccountId}/sweeps/{sweepId}", async (): Promise => { + scope.get(`/balanceAccounts/${balanceAccountId}/sweeps/${sweepId}`) + .reply(200, { + "id": sweepId, + "schedule": { + "type": "daily" + }, + "status": "active", + "targetAmount": { + "currency": "EUR", + "value": 0 + }, + "triggerAmount": { + "currency": "EUR", + "value": 0 + }, + "type": "push", + "counterparty": { + "balanceAccountId": "BA32272223222B5FTD2KR6TJD" + }, + "currency": "EUR" + }); + + const response: models.SweepConfigurationV2 = await balancePlatform.BalanceAccounts.retrieveSweep(balanceAccountId, sweepId); + + expect(response.id).toBe(sweepId); + expect(response.status).toBe("active"); + }); + + it("should support PATCH /balanceAccounts/{balanceAccountId}/sweeps/{sweepId}", async (): Promise => { + scope.patch(`/balanceAccounts/${balanceAccountId}/sweeps/${sweepId}`) + .reply(200, { + "id": sweepId, + "counterparty": { + "merchantAccount": "YOUR_MERCHANT_ACCOUNT" + }, + "triggerAmount": { + "currency": "EUR", + "value": 50000 + }, + "currency": "EUR", + "schedule": { + "type": "balance" + }, + "type": "pull", + "status": "inactive" + }); + const request: SweepConfigurationV2Update = { + "status": models.SweepConfigurationV2.StatusEnum.Inactive + }; + + const response: models.SweepConfigurationV2 = await balancePlatform.BalanceAccounts.updateSweep(balanceAccountId, sweepId, request); + + expect(response.status).toBe('inactive'); + }); + + it("should support GET /balanceAccounts/{id}", async (): Promise => { + scope.get(`/balanceAccounts/${balanceAccountId}`) + .reply(200, { + "accountHolderId": "AH32272223222B59K6RTQBFNZ", + "defaultCurrencyCode": "EUR", + "balances": [ + { + "available": 0, + "balance": 0, + "currency": "EUR", + "reserved": 0 + } + ], + "id": balanceAccountId, + "status": "Active" + }); + + const response: models.BalanceAccount = await balancePlatform.BalanceAccounts.retrieve(balanceAccountId); + + expect(response.id).toBe(balanceAccountId); + expect(response.status).toBe('Active'); + }); + + it("should support PATCH /balanceAccounts/{id}", async (): Promise => { + scope.patch(`/balanceAccounts/${balanceAccountId}`) + .reply(200, { + "accountHolderId": "string", + "balances": [ + { + "available": 0, + "balance": 0, + "currency": "string", + "reserved": 0 + } + ], + "defaultCurrencyCode": "string", + "description": "Testing", + "id": "string", + "reference": "string", + "status": "active", + "timeZone": "Europe/Amsterdam" + }); + const request: models.BalanceAccountUpdateRequest = { + "description": "Testing", + "status": models.BalanceAccountUpdateRequest.StatusEnum.Active, + "timeZone": "Europe/Amsterdam" + }; + + const response: models.BalanceAccount = await balancePlatform.BalanceAccounts.update(balanceAccountId, request); + + expect(response.status).toBe("active"); + expect(response.timeZone).toBe("Europe/Amsterdam"); + }); + + it("should support GET /balanceAccounts/{id}/paymentInstruments", async (): Promise => { + scope.get(`/balanceAccounts/${balanceAccountId}/paymentInstruments?limit=3&offset=6`) + .reply(200, { + "hasNext": "true", + "hasPrevious": "false", + "paymentInstruments": [ + { + "balanceAccountId": balanceAccountId, + "issuingCountryCode": "GB", + "status": "Active", + "type": "card", + "card": { + "brandVariant": "mc", + "cardholderName": "name", + "formFactor": "virtual", + "bin": "555544", + "expiration": { + "month": "12", + "year": "2022" + }, + "lastFour": "2357", + "number": "************2357" + }, + "id": "PI32272223222B59M5TM658DT" + }, + { + "balanceAccountId": balanceAccountId, + "issuingCountryCode": "GB", + "status": "Active", + "type": "card", + "card": { + "brandVariant": "mc", + "cardholderName": "name", + "formFactor": "virtual", + "bin": "555544", + "expiration": { + "month": "01", + "year": "2023" + }, + "lastFour": "8331", + "number": "************8331" + }, + "id": "PI32272223222B59PXDGQDLSF" + } + ] + }); + + const response: models.PaginatedPaymentInstrumentsResponse = await balancePlatform.BalanceAccounts.listPaymentInstruments(balanceAccountId, { + params: { + limit: "3", + offset: "6", + } + }); + + expect(response.paymentInstruments.length).toBe(2); + expect(response.paymentInstruments[0].id).toBe("PI32272223222B59M5TM658DT"); + }); + }); + + describe("General", (): void => { + it("should support GET /balancePlatforms/{id}", async (): Promise => { + scope.get(`/balancePlatforms/${balanceAccountId}`) + .reply(200, { + "id": balanceAccountId, + "status": "Active" + }); + + const response: models.BalancePlatform = await balancePlatform.General.retrieve(balanceAccountId); + + expect(response.id).toBe(balanceAccountId); + expect(response.status).toBe("Active"); + }); + + it("should support GET /balancePlatforms/{id}/accountHolders", async (): Promise => { + scope.get(`/balancePlatforms/${balanceAccountId}/accountHolders`) + .reply(200, { + "accountHolders": [ + { + "contactDetails": { + "address": { + "city": "Amsterdam", + "country": "NL", + "houseNumberOrName": "6", + "postalCode": "12336750", + "street": "Simon Carmiggeltstraat" + } + }, + "description": "J. Doe", + "id": "AH32272223222B59DDWSCCMP7", + "status": "Active" + }, + { + "contactDetails": { + "address": { + "city": "Amsterdam", + "country": "NL", + "houseNumberOrName": "11", + "postalCode": "12336750", + "street": "Simon Carmiggeltstraat" + } + }, + "description": "S. Hopper", + "id": "AH32272223222B59DJ7QBCMPN", + "status": "Active" + } + ], + "hasNext": "true", + "hasPrevious": "false" + }); + + const response: models.PaginatedAccountHoldersResponse = await balancePlatform.General.listAccountHolders(balanceAccountId); + + expect(response.accountHolders.length).toBe(2); + expect(response.accountHolders[0].id).toBe("AH32272223222B59DDWSCCMP7"); + }); + }); + + describe("PaymentInstruments", (): void => { + it("should support POST /paymentInstruments", async (): Promise => { + scope.post(`/paymentInstruments`) + .reply(200, { + "balanceAccountId": balanceAccountId, + "description": "S. Hopper - Main card", + "issuingCountryCode": "GB", + "status": "Active", + "type": "card", + "card": { + "brand": "mc", + "brandVariant": "mcdebit", + "cardholderName": "Simon Hopper", + "formFactor": "virtual", + "bin": "555544", + "cvc": "873", + "expiration": { + "month": "01", + "year": "2024" + }, + "lastFour": "3548" + }, + "id": paymentInstrumentId + }); + const request: models.PaymentInstrumentInfo = { + "type": models.PaymentInstrumentInfo.TypeEnum.Card, + "issuingCountryCode": "NL", + "balanceAccountId": balanceAccountId, + "status": models.PaymentInstrumentInfo.StatusEnum.Inactive, + "card": { + "formFactor": models.CardInfo.FormFactorEnum.Physical, + "brand": "mc", + "brandVariant": "mcdebit", + "cardholderName": "Sam Hopper", + "deliveryContact": { + "address": { + "city": "Amsterdam", + "country": "NL", + "stateOrProvince": "NH", + "line1": "Simon Carmiggeltstraat", + "line2": "6-50", + "postalCode": "1011DJ" + }, + "name": { + "firstName": "Sam", + "lastName": "Hopper" + } + }, + "configuration": { + "configurationProfileId": "YOUR_CONFIGURATION_PROFILE_ID" + }, + }, + "description": "S.Hopper - Main card" + }; + + const response: models.PaymentInstrument = await balancePlatform.PaymentInstruments.create(request); + + expect(response.id).toBe(paymentInstrumentId); + expect(response.balanceAccountId).toBe(balanceAccountId); + }); + + it("should support GET /paymentInstruments/{id}", async (): Promise => { + scope.get(`/paymentInstruments/${paymentInstrumentId}`) + .reply(200, { + "balanceAccountId": balanceAccountId, + "description": "S. Hopper - Main card", + "issuingCountryCode": "GB", + "status": "active", + "type": "card", + "card": { + "brand": "mc", + "brandVariant": "mcdebit", + "cardholderName": "Simon Hopper", + "formFactor": "virtual", + "bin": "555544", + "expiration": { + "month": "01", + "year": "2024" + }, + "lastFour": "3548", + "number": "************3548" + }, + "id": paymentInstrumentId + }); + + const response: models.PaymentInstrument = await balancePlatform.PaymentInstruments.retrieve(paymentInstrumentId); + + expect(response.id).toBe(paymentInstrumentId); + expect(response.status).toBe("active"); + }); + + it("should support PATCH /paymentInstruments/{id}", async (): Promise => { + scope.patch(`/paymentInstruments/${paymentInstrumentId}`) + .reply(200, { + "balanceAccountId": "BA32272223222B5CM82WL892M", + "description": "S. Hopper - Main card", + "issuingCountryCode": "GB", + "status": "inactive", + "type": "card", + "card": { + "brand": "mc", + "brandVariant": "mcdebit", + "cardholderName": "Simon Hopper", + "formFactor": "virtual", + "bin": "555544", + "expiration": { + "month": "01", + "year": "2024" + }, + "lastFour": "5785", + "number": "************5785" + }, + "id": paymentInstrumentId + }); + const request: models.PaymentInstrumentUpdateRequest = { + "balanceAccountId": "BA32272223222B5CM82WL892M" + }; + + const response: models.PaymentInstrument = await balancePlatform.PaymentInstruments.update(paymentInstrumentId, request); + + expect(response.id).toBe(paymentInstrumentId); + expect(response.balanceAccountId).toBe("BA32272223222B5CM82WL892M"); + }); + + it("should support GET /paymentInstruments/{id}/transactionRules", async (): Promise => { + scope.get(`/paymentInstruments/${paymentInstrumentId}/transactionRules`) + .reply(200, { + "transactionRules": [ + { + "description": "Allow 5 transactions per month", + "interval": { + "type": "monthly" + }, + "maxTransactions": 5, + "paymentInstrumentGroupId": paymentInstrumentGroupId, + "reference": "myRule12345", + "startDate": "2021-01-25T12:46:35.476629Z", + "status": "active", + "type": "velocity", + "id": "TR32272223222B5CMDGMC9F4F" + }, + { + "amount": { + "currency": "EUR", + "value": 10000 + }, + "description": "Allow up to 100 EUR per month", + "interval": { + "type": "monthly" + }, + "paymentInstrumentGroupId": paymentInstrumentGroupId, + "reference": "myRule16378", + "startDate": "2021-01-25T12:46:35.476629Z", + "status": "active", + "type": "velocity", + "id": "TR32272223222B5CMDGT89F4F" + } + ] + }); + + const response: models.TransactionRulesResponse = await balancePlatform.PaymentInstruments.listTransactionRules(paymentInstrumentId); + + expect(response.transactionRules!.length).toBe(2); + expect(response.transactionRules![0].id).toBe("TR32272223222B5CMDGMC9F4F"); + }); + }); + + describe("PaymentInstrumentGroups", (): void => { + it("should support POST /paymentInstrumentGroups", async (): Promise => { + scope.post(`/paymentInstrumentGroups`) + .reply(200, { + "balancePlatform": "YOUR_BALANCE_PLATFORM", + "txVariant": "mc", + "id": paymentInstrumentGroupId + }); + const request: models.PaymentInstrumentGroupInfo = { + "balancePlatform": "YOUR_BALANCE_PLATFORM", + "txVariant": "mc" + }; + + const response: models.PaymentInstrumentGroup = await balancePlatform.PaymentInstrumentGroups.create(request); + + expect(response.id).toBe(paymentInstrumentGroupId); + expect(response.txVariant).toBe("mc"); + }); + + it("should support GET /paymentInstrumentGroups/{id}", async (): Promise => { + scope.get(`/paymentInstrumentGroups/${paymentInstrumentGroupId}`) + .reply(200, { + "balancePlatform": "YOUR_BALANCE_PLATFORM", + "txVariant": "mc", + "id": paymentInstrumentGroupId + }); + + const response: models.PaymentInstrumentGroup = await balancePlatform.PaymentInstrumentGroups.retrieve(paymentInstrumentGroupId); + + expect(response.id).toBe(paymentInstrumentGroupId); + expect(response.txVariant).toBe('mc'); + }); + + it("should support GET /paymentInstrumentGroups/{id}/transactionRules", async (): Promise => { + scope.get(`/paymentInstrumentGroups/${paymentInstrumentGroupId}/transactionRules`) + .reply(200, { + "transactionRules": [ + { + "description": "Allow 5 transactions per month", + "interval": { + "type": "monthly" + }, + "maxTransactions": 5, + "paymentInstrumentGroupId": paymentInstrumentGroupId, + "reference": "myRule12345", + "startDate": "2021-01-25T12:46:35.476629Z", + "status": "active", + "type": "velocity", + "id": "TR32272223222B5CMDGMC9F4F" + }, + { + "amount": { + "currency": "EUR", + "value": 10000 + }, + "description": "Allow up to 100 EUR per month", + "interval": { + "type": "monthly" + }, + "paymentInstrumentGroupId": paymentInstrumentGroupId, + "reference": "myRule16378", + "startDate": "2021-01-25T12:46:35.476629Z", + "status": "active", + "type": "velocity", + "id": "TR32272223222B5CMDGT89F4F" + } + ] + }); + + const response: models.TransactionRulesResponse = await balancePlatform.PaymentInstrumentGroups.listTransactionRules(paymentInstrumentGroupId); + + expect(response.transactionRules!.length).toBe(2); + expect(response.transactionRules![0].id).toBe("TR32272223222B5CMDGMC9F4F"); + }); + }); +}); \ No newline at end of file diff --git a/src/client.ts b/src/client.ts index 9de3579ba..9a6baaffb 100644 --- a/src/client.ts +++ b/src/client.ts @@ -78,7 +78,9 @@ class Client { public static STOREDVALUE_API_ENDPOINT_LIVE = "https://pal-live.adyen.com/pal/servlet/StoredValue"; public static MANAGEMENT_API_ENDPOINT_TEST = "https://management-test.adyen.com"; public static MANAGEMENT_API_ENDPOINT_LIVE = "https://management-live.adyen.com"; - + public static BALANCE_PLATFORM_API_VERSION = "v2"; + public static BALANCE_PLATFORM_API_ENDPOINT_TEST = "https://balanceplatform-api-test.adyen.com/bcl"; + public static BALANCE_PLATFORM_API_ENDPOINT_LIVE = "https://balanceplatform-api-live.adyen.com/bcl"; private _httpClient!: ClientInterface; public config: Config; @@ -120,6 +122,7 @@ class Client { this.config.paymentEndpoint = Client.PAYMENT_API_ENDPOINT_TEST; this.config.storedValueEndpoint = Client.STOREDVALUE_API_ENDPOINT_TEST; this.config.managementEndpoint = Client.MANAGEMENT_API_ENDPOINT_TEST; + this.config.balancePlatformEndpoint = Client.BALANCE_PLATFORM_API_ENDPOINT_TEST; } else if (environment === "LIVE") { this.config.endpoint = Client.ENDPOINT_LIVE; this.config.marketPayEndpoint = Client.MARKETPAY_ENDPOINT_LIVE; @@ -128,6 +131,7 @@ class Client { this.config.paymentEndpoint = Client.PAYMENT_API_ENDPOINT_LIVE; this.config.storedValueEndpoint = Client.STOREDVALUE_API_ENDPOINT_LIVE; this.config.managementEndpoint = Client.MANAGEMENT_API_ENDPOINT_LIVE; + this.config.balancePlatformEndpoint = Client.BALANCE_PLATFORM_API_ENDPOINT_LIVE; if (liveEndpointUrlPrefix) { this.config.endpoint = diff --git a/src/config.ts b/src/config.ts index 5ca178e69..73c59526e 100644 --- a/src/config.ts +++ b/src/config.ts @@ -37,6 +37,7 @@ interface ConfigConstructor { paymentEndpoint?: string; storedValueEndpoint?: string; managementEndpoint?: string; + balancePlatformEndpoint?: string; } class Config { @@ -64,6 +65,7 @@ class Config { public paymentEndpoint?: string; public storedValueEndpoint?: string; public managementEndpoint?: string; + public balancePlatformEndpoint?: string; public constructor(options: ConfigConstructor = {}) { if (options.username) this.username = options.username; @@ -86,7 +88,7 @@ class Config { if (options.paymentEndpoint) this.paymentEndpoint = options.paymentEndpoint; if (options.storedValueEndpoint) this.storedValueEndpoint = options.storedValueEndpoint; if (options.managementEndpoint) this.managementEndpoint = options.managementEndpoint; - + if (options.balancePlatformEndpoint) this.balancePlatformEndpoint = options.balancePlatformEndpoint; } public set checkoutEndpoint(checkoutEndpoint: string | undefined) { diff --git a/src/httpClient/httpURLConnectionClient.ts b/src/httpClient/httpURLConnectionClient.ts index 2f913285b..9d282a9ab 100644 --- a/src/httpClient/httpURLConnectionClient.ts +++ b/src/httpClient/httpURLConnectionClient.ts @@ -22,7 +22,7 @@ import { Agent, AgentOptions, request as httpsRequest } from "https"; import { HttpsProxyAgent } from "https-proxy-agent"; import * as fs from "fs"; -import { URL } from "url"; +import { URL, URLSearchParams } from "url"; import Client from "../client"; import Config from "../config"; import HttpClientException from "./httpClientException"; @@ -87,6 +87,10 @@ class HttpURLConnectionClient implements ClientInterface { requestOptions.port = url.port; requestOptions.path = url.pathname; + if (requestOptions.params) { + requestOptions.path += '?' + new URLSearchParams(requestOptions.params).toString(); + } + if (requestOptions && requestOptions.idempotencyKey) { requestOptions.headers[ApiConstants.IDEMPOTENCY_KEY] = requestOptions.idempotencyKey; delete requestOptions.idempotencyKey; diff --git a/src/services/balancePlaftform/accountHolders.ts b/src/services/balancePlaftform/accountHolders.ts new file mode 100644 index 000000000..f562d3f34 --- /dev/null +++ b/src/services/balancePlaftform/accountHolders.ts @@ -0,0 +1,52 @@ +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +import { AccountHolder, AccountHolderInfo, ObjectSerializer, PaginatedBalanceAccountsResponse } from "../../typings/balancePlatform/models"; +import { IRequest } from "../../typings/requestOptions"; +import BalancePlatformResource from "../resource/balancePlaftformResource"; + +// @TODO PW-7013: make this change at the spec level? +export type AccountHolderUpdate = Omit; + +class AccountHolders extends Service { + public async create(request: AccountHolderInfo): Promise { + const resource = new BalancePlatformResource(this, `/accountHolders`); + const response = await getJsonResponse( + resource, + request, + { method: "POST" } + ); + return ObjectSerializer.deserialize(response, "AccountHolder"); + } + + public async retrieve(id: string): Promise { + const resource = new BalancePlatformResource(this, `/accountHolders/${id}`); + const response = await getJsonResponse( + resource, + '', + { method: "GET" } + ); + return ObjectSerializer.deserialize(response, "AccountHolder"); + } + + public async update(id: string, request: AccountHolderUpdate): Promise { + const resource = new BalancePlatformResource(this, `/accountHolders/${id}`); + const response = await getJsonResponse( + resource, + request, + { method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "AccountHolder"); + } + + public async listBalanceAccounts(id: string, requestOptions?: IRequest.Options): Promise { + const resource = new BalancePlatformResource(this, `/accountHolders/${id}/balanceAccounts`); + const response = await getJsonResponse( + resource, + '', + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "PaginatedBalanceAccountsResponse"); + } +} + +export default AccountHolders; \ No newline at end of file diff --git a/src/services/balancePlaftform/balanceAccounts.ts b/src/services/balancePlaftform/balanceAccounts.ts new file mode 100644 index 000000000..31a15ac54 --- /dev/null +++ b/src/services/balancePlaftform/balanceAccounts.ts @@ -0,0 +1,103 @@ +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +import { BalanceAccount, BalanceAccountInfo, BalanceAccountUpdateRequest, BalanceSweepConfigurationsResponse, ObjectSerializer, PaginatedPaymentInstrumentsResponse, SweepConfigurationV2 } from "../../typings/balancePlatform/models"; +import { IRequest } from "../../typings/requestOptions"; +import BalancePlatformResource from "../resource/balancePlaftformResource"; + +// @TODO PW-7013: make this change at the spec level? +export type SweepConfigurationV2Create = Omit; +export type SweepConfigurationV2Update = Partial; + +class BalanceAccounts extends Service { + public async create(request: BalanceAccountInfo): Promise { + const resource = new BalancePlatformResource(this, `/balanceAccounts`); + const response = await getJsonResponse( + resource, + request, + { method: "POST" } + ); + return ObjectSerializer.deserialize(response, "BalanceAccount"); + } + + public async listSweeps(balanceAccountId: string, requestOptions?: IRequest.Options): Promise { + const resource = new BalancePlatformResource(this, `/balanceAccounts/${balanceAccountId}/sweeps`); + const response = await getJsonResponse( + resource, + '', + { method: "GET" } + ); + return ObjectSerializer.deserialize(response, "BalanceSweepConfigurationsResponse"); + } + + public async createSweep(balanceAccountId: string, request: SweepConfigurationV2Create): Promise { + const resource = new BalancePlatformResource(this, `/balanceAccounts/${balanceAccountId}/sweeps`); + const response = await getJsonResponse( + resource, + request, + { method: "POST" } + ); + return ObjectSerializer.deserialize(response, "SweepConfigurationV2"); + } + + public async deleteSweep(balanceAccountId: string, sweepId: string): Promise { + const resource = new BalancePlatformResource(this, `/balanceAccounts/${balanceAccountId}/sweeps/${sweepId}`); + await getJsonResponse( + resource, + '', + { method: "DELETE" } + ); + } + + public async retrieveSweep(balanceAccountId: string, sweepId: string): Promise { + const resource = new BalancePlatformResource(this, `/balanceAccounts/${balanceAccountId}/sweeps/${sweepId}`); + const response = await getJsonResponse( + resource, + '', + { method: "GET" } + ); + return ObjectSerializer.deserialize(response, "SweepConfigurationV2"); + } + + public async updateSweep(balanceAccountId: string, sweepId: string, request: SweepConfigurationV2Update): Promise { + const resource = new BalancePlatformResource(this, `/balanceAccounts/${balanceAccountId}/sweeps/${sweepId}`); + const response = await getJsonResponse( + resource, + request, + { method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "SweepConfigurationV2"); + } + + public async retrieve(id: string): Promise { + const resource = new BalancePlatformResource(this, `/balanceAccounts/${id}`); + const response = await getJsonResponse( + resource, + '', + { method: "GET" } + ); + return ObjectSerializer.deserialize(response, "BalanceAccount"); + } + + public async update(id: string, request: BalanceAccountUpdateRequest): Promise { + const resource = new BalancePlatformResource(this, `/balanceAccounts/${id}`); + const response = await getJsonResponse( + resource, + request, + { method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "BalanceAccount"); + } + + public async listPaymentInstruments(id: string, requestOptions?: IRequest.Options): Promise { + const resource = new BalancePlatformResource(this, `/balanceAccounts/${id}/paymentInstruments`); + const response = await getJsonResponse( + resource, + '', + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "PaginatedPaymentInstrumentsResponse"); + } + +} + +export default BalanceAccounts; diff --git a/src/services/balancePlaftform/general.ts b/src/services/balancePlaftform/general.ts new file mode 100644 index 000000000..45befc322 --- /dev/null +++ b/src/services/balancePlaftform/general.ts @@ -0,0 +1,29 @@ +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +import { BalancePlatform, ObjectSerializer, PaginatedAccountHoldersResponse } from "../../typings/balancePlatform/models"; +import { IRequest } from "../../typings/requestOptions"; +import BalancePlatformResource from "../resource/balancePlaftformResource"; + +class General extends Service { + public async retrieve(id: string): Promise { + const resource = new BalancePlatformResource(this, `/balancePlatforms/${id}`); + const response = await getJsonResponse( + resource, + '', + { method: "GET" } + ); + return ObjectSerializer.deserialize(response, "BalancePlatform"); + } + + public async listAccountHolders(id: string, requestOptions?: IRequest.Options): Promise { + const resource = new BalancePlatformResource(this, `/balancePlatforms/${id}/accountHolders`); + const response = await getJsonResponse( + resource, + '', + { ...requestOptions, method: "GET" } + ); + return ObjectSerializer.deserialize(response, "PaginatedAccountHoldersResponse"); + } +} + +export default General; diff --git a/src/services/balancePlaftform/paymentInstrumentGroups.ts b/src/services/balancePlaftform/paymentInstrumentGroups.ts new file mode 100644 index 000000000..4c169427b --- /dev/null +++ b/src/services/balancePlaftform/paymentInstrumentGroups.ts @@ -0,0 +1,39 @@ +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +import { ObjectSerializer, PaymentInstrumentGroup, PaymentInstrumentGroupInfo, TransactionRulesResponse } from "../../typings/balancePlatform/models"; +import BalancePlatformResource from "../resource/balancePlaftformResource"; + +class PaymentInstrumentGroups extends Service { + public async create(request: PaymentInstrumentGroupInfo): Promise { + const resource = new BalancePlatformResource(this, `/paymentInstrumentGroups`); + const response = await getJsonResponse( + resource, + request, + { method: "POST" } + ); + return ObjectSerializer.deserialize(response, "PaymentInstrumentGroup"); + } + + public async retrieve(id: string): Promise { + const resource = new BalancePlatformResource(this, `/paymentInstrumentGroups/${id}`); + const response = await getJsonResponse( + resource, + "", + { method: "GET" } + ); + return ObjectSerializer.deserialize(response, "PaymentInstrumentGroup"); + } + + public async listTransactionRules(id: string): Promise { + const resource = new BalancePlatformResource(this, `/paymentInstrumentGroups/${id}/transactionRules`); + const response = await getJsonResponse( + resource, + "", + { method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TransactionRulesResponse"); + } +} + +export default PaymentInstrumentGroups; + diff --git a/src/services/balancePlaftform/paymentInstruments.ts b/src/services/balancePlaftform/paymentInstruments.ts new file mode 100644 index 000000000..705a85b95 --- /dev/null +++ b/src/services/balancePlaftform/paymentInstruments.ts @@ -0,0 +1,48 @@ +import getJsonResponse from "../../helpers/getJsonResponse"; +import Service from "../../service"; +import { ObjectSerializer, PaymentInstrument, PaymentInstrumentInfo, PaymentInstrumentUpdateRequest, TransactionRulesResponse } from "../../typings/balancePlatform/models"; +import BalancePlatformResource from "../resource/balancePlaftformResource"; + +class PaymentInstruments extends Service { + public async create(request: PaymentInstrumentInfo): Promise { + const resource = new BalancePlatformResource(this, `/paymentInstruments`); + const response = await getJsonResponse( + resource, + request, + { method: "POST" } + ); + return ObjectSerializer.deserialize(response, "PaymentInstrument"); + } + + public async retrieve(id: string): Promise { + const resource = new BalancePlatformResource(this, `/paymentInstruments/${id}`); + const response = await getJsonResponse( + resource, + '', + { method: "GET" } + ); + return ObjectSerializer.deserialize(response, "PaymentInstrument"); + } + + public async update(id: string, request: PaymentInstrumentUpdateRequest): Promise { + const resource = new BalancePlatformResource(this, `/paymentInstruments/${id}`); + const response = await getJsonResponse( + resource, + request, + { method: "PATCH" } + ); + return ObjectSerializer.deserialize(response, "PaymentInstrument"); + } + + public async listTransactionRules(id: string): Promise { + const resource = new BalancePlatformResource(this, `/paymentInstruments/${id}/transactionRules`); + const response = await getJsonResponse( + resource, + '', + { method: "GET" } + ); + return ObjectSerializer.deserialize(response, "TransactionRulesResponse"); + } +} + +export default PaymentInstruments; diff --git a/src/services/balancePlatform.ts b/src/services/balancePlatform.ts new file mode 100644 index 000000000..74e4d4086 --- /dev/null +++ b/src/services/balancePlatform.ts @@ -0,0 +1,35 @@ +import Service from "../service"; +import Client from "../client"; +import AccountHolders from "./balancePlaftform/accountHolders"; +import BalanceAccounts from "./balancePlaftform/balanceAccounts"; +import General from "./balancePlaftform/general"; +import PaymentInstruments from "./balancePlaftform/paymentInstruments"; +import PaymentInstrumentGroups from "./balancePlaftform/paymentInstrumentGroups"; + +class BalancePlatform extends Service { + public constructor(client: Client) { + super(client); + } + + public get General() { + return new General(this.client); + } + + public get AccountHolders() { + return new AccountHolders(this.client); + } + + public get BalanceAccounts() { + return new BalanceAccounts(this.client); + } + + public get PaymentInstruments() { + return new PaymentInstruments(this.client); + } + + public get PaymentInstrumentGroups() { + return new PaymentInstrumentGroups(this.client); + } +} + +export default BalancePlatform; diff --git a/src/services/resource/balancePlaftformResource.ts b/src/services/resource/balancePlaftformResource.ts new file mode 100644 index 000000000..b1073abc3 --- /dev/null +++ b/src/services/resource/balancePlaftformResource.ts @@ -0,0 +1,14 @@ +import Client from "../../client"; +import Service from "../../service"; +import Resource from "../resource"; + +class BalancePlatformResource extends Resource { + public constructor(service: Service, endpoint: string) { + super( + service, + `${service.client.config.balancePlatformEndpoint}/${Client.BALANCE_PLATFORM_API_VERSION}${endpoint}` + ); + } +} + +export default BalancePlatformResource; \ No newline at end of file diff --git a/src/typings/balancePlatform/accountHolder.ts b/src/typings/balancePlatform/accountHolder.ts new file mode 100644 index 000000000..ccfac13e5 --- /dev/null +++ b/src/typings/balancePlatform/accountHolder.ts @@ -0,0 +1,118 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { AccountHolderCapability } from './accountHolderCapability'; +import { ContactDetails } from './contactDetails'; + +export class AccountHolder { + /** + * The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. + */ + 'balancePlatform'?: string; + /** + * Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. + */ + 'capabilities'?: { [key: string]: AccountHolderCapability; }; + 'contactDetails'?: ContactDetails; + /** + * Your description for the account holder, maximum 300 characters. + */ + 'description'?: string; + /** + * The unique identifier of the account holder. + */ + 'id': string; + /** + * The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/legalEntities__resParam_id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. For more information on how to create a legal entity, refer to [Onboard and verify account holders](https://docs.adyen.com/issuing/kyc-verification). + */ + 'legalEntityId': string; + /** + * The ID of the account holder\'s primary balance account. By default, this is set to the first balance account that you create for the account holder. To assign a different balance account, send a PATCH request. + */ + 'primaryBalanceAccount'?: string; + /** + * Your reference for the account holder, maximum 150 characters. + */ + 'reference'?: string; + /** + * The status of the account holder. Possible values: * **Active**: The account holder is active. This is the default status when creating an account holder. * **Suspended**: The account holder is temporarily suspended. You can set the account back to active or close it permanently. * **Closed**: The account holder is permanently deactivated. This action cannot be undone. + */ + 'status'?: AccountHolder.StatusEnum; + /** + * The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. If not set, the time zone of the balance account will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + */ + 'timeZone'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "balancePlatform", + "baseName": "balancePlatform", + "type": "string" + }, + { + "name": "capabilities", + "baseName": "capabilities", + "type": "{ [key: string]: AccountHolderCapability; }" + }, + { + "name": "contactDetails", + "baseName": "contactDetails", + "type": "ContactDetails" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "string" + }, + { + "name": "legalEntityId", + "baseName": "legalEntityId", + "type": "string" + }, + { + "name": "primaryBalanceAccount", + "baseName": "primaryBalanceAccount", + "type": "string" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string" + }, + { + "name": "status", + "baseName": "status", + "type": "AccountHolder.StatusEnum" + }, + { + "name": "timeZone", + "baseName": "timeZone", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return AccountHolder.attributeTypeMap; + } +} + +export namespace AccountHolder { + export enum StatusEnum { + Active = 'active', + Closed = 'closed', + Inactive = 'inactive', + Suspended = 'suspended' + } +} diff --git a/src/typings/balancePlatform/accountHolderCapability.ts b/src/typings/balancePlatform/accountHolderCapability.ts new file mode 100644 index 000000000..e3f902f55 --- /dev/null +++ b/src/typings/balancePlatform/accountHolderCapability.ts @@ -0,0 +1,118 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { CapabilityProblem } from './capabilityProblem'; +import { JSONObject } from './jSONObject'; + +export class AccountHolderCapability { + /** + * Indicates whether the capability is allowed. Adyen sets this to **true** if the verification is successful and the account holder is permitted to use the capability. + */ + 'allowed'?: boolean; + /** + * The capability level that is allowed for the account holder. Possible values: **notApplicable**, **low**, **medium**, **high**. + */ + 'allowedLevel'?: AccountHolderCapability.AllowedLevelEnum; + 'allowedSettings'?: JSONObject; + /** + * Indicates whether the capability is enabled. If **false**, the capability is temporarily disabled for the account holder. + */ + 'enabled'?: boolean; + /** + * Contains verification errors and the actions that you can take to resolve them. + */ + 'problems'?: Array; + /** + * Indicates whether the capability is requested. To check whether the account holder is permitted to use the capability, refer to the `allowed` field. + */ + 'requested'?: boolean; + /** + * The requested level of the capability. Some capabilities, such as those used in [card issuing](https://docs.adyen.com/issuing/add-capabilities#capability-levels), have different levels. Levels increase the capability, but also require additional checks and increased monitoring. Possible values: **notApplicable**, **low**, **medium**, **high**. + */ + 'requestedLevel'?: AccountHolderCapability.RequestedLevelEnum; + 'requestedSettings'?: JSONObject; + /** + * The status of the verification checks for the capability. Possible values: * **pending**: Adyen is running the verification. * **invalid**: The verification failed. Check if the `errors` array contains more information. * **valid**: The verification has been successfully completed. * **rejected**: Adyen has verified the information, but found reasons to not allow the capability. + */ + 'verificationStatus'?: AccountHolderCapability.VerificationStatusEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "allowed", + "baseName": "allowed", + "type": "boolean" + }, + { + "name": "allowedLevel", + "baseName": "allowedLevel", + "type": "AccountHolderCapability.AllowedLevelEnum" + }, + { + "name": "allowedSettings", + "baseName": "allowedSettings", + "type": "JSONObject" + }, + { + "name": "enabled", + "baseName": "enabled", + "type": "boolean" + }, + { + "name": "problems", + "baseName": "problems", + "type": "Array" + }, + { + "name": "requested", + "baseName": "requested", + "type": "boolean" + }, + { + "name": "requestedLevel", + "baseName": "requestedLevel", + "type": "AccountHolderCapability.RequestedLevelEnum" + }, + { + "name": "requestedSettings", + "baseName": "requestedSettings", + "type": "JSONObject" + }, + { + "name": "verificationStatus", + "baseName": "verificationStatus", + "type": "AccountHolderCapability.VerificationStatusEnum" + } ]; + + static getAttributeTypeMap() { + return AccountHolderCapability.attributeTypeMap; + } +} + +export namespace AccountHolderCapability { + export enum AllowedLevelEnum { + High = 'high', + Low = 'low', + Medium = 'medium', + NotApplicable = 'notApplicable' + } + export enum RequestedLevelEnum { + High = 'high', + Low = 'low', + Medium = 'medium', + NotApplicable = 'notApplicable' + } + export enum VerificationStatusEnum { + Invalid = 'invalid', + Pending = 'pending', + Rejected = 'rejected', + Valid = 'valid' + } +} diff --git a/src/typings/balancePlatform/accountHolderInfo.ts b/src/typings/balancePlatform/accountHolderInfo.ts new file mode 100644 index 000000000..72a0c1cff --- /dev/null +++ b/src/typings/balancePlatform/accountHolderInfo.ts @@ -0,0 +1,83 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { AccountHolderCapability } from './accountHolderCapability'; +import { ContactDetails } from './contactDetails'; + +export class AccountHolderInfo { + /** + * The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the account holder belongs. Required in the request if your API credentials can be used for multiple balance platforms. + */ + 'balancePlatform'?: string; + /** + * Contains key-value pairs that specify the actions that an account holder can do in your platform. The key is a capability required for your integration. For example, **issueCard** for Issuing. The value is an object containing the settings for the capability. + */ + 'capabilities'?: { [key: string]: AccountHolderCapability; }; + 'contactDetails'?: ContactDetails; + /** + * Your description for the account holder, maximum 300 characters. + */ + 'description'?: string; + /** + * The unique identifier of the [legal entity](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/legalEntities__resParam_id) associated with the account holder. Adyen performs a verification process against the legal entity of the account holder. For more information on how to create a legal entity, refer to [Onboard and verify account holders](https://docs.adyen.com/issuing/kyc-verification). + */ + 'legalEntityId': string; + /** + * Your reference for the account holder, maximum 150 characters. + */ + 'reference'?: string; + /** + * The [time zone](https://www.iana.org/time-zones) of the account holder. For example, **Europe/Amsterdam**. If not set, the time zone of the balance account will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + */ + 'timeZone'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "balancePlatform", + "baseName": "balancePlatform", + "type": "string" + }, + { + "name": "capabilities", + "baseName": "capabilities", + "type": "{ [key: string]: AccountHolderCapability; }" + }, + { + "name": "contactDetails", + "baseName": "contactDetails", + "type": "ContactDetails" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "legalEntityId", + "baseName": "legalEntityId", + "type": "string" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string" + }, + { + "name": "timeZone", + "baseName": "timeZone", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return AccountHolderInfo.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/activeNetworkTokensRestriction.ts b/src/typings/balancePlatform/activeNetworkTokensRestriction.ts new file mode 100644 index 000000000..c62b129ec --- /dev/null +++ b/src/typings/balancePlatform/activeNetworkTokensRestriction.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ActiveNetworkTokensRestriction { + /** + * Defines how the condition must be evaluated. + */ + 'operation': string; + /** + * The number of tokens. + */ + 'value'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "operation", + "baseName": "operation", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return ActiveNetworkTokensRestriction.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/address.ts b/src/typings/balancePlatform/address.ts new file mode 100644 index 000000000..8a46c6b72 --- /dev/null +++ b/src/typings/balancePlatform/address.ts @@ -0,0 +1,75 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Address { + /** + * The name of the city. Maximum length: 3000 characters. + */ + 'city': string; + /** + * The two-character ISO-3166-1 alpha-2 country code. For example, **US**. > If you don\'t know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + */ + 'country': string; + /** + * The number or name of the house. Maximum length: 3000 characters. + */ + 'houseNumberOrName': string; + /** + * A maximum of five digits for an address in the US, or a maximum of ten characters for an address in all other countries. + */ + 'postalCode': string; + /** + * The two-character ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + */ + 'stateOrProvince'?: string; + /** + * The name of the street. Maximum length: 3000 characters. > The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. + */ + 'street': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "city", + "baseName": "city", + "type": "string" + }, + { + "name": "country", + "baseName": "country", + "type": "string" + }, + { + "name": "houseNumberOrName", + "baseName": "houseNumberOrName", + "type": "string" + }, + { + "name": "postalCode", + "baseName": "postalCode", + "type": "string" + }, + { + "name": "stateOrProvince", + "baseName": "stateOrProvince", + "type": "string" + }, + { + "name": "street", + "baseName": "street", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return Address.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/address2.ts b/src/typings/balancePlatform/address2.ts new file mode 100644 index 000000000..b6598f3b5 --- /dev/null +++ b/src/typings/balancePlatform/address2.ts @@ -0,0 +1,84 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Address2 { + /** + * The name of the city. + */ + 'city'?: string; + /** + * The two-character ISO-3166-1 alpha-2 country code. For example, **US**. >If you don\'t know the country or are not collecting the country from the shopper, provide `country` as `ZZ`. + */ + 'country': string; + /** + * First line of the address. + */ + 'line1'?: string; + /** + * Second line of the address. + */ + 'line2'?: string; + /** + * Third line of the address. + */ + 'line3'?: string; + /** + * The postal code. Maximum length: * 5 digits for an address in the US. * 10 characters for an address in all other countries. + */ + 'postalCode'?: string; + /** + * The two-letterISO 3166-2 state or province code. For example, **CA** in the US or **ON** in Canada. > Required for the US and Canada. + */ + 'stateOrProvince'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "city", + "baseName": "city", + "type": "string" + }, + { + "name": "country", + "baseName": "country", + "type": "string" + }, + { + "name": "line1", + "baseName": "line1", + "type": "string" + }, + { + "name": "line2", + "baseName": "line2", + "type": "string" + }, + { + "name": "line3", + "baseName": "line3", + "type": "string" + }, + { + "name": "postalCode", + "baseName": "postalCode", + "type": "string" + }, + { + "name": "stateOrProvince", + "baseName": "stateOrProvince", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return Address2.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/amount.ts b/src/typings/balancePlatform/amount.ts new file mode 100644 index 000000000..c987e5258 --- /dev/null +++ b/src/typings/balancePlatform/amount.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Amount { + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). + */ + 'currency': string; + /** + * The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + */ + 'value': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "currency", + "baseName": "currency", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return Amount.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/authentication.ts b/src/typings/balancePlatform/authentication.ts new file mode 100644 index 000000000..5892c951c --- /dev/null +++ b/src/typings/balancePlatform/authentication.ts @@ -0,0 +1,46 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Phone } from './phone'; + +export class Authentication { + /** + * The email address where the one-time password (OTP) is sent. + */ + 'email'?: string; + /** + * The password used for 3D Secure password-based authentication. The value must be between 1 to 30 characters and must only contain the following supported characters. * Characters between **a-z**, **A-Z**, and **0-9** * Special characters: **äöüßÄÖÜ+-*_/ç%()=?!~#\'\",;:$&àùòâôûáúó** + */ + 'password'?: string; + 'phone'?: Phone; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "password", + "baseName": "password", + "type": "string" + }, + { + "name": "phone", + "baseName": "phone", + "type": "Phone" + } ]; + + static getAttributeTypeMap() { + return Authentication.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/balance.ts b/src/typings/balancePlatform/balance.ts new file mode 100644 index 000000000..06a727a4c --- /dev/null +++ b/src/typings/balancePlatform/balance.ts @@ -0,0 +1,57 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Balance { + /** + * The remaining amount available for spending. + */ + 'available': number; + /** + * The total amount in the balance. + */ + 'balance': number; + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance. + */ + 'currency': string; + /** + * The amount reserved for payments that have been authorised, but have not been captured yet. + */ + 'reserved': number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "available", + "baseName": "available", + "type": "number" + }, + { + "name": "balance", + "baseName": "balance", + "type": "number" + }, + { + "name": "currency", + "baseName": "currency", + "type": "string" + }, + { + "name": "reserved", + "baseName": "reserved", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return Balance.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/balanceAccount.ts b/src/typings/balancePlatform/balanceAccount.ts new file mode 100644 index 000000000..d27ea7745 --- /dev/null +++ b/src/typings/balancePlatform/balanceAccount.ts @@ -0,0 +1,102 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Balance } from './balance'; + +export class BalanceAccount { + /** + * The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. + */ + 'accountHolderId': string; + /** + * List of balances with the amount and currency. + */ + 'balances'?: Array; + /** + * The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + */ + 'defaultCurrencyCode'?: string; + /** + * A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. + */ + 'description'?: string; + /** + * The unique identifier of the balance account. + */ + 'id': string; + /** + * Your reference for the balance account, maximum 150 characters. + */ + 'reference'?: string; + /** + * The status of the balance account, set to **active** by default. + */ + 'status'?: BalanceAccount.StatusEnum; + /** + * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. If not set, the time zone of the account holder will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + */ + 'timeZone'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "accountHolderId", + "baseName": "accountHolderId", + "type": "string" + }, + { + "name": "balances", + "baseName": "balances", + "type": "Array" + }, + { + "name": "defaultCurrencyCode", + "baseName": "defaultCurrencyCode", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "string" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string" + }, + { + "name": "status", + "baseName": "status", + "type": "BalanceAccount.StatusEnum" + }, + { + "name": "timeZone", + "baseName": "timeZone", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return BalanceAccount.attributeTypeMap; + } +} + +export namespace BalanceAccount { + export enum StatusEnum { + Active = 'active', + Closed = 'closed', + Inactive = 'inactive', + Suspended = 'suspended' + } +} diff --git a/src/typings/balancePlatform/balanceAccountInfo.ts b/src/typings/balancePlatform/balanceAccountInfo.ts new file mode 100644 index 000000000..6263416c4 --- /dev/null +++ b/src/typings/balancePlatform/balanceAccountInfo.ts @@ -0,0 +1,66 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class BalanceAccountInfo { + /** + * The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. + */ + 'accountHolderId': string; + /** + * The default three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) of the balance account. The default value is **EUR**. + */ + 'defaultCurrencyCode'?: string; + /** + * A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. + */ + 'description'?: string; + /** + * Your reference for the balance account, maximum 150 characters. + */ + 'reference'?: string; + /** + * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. If not set, the time zone of the account holder will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + */ + 'timeZone'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "accountHolderId", + "baseName": "accountHolderId", + "type": "string" + }, + { + "name": "defaultCurrencyCode", + "baseName": "defaultCurrencyCode", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string" + }, + { + "name": "timeZone", + "baseName": "timeZone", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return BalanceAccountInfo.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/balanceAccountUpdateRequest.ts b/src/typings/balancePlatform/balanceAccountUpdateRequest.ts new file mode 100644 index 000000000..6684d2c55 --- /dev/null +++ b/src/typings/balancePlatform/balanceAccountUpdateRequest.ts @@ -0,0 +1,83 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class BalanceAccountUpdateRequest { + /** + * The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/accountHolders__resParam_id) associated with the balance account. + */ + 'accountHolderId'?: string; + /** + * The default currency code of this balance account, in three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) format. The default value is **EUR**. + */ + 'defaultCurrencyCode'?: string; + /** + * A human-readable description of the balance account, maximum 300 characters. You can use this parameter to distinguish between multiple balance accounts under an account holder. + */ + 'description'?: string; + /** + * Your reference to the balance account, maximum 150 characters. + */ + 'reference'?: string; + /** + * The status of the balance account. Payment instruments linked to the balance account can only be used if the balance account status is **active**. Possible values: **active**, **inactive**, **closed**, **suspended**. + */ + 'status'?: BalanceAccountUpdateRequest.StatusEnum; + /** + * The [time zone](https://www.iana.org/time-zones) of the balance account. For example, **Europe/Amsterdam**. If not set, the time zone of the account holder will be used. For possible values, see the [list of time zone codes](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + */ + 'timeZone'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "accountHolderId", + "baseName": "accountHolderId", + "type": "string" + }, + { + "name": "defaultCurrencyCode", + "baseName": "defaultCurrencyCode", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string" + }, + { + "name": "status", + "baseName": "status", + "type": "BalanceAccountUpdateRequest.StatusEnum" + }, + { + "name": "timeZone", + "baseName": "timeZone", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return BalanceAccountUpdateRequest.attributeTypeMap; + } +} + +export namespace BalanceAccountUpdateRequest { + export enum StatusEnum { + Active = 'active', + Closed = 'closed', + Inactive = 'inactive', + Suspended = 'suspended' + } +} diff --git a/src/typings/balancePlatform/balancePlatform.ts b/src/typings/balancePlatform/balancePlatform.ts new file mode 100644 index 000000000..5c282bed1 --- /dev/null +++ b/src/typings/balancePlatform/balancePlatform.ts @@ -0,0 +1,48 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class BalancePlatform { + /** + * Your description of the balance platform, maximum 300 characters. + */ + 'description'?: string; + /** + * The unique identifier of the balance platform. + */ + 'id': string; + /** + * The status of the balance platform. Possible values: **Active**, **Inactive**, **Closed**, **Suspended**. + */ + 'status'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "string" + }, + { + "name": "status", + "baseName": "status", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return BalancePlatform.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/balanceSweepConfigurationsResponse.ts b/src/typings/balancePlatform/balanceSweepConfigurationsResponse.ts new file mode 100644 index 000000000..091615f29 --- /dev/null +++ b/src/typings/balancePlatform/balanceSweepConfigurationsResponse.ts @@ -0,0 +1,49 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { SweepConfigurationV2 } from './sweepConfigurationV2'; + +export class BalanceSweepConfigurationsResponse { + /** + * Indicates whether there are more items on the next page. + */ + 'hasNext': boolean; + /** + * Indicates whether there are more items on the previous page. + */ + 'hasPrevious': boolean; + /** + * List of sweeps associated with the balance account. + */ + 'sweeps': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "hasNext", + "baseName": "hasNext", + "type": "boolean" + }, + { + "name": "hasPrevious", + "baseName": "hasPrevious", + "type": "boolean" + }, + { + "name": "sweeps", + "baseName": "sweeps", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return BalanceSweepConfigurationsResponse.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/brandVariantsRestriction.ts b/src/typings/balancePlatform/brandVariantsRestriction.ts new file mode 100644 index 000000000..cfd1e00d0 --- /dev/null +++ b/src/typings/balancePlatform/brandVariantsRestriction.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class BrandVariantsRestriction { + /** + * Defines how the condition must be evaluated. + */ + 'operation': string; + /** + * List of card brand variants. Possible values: - **mc**, **mccredit**, **mccommercialcredit_b2b**, **mcdebit**, **mcbusinessdebit**, **mcbusinessworlddebit**, **mcprepaid**, **mcmaestro** - **visa**, **visacredit**, **visadebit**, **visaprepaid**. You can specify a rule for a generic variant. For example, to create a rule for all Mastercard payment instruments, use **mc**. The rule is applied to all payment instruments under **mc**, such as **mcbusinessdebit** and **mcdebit**. + */ + 'value'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "operation", + "baseName": "operation", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return BrandVariantsRestriction.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/bulkAddress.ts b/src/typings/balancePlatform/bulkAddress.ts new file mode 100644 index 000000000..62779dc29 --- /dev/null +++ b/src/typings/balancePlatform/bulkAddress.ts @@ -0,0 +1,102 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class BulkAddress { + /** + * The name of the city. + */ + 'city'?: string; + /** + * The name of the company. + */ + 'company'?: string; + /** + * The two-character ISO-3166-1 alpha-2 country code. For example, **US**. + */ + 'country': string; + /** + * The email address. + */ + 'email'?: string; + /** + * The house number or name. + */ + 'houseNumberOrName'?: string; + /** + * The full telephone number. + */ + 'mobile'?: string; + /** + * The postal code. Maximum length: * 5 digits for addresses in the US. * 10 characters for all other countries. + */ + 'postalCode'?: string; + /** + * The two-letter ISO 3166-2 state or province code. Maximum length: 2 characters for addresses in the US. + */ + 'stateOrProvince'?: string; + /** + * The streetname of the house. + */ + 'street'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "city", + "baseName": "city", + "type": "string" + }, + { + "name": "company", + "baseName": "company", + "type": "string" + }, + { + "name": "country", + "baseName": "country", + "type": "string" + }, + { + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "houseNumberOrName", + "baseName": "houseNumberOrName", + "type": "string" + }, + { + "name": "mobile", + "baseName": "mobile", + "type": "string" + }, + { + "name": "postalCode", + "baseName": "postalCode", + "type": "string" + }, + { + "name": "stateOrProvince", + "baseName": "stateOrProvince", + "type": "string" + }, + { + "name": "street", + "baseName": "street", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return BulkAddress.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/capabilityProblem.ts b/src/typings/balancePlatform/capabilityProblem.ts new file mode 100644 index 000000000..14ba7442b --- /dev/null +++ b/src/typings/balancePlatform/capabilityProblem.ts @@ -0,0 +1,38 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { CapabilityProblemEntity } from './capabilityProblemEntity'; +import { VerificationError } from './verificationError'; + +export class CapabilityProblem { + 'entity'?: CapabilityProblemEntity; + /** + * Contains information about the verification error. + */ + 'verificationErrors'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "entity", + "baseName": "entity", + "type": "CapabilityProblemEntity" + }, + { + "name": "verificationErrors", + "baseName": "verificationErrors", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return CapabilityProblem.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/capabilityProblemEntity.ts b/src/typings/balancePlatform/capabilityProblemEntity.ts new file mode 100644 index 000000000..efbd925bb --- /dev/null +++ b/src/typings/balancePlatform/capabilityProblemEntity.ts @@ -0,0 +1,53 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { CapabilityProblemEntityRecursive } from './capabilityProblemEntityRecursive'; + +export class CapabilityProblemEntity { + /** + * The ID of the entity. + */ + 'id'?: string; + 'owner'?: CapabilityProblemEntityRecursive; + /** + * Type of entity. Possible values: **LegalEntity**, **BankAccount**, **Document**. + */ + 'type'?: CapabilityProblemEntity.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string" + }, + { + "name": "owner", + "baseName": "owner", + "type": "CapabilityProblemEntityRecursive" + }, + { + "name": "type", + "baseName": "type", + "type": "CapabilityProblemEntity.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return CapabilityProblemEntity.attributeTypeMap; + } +} + +export namespace CapabilityProblemEntity { + export enum TypeEnum { + BankAccount = 'BankAccount', + Document = 'Document', + LegalEntity = 'LegalEntity' + } +} diff --git a/src/typings/balancePlatform/capabilityProblemEntityRecursive.ts b/src/typings/balancePlatform/capabilityProblemEntityRecursive.ts new file mode 100644 index 000000000..e75b3a5ba --- /dev/null +++ b/src/typings/balancePlatform/capabilityProblemEntityRecursive.ts @@ -0,0 +1,46 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class CapabilityProblemEntityRecursive { + /** + * The ID of the entity. + */ + 'id'?: string; + /** + * Type of entity. Possible values: **LegalEntity**, **BankAccount**, **Document**. + */ + 'type'?: CapabilityProblemEntityRecursive.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "id", + "baseName": "id", + "type": "string" + }, + { + "name": "type", + "baseName": "type", + "type": "CapabilityProblemEntityRecursive.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return CapabilityProblemEntityRecursive.attributeTypeMap; + } +} + +export namespace CapabilityProblemEntityRecursive { + export enum TypeEnum { + BankAccount = 'BankAccount', + Document = 'Document', + LegalEntity = 'LegalEntity' + } +} diff --git a/src/typings/balancePlatform/card.ts b/src/typings/balancePlatform/card.ts new file mode 100644 index 000000000..439f242b2 --- /dev/null +++ b/src/typings/balancePlatform/card.ts @@ -0,0 +1,128 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Authentication } from './authentication'; +import { CardConfiguration } from './cardConfiguration'; +import { DeliveryContact } from './deliveryContact'; +import { Expiry } from './expiry'; + +export class Card { + 'authentication'?: Authentication; + /** + * The bank identification number (BIN) of the card number. + */ + 'bin'?: string; + /** + * The brand of the payment instrument. Possible values: **visa**, **mc**. + */ + 'brand': string; + /** + * The brand variant of the payment instrument. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. + */ + 'brandVariant': string; + /** + * The name of the card holder. Maximum length: 26 characters. + */ + 'cardholderName': string; + 'configuration'?: CardConfiguration; + /** + * The CVC2 value of the card. > The CVC2 is not sent by default. This is only returned in the `POST` response for single-use virtual cards. + */ + 'cvc'?: string; + 'deliveryContact'?: DeliveryContact; + 'expiration'?: Expiry; + /** + * The form factor of the card. Possible values: **virtual**, **physical**. + */ + 'formFactor': Card.FormFactorEnum; + /** + * Last last four digits of the card number. + */ + 'lastFour'?: string; + /** + * The primary account number (PAN) of the card. > The PAN is masked by default and returned only for single-use virtual cards. + */ + 'number': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "authentication", + "baseName": "authentication", + "type": "Authentication" + }, + { + "name": "bin", + "baseName": "bin", + "type": "string" + }, + { + "name": "brand", + "baseName": "brand", + "type": "string" + }, + { + "name": "brandVariant", + "baseName": "brandVariant", + "type": "string" + }, + { + "name": "cardholderName", + "baseName": "cardholderName", + "type": "string" + }, + { + "name": "configuration", + "baseName": "configuration", + "type": "CardConfiguration" + }, + { + "name": "cvc", + "baseName": "cvc", + "type": "string" + }, + { + "name": "deliveryContact", + "baseName": "deliveryContact", + "type": "DeliveryContact" + }, + { + "name": "expiration", + "baseName": "expiration", + "type": "Expiry" + }, + { + "name": "formFactor", + "baseName": "formFactor", + "type": "Card.FormFactorEnum" + }, + { + "name": "lastFour", + "baseName": "lastFour", + "type": "string" + }, + { + "name": "number", + "baseName": "number", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return Card.attributeTypeMap; + } +} + +export namespace Card { + export enum FormFactorEnum { + Physical = 'physical', + Unknown = 'unknown', + Virtual = 'virtual' + } +} diff --git a/src/typings/balancePlatform/cardConfiguration.ts b/src/typings/balancePlatform/cardConfiguration.ts new file mode 100644 index 000000000..d3eaf142c --- /dev/null +++ b/src/typings/balancePlatform/cardConfiguration.ts @@ -0,0 +1,145 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { BulkAddress } from './bulkAddress'; + +export class CardConfiguration { + /** + * Overrides the activation label design ID defined in the `configurationProfileId`. The activation label is attached to the card and contains the activation instructions. + */ + 'activation'?: string; + /** + * Your app\'s URL, if you want to activate cards through your app. For example, **my-app://ref1236a7d**. A QR code is created based on this URL, and is included in the carrier. Before you use this field, reach out to your Adyen contact to set up the QR code process. Maximum length: 255 characters. + */ + 'activationUrl'?: string; + 'bulkAddress'?: BulkAddress; + /** + * The ID of the card image. This is the image that will be printed on the full front of the card. + */ + 'cardImageId'?: string; + /** + * Overrides the carrier design ID defined in the `configurationProfileId`. The carrier is the letter or packaging to which the card is attached. + */ + 'carrier'?: string; + /** + * The ID of the carrier image. This is the image that will printed on the letter to which the card is attached. + */ + 'carrierImageId'?: string; + /** + * The ID of the card configuration profile that contains the settings of the card. For example, the envelope and PIN mailer designs or the logistics company handling the shipment. All the settings in the profile are applied to the card, unless you provide other fields to override them. For example, send the `shipmentMethod` to override the logistics company defined in the card configuration profile. + */ + 'configurationProfileId': string; + /** + * The three-letter [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) currency code of the card. For example, **EUR**. + */ + 'currency'?: string; + /** + * Overrides the envelope design ID defined in the `configurationProfileId`. + */ + 'envelope'?: string; + /** + * Overrides the insert design ID defined in the `configurationProfileId`. An insert is any additional material, such as marketing materials, that are shipped together with the card. + */ + 'insert'?: string; + /** + * The two-letter [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code of the card. For example, **en**. + */ + 'language'?: string; + /** + * The ID of the logo image. This is the image that will be printed on the partial front of the card, such as a logo on the upper right corner. + */ + 'logoImageId'?: string; + /** + * Overrides the PIN mailer design ID defined in the `configurationProfileId`. The PIN mailer is the letter on which the PIN is printed. + */ + 'pinMailer'?: string; + /** + * Overrides the logistics company defined in the `configurationProfileId`. + */ + 'shipmentMethod'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "activation", + "baseName": "activation", + "type": "string" + }, + { + "name": "activationUrl", + "baseName": "activationUrl", + "type": "string" + }, + { + "name": "bulkAddress", + "baseName": "bulkAddress", + "type": "BulkAddress" + }, + { + "name": "cardImageId", + "baseName": "cardImageId", + "type": "string" + }, + { + "name": "carrier", + "baseName": "carrier", + "type": "string" + }, + { + "name": "carrierImageId", + "baseName": "carrierImageId", + "type": "string" + }, + { + "name": "configurationProfileId", + "baseName": "configurationProfileId", + "type": "string" + }, + { + "name": "currency", + "baseName": "currency", + "type": "string" + }, + { + "name": "envelope", + "baseName": "envelope", + "type": "string" + }, + { + "name": "insert", + "baseName": "insert", + "type": "string" + }, + { + "name": "language", + "baseName": "language", + "type": "string" + }, + { + "name": "logoImageId", + "baseName": "logoImageId", + "type": "string" + }, + { + "name": "pinMailer", + "baseName": "pinMailer", + "type": "string" + }, + { + "name": "shipmentMethod", + "baseName": "shipmentMethod", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return CardConfiguration.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/cardInfo.ts b/src/typings/balancePlatform/cardInfo.ts new file mode 100644 index 000000000..d6bd71f19 --- /dev/null +++ b/src/typings/balancePlatform/cardInfo.ts @@ -0,0 +1,85 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Authentication } from './authentication'; +import { CardConfiguration } from './cardConfiguration'; +import { DeliveryContact } from './deliveryContact'; + +export class CardInfo { + 'authentication'?: Authentication; + /** + * The brand of the payment instrument. Possible values: **visa**, **mc**. + */ + 'brand': string; + /** + * The brand variant of the payment instrument. >Contact your Adyen Implementation Manager to get the values that are relevant to your integration. Examples: **visadebit**, **mcprepaid**. + */ + 'brandVariant': string; + /** + * The name of the card holder. Maximum length: 26 characters. + */ + 'cardholderName': string; + 'configuration'?: CardConfiguration; + 'deliveryContact'?: DeliveryContact; + /** + * The form factor of the card. Possible values: **virtual**, **physical**. + */ + 'formFactor': CardInfo.FormFactorEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "authentication", + "baseName": "authentication", + "type": "Authentication" + }, + { + "name": "brand", + "baseName": "brand", + "type": "string" + }, + { + "name": "brandVariant", + "baseName": "brandVariant", + "type": "string" + }, + { + "name": "cardholderName", + "baseName": "cardholderName", + "type": "string" + }, + { + "name": "configuration", + "baseName": "configuration", + "type": "CardConfiguration" + }, + { + "name": "deliveryContact", + "baseName": "deliveryContact", + "type": "DeliveryContact" + }, + { + "name": "formFactor", + "baseName": "formFactor", + "type": "CardInfo.FormFactorEnum" + } ]; + + static getAttributeTypeMap() { + return CardInfo.attributeTypeMap; + } +} + +export namespace CardInfo { + export enum FormFactorEnum { + Physical = 'physical', + Unknown = 'unknown', + Virtual = 'virtual' + } +} diff --git a/src/typings/balancePlatform/contactDetails.ts b/src/typings/balancePlatform/contactDetails.ts new file mode 100644 index 000000000..be1668a8b --- /dev/null +++ b/src/typings/balancePlatform/contactDetails.ts @@ -0,0 +1,53 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Address } from './address'; +import { Phone } from './phone'; + +export class ContactDetails { + 'address': Address; + /** + * The email address of the account holder. + */ + 'email': string; + 'phone': Phone; + /** + * The URL of the account holder\'s website. + */ + 'webAddress'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "address", + "baseName": "address", + "type": "Address" + }, + { + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "phone", + "baseName": "phone", + "type": "Phone" + }, + { + "name": "webAddress", + "baseName": "webAddress", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return ContactDetails.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/countriesRestriction.ts b/src/typings/balancePlatform/countriesRestriction.ts new file mode 100644 index 000000000..3a1c3acc7 --- /dev/null +++ b/src/typings/balancePlatform/countriesRestriction.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class CountriesRestriction { + /** + * Defines how the condition must be evaluated. + */ + 'operation': string; + /** + * List of two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country codes. + */ + 'value'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "operation", + "baseName": "operation", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return CountriesRestriction.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/deliveryContact.ts b/src/typings/balancePlatform/deliveryContact.ts new file mode 100644 index 000000000..038f51c51 --- /dev/null +++ b/src/typings/balancePlatform/deliveryContact.ts @@ -0,0 +1,69 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Address2 } from './address2'; +import { Name } from './name'; +import { PhoneNumber } from './phoneNumber'; + +export class DeliveryContact { + 'address'?: Address2; + /** + * The email address of the contact. + */ + 'email'?: string; + /** + * The full phone number of the contact provided as a single string. It will be handled as a landline phone. **Examples:** \"0031 6 11 22 33 44\", \"+316/1122-3344\", \"(0031) 611223344\" + */ + 'fullPhoneNumber'?: string; + 'name'?: Name; + 'phoneNumber'?: PhoneNumber; + /** + * The URL of the contact\'s website. + */ + 'webAddress'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "address", + "baseName": "address", + "type": "Address2" + }, + { + "name": "email", + "baseName": "email", + "type": "string" + }, + { + "name": "fullPhoneNumber", + "baseName": "fullPhoneNumber", + "type": "string" + }, + { + "name": "name", + "baseName": "name", + "type": "Name" + }, + { + "name": "phoneNumber", + "baseName": "phoneNumber", + "type": "PhoneNumber" + }, + { + "name": "webAddress", + "baseName": "webAddress", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return DeliveryContact.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/differentCurrenciesRestriction.ts b/src/typings/balancePlatform/differentCurrenciesRestriction.ts new file mode 100644 index 000000000..b39143d7f --- /dev/null +++ b/src/typings/balancePlatform/differentCurrenciesRestriction.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class DifferentCurrenciesRestriction { + /** + * Defines how the condition must be evaluated. + */ + 'operation': string; + /** + * Checks the currency of the payment against the currency of the payment instrument. Possible values: - **true**: The currency of the payment is different from the currency of the payment instrument. - **false**: The currencies are the same. + */ + 'value'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "operation", + "baseName": "operation", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return DifferentCurrenciesRestriction.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/duration.ts b/src/typings/balancePlatform/duration.ts new file mode 100644 index 000000000..bd0389d1e --- /dev/null +++ b/src/typings/balancePlatform/duration.ts @@ -0,0 +1,48 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Duration { + /** + * The unit of time. You can only use **minutes** and **hours** if the `interval.type` is **sliding**. Possible values: **minutes**, **hours**, **days**, **weeks**, or **months** + */ + 'unit'?: Duration.UnitEnum; + /** + * The length of time by the unit. For example, 5 days. The maximum duration is 90 days or an equivalent in other units. For example, 3 months. + */ + 'value'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "unit", + "baseName": "unit", + "type": "Duration.UnitEnum" + }, + { + "name": "value", + "baseName": "value", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return Duration.attributeTypeMap; + } +} + +export namespace Duration { + export enum UnitEnum { + Days = 'days', + Hours = 'hours', + Minutes = 'minutes', + Months = 'months', + Weeks = 'weeks' + } +} diff --git a/src/typings/balancePlatform/entryModesRestriction.ts b/src/typings/balancePlatform/entryModesRestriction.ts new file mode 100644 index 000000000..a5b11738f --- /dev/null +++ b/src/typings/balancePlatform/entryModesRestriction.ts @@ -0,0 +1,53 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class EntryModesRestriction { + /** + * Defines how the condition must be evaluated. + */ + 'operation': string; + /** + * List of point-of-sale entry modes. Possible values: **manual**, **chip**, **magstripe**, **contactless**, **cof**, **token**, **server**, **barcode**, **ocr**. + */ + 'value'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "operation", + "baseName": "operation", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return EntryModesRestriction.attributeTypeMap; + } +} + +export namespace EntryModesRestriction { + export enum ValueEnum { + Barcode = 'barcode', + Chip = 'chip', + Cof = 'cof', + Contactless = 'contactless', + Magstripe = 'magstripe', + Manual = 'manual', + Ocr = 'ocr', + Server = 'server', + Token = 'token', + Unknown = 'unknown' + } +} diff --git a/src/typings/balancePlatform/expiry.ts b/src/typings/balancePlatform/expiry.ts new file mode 100644 index 000000000..9d63d5ec5 --- /dev/null +++ b/src/typings/balancePlatform/expiry.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Expiry { + /** + * The month in which the card will expire. + */ + 'month'?: string; + /** + * The year in which the card will expire. + */ + 'year'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "month", + "baseName": "month", + "type": "string" + }, + { + "name": "year", + "baseName": "year", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return Expiry.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/internationalTransactionRestriction.ts b/src/typings/balancePlatform/internationalTransactionRestriction.ts new file mode 100644 index 000000000..c5d3d18e3 --- /dev/null +++ b/src/typings/balancePlatform/internationalTransactionRestriction.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class InternationalTransactionRestriction { + /** + * Defines how the condition must be evaluated. + */ + 'operation': string; + /** + * Boolean indicating whether transaction is an international transaction. Possible values: - **true**: The transaction is an international transaction. - **false**: The transaction is a domestic transaction. + */ + 'value'?: boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "operation", + "baseName": "operation", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return InternationalTransactionRestriction.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/invalidField.ts b/src/typings/balancePlatform/invalidField.ts new file mode 100644 index 000000000..887af0490 --- /dev/null +++ b/src/typings/balancePlatform/invalidField.ts @@ -0,0 +1,48 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class InvalidField { + /** + * Description of the validation error. + */ + 'message': string; + /** + * The field that has an invalid value. + */ + 'name': string; + /** + * The invalid value. + */ + 'value': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "message", + "baseName": "message", + "type": "string" + }, + { + "name": "name", + "baseName": "name", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return InvalidField.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/jSONObject.ts b/src/typings/balancePlatform/jSONObject.ts new file mode 100644 index 000000000..4aa268363 --- /dev/null +++ b/src/typings/balancePlatform/jSONObject.ts @@ -0,0 +1,34 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { JSONPath } from './jSONPath'; + +export class JSONObject { + 'paths'?: Array; + 'rootPath'?: JSONPath; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "paths", + "baseName": "paths", + "type": "Array" + }, + { + "name": "rootPath", + "baseName": "rootPath", + "type": "JSONPath" + } ]; + + static getAttributeTypeMap() { + return JSONObject.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/jSONPath.ts b/src/typings/balancePlatform/jSONPath.ts new file mode 100644 index 000000000..2cb727a6b --- /dev/null +++ b/src/typings/balancePlatform/jSONPath.ts @@ -0,0 +1,27 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class JSONPath { + 'content'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "content", + "baseName": "content", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return JSONPath.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/matchingTransactionsRestriction.ts b/src/typings/balancePlatform/matchingTransactionsRestriction.ts new file mode 100644 index 000000000..6f7d4cb6d --- /dev/null +++ b/src/typings/balancePlatform/matchingTransactionsRestriction.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class MatchingTransactionsRestriction { + /** + * Defines how the condition must be evaluated. + */ + 'operation': string; + /** + * The number of transactions. + */ + 'value'?: number; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "operation", + "baseName": "operation", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "number" + } ]; + + static getAttributeTypeMap() { + return MatchingTransactionsRestriction.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/mccsRestriction.ts b/src/typings/balancePlatform/mccsRestriction.ts new file mode 100644 index 000000000..06ce9cf69 --- /dev/null +++ b/src/typings/balancePlatform/mccsRestriction.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class MccsRestriction { + /** + * Defines how the condition must be evaluated. + */ + 'operation': string; + /** + * List of merchant category codes (MCCs). + */ + 'value'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "operation", + "baseName": "operation", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return MccsRestriction.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/merchantAcquirerPair.ts b/src/typings/balancePlatform/merchantAcquirerPair.ts new file mode 100644 index 000000000..85ee765c5 --- /dev/null +++ b/src/typings/balancePlatform/merchantAcquirerPair.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class MerchantAcquirerPair { + /** + * The acquirer ID. + */ + 'acquirerId'?: string; + /** + * The merchant identification number (MID). + */ + 'merchantId'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "acquirerId", + "baseName": "acquirerId", + "type": "string" + }, + { + "name": "merchantId", + "baseName": "merchantId", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return MerchantAcquirerPair.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/merchantsRestriction.ts b/src/typings/balancePlatform/merchantsRestriction.ts new file mode 100644 index 000000000..c3ea6eee5 --- /dev/null +++ b/src/typings/balancePlatform/merchantsRestriction.ts @@ -0,0 +1,40 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { MerchantAcquirerPair } from './merchantAcquirerPair'; + +export class MerchantsRestriction { + /** + * Defines how the condition must be evaluated. + */ + 'operation': string; + /** + * List of merchant ID and acquirer ID pairs. + */ + 'value'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "operation", + "baseName": "operation", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return MerchantsRestriction.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/models.ts b/src/typings/balancePlatform/models.ts new file mode 100644 index 000000000..147785daa --- /dev/null +++ b/src/typings/balancePlatform/models.ts @@ -0,0 +1,378 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export * from './accountHolder'; +export * from './accountHolderCapability'; +export * from './accountHolderInfo'; +export * from './activeNetworkTokensRestriction'; +export * from './address'; +export * from './address2'; +export * from './amount'; +export * from './authentication'; +export * from './balance'; +export * from './balanceAccount'; +export * from './balanceAccountInfo'; +export * from './balanceAccountUpdateRequest'; +export * from './balancePlatform'; +export * from './balanceSweepConfigurationsResponse'; +export * from './brandVariantsRestriction'; +export * from './bulkAddress'; +export * from './capabilityProblem'; +export * from './capabilityProblemEntity'; +export * from './capabilityProblemEntityRecursive'; +export * from './card'; +export * from './cardConfiguration'; +export * from './cardInfo'; +export * from './contactDetails'; +export * from './countriesRestriction'; +export * from './deliveryContact'; +export * from './differentCurrenciesRestriction'; +export * from './duration'; +export * from './entryModesRestriction'; +export * from './expiry'; +export * from './internationalTransactionRestriction'; +export * from './invalidField'; +export * from './jSONObject'; +export * from './jSONPath'; +export * from './matchingTransactionsRestriction'; +export * from './mccsRestriction'; +export * from './merchantAcquirerPair'; +export * from './merchantsRestriction'; +export * from './name'; +export * from './paginatedAccountHoldersResponse'; +export * from './paginatedBalanceAccountsResponse'; +export * from './paginatedPaymentInstrumentsResponse'; +export * from './paymentInstrument'; +export * from './paymentInstrumentGroup'; +export * from './paymentInstrumentGroupInfo'; +export * from './paymentInstrumentInfo'; +export * from './paymentInstrumentUpdateRequest'; +export * from './phone'; +export * from './phoneNumber'; +export * from './processingTypesRestriction'; +export * from './remediatingAction'; +export * from './restServiceError'; +export * from './sweepConfigurationV2'; +export * from './sweepCounterparty'; +export * from './sweepSchedule'; +export * from './timeOfDay'; +export * from './timeOfDayRestriction'; +export * from './totalAmountRestriction'; +export * from './transactionRule'; +export * from './transactionRuleEntityKey'; +export * from './transactionRuleInfo'; +export * from './transactionRuleInterval'; +export * from './transactionRuleResponse'; +export * from './transactionRuleRestrictions'; +export * from './transactionRulesResponse'; +export * from './verificationError'; +export * from './verificationErrorRecursive'; + + +import { AccountHolder } from './accountHolder'; +import { AccountHolderCapability } from './accountHolderCapability'; +import { AccountHolderInfo } from './accountHolderInfo'; +import { ActiveNetworkTokensRestriction } from './activeNetworkTokensRestriction'; +import { Address } from './address'; +import { Address2 } from './address2'; +import { Amount } from './amount'; +import { Authentication } from './authentication'; +import { Balance } from './balance'; +import { BalanceAccount } from './balanceAccount'; +import { BalanceAccountInfo } from './balanceAccountInfo'; +import { BalanceAccountUpdateRequest } from './balanceAccountUpdateRequest'; +import { BalancePlatform } from './balancePlatform'; +import { BalanceSweepConfigurationsResponse } from './balanceSweepConfigurationsResponse'; +import { BrandVariantsRestriction } from './brandVariantsRestriction'; +import { BulkAddress } from './bulkAddress'; +import { CapabilityProblem } from './capabilityProblem'; +import { CapabilityProblemEntity } from './capabilityProblemEntity'; +import { CapabilityProblemEntityRecursive } from './capabilityProblemEntityRecursive'; +import { Card } from './card'; +import { CardConfiguration } from './cardConfiguration'; +import { CardInfo } from './cardInfo'; +import { ContactDetails } from './contactDetails'; +import { CountriesRestriction } from './countriesRestriction'; +import { DeliveryContact } from './deliveryContact'; +import { DifferentCurrenciesRestriction } from './differentCurrenciesRestriction'; +import { Duration } from './duration'; +import { EntryModesRestriction } from './entryModesRestriction'; +import { Expiry } from './expiry'; +import { InternationalTransactionRestriction } from './internationalTransactionRestriction'; +import { InvalidField } from './invalidField'; +import { JSONObject } from './jSONObject'; +import { JSONPath } from './jSONPath'; +import { MatchingTransactionsRestriction } from './matchingTransactionsRestriction'; +import { MccsRestriction } from './mccsRestriction'; +import { MerchantAcquirerPair } from './merchantAcquirerPair'; +import { MerchantsRestriction } from './merchantsRestriction'; +import { Name } from './name'; +import { PaginatedAccountHoldersResponse } from './paginatedAccountHoldersResponse'; +import { PaginatedBalanceAccountsResponse } from './paginatedBalanceAccountsResponse'; +import { PaginatedPaymentInstrumentsResponse } from './paginatedPaymentInstrumentsResponse'; +import { PaymentInstrument } from './paymentInstrument'; +import { PaymentInstrumentGroup } from './paymentInstrumentGroup'; +import { PaymentInstrumentGroupInfo } from './paymentInstrumentGroupInfo'; +import { PaymentInstrumentInfo } from './paymentInstrumentInfo'; +import { PaymentInstrumentUpdateRequest } from './paymentInstrumentUpdateRequest'; +import { Phone } from './phone'; +import { PhoneNumber } from './phoneNumber'; +import { ProcessingTypesRestriction } from './processingTypesRestriction'; +import { RemediatingAction } from './remediatingAction'; +import { RestServiceError } from './restServiceError'; +import { SweepConfigurationV2 } from './sweepConfigurationV2'; +import { SweepCounterparty } from './sweepCounterparty'; +import { SweepSchedule } from './sweepSchedule'; +import { TimeOfDay } from './timeOfDay'; +import { TimeOfDayRestriction } from './timeOfDayRestriction'; +import { TotalAmountRestriction } from './totalAmountRestriction'; +import { TransactionRule } from './transactionRule'; +import { TransactionRuleEntityKey } from './transactionRuleEntityKey'; +import { TransactionRuleInfo } from './transactionRuleInfo'; +import { TransactionRuleInterval } from './transactionRuleInterval'; +import { TransactionRuleResponse } from './transactionRuleResponse'; +import { TransactionRuleRestrictions } from './transactionRuleRestrictions'; +import { TransactionRulesResponse } from './transactionRulesResponse'; +import { VerificationError } from './verificationError'; +import { VerificationErrorRecursive } from './verificationErrorRecursive'; + +/* tslint:disable:no-unused-variable */ +let primitives = [ + "string", + "boolean", + "double", + "integer", + "long", + "float", + "number", + "any" + ]; + +let enumsMap: {[index: string]: any} = { + "AccountHolder.StatusEnum": AccountHolder.StatusEnum, + "AccountHolderCapability.AllowedLevelEnum": AccountHolderCapability.AllowedLevelEnum, + "AccountHolderCapability.RequestedLevelEnum": AccountHolderCapability.RequestedLevelEnum, + "AccountHolderCapability.VerificationStatusEnum": AccountHolderCapability.VerificationStatusEnum, + "BalanceAccount.StatusEnum": BalanceAccount.StatusEnum, + "BalanceAccountUpdateRequest.StatusEnum": BalanceAccountUpdateRequest.StatusEnum, + "CapabilityProblemEntity.TypeEnum": CapabilityProblemEntity.TypeEnum, + "CapabilityProblemEntityRecursive.TypeEnum": CapabilityProblemEntityRecursive.TypeEnum, + "Card.FormFactorEnum": Card.FormFactorEnum, + "CardInfo.FormFactorEnum": CardInfo.FormFactorEnum, + "Duration.UnitEnum": Duration.UnitEnum, + "EntryModesRestriction.ValueEnum": EntryModesRestriction.ValueEnum, + "PaymentInstrument.StatusEnum": PaymentInstrument.StatusEnum, + "PaymentInstrument.StatusReasonEnum": PaymentInstrument.StatusReasonEnum, + "PaymentInstrument.TypeEnum": PaymentInstrument.TypeEnum, + "PaymentInstrumentInfo.StatusEnum": PaymentInstrumentInfo.StatusEnum, + "PaymentInstrumentInfo.StatusReasonEnum": PaymentInstrumentInfo.StatusReasonEnum, + "PaymentInstrumentInfo.TypeEnum": PaymentInstrumentInfo.TypeEnum, + "PaymentInstrumentUpdateRequest.StatusEnum": PaymentInstrumentUpdateRequest.StatusEnum, + "PaymentInstrumentUpdateRequest.StatusReasonEnum": PaymentInstrumentUpdateRequest.StatusReasonEnum, + "Phone.TypeEnum": Phone.TypeEnum, + "PhoneNumber.PhoneTypeEnum": PhoneNumber.PhoneTypeEnum, + "ProcessingTypesRestriction.ValueEnum": ProcessingTypesRestriction.ValueEnum, + "SweepConfigurationV2.StatusEnum": SweepConfigurationV2.StatusEnum, + "SweepConfigurationV2.TypeEnum": SweepConfigurationV2.TypeEnum, + "SweepSchedule.TypeEnum": SweepSchedule.TypeEnum, + "TransactionRule.OutcomeTypeEnum": TransactionRule.OutcomeTypeEnum, + "TransactionRule.StatusEnum": TransactionRule.StatusEnum, + "TransactionRule.TypeEnum": TransactionRule.TypeEnum, + "TransactionRuleInfo.OutcomeTypeEnum": TransactionRuleInfo.OutcomeTypeEnum, + "TransactionRuleInfo.StatusEnum": TransactionRuleInfo.StatusEnum, + "TransactionRuleInfo.TypeEnum": TransactionRuleInfo.TypeEnum, + "TransactionRuleInterval.DayOfWeekEnum": TransactionRuleInterval.DayOfWeekEnum, + "TransactionRuleInterval.TypeEnum": TransactionRuleInterval.TypeEnum, + "VerificationError.TypeEnum": VerificationError.TypeEnum, + "VerificationErrorRecursive.TypeEnum": VerificationErrorRecursive.TypeEnum, +} + +let typeMap: {[index: string]: any} = { + "AccountHolder": AccountHolder, + "AccountHolderCapability": AccountHolderCapability, + "AccountHolderInfo": AccountHolderInfo, + "ActiveNetworkTokensRestriction": ActiveNetworkTokensRestriction, + "Address": Address, + "Address2": Address2, + "Amount": Amount, + "Authentication": Authentication, + "Balance": Balance, + "BalanceAccount": BalanceAccount, + "BalanceAccountInfo": BalanceAccountInfo, + "BalanceAccountUpdateRequest": BalanceAccountUpdateRequest, + "BalancePlatform": BalancePlatform, + "BalanceSweepConfigurationsResponse": BalanceSweepConfigurationsResponse, + "BrandVariantsRestriction": BrandVariantsRestriction, + "BulkAddress": BulkAddress, + "CapabilityProblem": CapabilityProblem, + "CapabilityProblemEntity": CapabilityProblemEntity, + "CapabilityProblemEntityRecursive": CapabilityProblemEntityRecursive, + "Card": Card, + "CardConfiguration": CardConfiguration, + "CardInfo": CardInfo, + "ContactDetails": ContactDetails, + "CountriesRestriction": CountriesRestriction, + "DeliveryContact": DeliveryContact, + "DifferentCurrenciesRestriction": DifferentCurrenciesRestriction, + "Duration": Duration, + "EntryModesRestriction": EntryModesRestriction, + "Expiry": Expiry, + "InternationalTransactionRestriction": InternationalTransactionRestriction, + "InvalidField": InvalidField, + "JSONObject": JSONObject, + "JSONPath": JSONPath, + "MatchingTransactionsRestriction": MatchingTransactionsRestriction, + "MccsRestriction": MccsRestriction, + "MerchantAcquirerPair": MerchantAcquirerPair, + "MerchantsRestriction": MerchantsRestriction, + "Name": Name, + "PaginatedAccountHoldersResponse": PaginatedAccountHoldersResponse, + "PaginatedBalanceAccountsResponse": PaginatedBalanceAccountsResponse, + "PaginatedPaymentInstrumentsResponse": PaginatedPaymentInstrumentsResponse, + "PaymentInstrument": PaymentInstrument, + "PaymentInstrumentGroup": PaymentInstrumentGroup, + "PaymentInstrumentGroupInfo": PaymentInstrumentGroupInfo, + "PaymentInstrumentInfo": PaymentInstrumentInfo, + "PaymentInstrumentUpdateRequest": PaymentInstrumentUpdateRequest, + "Phone": Phone, + "PhoneNumber": PhoneNumber, + "ProcessingTypesRestriction": ProcessingTypesRestriction, + "RemediatingAction": RemediatingAction, + "RestServiceError": RestServiceError, + "SweepConfigurationV2": SweepConfigurationV2, + "SweepCounterparty": SweepCounterparty, + "SweepSchedule": SweepSchedule, + "TimeOfDay": TimeOfDay, + "TimeOfDayRestriction": TimeOfDayRestriction, + "TotalAmountRestriction": TotalAmountRestriction, + "TransactionRule": TransactionRule, + "TransactionRuleEntityKey": TransactionRuleEntityKey, + "TransactionRuleInfo": TransactionRuleInfo, + "TransactionRuleInterval": TransactionRuleInterval, + "TransactionRuleResponse": TransactionRuleResponse, + "TransactionRuleRestrictions": TransactionRuleRestrictions, + "TransactionRulesResponse": TransactionRulesResponse, + "VerificationError": VerificationError, + "VerificationErrorRecursive": VerificationErrorRecursive, +} + +export class ObjectSerializer { + public static findCorrectType(data: any, expectedType: string) { + if (data == undefined) { + return expectedType; + } else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) { + return expectedType; + } else if (expectedType === "Date") { + return expectedType; + } else { + if (enumsMap[expectedType]) { + return expectedType; + } + + if (!typeMap[expectedType]) { + return expectedType; // w/e we don't know the type + } + + // Check the discriminator + let discriminatorProperty = typeMap[expectedType].discriminator; + if (discriminatorProperty == null) { + return expectedType; // the type does not have a discriminator. use it. + } else { + if (data[discriminatorProperty]) { + var discriminatorType = data[discriminatorProperty]; + if(typeMap[discriminatorType]){ + return discriminatorType; // use the type given in the discriminator + } else { + return expectedType; // discriminator did not map to a type + } + } else { + return expectedType; // discriminator was not present (or an empty string) + } + } + } + } + + public static serialize(data: any, type: string) { + if (data == undefined) { + return data; + } else if (primitives.indexOf(type.toLowerCase()) !== -1) { + return data; + } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 + let subType: string = type.replace("Array<", ""); // Array => Type> + subType = subType.substring(0, subType.length - 1); // Type> => Type + let transformedData: any[] = []; + for (let index = 0; index < data.length; index++) { + let datum = data[index]; + transformedData.push(ObjectSerializer.serialize(datum, subType)); + } + return transformedData; + } else if (type === "Date") { + return data.toISOString(); + } else if (type === "SaleToAcquirerData") { + const dataString = JSON.stringify(data); + return Buffer.from(dataString).toString("base64"); + } else { + if (enumsMap[type]) { + return data; + } + if (!typeMap[type]) { // in case we dont know the type + return data; + } + + // Get the actual type of this object + type = this.findCorrectType(data, type); + + // get the map for the correct type. + let attributeTypes = typeMap[type].getAttributeTypeMap(); + let instance: {[index: string]: any} = {}; + for (let index = 0; index < attributeTypes.length; index++) { + let attributeType = attributeTypes[index]; + instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type); + } + return instance; + } + } + + public static deserialize(data: any, type: string) { + // polymorphism may change the actual type. + type = ObjectSerializer.findCorrectType(data, type); + if (data == undefined) { + return data; + } else if (primitives.indexOf(type.toLowerCase()) !== -1) { + return data; + } else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6 + let subType: string = type.replace("Array<", ""); // Array => Type> + subType = subType.substring(0, subType.length - 1); // Type> => Type + let transformedData: any[] = []; + for (let index = 0; index < data.length; index++) { + let datum = data[index]; + transformedData.push(ObjectSerializer.deserialize(datum, subType)); + } + return transformedData; + } else if (type === "Date") { + return new Date(data); + } else { + if (enumsMap[type]) {// is Enum + return data; + } + + if (!typeMap[type]) { // dont know the type + return data; + } + let instance = new typeMap[type](); + let attributeTypes = typeMap[type].getAttributeTypeMap(); + for (let index = 0; index < attributeTypes.length; index++) { + let attributeType = attributeTypes[index]; + instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type); + } + return instance; + } + } +} diff --git a/src/typings/balancePlatform/name.ts b/src/typings/balancePlatform/name.ts new file mode 100644 index 000000000..46326e4bd --- /dev/null +++ b/src/typings/balancePlatform/name.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Name { + /** + * The first name. + */ + 'firstName': string; + /** + * The last name. + */ + 'lastName': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "firstName", + "baseName": "firstName", + "type": "string" + }, + { + "name": "lastName", + "baseName": "lastName", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return Name.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/paginatedAccountHoldersResponse.ts b/src/typings/balancePlatform/paginatedAccountHoldersResponse.ts new file mode 100644 index 000000000..72b734162 --- /dev/null +++ b/src/typings/balancePlatform/paginatedAccountHoldersResponse.ts @@ -0,0 +1,49 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { AccountHolder } from './accountHolder'; + +export class PaginatedAccountHoldersResponse { + /** + * List of account holders. + */ + 'accountHolders': Array; + /** + * Indicates whether there are more items on the next page. + */ + 'hasNext': boolean; + /** + * Indicates whether there are more items on the previous page. + */ + 'hasPrevious': boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "accountHolders", + "baseName": "accountHolders", + "type": "Array" + }, + { + "name": "hasNext", + "baseName": "hasNext", + "type": "boolean" + }, + { + "name": "hasPrevious", + "baseName": "hasPrevious", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return PaginatedAccountHoldersResponse.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/paginatedBalanceAccountsResponse.ts b/src/typings/balancePlatform/paginatedBalanceAccountsResponse.ts new file mode 100644 index 000000000..72d2b6387 --- /dev/null +++ b/src/typings/balancePlatform/paginatedBalanceAccountsResponse.ts @@ -0,0 +1,49 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { BalanceAccount } from './balanceAccount'; + +export class PaginatedBalanceAccountsResponse { + /** + * List of balance accounts. + */ + 'balanceAccounts': Array; + /** + * Indicates whether there are more items on the next page. + */ + 'hasNext': boolean; + /** + * Indicates whether there are more items on the previous page. + */ + 'hasPrevious': boolean; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "balanceAccounts", + "baseName": "balanceAccounts", + "type": "Array" + }, + { + "name": "hasNext", + "baseName": "hasNext", + "type": "boolean" + }, + { + "name": "hasPrevious", + "baseName": "hasPrevious", + "type": "boolean" + } ]; + + static getAttributeTypeMap() { + return PaginatedBalanceAccountsResponse.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/paginatedPaymentInstrumentsResponse.ts b/src/typings/balancePlatform/paginatedPaymentInstrumentsResponse.ts new file mode 100644 index 000000000..7edb9c5a4 --- /dev/null +++ b/src/typings/balancePlatform/paginatedPaymentInstrumentsResponse.ts @@ -0,0 +1,49 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { PaymentInstrument } from './paymentInstrument'; + +export class PaginatedPaymentInstrumentsResponse { + /** + * Indicates whether there are more items on the next page. + */ + 'hasNext': boolean; + /** + * Indicates whether there are more items on the previous page. + */ + 'hasPrevious': boolean; + /** + * List of payment instruments associated with the balance account. + */ + 'paymentInstruments': Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "hasNext", + "baseName": "hasNext", + "type": "boolean" + }, + { + "name": "hasPrevious", + "baseName": "hasPrevious", + "type": "boolean" + }, + { + "name": "paymentInstruments", + "baseName": "paymentInstruments", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return PaginatedPaymentInstrumentsResponse.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/paymentInstrument.ts b/src/typings/balancePlatform/paymentInstrument.ts new file mode 100644 index 000000000..3e4785f73 --- /dev/null +++ b/src/typings/balancePlatform/paymentInstrument.ts @@ -0,0 +1,130 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Card } from './card'; + +export class PaymentInstrument { + /** + * The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. + */ + 'balanceAccountId': string; + 'card'?: Card; + /** + * Your description for the payment instrument, maximum 300 characters. + */ + 'description'?: string; + /** + * The unique identifier of the payment instrument. + */ + 'id': string; + /** + * The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**. + */ + 'issuingCountryCode': string; + /** + * The unique identifier of the [payment instrument group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) to which the payment instrument belongs. + */ + 'paymentInstrumentGroupId'?: string; + /** + * Your reference for the payment instrument, maximum 150 characters. + */ + 'reference'?: string; + /** + * The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + */ + 'status'?: PaymentInstrument.StatusEnum; + /** + * The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + */ + 'statusReason'?: PaymentInstrument.StatusReasonEnum; + /** + * Type of payment instrument. Possible value: **card**. + */ + 'type': PaymentInstrument.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "balanceAccountId", + "baseName": "balanceAccountId", + "type": "string" + }, + { + "name": "card", + "baseName": "card", + "type": "Card" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "string" + }, + { + "name": "issuingCountryCode", + "baseName": "issuingCountryCode", + "type": "string" + }, + { + "name": "paymentInstrumentGroupId", + "baseName": "paymentInstrumentGroupId", + "type": "string" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string" + }, + { + "name": "status", + "baseName": "status", + "type": "PaymentInstrument.StatusEnum" + }, + { + "name": "statusReason", + "baseName": "statusReason", + "type": "PaymentInstrument.StatusReasonEnum" + }, + { + "name": "type", + "baseName": "type", + "type": "PaymentInstrument.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return PaymentInstrument.attributeTypeMap; + } +} + +export namespace PaymentInstrument { + export enum StatusEnum { + Active = 'active', + Closed = 'closed', + Inactive = 'inactive', + Suspended = 'suspended' + } + export enum StatusReasonEnum { + AccountClosure = 'accountClosure', + Damaged = 'damaged', + EndOfLife = 'endOfLife', + Expired = 'expired', + Lost = 'lost', + Other = 'other', + Stolen = 'stolen', + SuspectedFraud = 'suspectedFraud' + } + export enum TypeEnum { + Card = 'card' + } +} diff --git a/src/typings/balancePlatform/paymentInstrumentGroup.ts b/src/typings/balancePlatform/paymentInstrumentGroup.ts new file mode 100644 index 000000000..205cde43d --- /dev/null +++ b/src/typings/balancePlatform/paymentInstrumentGroup.ts @@ -0,0 +1,75 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class PaymentInstrumentGroup { + /** + * The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the payment instrument group belongs. + */ + 'balancePlatform': string; + /** + * Your description for the payment instrument group, maximum 300 characters. + */ + 'description'?: string; + /** + * The unique identifier of the payment instrument group. + */ + 'id'?: string; + /** + * Properties of the payment instrument group. + */ + 'properties'?: { [key: string]: string; }; + /** + * Your reference for the payment instrument group, maximum 150 characters. + */ + 'reference'?: string; + /** + * The tx variant of the payment instrument group. + */ + 'txVariant': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "balancePlatform", + "baseName": "balancePlatform", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "string" + }, + { + "name": "properties", + "baseName": "properties", + "type": "{ [key: string]: string; }" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string" + }, + { + "name": "txVariant", + "baseName": "txVariant", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return PaymentInstrumentGroup.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/paymentInstrumentGroupInfo.ts b/src/typings/balancePlatform/paymentInstrumentGroupInfo.ts new file mode 100644 index 000000000..d1b503f23 --- /dev/null +++ b/src/typings/balancePlatform/paymentInstrumentGroupInfo.ts @@ -0,0 +1,66 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class PaymentInstrumentGroupInfo { + /** + * The unique identifier of the [balance platform](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balancePlatforms/{id}__queryParam_id) to which the payment instrument group belongs. + */ + 'balancePlatform': string; + /** + * Your description for the payment instrument group, maximum 300 characters. + */ + 'description'?: string; + /** + * Properties of the payment instrument group. + */ + 'properties'?: { [key: string]: string; }; + /** + * Your reference for the payment instrument group, maximum 150 characters. + */ + 'reference'?: string; + /** + * The tx variant of the payment instrument group. + */ + 'txVariant': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "balancePlatform", + "baseName": "balancePlatform", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "properties", + "baseName": "properties", + "type": "{ [key: string]: string; }" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string" + }, + { + "name": "txVariant", + "baseName": "txVariant", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return PaymentInstrumentGroupInfo.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/paymentInstrumentInfo.ts b/src/typings/balancePlatform/paymentInstrumentInfo.ts new file mode 100644 index 000000000..015bed84f --- /dev/null +++ b/src/typings/balancePlatform/paymentInstrumentInfo.ts @@ -0,0 +1,121 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { CardInfo } from './cardInfo'; + +export class PaymentInstrumentInfo { + /** + * The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/balanceAccounts__resParam_id) associated with the payment instrument. + */ + 'balanceAccountId': string; + 'card'?: CardInfo; + /** + * Your description for the payment instrument, maximum 300 characters. + */ + 'description'?: string; + /** + * The two-character [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code where the payment instrument is issued. For example, **NL** or **US**. + */ + 'issuingCountryCode': string; + /** + * The unique identifier of the [payment instrument group](https://docs.adyen.com/api-explorer/#/balanceplatform/v1/post/paymentInstrumentGroups__resParam_id) to which the payment instrument belongs. + */ + 'paymentInstrumentGroupId'?: string; + /** + * Your reference for the payment instrument, maximum 150 characters. + */ + 'reference'?: string; + /** + * The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + */ + 'status'?: PaymentInstrumentInfo.StatusEnum; + /** + * The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + */ + 'statusReason'?: PaymentInstrumentInfo.StatusReasonEnum; + /** + * Type of payment instrument. Possible value: **card**. + */ + 'type': PaymentInstrumentInfo.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "balanceAccountId", + "baseName": "balanceAccountId", + "type": "string" + }, + { + "name": "card", + "baseName": "card", + "type": "CardInfo" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "issuingCountryCode", + "baseName": "issuingCountryCode", + "type": "string" + }, + { + "name": "paymentInstrumentGroupId", + "baseName": "paymentInstrumentGroupId", + "type": "string" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string" + }, + { + "name": "status", + "baseName": "status", + "type": "PaymentInstrumentInfo.StatusEnum" + }, + { + "name": "statusReason", + "baseName": "statusReason", + "type": "PaymentInstrumentInfo.StatusReasonEnum" + }, + { + "name": "type", + "baseName": "type", + "type": "PaymentInstrumentInfo.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return PaymentInstrumentInfo.attributeTypeMap; + } +} + +export namespace PaymentInstrumentInfo { + export enum StatusEnum { + Active = 'active', + Closed = 'closed', + Inactive = 'inactive', + Suspended = 'suspended' + } + export enum StatusReasonEnum { + AccountClosure = 'accountClosure', + Damaged = 'damaged', + EndOfLife = 'endOfLife', + Expired = 'expired', + Lost = 'lost', + Other = 'other', + Stolen = 'stolen', + SuspectedFraud = 'suspectedFraud' + } + export enum TypeEnum { + Card = 'card' + } +} diff --git a/src/typings/balancePlatform/paymentInstrumentUpdateRequest.ts b/src/typings/balancePlatform/paymentInstrumentUpdateRequest.ts new file mode 100644 index 000000000..1e8fb0505 --- /dev/null +++ b/src/typings/balancePlatform/paymentInstrumentUpdateRequest.ts @@ -0,0 +1,82 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { CardInfo } from './cardInfo'; + +export class PaymentInstrumentUpdateRequest { + /** + * The unique identifier of the balance account associated with this payment instrument. >You can only change the balance account ID if the payment instrument has **inactive** status. + */ + 'balanceAccountId'?: string; + 'card'?: CardInfo; + /** + * The status of the payment instrument. If a status is not specified when creating a payment instrument, it is set to **active** by default. However, there can be exceptions based on the `card.formFactor` and the `issuingCountryCode`. For example, when issuing physical cards in the US, the default status is **inactive**. Possible values: * **active**: The payment instrument is active and can be used to make payments. * **inactive**: The payment instrument is inactive and cannot be used to make payments. * **suspended**: The payment instrument is suspended, either because it was stolen or lost. * **closed**: The payment instrument is permanently closed. This action cannot be undone. + */ + 'status'?: PaymentInstrumentUpdateRequest.StatusEnum; + /** + * Comment for the status of the payment instrument. Required if `statusReason` is **other**. + */ + 'statusComment'?: string; + /** + * The reason for updating the status of the payment instrument. Possible values: **lost**, **stolen**, **damaged**, **suspectedFraud**, **expired**, **endOfLife**, **accountClosure**, **other**. If the reason is **other**, you must also send the `statusComment` parameter describing the status change. + */ + 'statusReason'?: PaymentInstrumentUpdateRequest.StatusReasonEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "balanceAccountId", + "baseName": "balanceAccountId", + "type": "string" + }, + { + "name": "card", + "baseName": "card", + "type": "CardInfo" + }, + { + "name": "status", + "baseName": "status", + "type": "PaymentInstrumentUpdateRequest.StatusEnum" + }, + { + "name": "statusComment", + "baseName": "statusComment", + "type": "string" + }, + { + "name": "statusReason", + "baseName": "statusReason", + "type": "PaymentInstrumentUpdateRequest.StatusReasonEnum" + } ]; + + static getAttributeTypeMap() { + return PaymentInstrumentUpdateRequest.attributeTypeMap; + } +} + +export namespace PaymentInstrumentUpdateRequest { + export enum StatusEnum { + Active = 'active', + Closed = 'closed', + Inactive = 'inactive', + Suspended = 'suspended' + } + export enum StatusReasonEnum { + AccountClosure = 'accountClosure', + Damaged = 'damaged', + EndOfLife = 'endOfLife', + Expired = 'expired', + Lost = 'lost', + Other = 'other', + Stolen = 'stolen', + SuspectedFraud = 'suspectedFraud' + } +} diff --git a/src/typings/balancePlatform/phone.ts b/src/typings/balancePlatform/phone.ts new file mode 100644 index 000000000..731e45b7b --- /dev/null +++ b/src/typings/balancePlatform/phone.ts @@ -0,0 +1,45 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class Phone { + /** + * The full phone number provided as a single string. For example, **\"0031 6 11 22 33 44\"**, **\"+316/1122-3344\"**, or **\"(0031) 611223344\"**. + */ + 'number': string; + /** + * Type of phone number. Possible values: **Landline**, **Mobile**. + */ + 'type': Phone.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "number", + "baseName": "number", + "type": "string" + }, + { + "name": "type", + "baseName": "type", + "type": "Phone.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return Phone.attributeTypeMap; + } +} + +export namespace Phone { + export enum TypeEnum { + Landline = 'landline', + Mobile = 'mobile' + } +} diff --git a/src/typings/balancePlatform/phoneNumber.ts b/src/typings/balancePlatform/phoneNumber.ts new file mode 100644 index 000000000..cfa7db35b --- /dev/null +++ b/src/typings/balancePlatform/phoneNumber.ts @@ -0,0 +1,56 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class PhoneNumber { + /** + * The two-character ISO-3166-1 alpha-2 country code of the phone number. For example, **US** or **NL**. + */ + 'phoneCountryCode': string; + /** + * The phone number. The inclusion of the phone number country code is not necessary. + */ + 'phoneNumber': string; + /** + * The type of the phone number. Possible values: **Landline**, **Mobile**, **SIP**, **Fax**. + */ + 'phoneType'?: PhoneNumber.PhoneTypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "phoneCountryCode", + "baseName": "phoneCountryCode", + "type": "string" + }, + { + "name": "phoneNumber", + "baseName": "phoneNumber", + "type": "string" + }, + { + "name": "phoneType", + "baseName": "phoneType", + "type": "PhoneNumber.PhoneTypeEnum" + } ]; + + static getAttributeTypeMap() { + return PhoneNumber.attributeTypeMap; + } +} + +export namespace PhoneNumber { + export enum PhoneTypeEnum { + Fax = 'Fax', + Landline = 'Landline', + Mobile = 'Mobile', + Sip = 'SIP' + } +} diff --git a/src/typings/balancePlatform/processingTypesRestriction.ts b/src/typings/balancePlatform/processingTypesRestriction.ts new file mode 100644 index 000000000..f0c1004b7 --- /dev/null +++ b/src/typings/balancePlatform/processingTypesRestriction.ts @@ -0,0 +1,52 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class ProcessingTypesRestriction { + /** + * Defines how the condition must be evaluated. + */ + 'operation': string; + /** + * List of processing types. Possible values: **atmWithdraw**, **pos**, **ecommerce**, **moto**, **recurring**, **balanceInquiry**. + */ + 'value'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "operation", + "baseName": "operation", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return ProcessingTypesRestriction.attributeTypeMap; + } +} + +export namespace ProcessingTypesRestriction { + export enum ValueEnum { + AtmWithdraw = 'atmWithdraw', + BalanceInquiry = 'balanceInquiry', + Ecommerce = 'ecommerce', + Moto = 'moto', + Pos = 'pos', + PurchaseWithCashback = 'purchaseWithCashback', + Recurring = 'recurring', + Token = 'token', + Unknown = 'unknown' + } +} diff --git a/src/typings/balancePlatform/remediatingAction.ts b/src/typings/balancePlatform/remediatingAction.ts new file mode 100644 index 000000000..b90d13df1 --- /dev/null +++ b/src/typings/balancePlatform/remediatingAction.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class RemediatingAction { + /** + * The remediating action code. + */ + 'code'?: string; + /** + * A description of how you can resolve the verification error. + */ + 'message'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string" + }, + { + "name": "message", + "baseName": "message", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return RemediatingAction.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/restServiceError.ts b/src/typings/balancePlatform/restServiceError.ts new file mode 100644 index 000000000..f41d0c63b --- /dev/null +++ b/src/typings/balancePlatform/restServiceError.ts @@ -0,0 +1,101 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { InvalidField } from './invalidField'; +import { JSONObject } from './jSONObject'; + +export class RestServiceError { + /** + * A human-readable explanation specific to this occurrence of the problem. + */ + 'detail': string; + /** + * A code that identifies the problem type. + */ + 'errorCode': string; + /** + * A URI that identifies the problem type, pointing to human-readable documentation on this problem type. + */ + 'errorType': string; + /** + * A unique URI that identifies the specific occurrence of the problem. + */ + 'instance'?: string; + /** + * Detailed explanation of each validation error, when applicable. + */ + 'invalidFields'?: Array; + /** + * A unique reference for the request, essentially the same as `pspReference`. + */ + 'requestId'?: string; + 'response'?: JSONObject; + /** + * The HTTP status code. + */ + 'status': number; + /** + * A short, human-readable summary of the problem type. + */ + 'title': string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "detail", + "baseName": "detail", + "type": "string" + }, + { + "name": "errorCode", + "baseName": "errorCode", + "type": "string" + }, + { + "name": "errorType", + "baseName": "errorType", + "type": "string" + }, + { + "name": "instance", + "baseName": "instance", + "type": "string" + }, + { + "name": "invalidFields", + "baseName": "invalidFields", + "type": "Array" + }, + { + "name": "requestId", + "baseName": "requestId", + "type": "string" + }, + { + "name": "response", + "baseName": "response", + "type": "JSONObject" + }, + { + "name": "status", + "baseName": "status", + "type": "number" + }, + { + "name": "title", + "baseName": "title", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return RestServiceError.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/sweepConfigurationV2.ts b/src/typings/balancePlatform/sweepConfigurationV2.ts new file mode 100644 index 000000000..23d9fdf46 --- /dev/null +++ b/src/typings/balancePlatform/sweepConfigurationV2.ts @@ -0,0 +1,100 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Amount } from './amount'; +import { SweepCounterparty } from './sweepCounterparty'; +import { SweepSchedule } from './sweepSchedule'; + +export class SweepConfigurationV2 { + 'counterparty': SweepCounterparty; + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes) in uppercase. For example, **EUR**. The sweep currency must match any of the [balances currencies](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__resParam_balances). + */ + 'currency': string; + /** + * The unique identifier of the sweep. + */ + 'id': string; + 'schedule': SweepSchedule; + /** + * The status of the sweep. If not provided, by default, this is set to **active**. Possible values: * **active**: the sweep is enabled and funds will be pulled in or pushed out based on the defined configuration. * **inactive**: the sweep is disabled and cannot be triggered. + */ + 'status'?: SweepConfigurationV2.StatusEnum; + 'sweepAmount'?: Amount; + 'targetAmount'?: Amount; + 'triggerAmount'?: Amount; + /** + * The direction of sweep, whether pushing out or pulling in funds to the balance account. If not provided, by default, this is set to **push**. Possible values: * **push**: _push out funds_ to a destination balance account or transfer instrument. * **pull**: _pull in funds_ from a source merchant account, transfer instrument, or balance account. + */ + 'type'?: SweepConfigurationV2.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "counterparty", + "baseName": "counterparty", + "type": "SweepCounterparty" + }, + { + "name": "currency", + "baseName": "currency", + "type": "string" + }, + { + "name": "id", + "baseName": "id", + "type": "string" + }, + { + "name": "schedule", + "baseName": "schedule", + "type": "SweepSchedule" + }, + { + "name": "status", + "baseName": "status", + "type": "SweepConfigurationV2.StatusEnum" + }, + { + "name": "sweepAmount", + "baseName": "sweepAmount", + "type": "Amount" + }, + { + "name": "targetAmount", + "baseName": "targetAmount", + "type": "Amount" + }, + { + "name": "triggerAmount", + "baseName": "triggerAmount", + "type": "Amount" + }, + { + "name": "type", + "baseName": "type", + "type": "SweepConfigurationV2.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return SweepConfigurationV2.attributeTypeMap; + } +} + +export namespace SweepConfigurationV2 { + export enum StatusEnum { + Active = 'active', + Inactive = 'inactive' + } + export enum TypeEnum { + Pull = 'pull', + Push = 'push' + } +} diff --git a/src/typings/balancePlatform/sweepCounterparty.ts b/src/typings/balancePlatform/sweepCounterparty.ts new file mode 100644 index 000000000..692d9f8e7 --- /dev/null +++ b/src/typings/balancePlatform/sweepCounterparty.ts @@ -0,0 +1,48 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class SweepCounterparty { + /** + * The unique identifier of the destination or source [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id). You can only use this for periodic sweep schedules such as `schedule.type` **daily** or **monthly**. + */ + 'balanceAccountId'?: string; + /** + * The merchant account that will be the source of funds, if you are processing payments with Adyen. You can only use this with sweeps of `type` **pull** and `schedule.type` **balance**. + */ + 'merchantAccount'?: string; + /** + * The unique identifier of the destination or source [transfer instrument](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/transferInstruments__resParam_id). You can also use this in combination with a `merchantAccount` and a `type` **pull** to start a direct debit request from the source transfer instrument. To use this feature, reach out to your Adyen contact. + */ + 'transferInstrumentId'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "balanceAccountId", + "baseName": "balanceAccountId", + "type": "string" + }, + { + "name": "merchantAccount", + "baseName": "merchantAccount", + "type": "string" + }, + { + "name": "transferInstrumentId", + "baseName": "transferInstrumentId", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return SweepCounterparty.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/sweepSchedule.ts b/src/typings/balancePlatform/sweepSchedule.ts new file mode 100644 index 000000000..64dca0590 --- /dev/null +++ b/src/typings/balancePlatform/sweepSchedule.ts @@ -0,0 +1,38 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class SweepSchedule { + /** + * The schedule type. Possible values: * **daily**: push out funds daily at 07:00 AM CET. * **weekly**: push out funds every Monday at 07:00 AM CET. * **monthly**: push out funds every first of the month at 07:00 AM CET. * **balance**: pull in funds instantly if the balance is less than or equal to the `triggerAmount`. You can only use this for sweeps of `type` **pull** and when the source is a `merchantAccount` or `transferInstrument`. + */ + 'type'?: SweepSchedule.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "type", + "baseName": "type", + "type": "SweepSchedule.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return SweepSchedule.attributeTypeMap; + } +} + +export namespace SweepSchedule { + export enum TypeEnum { + Daily = 'daily', + Weekly = 'weekly', + Monthly = 'monthly', + Balance = 'balance' + } +} diff --git a/src/typings/balancePlatform/timeOfDay.ts b/src/typings/balancePlatform/timeOfDay.ts new file mode 100644 index 000000000..f28b2bfc6 --- /dev/null +++ b/src/typings/balancePlatform/timeOfDay.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class TimeOfDay { + /** + * The end time in a time-only ISO-8601 extended offset format. For example: **08:00:00+02:00**, **22:30:00-03:00**. + */ + 'endTime'?: string; + /** + * The start time in a time-only ISO-8601 extended offset format. For example: **08:00:00+02:00**, **22:30:00-03:00**. + */ + 'startTime'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "endTime", + "baseName": "endTime", + "type": "string" + }, + { + "name": "startTime", + "baseName": "startTime", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return TimeOfDay.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/timeOfDayRestriction.ts b/src/typings/balancePlatform/timeOfDayRestriction.ts new file mode 100644 index 000000000..051a59d7a --- /dev/null +++ b/src/typings/balancePlatform/timeOfDayRestriction.ts @@ -0,0 +1,37 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { TimeOfDay } from './timeOfDay'; + +export class TimeOfDayRestriction { + /** + * Defines how the condition must be evaluated. + */ + 'operation': string; + 'value'?: TimeOfDay; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "operation", + "baseName": "operation", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "TimeOfDay" + } ]; + + static getAttributeTypeMap() { + return TimeOfDayRestriction.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/totalAmountRestriction.ts b/src/typings/balancePlatform/totalAmountRestriction.ts new file mode 100644 index 000000000..320fe8b84 --- /dev/null +++ b/src/typings/balancePlatform/totalAmountRestriction.ts @@ -0,0 +1,37 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Amount } from './amount'; + +export class TotalAmountRestriction { + /** + * Defines how the condition must be evaluated. + */ + 'operation': string; + 'value'?: Amount; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "operation", + "baseName": "operation", + "type": "string" + }, + { + "name": "value", + "baseName": "value", + "type": "Amount" + } ]; + + static getAttributeTypeMap() { + return TotalAmountRestriction.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/transactionRule.ts b/src/typings/balancePlatform/transactionRule.ts new file mode 100644 index 000000000..9bb305424 --- /dev/null +++ b/src/typings/balancePlatform/transactionRule.ts @@ -0,0 +1,148 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { TransactionRuleEntityKey } from './transactionRuleEntityKey'; +import { TransactionRuleInterval } from './transactionRuleInterval'; +import { TransactionRuleRestrictions } from './transactionRuleRestrictions'; + +export class TransactionRule { + /** + * The level at which data must be accumulated, used in rules with `type` **velocity** or **maxUsage**. The level must be the [same or lower in hierarchy](https://docs.adyen.com/issuing/transaction-rules#accumulate-data) than the `entityKey`. If not provided, by default, the rule will accumulate data at the **paymentInstrument** level. Possible values: **paymentInstrument**, **paymentInstrumentGroup**, **balanceAccount**, **accountHolder**, **balancePlatform**. + */ + 'aggregationLevel'?: string; + /** + * Your description for the transaction rule, maximum 300 characters. + */ + 'description': string; + /** + * The date when the rule will stop being evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided, the rule will be evaluated until the rule status is set to **inactive**. + */ + 'endDate'?: string; + 'entityKey': TransactionRuleEntityKey; + /** + * The unique identifier of the transaction rule. + */ + 'id'?: string; + 'interval': TransactionRuleInterval; + /** + * The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. If not provided, by default, this is set to **hardBlock**. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. + */ + 'outcomeType'?: TransactionRule.OutcomeTypeEnum; + /** + * Your reference for the transaction rule, maximum 150 characters. + */ + 'reference': string; + 'ruleRestrictions': TransactionRuleRestrictions; + /** + * A positive or negative score applied to the transaction if it meets the conditions of the rule. Required when `outcomeType` is **scoreBased**. The value must be between **-100** and **100**. + */ + 'score'?: number; + /** + * The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided when creating a transaction rule, the `startDate` is set to the date when the rule status is set to **active**. + */ + 'startDate'?: string; + /** + * The status of the transaction rule. If you provide a `startDate` in the request, the rule is automatically created with an **active** status. Possible values: **active**, **inactive**. + */ + 'status'?: TransactionRule.StatusEnum; + /** + * The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which definesif a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. + */ + 'type': TransactionRule.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "aggregationLevel", + "baseName": "aggregationLevel", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "endDate", + "baseName": "endDate", + "type": "string" + }, + { + "name": "entityKey", + "baseName": "entityKey", + "type": "TransactionRuleEntityKey" + }, + { + "name": "id", + "baseName": "id", + "type": "string" + }, + { + "name": "interval", + "baseName": "interval", + "type": "TransactionRuleInterval" + }, + { + "name": "outcomeType", + "baseName": "outcomeType", + "type": "TransactionRule.OutcomeTypeEnum" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string" + }, + { + "name": "ruleRestrictions", + "baseName": "ruleRestrictions", + "type": "TransactionRuleRestrictions" + }, + { + "name": "score", + "baseName": "score", + "type": "number" + }, + { + "name": "startDate", + "baseName": "startDate", + "type": "string" + }, + { + "name": "status", + "baseName": "status", + "type": "TransactionRule.StatusEnum" + }, + { + "name": "type", + "baseName": "type", + "type": "TransactionRule.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return TransactionRule.attributeTypeMap; + } +} + +export namespace TransactionRule { + export enum OutcomeTypeEnum { + HardBlock = 'hardBlock', + ScoreBased = 'scoreBased' + } + export enum StatusEnum { + Active = 'active', + Inactive = 'inactive' + } + export enum TypeEnum { + AllowList = 'allowList', + BlockList = 'blockList', + MaxUsage = 'maxUsage', + Velocity = 'velocity' + } +} diff --git a/src/typings/balancePlatform/transactionRuleEntityKey.ts b/src/typings/balancePlatform/transactionRuleEntityKey.ts new file mode 100644 index 000000000..b6a85fa87 --- /dev/null +++ b/src/typings/balancePlatform/transactionRuleEntityKey.ts @@ -0,0 +1,39 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + + +export class TransactionRuleEntityKey { + /** + * The unique identifier of the resource. + */ + 'entityReference'?: string; + /** + * The type of resource. Possible values: **balancePlatform**, **paymentInstrumentGroup**, **accountHolder**, **balanceAccount**, or **paymentInstrument**. + */ + 'entityType'?: string; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "entityReference", + "baseName": "entityReference", + "type": "string" + }, + { + "name": "entityType", + "baseName": "entityType", + "type": "string" + } ]; + + static getAttributeTypeMap() { + return TransactionRuleEntityKey.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/transactionRuleInfo.ts b/src/typings/balancePlatform/transactionRuleInfo.ts new file mode 100644 index 000000000..819901795 --- /dev/null +++ b/src/typings/balancePlatform/transactionRuleInfo.ts @@ -0,0 +1,139 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { TransactionRuleEntityKey } from './transactionRuleEntityKey'; +import { TransactionRuleInterval } from './transactionRuleInterval'; +import { TransactionRuleRestrictions } from './transactionRuleRestrictions'; + +export class TransactionRuleInfo { + /** + * The level at which data must be accumulated, used in rules with `type` **velocity** or **maxUsage**. The level must be the [same or lower in hierarchy](https://docs.adyen.com/issuing/transaction-rules#accumulate-data) than the `entityKey`. If not provided, by default, the rule will accumulate data at the **paymentInstrument** level. Possible values: **paymentInstrument**, **paymentInstrumentGroup**, **balanceAccount**, **accountHolder**, **balancePlatform**. + */ + 'aggregationLevel'?: string; + /** + * Your description for the transaction rule, maximum 300 characters. + */ + 'description': string; + /** + * The date when the rule will stop being evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided, the rule will be evaluated until the rule status is set to **inactive**. + */ + 'endDate'?: string; + 'entityKey': TransactionRuleEntityKey; + 'interval': TransactionRuleInterval; + /** + * The [outcome](https://docs.adyen.com/issuing/transaction-rules#outcome) that will be applied when a transaction meets the conditions of the rule. If not provided, by default, this is set to **hardBlock**. Possible values: * **hardBlock**: the transaction is declined. * **scoreBased**: the transaction is assigned the `score` you specified. Adyen calculates the total score and if it exceeds 100, the transaction is declined. + */ + 'outcomeType'?: TransactionRuleInfo.OutcomeTypeEnum; + /** + * Your reference for the transaction rule, maximum 150 characters. + */ + 'reference': string; + 'ruleRestrictions': TransactionRuleRestrictions; + /** + * A positive or negative score applied to the transaction if it meets the conditions of the rule. Required when `outcomeType` is **scoreBased**. The value must be between **-100** and **100**. + */ + 'score'?: number; + /** + * The date when the rule will start to be evaluated, in ISO 8601 extended offset date-time format. For example, **2020-12-18T10:15:30+01:00**. If not provided when creating a transaction rule, the `startDate` is set to the date when the rule status is set to **active**. + */ + 'startDate'?: string; + /** + * The status of the transaction rule. If you provide a `startDate` in the request, the rule is automatically created with an **active** status. Possible values: **active**, **inactive**. + */ + 'status'?: TransactionRuleInfo.StatusEnum; + /** + * The [type of rule](https://docs.adyen.com/issuing/transaction-rules#rule-types), which definesif a rule blocks transactions based on individual characteristics or accumulates data. Possible values: * **blockList**: decline a transaction when the conditions are met. * **maxUsage**: add the amount or number of transactions for the lifetime of a payment instrument, and then decline a transaction when the specified limits are met. * **velocity**: add the amount or number of transactions based on a specified time interval, and then decline a transaction when the specified limits are met. + */ + 'type': TransactionRuleInfo.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "aggregationLevel", + "baseName": "aggregationLevel", + "type": "string" + }, + { + "name": "description", + "baseName": "description", + "type": "string" + }, + { + "name": "endDate", + "baseName": "endDate", + "type": "string" + }, + { + "name": "entityKey", + "baseName": "entityKey", + "type": "TransactionRuleEntityKey" + }, + { + "name": "interval", + "baseName": "interval", + "type": "TransactionRuleInterval" + }, + { + "name": "outcomeType", + "baseName": "outcomeType", + "type": "TransactionRuleInfo.OutcomeTypeEnum" + }, + { + "name": "reference", + "baseName": "reference", + "type": "string" + }, + { + "name": "ruleRestrictions", + "baseName": "ruleRestrictions", + "type": "TransactionRuleRestrictions" + }, + { + "name": "score", + "baseName": "score", + "type": "number" + }, + { + "name": "startDate", + "baseName": "startDate", + "type": "string" + }, + { + "name": "status", + "baseName": "status", + "type": "TransactionRuleInfo.StatusEnum" + }, + { + "name": "type", + "baseName": "type", + "type": "TransactionRuleInfo.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return TransactionRuleInfo.attributeTypeMap; + } +} + +export namespace TransactionRuleInfo { + export enum OutcomeTypeEnum { + HardBlock = 'hardBlock', + ScoreBased = 'scoreBased' + } + export enum StatusEnum { + Active = 'active', + Inactive = 'inactive' + } + export enum TypeEnum { + AllowList = 'allowList', + BlockList = 'blockList', + MaxUsage = 'maxUsage', + Velocity = 'velocity' + } +} diff --git a/src/typings/balancePlatform/transactionRuleInterval.ts b/src/typings/balancePlatform/transactionRuleInterval.ts new file mode 100644 index 000000000..285d3de11 --- /dev/null +++ b/src/typings/balancePlatform/transactionRuleInterval.ts @@ -0,0 +1,93 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { Duration } from './duration'; + +export class TransactionRuleInterval { + /** + * The day of month, used when the `duration.unit` is **months**. If not provided, by default, this is set to **1**, the first day of the month. + */ + 'dayOfMonth'?: number; + /** + * The day of week, used when the `duration.unit` is **weeks**. If not provided, by default, this is set to **monday**. Possible values: **sunday**, **monday**, **tuesday**, **wednesday**, **thursday**, **friday**. + */ + 'dayOfWeek'?: TransactionRuleInterval.DayOfWeekEnum; + 'duration'?: Duration; + /** + * The time of day, in **hh:mm:ss** format, used when the `duration.unit` is **hours**. If not provided, by default, this is set to **00:00:00**. + */ + 'timeOfDay'?: string; + /** + * The [time zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For example, **Europe/Amsterdam**. By default, this is set to **UTC**. + */ + 'timeZone'?: string; + /** + * The [type of interval](https://docs.adyen.com/issuing/transaction-rules#time-intervals) during which the rule conditions and limits apply, and how often counters are reset. Possible values: * **perTransaction**: conditions are evaluated and the counters are reset for every transaction. * **daily**: the counters are reset daily at 00:00:00 UTC. * **weekly**: the counters are reset every Monday at 00:00:00 UTC. * **monthly**: the counters reset every first day of the month at 00:00:00 UTC. * **lifetime**: conditions are applied to the lifetime of the payment instrument. * **rolling**: conditions are applied and the counters are reset based on a `duration`. If the reset date and time are not provided, Adyen applies the default reset time similar to fixed intervals. For example, if the duration is every two weeks, the counter resets every third Monday at 00:00:00 UTC. * **sliding**: conditions are applied and the counters are reset based on the current time and a `duration` that you specify. + */ + 'type': TransactionRuleInterval.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "dayOfMonth", + "baseName": "dayOfMonth", + "type": "number" + }, + { + "name": "dayOfWeek", + "baseName": "dayOfWeek", + "type": "TransactionRuleInterval.DayOfWeekEnum" + }, + { + "name": "duration", + "baseName": "duration", + "type": "Duration" + }, + { + "name": "timeOfDay", + "baseName": "timeOfDay", + "type": "string" + }, + { + "name": "timeZone", + "baseName": "timeZone", + "type": "string" + }, + { + "name": "type", + "baseName": "type", + "type": "TransactionRuleInterval.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return TransactionRuleInterval.attributeTypeMap; + } +} + +export namespace TransactionRuleInterval { + export enum DayOfWeekEnum { + Friday = 'friday', + Monday = 'monday', + Saturday = 'saturday', + Sunday = 'sunday', + Thursday = 'thursday', + Tuesday = 'tuesday', + Wednesday = 'wednesday' + } + export enum TypeEnum { + Daily = 'daily', + Lifetime = 'lifetime', + Monthly = 'monthly', + PerTransaction = 'perTransaction', + Rolling = 'rolling', + Sliding = 'sliding', + Weekly = 'weekly' + } +} diff --git a/src/typings/balancePlatform/transactionRuleResponse.ts b/src/typings/balancePlatform/transactionRuleResponse.ts new file mode 100644 index 000000000..03f7d5406 --- /dev/null +++ b/src/typings/balancePlatform/transactionRuleResponse.ts @@ -0,0 +1,28 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { TransactionRule } from './transactionRule'; + +export class TransactionRuleResponse { + 'transactionRule'?: TransactionRule; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "transactionRule", + "baseName": "transactionRule", + "type": "TransactionRule" + } ]; + + static getAttributeTypeMap() { + return TransactionRuleResponse.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/transactionRuleRestrictions.ts b/src/typings/balancePlatform/transactionRuleRestrictions.ts new file mode 100644 index 000000000..7c1a68bdd --- /dev/null +++ b/src/typings/balancePlatform/transactionRuleRestrictions.ts @@ -0,0 +1,105 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { ActiveNetworkTokensRestriction } from './activeNetworkTokensRestriction'; +import { BrandVariantsRestriction } from './brandVariantsRestriction'; +import { CountriesRestriction } from './countriesRestriction'; +import { DifferentCurrenciesRestriction } from './differentCurrenciesRestriction'; +import { EntryModesRestriction } from './entryModesRestriction'; +import { InternationalTransactionRestriction } from './internationalTransactionRestriction'; +import { MatchingTransactionsRestriction } from './matchingTransactionsRestriction'; +import { MccsRestriction } from './mccsRestriction'; +import { MerchantsRestriction } from './merchantsRestriction'; +import { ProcessingTypesRestriction } from './processingTypesRestriction'; +import { TimeOfDayRestriction } from './timeOfDayRestriction'; +import { TotalAmountRestriction } from './totalAmountRestriction'; + +export class TransactionRuleRestrictions { + 'activeNetworkTokens'?: ActiveNetworkTokensRestriction; + 'brandVariants'?: BrandVariantsRestriction; + 'countries'?: CountriesRestriction; + 'differentCurrencies'?: DifferentCurrenciesRestriction; + 'entryModes'?: EntryModesRestriction; + 'internationalTransaction'?: InternationalTransactionRestriction; + 'matchingTransactions'?: MatchingTransactionsRestriction; + 'mccs'?: MccsRestriction; + 'merchants'?: MerchantsRestriction; + 'processingTypes'?: ProcessingTypesRestriction; + 'timeOfDay'?: TimeOfDayRestriction; + 'totalAmount'?: TotalAmountRestriction; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "activeNetworkTokens", + "baseName": "activeNetworkTokens", + "type": "ActiveNetworkTokensRestriction" + }, + { + "name": "brandVariants", + "baseName": "brandVariants", + "type": "BrandVariantsRestriction" + }, + { + "name": "countries", + "baseName": "countries", + "type": "CountriesRestriction" + }, + { + "name": "differentCurrencies", + "baseName": "differentCurrencies", + "type": "DifferentCurrenciesRestriction" + }, + { + "name": "entryModes", + "baseName": "entryModes", + "type": "EntryModesRestriction" + }, + { + "name": "internationalTransaction", + "baseName": "internationalTransaction", + "type": "InternationalTransactionRestriction" + }, + { + "name": "matchingTransactions", + "baseName": "matchingTransactions", + "type": "MatchingTransactionsRestriction" + }, + { + "name": "mccs", + "baseName": "mccs", + "type": "MccsRestriction" + }, + { + "name": "merchants", + "baseName": "merchants", + "type": "MerchantsRestriction" + }, + { + "name": "processingTypes", + "baseName": "processingTypes", + "type": "ProcessingTypesRestriction" + }, + { + "name": "timeOfDay", + "baseName": "timeOfDay", + "type": "TimeOfDayRestriction" + }, + { + "name": "totalAmount", + "baseName": "totalAmount", + "type": "TotalAmountRestriction" + } ]; + + static getAttributeTypeMap() { + return TransactionRuleRestrictions.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/transactionRulesResponse.ts b/src/typings/balancePlatform/transactionRulesResponse.ts new file mode 100644 index 000000000..236cd1e02 --- /dev/null +++ b/src/typings/balancePlatform/transactionRulesResponse.ts @@ -0,0 +1,31 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { TransactionRule } from './transactionRule'; + +export class TransactionRulesResponse { + /** + * List of transaction rules. + */ + 'transactionRules'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "transactionRules", + "baseName": "transactionRules", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return TransactionRulesResponse.attributeTypeMap; + } +} + diff --git a/src/typings/balancePlatform/verificationError.ts b/src/typings/balancePlatform/verificationError.ts new file mode 100644 index 000000000..bd3ccfac6 --- /dev/null +++ b/src/typings/balancePlatform/verificationError.ts @@ -0,0 +1,75 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { RemediatingAction } from './remediatingAction'; +import { VerificationErrorRecursive } from './verificationErrorRecursive'; + +export class VerificationError { + /** + * The verification error code. + */ + 'code'?: string; + /** + * A description of the error. + */ + 'message'?: string; + /** + * Contains the actions that you can take to resolve the verification error. + */ + 'remediatingActions'?: Array; + /** + * Contains more granular information about the verification error. + */ + 'subErrors'?: Array; + /** + * The type of error. Possible values: **invalidInput**, **dataMissing**. + */ + 'type'?: VerificationError.TypeEnum; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string" + }, + { + "name": "message", + "baseName": "message", + "type": "string" + }, + { + "name": "remediatingActions", + "baseName": "remediatingActions", + "type": "Array" + }, + { + "name": "subErrors", + "baseName": "subErrors", + "type": "Array" + }, + { + "name": "type", + "baseName": "type", + "type": "VerificationError.TypeEnum" + } ]; + + static getAttributeTypeMap() { + return VerificationError.attributeTypeMap; + } +} + +export namespace VerificationError { + export enum TypeEnum { + DataMissing = 'dataMissing', + InvalidInput = 'invalidInput', + PendingStatus = 'pendingStatus' + } +} diff --git a/src/typings/balancePlatform/verificationErrorRecursive.ts b/src/typings/balancePlatform/verificationErrorRecursive.ts new file mode 100644 index 000000000..d047d6fa1 --- /dev/null +++ b/src/typings/balancePlatform/verificationErrorRecursive.ts @@ -0,0 +1,65 @@ +/* + * The version of the OpenAPI document: v2 + * Contact: developer-experience@adyen.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit this class manually. + */ + +import { RemediatingAction } from './remediatingAction'; + +export class VerificationErrorRecursive { + /** + * The verification error code. + */ + 'code'?: string; + /** + * A description of the error. + */ + 'message'?: string; + /** + * The type of error. Possible values: **invalidInput**, **dataMissing**. + */ + 'type'?: VerificationErrorRecursive.TypeEnum; + /** + * Contains the actions that you can take to resolve the verification error. + */ + 'remediatingActions'?: Array; + + static discriminator: string | undefined = undefined; + + static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [ + { + "name": "code", + "baseName": "code", + "type": "string" + }, + { + "name": "message", + "baseName": "message", + "type": "string" + }, + { + "name": "type", + "baseName": "type", + "type": "VerificationErrorRecursive.TypeEnum" + }, + { + "name": "remediatingActions", + "baseName": "remediatingActions", + "type": "Array" + } ]; + + static getAttributeTypeMap() { + return VerificationErrorRecursive.attributeTypeMap; + } +} + +export namespace VerificationErrorRecursive { + export enum TypeEnum { + DataMissing = 'dataMissing', + InvalidInput = 'invalidInput', + PendingStatus = 'pendingStatus' + } +} diff --git a/src/typings/requestOptions.ts b/src/typings/requestOptions.ts index 69b2550bf..9a54fd152 100644 --- a/src/typings/requestOptions.ts +++ b/src/typings/requestOptions.ts @@ -22,10 +22,13 @@ /// import * as https from "https"; +import { URLSearchParams } from "url"; export namespace IRequest { + type QueryString = URLSearchParams | string | NodeJS.Dict | Iterable<[string, string]> | Array<[string, string]>; export type Options = https.RequestOptions & { idempotencyKey?: string; + params?: QueryString; }; }