Skip to content

Commit d043dfd

Browse files
Merge pull request #1269 from Adyen/automation/release
Release v15.0.0
2 parents ddbb4b4 + dbf4201 commit d043dfd

File tree

210 files changed

+948
-691
lines changed

Some content is hidden

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

210 files changed

+948
-691
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ openapi-generator-url:=https://repo1.maven.org/maven2/org/openapitools/openapi-g
44
openapi-generator-jar:=build/openapi-generator-cli.jar
55
openapi-generator-cli:=java -jar $(openapi-generator-jar)
66

7-
services:=acsWebhooks balanceControl balancePlatform binLookup checkout configurationWebhooks dataProtection disputes legalEntityManagement management managementWebhooks payment payout recurring reportWebhooks storedValue terminalManagement transfers transferWebhooks
7+
services:=acsWebhooks balanceControl balancePlatform binLookup checkout configurationWebhooks dataProtection disputes legalEntityManagement management managementWebhooks payment payout recurring reportWebhooks storedValue terminalManagement transfers transferWebhooks transactionWebhooks
88

99
# Generate models (for each service)
1010
models: $(services)
1111

1212
balanceControl: spec=BalanceControlService-v1
1313
balancePlatform: spec=BalancePlatformService-v2
1414
binLookup: spec=BinLookupService-v54
15-
checkout: spec=CheckoutService-v70
15+
checkout: spec=CheckoutService-v71
1616
dataProtection: spec=DataProtectionService-v1
1717
disputes: spec=DisputeService-v30
1818
storedValue: spec=StoredValueService-v46
@@ -32,6 +32,7 @@ acsWebhooks: spec=BalancePlatformAcsNotification-v1
3232
configurationWebhooks: spec=BalancePlatformConfigurationNotification-v1
3333
reportWebhooks: spec=BalancePlatformReportNotification-v1
3434
transferWebhooks: spec=BalancePlatformTransferNotification-v4
35+
transactionWebhooks: spec=BalancePlatformTransactionNotification-v4
3536
# ManagementWebhooks
3637
managementWebhooks: spec=ManagementNotificationService-v3
3738

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This library supports the following:
1818
| API name | API version | Description | API object |
1919
|------------------------------------------------------------------------------------------------------------|:-----------:|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
2020
| [BIN Lookup API](https://docs.adyen.com/api-explorer/BinLookup/54/overview) | v54 | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | [BinLookup](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/binLookupApi.ts) |
21-
| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/70/overview) | v70 | Our latest integration for accepting online payments. | [CheckoutAPI](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/checkout/index.ts) |
21+
| [Checkout API](https://docs.adyen.com/api-explorer/Checkout/71/overview) | v71 | Our latest integration for accepting online payments. | [CheckoutAPI](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/checkout/index.ts) |
2222
| [Configuration API](https://docs.adyen.com/api-explorer/balanceplatform/2/overview) | v2 | The Configuration API enables you to create a platform where you can onboard your users as account holders and create balance accounts, cards, and business accounts. | [BalancePlatform](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/balancePlatform/index.ts) |
2323
| [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | v1 | Adyen Data Protection API provides a way for you to process [Subject Erasure Requests](https://gdpr-info.eu/art-17-gdpr/) as mandated in GDPR. Use our API to submit a request to delete shopper's data, including payment details and other related information (for example, delivery address or shopper email) | [DataProtection](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/dataProtectionApi.ts) |
2424
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/legalentity/3/overview) | v3 | Manage legal entities that contain information required for verification. | [LegalEntityManagement](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/legalEntityManagement/index.ts) |
@@ -48,6 +48,7 @@ The library supports all webhooks under the following model directories:
4848
| [Report Webhooks](https://docs.adyen.com/api-explorer/report-webhooks/1/overview) | You can download reports programmatically by making an HTTP GET request, or manually from your Balance Platform Customer Area | [ReportNotification](src/typings/reportWebhooks) | **v1** |
4949
| [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** |
5050
| [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** |
51+
| [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** |
5152

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

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": "15.0.0-beta",
3+
"version": "15.0.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",

src/__tests__/checkout.spec.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function createUpdatePaymentLinkRequest(): checkout.UpdatePaymentLinkRequest {
7070
"status": checkout.UpdatePaymentLinkRequest.StatusEnum.Expired
7171
};
7272
}
73-
function getPaymentLinkSuccess(expiresAt: string): checkout.PaymentLinkResponse {
73+
function getPaymentLinkSuccess(expiresAt: Date): checkout.PaymentLinkResponse {
7474
return {
7575
amount: createAmountObject("USD", 1000),
7676
expiresAt,
@@ -130,7 +130,7 @@ beforeEach((): void => {
130130
nock.activate();
131131
}
132132
client = createClient();
133-
scope = nock("https://checkout-test.adyen.com/v70");
133+
scope = nock("https://checkout-test.adyen.com/v71");
134134
checkoutService = new CheckoutAPI(client);
135135
});
136136

@@ -152,8 +152,8 @@ describe("Checkout", (): void => {
152152
.matchHeader("Idempotency-Key", "testKey");
153153
await checkoutService.PaymentsApi.paymentMethods(paymentMethodsRequest, {idempotencyKey: "testKey"});
154154

155-
const expiresAt = "2019-12-17T10:05:29Z";
156-
const paymentLinkSuccess: checkout.PaymentLinkResponse = getPaymentLinkSuccess(expiresAt);
155+
const expiresAt = "2020-12-18T10:15:30+01:00";
156+
const paymentLinkSuccess: checkout.PaymentLinkResponse = getPaymentLinkSuccess(new Date(expiresAt));
157157
scope.post("/paymentLinks")
158158
.reply(200, paymentLinkSuccess)
159159
.matchHeader("Idempotency-Key", "testKey");
@@ -292,7 +292,7 @@ describe("Checkout", (): void => {
292292

293293
test("should have valid payment link", async (): Promise<void> => {
294294
const expiresAt = "2019-12-17T10:05:29Z";
295-
const paymentLinkSuccess: checkout.PaymentLinkResponse = getPaymentLinkSuccess(expiresAt);
295+
const paymentLinkSuccess: checkout.PaymentLinkResponse = getPaymentLinkSuccess(new Date(expiresAt));
296296

297297
scope.post("/paymentLinks").reply(200, paymentLinkSuccess);
298298

@@ -302,7 +302,7 @@ describe("Checkout", (): void => {
302302

303303
test("should get payment link", async (): Promise<void> => {
304304
const expiresAt = "2019-12-17T10:05:29Z";
305-
const paymentLinkSuccess: checkout.PaymentLinkResponse = getPaymentLinkSuccess(expiresAt);
305+
const paymentLinkSuccess: checkout.PaymentLinkResponse = getPaymentLinkSuccess(new Date(expiresAt));
306306

307307
scope.post("/paymentLinks").reply(200, paymentLinkSuccess);
308308

@@ -315,7 +315,7 @@ describe("Checkout", (): void => {
315315

316316
test("should patch payment link", async (): Promise<void> => {
317317
const expiresAt = "2019-12-17T10:05:29Z";
318-
const paymentLinkSuccess: checkout.PaymentLinkResponse = getPaymentLinkSuccess(expiresAt);
318+
const paymentLinkSuccess: checkout.PaymentLinkResponse = getPaymentLinkSuccess(new Date(expiresAt));
319319

320320
scope.post("/paymentLinks").reply(200, paymentLinkSuccess);
321321

@@ -387,7 +387,7 @@ describe("Checkout", (): void => {
387387
};
388388

389389
nock(`https://checkout-test.adyen.com`)
390-
.post(`/v70/originKeys`)
390+
.post(`/v71/originKeys`)
391391
.reply(200, originKeysSuccess);
392392

393393
const originKeysResponse = await checkoutUtility.UtilityApi.originKeys(originKeysRequest);

src/__tests__/modification.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ beforeEach((): void => {
150150
}
151151
client = createClient();
152152
checkoutAPI = new CheckoutAPI(client);
153-
scope = nock("https://checkout-test.adyen.com/v70");
153+
scope = nock("https://checkout-test.adyen.com/v71");
154154
});
155155

156156
afterEach(() => {

src/__tests__/notification.spec.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {AuthenticationNotificationRequest} from "../typings/acsWebhooks/authenti
1919
import {TransferNotificationRequest} from "../typings/transferWebhooks/transferNotificationRequest";
2020
import { PaymentMethodRequestRemovedNotificationRequest } from "../typings/managementWebhooks/paymentMethodRequestRemovedNotificationRequest";
2121
import { PaymentMethodScheduledForRemovalNotificationRequest } from "../typings/managementWebhooks/paymentMethodScheduledForRemovalNotificationRequest";
22+
import { TransactionNotificationRequestV4 } from "../typings/transactionWebhooks/transactionNotificationRequestV4";
2223

2324
describe("Notification Test", function (): void {
2425

@@ -231,4 +232,44 @@ describe("Notification Test", function (): void {
231232
expect(genericWebhook instanceof PaymentMethodScheduledForRemovalNotificationRequest).toBe(false)
232233
expect(paymentMethodRequestRemoved.type).toEqual(PaymentMethodRequestRemovedNotificationRequest.TypeEnum.PaymentMethodRequestRemoved)
233234
});
235+
236+
it("should deserialize Transaction v4 Webhooks", function (): void {
237+
const json = {
238+
"data": {
239+
"id": "EVJN42272224222B5JB8BRC84N686ZEUR",
240+
"amount": {
241+
"value": 7000,
242+
"currency": "EUR"
243+
},
244+
"status": "booked",
245+
"transfer": {
246+
"id": "JN4227222422265",
247+
"reference": "Split_item_1",
248+
},
249+
"valueDate": "2023-03-01T00:00:00+02:00",
250+
"bookingDate": "2023-02-28T13:30:20+02:00",
251+
"creationDate": "2023-02-28T13:30:05+02:00",
252+
"accountHolder": {
253+
"id": "AH00000000000000000000001",
254+
"description": "Your description for the account holder",
255+
"reference": "Your reference for the account holder"
256+
},
257+
"balanceAccount": {
258+
"id": "BA00000000000000000000001",
259+
"description": "Your description for the balance account",
260+
"reference": "Your reference for the balance account"
261+
},
262+
"balancePlatform": "YOUR_BALANCE_PLATFORM"
263+
},
264+
"type": "balancePlatform.transaction.created",
265+
"environment": "test"
266+
};
267+
const jsonString = JSON.stringify(json);
268+
let bankingWebhookHandler = new BankingWebhookHandler(jsonString);
269+
const transactionCreated: TransactionNotificationRequestV4 = bankingWebhookHandler.getTransactionNotificationRequest();
270+
const genericWebhook = bankingWebhookHandler.getGenericWebhook();
271+
expect(genericWebhook instanceof TransactionNotificationRequestV4).toBe(true)
272+
expect(genericWebhook instanceof PaymentMethodScheduledForRemovalNotificationRequest).toBe(false)
273+
expect(transactionCreated.type).toEqual(TransactionNotificationRequestV4.TypeEnum.BalancePlatformTransactionCreated)
274+
});
234275
});

src/notification/bankingWebhookHandler.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
* This file is open source and available under the MIT license.
55
* See the LICENSE file for more info.
66
*/
7-
import {configurationWebhooks} from "../typings";
8-
import {acsWebhooks} from "../typings"
9-
import {reportWebhooks} from "../typings";
10-
import {transferWebhooks} from "../typings";
7+
import {configurationWebhooks, acsWebhooks, reportWebhooks, transferWebhooks, transactionWebhooks} from "../typings";
118

129
class BankingWebhookHandler {
1310
private readonly payload: string;
@@ -24,7 +21,8 @@ class BankingWebhookHandler {
2421
| configurationWebhooks.SweepConfigurationNotificationRequest
2522
| configurationWebhooks.CardOrderNotificationRequest
2623
| reportWebhooks.ReportNotificationRequest
27-
| transferWebhooks.TransferNotificationRequest {
24+
| transferWebhooks.TransferNotificationRequest
25+
| transactionWebhooks.TransactionNotificationRequestV4 {
2826
const type = this.payload['type'];
2927

3028
if(Object.values(acsWebhooks.AuthenticationNotificationRequest.TypeEnum).includes(type)){
@@ -59,6 +57,10 @@ class BankingWebhookHandler {
5957
return this.getTransferNotificationRequest();
6058
}
6159

60+
if(Object.values(transactionWebhooks.TransactionNotificationRequestV4.TypeEnum).includes(type)){
61+
return this.getTransactionNotificationRequest();
62+
}
63+
6264
throw new Error("Could not parse the json payload: " + this.payload)
6365
}
6466

@@ -93,6 +95,10 @@ class BankingWebhookHandler {
9395
public getTransferNotificationRequest(): transferWebhooks.TransferNotificationRequest {
9496
return transferWebhooks.ObjectSerializer.deserialize(this.payload, "TransferNotificationRequest");
9597
}
98+
99+
public getTransactionNotificationRequest(): transactionWebhooks.TransactionNotificationRequestV4 {
100+
return transactionWebhooks.ObjectSerializer.deserialize(this.payload, "TransactionNotificationRequestV4");
101+
}
96102
}
97103

98104
export default BankingWebhookHandler;

src/services/checkout/classicCheckoutSDKApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* The version of the OpenAPI document: v70
2+
* The version of the OpenAPI document: v71
33
*
44
*
55
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -20,7 +20,7 @@ import { ObjectSerializer } from "../../typings/checkout/models";
2020

2121
export class ClassicCheckoutSDKApi extends Service {
2222

23-
private readonly API_BASEPATH: string = "https://checkout-test.adyen.com/v70";
23+
private readonly API_BASEPATH: string = "https://checkout-test.adyen.com/v71";
2424
private baseUrl: string;
2525

2626
public constructor(client: Client){

src/services/checkout/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* The version of the OpenAPI document: v70
2+
* The version of the OpenAPI document: v71
33
*
44
*
55
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).

src/services/checkout/modificationsApi.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* The version of the OpenAPI document: v70
2+
* The version of the OpenAPI document: v71
33
*
44
*
55
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -28,7 +28,7 @@ import { ObjectSerializer } from "../../typings/checkout/models";
2828

2929
export class ModificationsApi extends Service {
3030

31-
private readonly API_BASEPATH: string = "https://checkout-test.adyen.com/v70";
31+
private readonly API_BASEPATH: string = "https://checkout-test.adyen.com/v71";
3232
private baseUrl: string;
3333

3434
public constructor(client: Client){

0 commit comments

Comments
 (0)