Skip to content

Commit 4b2ccec

Browse files
authored
update makefile, readme and tests to upgrade Transfers and Management API (#1235)
* regenerate ManagementApi v3 * regenerate Transfers v4 * regenerate TransferWebhooks v4 * regenerate ManagementWebhooks v3 * regenerate ManagementWebhooks
1 parent 3e8e162 commit 4b2ccec

File tree

338 files changed

+2505
-1157
lines changed

Some content is hidden

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

338 files changed

+2505
-1157
lines changed

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,20 @@ terminalManagement: spec=TfmAPIService-v1
2020
payment: spec=PaymentService-v68
2121
recurring: spec=RecurringService-v68
2222
payout: spec=PayoutService-v68
23-
management: spec=ManagementService-v1
23+
management: spec=ManagementService-v3
2424
legalEntityManagement: spec=LegalEntityService-v3
2525
platformsAccount: spec=AccountService-v6
2626
platformsFund: spec=FundService-v6
2727
platformsNotificationConfiguration: spec=NotificationConfigurationService-v6
2828
platformsHostedOnboardingPage: spec=HopService-v6
29-
transfers: spec=TransferService-v3
30-
29+
transfers: spec=TransferService-v4
3130
# BalanceWebhooks
3231
acsWebhooks: spec=BalancePlatformAcsNotification-v1
3332
configurationWebhooks: spec=BalancePlatformConfigurationNotification-v1
3433
reportWebhooks: spec=BalancePlatformReportNotification-v1
35-
transferWebhooks: spec=BalancePlatformTransferNotification-v3
34+
transferWebhooks: spec=BalancePlatformTransferNotification-v4
3635
# ManagementWebhooks
37-
managementWebhooks: spec=ManagementNotificationService-v1
36+
managementWebhooks: spec=ManagementNotificationService-v3
3837

3938
$(services): build/spec $(openapi-generator-jar)
4039
rm -rf src/typings/$@ build/model

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This library supports the following:
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) |
2525
| [Local/Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference) | - | Our point-of-sale integration. | [TerminalLocalAPI](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/terminalLocalAPI.ts) or [TerminalCloudAPI](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/terminalCloudAPI.ts) |
26-
| [Management API](https://docs.adyen.com/api-explorer/Management/1/overview) | v1 | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | [Management](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/management/index.ts) |
26+
| [Management API](https://docs.adyen.com/api-explorer/Management/3/overview) | v3 | Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | [Management](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/management/index.ts) |
2727
| [Payments API](https://docs.adyen.com/api-explorer/Payment/68/overview) | v68 | Our classic integration for online payments. | [ClassicIntegrationAPI](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/paymentApi.ts) |
2828
| [Payouts API](https://docs.adyen.com/api-explorer/Payout/68/overview) | v68 | Endpoints for sending funds to your customers. | [Payout](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/payout/index.ts) |
2929
| [Platforms APIs](https://docs.adyen.com/platforms/api) | - | Set of APIs when using Adyen for Platforms. This API is used for the classic integration. | [Platforms](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/platforms.ts) |
@@ -34,7 +34,7 @@ This library supports the following:
3434
| [POS Terminal Management API](https://docs.adyen.com/api-explorer/postfmapi/1/overview) | v1 | Endpoints for managing your point-of-sale payment terminals. | [TerminalManagement](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/terminalManagementApi.ts) |
3535
| [Recurring API](https://docs.adyen.com/api-explorer/Recurring/68/overview) | v68 | Endpoints for managing saved payment details. | [Recurring](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/recurringApi.ts) |
3636
| [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | v46 | Manage both online and point-of-sale gift cards and other stored-value cards. | [StoredValue](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/storedValueApi.ts) |
37-
| [Transfers API](https://docs.adyen.com/api-explorer/transfers/3/overview) | v3 | The Transfers API provides endpoints that can be used to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. | [Transfers](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/transfers/index.ts) |
37+
| [Transfers API](https://docs.adyen.com/api-explorer/transfers/4/overview) | v4 | The Transfers API provides endpoints that can be used to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. | [Transfers](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/transfers/index.ts) |
3838
| [Disputes API](https://docs.adyen.com/api-explorer/Disputes/30/overview) | v30 | You can use the [Disputes API](https://docs.adyen.com/risk-management/disputes-api) to automate the dispute handling process so that you can respond to disputes and chargebacks as soon as they are initiated. The Disputes API lets you retrieve defense reasons, supply and delete defense documents, and accept or defend disputes. | [Disputes](https://github.com/Adyen/adyen-node-api-library/blob/main/src/services/disputesApi.ts) |
3939

4040
## Supported Webhook versions
@@ -44,9 +44,9 @@ The library supports all webhooks under the following model directories:
4444
|---------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|-------------------|
4545
| [Authentication Webhooks](https://docs.adyen.com/api-explorer/acs-webhook/1/overview) | Adyen sends this webhook when the process of cardholder authentication is finalized, whether it is completed successfully, fails, or expires. | [AcsWebhooks](src/typings/acsWebhooks) | **v1** |
4646
| [Configuration Webhooks](https://docs.adyen.com/api-explorer/balanceplatform-webhooks/1/overview) | You can use these webhooks to build your implementation. For example, you can use this information to update internal statuses when the status of a capability is changed. | [ConfigurationNotification](src/typings/configurationWebhooks) | **v1** |
47-
| [Transfer Webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/3/overview) | 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. | [TransferNotification](src/typings/transferWebhooks) | **v3** |
47+
| [Transfer Webhooks](https://docs.adyen.com/api-explorer/transfer-webhooks/4/overview) | 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. | [TransferNotification](src/typings/transferWebhooks) | **v4** |
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** |
49-
| [Management Webhooks](https://docs.adyen.com/api-explorer/ManagementNotification/1/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) | **v1** |
49+
| [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** |
5151

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

src/__tests__/management.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ beforeEach((): void => {
2828
nock.activate();
2929
}
3030
client = createClient();
31-
scope = nock("https://management-test.adyen.com/v1");
31+
scope = nock("https://management-test.adyen.com/v3");
3232
managementService = new ManagementAPI(client);
3333
});
3434

@@ -678,7 +678,7 @@ describe("Management", (): void => {
678678
...requests.createMerchantWebhookRequest,
679679
communicationFormat: management.CreateMerchantWebhookRequest.CommunicationFormatEnum.Json,
680680
networkType: management.CreateMerchantWebhookRequest.NetworkTypeEnum.Public,
681-
sslVersion: management.CreateMerchantWebhookRequest.SslVersionEnum.Tlsv12
681+
encryptionProtocol: management.CreateMerchantWebhookRequest.EncryptionProtocolEnum.Tlsv12
682682
});
683683

684684
expect(response).toBeTruthy();
@@ -708,7 +708,7 @@ describe("Management", (): void => {
708708
...requests.updateMerchantWebhookRequest,
709709
communicationFormat: management.CreateMerchantWebhookRequest.CommunicationFormatEnum.Soap,
710710
networkType: management.CreateMerchantWebhookRequest.NetworkTypeEnum.Local,
711-
sslVersion: management.CreateMerchantWebhookRequest.SslVersionEnum.Tlsv13
711+
encryptionProtocol: management.CreateMerchantWebhookRequest.EncryptionProtocolEnum.Tlsv13
712712
});
713713

714714
expect(response).toBeTruthy();

src/__tests__/notification.spec.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import {
1717
import {MerchantUpdatedNotificationRequest} from "../typings/managementWebhooks/merchantUpdatedNotificationRequest";
1818
import {AuthenticationNotificationRequest} from "../typings/acsWebhooks/authenticationNotificationRequest";
1919
import {TransferNotificationRequest} from "../typings/transferWebhooks/transferNotificationRequest";
20+
import { PaymentMethodRequestRemovedNotificationRequest } from "../typings/managementWebhooks/paymentMethodRequestRemovedNotificationRequest";
21+
import { PaymentMethodScheduledForRemovalNotificationRequest } from "../typings/managementWebhooks/paymentMethodScheduledForRemovalNotificationRequest";
2022

2123
describe("Notification Test", function (): void {
2224

@@ -206,4 +208,27 @@ describe("Notification Test", function (): void {
206208
expect(genericWebhook instanceof AccountHolderNotificationRequest).toBe(false)
207209
expect(genericWebhook instanceof AuthenticationNotificationRequest).toBe(true)
208210
});
211+
212+
it("should deserialize Management v3 Webhooks", function (): void {
213+
const json = {
214+
"type": "paymentMethod.requestRemoved",
215+
"environment": "devl",
216+
"createdAt": "2023-06-12T18:59:17+02:00",
217+
"data": {
218+
"id": "PM322WP223224M5HJ6PX77BW8",
219+
"storeId": "TestStore",
220+
"type": "amex",
221+
"status": "dataRequired",
222+
"merchantId": "TestMerchant",
223+
"enabled": false
224+
}
225+
};
226+
const jsonString = JSON.stringify(json);
227+
let managementWebhookHandler = new ManagementWebhookHandler(jsonString);
228+
const paymentMethodRequestRemoved: PaymentMethodRequestRemovedNotificationRequest = managementWebhookHandler.getPaymentMethodRequestRemovedNotificationRequest();
229+
const genericWebhook = managementWebhookHandler.getGenericWebhook();
230+
expect(genericWebhook instanceof PaymentMethodRequestRemovedNotificationRequest).toBe(true)
231+
expect(genericWebhook instanceof PaymentMethodScheduledForRemovalNotificationRequest).toBe(false)
232+
expect(paymentMethodRequestRemoved.type).toEqual(PaymentMethodRequestRemovedNotificationRequest.TypeEnum.PaymentMethodRequestRemoved)
233+
});
209234
});

src/__tests__/transfers.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ beforeEach((): void => {
1515
}
1616
client = createClient();
1717
transfersAPI = new TransfersAPI(client);
18-
scope = nock("https://balanceplatform-api-test.adyen.com/btl/v3");
18+
scope = nock("https://balanceplatform-api-test.adyen.com/btl/v4");
1919
});
2020

2121
afterEach(() => {

0 commit comments

Comments
 (0)