Skip to content

Commit 1da963f

Browse files
authored
Merge pull request #1493 from Adyen/generate-models
Generate Payout/BalanceControl/LEM/Transfers API from OpenAPI specs
2 parents 52fc1af + 4a53256 commit 1da963f

29 files changed

+315
-59
lines changed

src/__tests__/transfers.spec.ts

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,31 @@ describe("Transfers", (): void => {
5555
});
5656

5757
test("should list transactions", async (): Promise<void> => {
58-
scope.get("/transactions?balancePlatform=platform&createdSince=2023-12-12T00%3A00%3A00.000Z&createdUntil=2023-12-13T00%3A00%3A00.000Z")
59-
.reply(200, listTransactionsSuccess);
60-
const response: transfers.TransactionSearchResponse = await transfersAPI.TransactionsApi.getAllTransactions("platform", undefined, undefined, undefined, undefined, new Date("12-12-2023"), new Date("12-13-2023"));
58+
const createdSince = new Date(Date.UTC(2023, 11, 12, 0, 0, 0)); // 12-12-2023 December is month 11
59+
const createdUntil = new Date(Date.UTC(2023, 11, 13, 0, 0, 0)); // 13-12-2023 December is month 11
60+
61+
scope
62+
.get("/transactions")
63+
.query({
64+
balancePlatform: "platform",
65+
createdSince: createdSince.toISOString(),
66+
createdUntil: createdUntil.toISOString(),
67+
})
68+
.reply(200, listTransactionsSuccess);
69+
70+
const response: transfers.TransactionSearchResponse = await transfersAPI.TransactionsApi.getAllTransactions(
71+
"platform",
72+
undefined,
73+
undefined,
74+
undefined,
75+
undefined,
76+
createdSince,
77+
createdUntil
78+
);
79+
6180
expect(response.data?.length).toEqual(3);
62-
if(response.data && response.data?.length > 0) {
63-
expect(response?.data[0]?.id).toEqual("1VVF0D5U66PIUIVP");
81+
if (response.data && response.data.length > 0) {
82+
expect(response.data[0].id).toEqual("1VVF0D5U66PIUIVP");
6483
} else {
6584
fail();
6685
}

src/typings/balanceControl/amount.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
export class Amount {
1212
/**
13-
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
13+
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
1414
*/
1515
'currency': string;
1616
/**
17-
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).
17+
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
1818
*/
1919
'value': number;
2020

src/typings/legalEntityManagement/onboardingLinkSettings.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export class OnboardingLinkSettings {
1818
*/
1919
'allowBankAccountFormatSelection'?: boolean;
2020
/**
21+
* Default value: **true** Indicates whether the debug user interface (UI) is enabled. The debug UI provides information for your support staff to diagnose and resolve user issues during onboarding. It can be accessed using a keyboard shortcut.
22+
*/
23+
'allowDebugUi'?: boolean;
24+
/**
2125
* Default value: **false** Indicates if the user can select a payout account in a different EU/EEA location (including Switzerland and the UK) than the location of their legal entity.
2226
*/
2327
'allowIntraRegionCrossBorderPayout'?: boolean;
@@ -87,6 +91,11 @@ export class OnboardingLinkSettings {
8791
"baseName": "allowBankAccountFormatSelection",
8892
"type": "boolean"
8993
},
94+
{
95+
"name": "allowDebugUi",
96+
"baseName": "allowDebugUi",
97+
"type": "boolean"
98+
},
9099
{
91100
"name": "allowIntraRegionCrossBorderPayout",
92101
"baseName": "allowIntraRegionCrossBorderPayout",

src/typings/legalEntityManagement/termsOfServiceAcceptanceInfo.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export class TermsOfServiceAcceptanceInfo {
1818
*/
1919
'acceptedFor'?: string;
2020
/**
21-
* The date when the Terms of Service were accepted.
21+
* The date when the Terms of Service were accepted, in ISO 8601 extended format. For example, 2022-12-18T10:15:30+01:00.
2222
*/
2323
'createdAt'?: Date;
2424
/**
@@ -29,6 +29,10 @@ export class TermsOfServiceAcceptanceInfo {
2929
* The type of Terms of Service. Possible values: * **adyenForPlatformsManage** * **adyenIssuing** * **adyenForPlatformsAdvanced** * **adyenCapital** * **adyenAccount** * **adyenCard** * **adyenFranchisee** * **adyenPccr** * **adyenChargeCard**
3030
*/
3131
'type'?: TermsOfServiceAcceptanceInfo.TypeEnum;
32+
/**
33+
* The expiration date for the Terms of Service acceptance, in ISO 8601 extended format. For example, 2022-12-18T00:00:00+01:00.
34+
*/
35+
'validTo'?: Date;
3236

3337
static discriminator: string | undefined = undefined;
3438

@@ -57,6 +61,11 @@ export class TermsOfServiceAcceptanceInfo {
5761
"name": "type",
5862
"baseName": "type",
5963
"type": "TermsOfServiceAcceptanceInfo.TypeEnum"
64+
},
65+
{
66+
"name": "validTo",
67+
"baseName": "validTo",
68+
"type": "Date"
6069
} ];
6170

6271
static getAttributeTypeMap() {

src/typings/payment/additionalDataAirline.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ export class AdditionalDataAirline {
1818
*/
1919
'airline_agency_plan_name'?: string;
2020
/**
21-
* The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros.
21+
* The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-digit accounting code (PAX) that identifies the carrier. * Format: IATA 3-digit accounting code (PAX) * Example: KLM = 074 * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros.
2222
*/
2323
'airline_airline_code'?: string;
2424
/**
25-
* The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces *Must not be all zeros.
25+
* The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. * Encoding: ASCII * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros.
2626
*/
2727
'airline_airline_designator_code'?: string;
2828
/**
@@ -50,35 +50,35 @@ export class AdditionalDataAirline {
5050
*/
5151
'airline_issue_date'?: string;
5252
/**
53-
* The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces *Must not be all zeros.
53+
* The [IATA](https://www.iata.org/services/pages/codes.aspx) 2-letter accounting code (PAX) that identifies the carrier. This field is required if the airline data includes leg details. * Example: KLM = KL * minLength: 2 characters * maxLength: 2 characters * Must not be all spaces * Must not be all zeros.
5454
*/
5555
'airline_leg_carrier_code'?: string;
5656
/**
57-
* A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces *Must not be all zeros.
57+
* A one-letter travel class identifier. The following are common: * F: first class * J: business class * Y: economy class * W: premium economy * Encoding: ASCII * minLength: 1 character * maxLength: 1 character * Must not be all spaces * Must not be all zeros.
5858
*/
5959
'airline_leg_class_of_travel'?: string;
6060
/**
6161
* Date and time of travel in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format `yyyy-MM-dd HH:mm`. * Encoding: ASCII * minLength: 16 characters * maxLength: 16 characters
6262
*/
6363
'airline_leg_date_of_travel'?: string;
6464
/**
65-
* The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros.
65+
* The [IATA](https://www.iata.org/services/pages/codes.aspx) three-letter airport code of the departure airport. This field is required if the airline data includes leg details. * Encoding: ASCII * Example: Amsterdam = AMS * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros.
6666
*/
6767
'airline_leg_depart_airport'?: string;
6868
/**
69-
* The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 *Must not be all zeros.
69+
* The amount of [departure tax](https://en.wikipedia.org/wiki/Departure_tax) charged, in [minor units](https://docs.adyen.com/development-resources/currency-codes). * Encoding: Numeric * minLength: 1 * maxLength: 12 * Must not be all zeros.
7070
*/
7171
'airline_leg_depart_tax'?: string;
7272
/**
73-
* The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces *Must not be all zeros.
73+
* The [IATA](https://www.iata.org/services/pages/codes.aspx) 3-letter airport code of the destination airport. This field is required if the airline data includes leg details. * Example: Amsterdam = AMS * Encoding: ASCII * minLength: 3 characters * maxLength: 3 characters * Must not be all spaces * Must not be all zeros.
7474
*/
7575
'airline_leg_destination_code'?: string;
7676
/**
77-
* The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces *Must not be all zeros.
77+
* The [fare basis code](https://en.wikipedia.org/wiki/Fare_basis_code), alphanumeric. * minLength: 1 character * maxLength: 6 characters * Must not be all spaces * Must not be all zeros.
7878
*/
7979
'airline_leg_fare_base_code'?: string;
8080
/**
81-
* The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces *Must not be all zeros.
81+
* The flight identifier. * minLength: 1 character * maxLength: 5 characters * Must not be all spaces * Must not be all zeros.
8282
*/
8383
'airline_leg_flight_number'?: string;
8484
/**
@@ -106,23 +106,23 @@ export class AdditionalDataAirline {
106106
*/
107107
'airline_passenger_traveller_type'?: string;
108108
/**
109-
* The passenger\'s name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces *Must not be all zeros.
109+
* The passenger\'s name, initials, and title. * Format: last name + first name or initials + title * Example: *FLYER / MARY MS* * minLength: 1 character * maxLength: 20 characters * If you send more than 20 characters, the name is truncated * Must not be all spaces * Must not be all zeros.
110110
*/
111111
'airline_passenger_name': string;
112112
/**
113113
* The address of the organization that issued the ticket. * minLength: 0 characters * maxLength: 16 characters
114114
*/
115115
'airline_ticket_issue_address'?: string;
116116
/**
117-
* The ticket\'s unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces *Must not be all zeros.
117+
* The ticket\'s unique identifier. * minLength: 1 character * maxLength: 15 characters * Must not be all spaces * Must not be all zeros.
118118
*/
119119
'airline_ticket_number'?: string;
120120
/**
121-
* The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces *Must not be all zeros.
121+
* The unique identifier from IATA or ARC for the travel agency that issues the ticket. * Encoding: ASCII * minLength: 1 character * maxLength: 8 characters * Must not be all spaces * Must not be all zeros.
122122
*/
123123
'airline_travel_agency_code'?: string;
124124
/**
125-
* The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces *Must not be all zeros.
125+
* The name of the travel agency. * Encoding: ASCII * minLength: 1 character * maxLength: 25 characters * Must not be all spaces * Must not be all zeros.
126126
*/
127127
'airline_travel_agency_name'?: string;
128128

src/typings/payment/additionalDataCommon.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010

1111
export class AdditionalDataCommon {
12+
/**
13+
* Triggers test scenarios that allow to replicate certain acquirer response codes. See [Testing result codes and refusal reasons](https://docs.adyen.com/development-resources/testing/result-codes/) to learn about the possible values, and the `refusalReason` values you can trigger.
14+
*/
15+
'RequestedTestAcquirerResponseCode'?: string;
1216
/**
1317
* Triggers test scenarios that allow to replicate certain communication errors. Allowed values: * **NO_CONNECTION_AVAILABLE** – There wasn\'t a connection available to service the outgoing communication. This is a transient, retriable error since no messaging could be initiated to an issuing system (or third-party acquiring system). Therefore, the header Transient-Error: true is returned in the response. A subsequent request using the same idempotency key will be processed as if it was the first request. * **IOEXCEPTION_RECEIVED** – Something went wrong during transmission of the message or receiving the response. This is a classified as non-transient because the message could have been received by the issuing party and been acted upon. No transient error header is returned. If using idempotency, the (error) response is stored as the final result for the idempotency key. Subsequent messages with the same idempotency key not be processed beyond returning the stored response.
1418
*/
@@ -58,6 +62,10 @@ export class AdditionalDataCommon {
5862
*/
5963
'subMerchantCountry'?: string;
6064
/**
65+
* This field is required for transactions performed by registered payment facilitators. This field contains the email address of the sub-merchant. * Format: Alphanumeric * Maximum length: 40 characters
66+
*/
67+
'subMerchantEmail'?: string;
68+
/**
6169
* This field contains an identifier of the actual merchant when a transaction is submitted via a payment facilitator. The payment facilitator must send in this unique ID. A unique identifier per submerchant that is required if the transaction is performed by a registered payment facilitator. * Format: alpha-numeric. * Fixed length: 15 characters.
6270
*/
6371
'subMerchantID'?: string;
@@ -66,6 +74,10 @@ export class AdditionalDataCommon {
6674
*/
6775
'subMerchantName'?: string;
6876
/**
77+
* This field is required for transactions performed by registered payment facilitators. This field contains the phone number of the sub-merchant.* Format: Alphanumeric * Maximum length: 20 characters
78+
*/
79+
'subMerchantPhoneNumber'?: string;
80+
/**
6981
* This field is required if the transaction is performed by a registered payment facilitator. This field must contain the postal code of the actual merchant\'s address. * Format: alpha-numeric. * Maximum length: 10 characters.
7082
*/
7183
'subMerchantPostalCode'?: string;
@@ -85,6 +97,11 @@ export class AdditionalDataCommon {
8597
static discriminator: string | undefined = undefined;
8698

8799
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
100+
{
101+
"name": "RequestedTestAcquirerResponseCode",
102+
"baseName": "RequestedTestAcquirerResponseCode",
103+
"type": "string"
104+
},
88105
{
89106
"name": "RequestedTestErrorResponseCode",
90107
"baseName": "RequestedTestErrorResponseCode",
@@ -145,6 +162,11 @@ export class AdditionalDataCommon {
145162
"baseName": "subMerchantCountry",
146163
"type": "string"
147164
},
165+
{
166+
"name": "subMerchantEmail",
167+
"baseName": "subMerchantEmail",
168+
"type": "string"
169+
},
148170
{
149171
"name": "subMerchantID",
150172
"baseName": "subMerchantID",
@@ -155,6 +177,11 @@ export class AdditionalDataCommon {
155177
"baseName": "subMerchantName",
156178
"type": "string"
157179
},
180+
{
181+
"name": "subMerchantPhoneNumber",
182+
"baseName": "subMerchantPhoneNumber",
183+
"type": "string"
184+
},
158185
{
159186
"name": "subMerchantPostalCode",
160187
"baseName": "subMerchantPostalCode",

0 commit comments

Comments
 (0)