Skip to content

Commit 52fc1af

Browse files
authored
Merge pull request #1492 from Adyen/generate-checkout
Generate Checkout models from OpenAPI spec
2 parents 493b7b7 + 5ccd4b7 commit 52fc1af

36 files changed

+682
-118
lines changed

src/typings/checkout/achDetails.ts

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

1010

1111
export class AchDetails {
12+
/**
13+
* The account holder type (personal or business).
14+
*/
15+
'accountHolderType'?: AchDetails.AccountHolderTypeEnum;
1216
/**
1317
* The bank account number (without separators).
1418
*/
@@ -60,6 +64,11 @@ export class AchDetails {
6064
static discriminator: string | undefined = undefined;
6165

6266
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
67+
{
68+
"name": "accountHolderType",
69+
"baseName": "accountHolderType",
70+
"type": "AchDetails.AccountHolderTypeEnum"
71+
},
6372
{
6473
"name": "bankAccountNumber",
6574
"baseName": "bankAccountNumber",
@@ -122,6 +131,10 @@ export class AchDetails {
122131
}
123132

124133
export namespace AchDetails {
134+
export enum AccountHolderTypeEnum {
135+
Business = 'business',
136+
Personal = 'personal'
137+
}
125138
export enum BankAccountTypeEnum {
126139
Balance = 'balance',
127140
Checking = 'checking',

src/typings/checkout/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/checkout/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)