Skip to content

Commit 01f0fc7

Browse files
authored
Merge branch 'main' into predefinedcontent-referenceid-helper
2 parents 6750cb5 + 60ceb8c commit 01f0fc7

File tree

101 files changed

+1908
-169
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+1908
-169
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ The library supports all webhooks under the following model directories:
5353
| [Management Webhooks](https://docs.adyen.com/api-explorer/ManagementNotification/3/overview) | Adyen uses webhooks to inform your system about events that happen with your Adyen company and merchant accounts, stores, payment terminals, and payment methods when using Management API. | [ManagementWebhooks](src/typings/managementWebhooks) | **v3** |
5454
| [Notification Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | We use webhooks to send you updates about payment status updates, newly available reports, and other events that you can subscribe to. For more information, refer to our documentation | [Notification](src/typings/notification) | **v1** |
5555
| [Transaction Webhooks](https://docs.adyen.com/api-explorer/transaction-webhooks/4/overview) | Adyen sends webhooks to inform your system about incoming and outgoing transfers in your platform. You can use these webhooks to build your implementation. For example, you can use this information to update balances in your own dashboards or to keep track of incoming funds. | [TransactionWebhooks](src/typings/transactionWebhooks) | **v4** |
56+
| [Tokenization Webhooks](https://docs.adyen.com/api-explorer/Tokenization-webhooks/1/overview) | Adyen sends webhooks to inform you about the creation and changes to the recurring tokens. | [tokenizationwebhooks](src/main/java/com/adyen/model/tokenizationwebhooks) | **v1** |
5657

5758
For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/).
5859

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
28.0.0
1+
28.1.0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@adyen/api-library",
3-
"version": "28.0.0",
3+
"version": "28.1.0",
44
"description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs.",
55
"main": "lib/src/index.js",
66
"types": "lib/src/index.d.ts",
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
import { TokenizationAlreadyExistingDetailsNotificationRequest } from "../../typings/tokenizationWebhooks/tokenizationAlreadyExistingDetailsNotificationRequest";
2+
import { TokenizationCreatedDetailsNotificationRequest } from "../../typings/tokenizationWebhooks/tokenizationCreatedDetailsNotificationRequest";
3+
import { TokenizationDisabledDetailsNotificationRequest } from "../../typings/tokenizationWebhooks/tokenizationDisabledDetailsNotificationRequest";
4+
import { TokenizationUpdatedDetailsNotificationRequest } from "../../typings/tokenizationWebhooks/tokenizationUpdatedDetailsNotificationRequest";
5+
import { TokenizationWebhooksHandler } from "../../typings/tokenizationWebhooks/tokenizationWebhooksHandler";
6+
7+
describe("TokenizationWebhooksHandler", () => {
8+
it("should deserialize TokenizationAlreadyExistingDetailsNotificationRequest", () => {
9+
const json = {
10+
"createdAt": "2025-06-30T16:40:23+02:00",
11+
"eventId": "QBQQ9DLNRHHKGK38",
12+
"environment": "test",
13+
"data": {
14+
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
15+
"storedPaymentMethodId": "M5N7TQ4TG5PFWR50",
16+
"type": "visastandarddebit",
17+
"operation": "alreadyExisting",
18+
"shopperReference": "YOUR_SHOPPER_REFERENCE"
19+
},
20+
"type": "recurring.token.alreadyExisting"
21+
};
22+
const handler = new TokenizationWebhooksHandler(JSON.stringify(json));
23+
const request = handler.getTokenizationAlreadyExistingDetailsNotificationRequest();
24+
expect(request).toBeTruthy();
25+
expect(request.type).toBe(TokenizationAlreadyExistingDetailsNotificationRequest.TypeEnum.RecurringTokenAlreadyExisting);
26+
expect(request.data.type).toBe("visastandarddebit");
27+
// test GenericWebhook
28+
const genericWebhook = handler.getGenericWebhook();
29+
expect(genericWebhook).toBeInstanceOf(TokenizationAlreadyExistingDetailsNotificationRequest);
30+
expect(genericWebhook.type).toBe("recurring.token.alreadyExisting");
31+
});
32+
33+
it("should deserialize TokenizationCreatedDetailsNotificationRequest", () => {
34+
const json = {
35+
"createdAt": "2025-06-30T16:40:23+02:00",
36+
"eventId": "QBQQ9DLNRHHKGK38",
37+
"environment": "test",
38+
"data": {
39+
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
40+
"storedPaymentMethodId": "M5N7TQ4TG5PFWR50",
41+
"type": "visastandarddebit",
42+
"operation": "created",
43+
"shopperReference": "YOUR_SHOPPER_REFERENCE"
44+
},
45+
"type": "recurring.token.created"
46+
};
47+
const handler = new TokenizationWebhooksHandler(JSON.stringify(json));
48+
const request = handler.getTokenizationCreatedDetailsNotificationRequest();
49+
expect(request).toBeTruthy();
50+
expect(request.type).toBe(TokenizationCreatedDetailsNotificationRequest.TypeEnum.RecurringTokenCreated);
51+
expect(request.data.type).toBe("visastandarddebit");
52+
// test GenericWebhook
53+
const genericWebhook = handler.getGenericWebhook();
54+
expect(genericWebhook).toBeInstanceOf(TokenizationCreatedDetailsNotificationRequest);
55+
expect(genericWebhook.type).toBe("recurring.token.created");
56+
});
57+
58+
it("should deserialize TokenizationUpdatedDetailsNotificationRequest", () => {
59+
const json = {
60+
"createdAt": "2025-06-30T16:40:23+02:00",
61+
"eventId": "QBQQ9DLNRHHKGK38",
62+
"environment": "test",
63+
"data": {
64+
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
65+
"storedPaymentMethodId": "M5N7TQ4TG5PFWR50",
66+
"type": "visastandarddebit",
67+
"operation": "updated",
68+
"shopperReference": "YOUR_SHOPPER_REFERENCE"
69+
},
70+
"type": "recurring.token.updated"
71+
};
72+
const handler = new TokenizationWebhooksHandler(JSON.stringify(json));
73+
const request = handler.getTokenizationUpdatedDetailsNotificationRequest();
74+
expect(request).toBeTruthy();
75+
expect(request.type).toBe(TokenizationUpdatedDetailsNotificationRequest.TypeEnum.RecurringTokenUpdated);
76+
expect(request.data.type).toBe("visastandarddebit");
77+
// test GenericWebhook
78+
const genericWebhook = handler.getGenericWebhook();
79+
expect(genericWebhook).toBeInstanceOf(TokenizationUpdatedDetailsNotificationRequest);
80+
expect(genericWebhook.type).toBe("recurring.token.updated");
81+
});
82+
83+
it("should deserialize TokenizationDisabledDetailsNotificationRequest", () => {
84+
const json = {
85+
"createdAt": "2025-06-30T16:40:23+02:00",
86+
"eventId": "QBQQ9DLNRHHKGK38",
87+
"environment": "test",
88+
"data": {
89+
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
90+
"storedPaymentMethodId": "M5N7TQ4TG5PFWR50",
91+
"type": "visastandarddebit",
92+
"shopperReference": "YOUR_SHOPPER_REFERENCE"
93+
},
94+
"type": "recurring.token.disabled"
95+
};
96+
const handler = new TokenizationWebhooksHandler(JSON.stringify(json));
97+
const request = handler.getTokenizationDisabledDetailsNotificationRequest();
98+
expect(request).toBeTruthy();
99+
expect(request.type).toBe(TokenizationDisabledDetailsNotificationRequest.TypeEnum.RecurringTokenDisabled);
100+
expect(request.data.type).toBe("visastandarddebit");
101+
// test GenericWebhook
102+
const genericWebhook = handler.getGenericWebhook();
103+
expect(genericWebhook).toBeInstanceOf(TokenizationDisabledDetailsNotificationRequest);
104+
expect(genericWebhook.type).toBe("recurring.token.disabled");
105+
});
106+
107+
it("should throw error for unknown type", () => {
108+
const json = {
109+
type: "unknown.type",
110+
data: {}
111+
};
112+
const handler = new TokenizationWebhooksHandler(JSON.stringify(json));
113+
expect(() => handler.getGenericWebhook()).toThrow("Could not parse the json payload");
114+
});
115+
116+
it("should throw SyntaxError for invalid JSON", () => {
117+
expect(() => new TokenizationWebhooksHandler("{ invalid json }")).toThrow(SyntaxError);
118+
});
119+
});

src/services/balancePlatform/paymentInstrumentsApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ export class PaymentInstrumentsApi extends Service {
4141
}
4242

4343
/**
44-
* @summary Create network token activation data
44+
* @summary Create network token provisioning data
4545
* @param id {@link string } The unique identifier of the payment instrument.
4646
* @param networkTokenActivationDataRequest {@link NetworkTokenActivationDataRequest }
4747
* @param requestOptions {@link IRequest.Options }
4848
* @return {@link NetworkTokenActivationDataResponse }
4949
*/
50-
public async createNetworkTokenActivationData(id: string, networkTokenActivationDataRequest: NetworkTokenActivationDataRequest, requestOptions?: IRequest.Options): Promise<NetworkTokenActivationDataResponse> {
50+
public async createNetworkTokenProvisioningData(id: string, networkTokenActivationDataRequest: NetworkTokenActivationDataRequest, requestOptions?: IRequest.Options): Promise<NetworkTokenActivationDataResponse> {
5151
const endpoint = `${this.baseUrl}/paymentInstruments/{id}/networkTokenActivationData`
5252
.replace("{" + "id" + "}", encodeURIComponent(String(id)));
5353
const resource = new Resource(this, endpoint);

src/services/transfers/transactionsApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class TransactionsApi extends Service {
4141
* @param accountHolderId {@link string } The unique identifier of the [account holder](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/accountHolders/{id}__queryParam_id). Required if you don\&#39;t provide a &#x60;balanceAccountId&#x60; or &#x60;balancePlatform&#x60;. If you provide a &#x60;balanceAccountId&#x60;, the &#x60;accountHolderId&#x60; must be related to the &#x60;balanceAccountId&#x60;.
4242
* @param balanceAccountId {@link string } The unique identifier of the [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/get/balanceAccounts/{id}__queryParam_id). Required if you don\&#39;t provide an &#x60;accountHolderId&#x60; or &#x60;balancePlatform&#x60;. If you provide an &#x60;accountHolderId&#x60;, the &#x60;balanceAccountId&#x60; must be related to the &#x60;accountHolderId&#x60;.
4343
* @param cursor {@link string } The &#x60;cursor&#x60; returned in the links of the previous response.
44-
* @param sortOrder {@link &#39;asc&#39; | &#39;desc&#39; } The transactions sorting order. Possible values: - **asc**: Ascending order, from older to most recent. - **desc**: Descending order, from most recent to older.
44+
* @param sortOrder {@link &#39;asc&#39; | &#39;desc&#39; } Determines the sort order of the returned transactions. The sort order is based on the creation date of the transaction. Possible values: - **asc**: Ascending order, from oldest to most recent. - **desc**: Descending order, from most recent to oldest. Default value: **asc**.
4545
* @param limit {@link number } The number of items returned per page, maximum of 100 items. By default, the response returns 10 items per page.
4646
* @return {@link TransactionSearchResponse }
4747
*/

src/services/transfers/transfersApi.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export class TransfersApi extends Service {
8484
* @param paymentInstrumentId {@link string } The unique identifier of the [payment instrument](https://docs.adyen.com/api-explorer/balanceplatform/latest/get/paymentInstruments/_id_). To use this parameter, you must also provide a &#x60;balanceAccountId&#x60;, &#x60;accountHolderId&#x60;, or &#x60;balancePlatform&#x60;. The &#x60;paymentInstrumentId&#x60; must be related to the &#x60;balanceAccountId&#x60; or &#x60;accountHolderId&#x60; that you provide.
8585
* @param reference {@link string } The reference you provided in the POST [/transfers](https://docs.adyen.com/api-explorer/transfers/latest/post/transfers) request
8686
* @param category {@link &#39;bank&#39; | &#39;card&#39; | &#39;grants&#39; | &#39;interest&#39; | &#39;internal&#39; | &#39;issuedCard&#39; | &#39;migration&#39; | &#39;platformPayment&#39; | &#39;topUp&#39; | &#39;upgrade&#39; } The type of transfer. Possible values: - **bank**: Transfer to a [transfer instrument](https://docs.adyen.com/api-explorer/#/legalentity/latest/post/transferInstruments__resParam_id) or a bank account. - **internal**: Transfer to another [balance account](https://docs.adyen.com/api-explorer/#/balanceplatform/latest/post/balanceAccounts__resParam_id) within your platform. - **issuedCard**: Transfer initiated by a Adyen-issued card. - **platformPayment**: Fund movements related to payments that are acquired for your users.
87-
* @param sortOrder {@link &#39;asc&#39; | &#39;desc&#39; } The transfers sorting order. Possible values: - **asc**: Ascending order, from older to most recent. - **desc**: Descending order, from most recent to older.
87+
* @param sortOrder {@link &#39;asc&#39; | &#39;desc&#39; } Determines the sort order of the returned transfers. The sort order is based on the creation date of the transfers. Possible values: - **asc**: Ascending order, from oldest to most recent. - **desc**: Descending order, from most recent to oldest. Default value: **asc**.
8888
* @param cursor {@link string } The &#x60;cursor&#x60; returned in the links of the previous response.
8989
* @param limit {@link number } The number of items returned per page, maximum of 100 items. By default, the response returns 10 items per page.
9090
* @return {@link FindTransfersResponse }

src/typings/acsWebhooks/balancePlatformNotificationResponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
export class BalancePlatformNotificationResponse {
1212
/**
13-
* Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks#accept-notifications).
13+
* Respond with any **2xx** HTTP status code to [accept the webhook](https://docs.adyen.com/development-resources/webhooks/#accept-webhooks).
1414
*/
1515
"notificationResponse"?: string;
1616

src/typings/acsWebhooks/resource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class Resource {
1414
*/
1515
"balancePlatform"?: string;
1616
/**
17-
* The date and time when the event was triggered, in ISO 8601 extended format. For example, **2020-12-18T10:15:30+01:00**.
17+
* The date and time when the event was triggered, in ISO 8601 extended format. For example, **2025-03-19T10:15:30+01:00**.
1818
*/
1919
"creationDate"?: Date;
2020
/**
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* The version of the OpenAPI document: v2
3+
*
4+
*
5+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
6+
* https://openapi-generator.tech
7+
* Do not edit this class manually.
8+
*/
9+
10+
11+
export class AdditionalBankIdentificationRequirement {
12+
/**
13+
* The type of additional bank identification, depending on the country. Possible values: * **auBsbCode**: The 6-digit [Australian Bank State Branch (BSB) code](https://en.wikipedia.org/wiki/Bank_state_branch), without separators or spaces. * **caRoutingNumber**: The 9-digit [Canadian routing number](https://en.wikipedia.org/wiki/Routing_number_(Canada)), in EFT format, without separators or spaces. * **gbSortCode**: The 6-digit [UK sort code](https://en.wikipedia.org/wiki/Sort_code), without separators or spaces * **usRoutingNumber**: The 9-digit [routing number](https://en.wikipedia.org/wiki/ABA_routing_transit_number), without separators or spaces.
14+
*/
15+
"additionalBankIdentificationType"?: AdditionalBankIdentificationRequirement.AdditionalBankIdentificationTypeEnum;
16+
/**
17+
* The description of the additional bank identification requirement.
18+
*/
19+
"description"?: string;
20+
/**
21+
* **additionalBankIdentificationRequirement**
22+
*/
23+
"type": AdditionalBankIdentificationRequirement.TypeEnum;
24+
25+
static readonly discriminator: string | undefined = undefined;
26+
27+
static readonly mapping: {[index: string]: string} | undefined = undefined;
28+
29+
static readonly attributeTypeMap: Array<{name: string, baseName: string, type: string, format: string}> = [
30+
{
31+
"name": "additionalBankIdentificationType",
32+
"baseName": "additionalBankIdentificationType",
33+
"type": "AdditionalBankIdentificationRequirement.AdditionalBankIdentificationTypeEnum",
34+
"format": ""
35+
},
36+
{
37+
"name": "description",
38+
"baseName": "description",
39+
"type": "string",
40+
"format": ""
41+
},
42+
{
43+
"name": "type",
44+
"baseName": "type",
45+
"type": "AdditionalBankIdentificationRequirement.TypeEnum",
46+
"format": ""
47+
} ];
48+
49+
static getAttributeTypeMap() {
50+
return AdditionalBankIdentificationRequirement.attributeTypeMap;
51+
}
52+
53+
public constructor() {
54+
}
55+
}
56+
57+
export namespace AdditionalBankIdentificationRequirement {
58+
export enum AdditionalBankIdentificationTypeEnum {
59+
AuBsbCode = 'auBsbCode',
60+
CaRoutingNumber = 'caRoutingNumber',
61+
GbSortCode = 'gbSortCode',
62+
UsRoutingNumber = 'usRoutingNumber'
63+
}
64+
export enum TypeEnum {
65+
AdditionalBankIdentificationRequirement = 'additionalBankIdentificationRequirement'
66+
}
67+
}

0 commit comments

Comments
 (0)