Compare commits

...

38 Commits

Author SHA1 Message Date
jillingk
d800ac8bcc Merge branch 'develop' into PW-7518 2023-01-19 15:47:20 +01:00
Wouter Boereboom
8c451502e3 Remove LGTM badges from README (#1080) 2023-01-19 15:46:05 +01:00
jillingk
63c8357bad Merge branch 'develop' into PW-7518 2023-01-19 11:41:47 +01:00
Wouter Boereboom
bd70b93c08 update unit tests to test uniform error handling over APIs (#1079)
Co-authored-by: jillingk <93914435+jillingk@users.noreply.github.com>
2023-01-13 15:54:15 +01:00
jillingk
bb983fe4b7 Merge branch 'develop' into PW-7518 2023-01-13 09:54:14 +01:00
renovate[bot]
fd7b05ab09 chore(deps): update dependency nock to v13.3.0 (#1081)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-12 09:49:03 +01:00
renovate[bot]
4ed7e77d0e chore(deps): update dependency @types/node to v14.18.36 (#1044)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-01-03 08:20:22 +01:00
Michael Paul
a289846a16 PW-7502: Bind QueryString type to URLSearchParams (#1077) 2022-12-30 13:22:21 +01:00
Wouter Boereboom
277edb212c remove API calls from unit tests. Remove ASCII headers from test files, use typings index in test classes. add missing entries to typings index class (#1075) 2022-12-23 10:05:52 +01:00
Wouter Boereboom
be9194fafe add basic auth option to the client (#1076) 2022-12-22 10:38:07 +01:00
renovate[bot]
f210123964 Update dependency typescript to v4.9.4 (#1073)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-22 10:18:50 +01:00
jillingk
c6c3c97327 Merge branch 'develop' into PW-7518 2022-12-14 11:21:53 +01:00
Wouter Boereboom
872f86064f Add banner to README (#1074) 2022-12-14 11:07:55 +01:00
Wouter Boereboom
d64dbaaf32 Merge branch 'develop' into PW-7518 2022-12-05 16:10:26 +01:00
Wouter Boereboom
ba18fcb181 Pw 7156/update readme (#1069)
* update README

* fix link to integration section

* add webhooks to README.md

* fix bullet lists in README

* minor code example fix

* process feedback

* Update README.md

Co-authored-by: Jeantwan Teuma <Morerice@users.noreply.github.com>

* Update README.md

Co-authored-by: Jeantwan Teuma <Morerice@users.noreply.github.com>

* Grammar

Co-authored-by: Jeantwan Teuma <Morerice@users.noreply.github.com>
2022-12-05 16:04:59 +01:00
Wouter Boereboom
79aaf6580e update .npmignore (#1072) 2022-12-05 15:37:44 +01:00
jillingk
7e45720ae8 Merge branch 'develop' into PW-7518 2022-12-04 12:41:10 +01:00
jillingk
2a7ceee216 Update Makefile
Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com>
2022-12-04 12:41:04 +01:00
jillingk
e20a426703 Update src/__tests__/hmacValidator.spec.ts
Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com>
2022-12-04 12:40:56 +01:00
renovate[bot]
2d6330b552 Update dependency ts-loader to v9 (#1055)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-12-02 09:27:55 +01:00
jillingk
a4314a9e31 Merge branch 'develop' into PW-7518 2022-12-01 11:07:28 +01:00
jillingk
818574f222 remove additionalData class at all and replace with key-value pair 2022-12-01 11:03:53 +01:00
renovate[bot]
ad540c8964 Update dependency typescript to v4.9.3 (#1050)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-30 14:01:37 +01:00
renovate[bot]
e10cd25364 Update dependency eslint to v8.28.0 (#1057)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-30 13:28:37 +01:00
Wouter Boereboom
7ed7299480 Delete dependabot.yml (#1059) 2022-11-30 13:07:43 +01:00
Wouter Boereboom
c8220fe6d4 fix: add balancePlatform to services index (#1068) 2022-11-30 12:58:05 +01:00
Wouter Boereboom
790c880eef add dataProtection service to library (#1063)
* add dataProtection service to library

* add missing import

* fix mock class for unit test
2022-11-30 12:51:27 +01:00
renovate[bot]
e3a2918fa9 Update actions/checkout action to v3 (#1052)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com>
2022-11-30 08:46:33 +01:00
dependabot[bot]
aa35700e88 Bump @typescript-eslint/parser from 5.43.0 to 5.45.0 (#1067)
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 5.43.0 to 5.45.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.45.0/packages/parser)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/parser"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-30 08:39:45 +01:00
jillingk
b500101c02 created script to update additional data file and small check new parameter works 2022-11-28 17:44:07 +01:00
renovate[bot]
7a8ef2bc40 Update actions/setup-node action to v3 (#1053)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-21 15:25:07 +01:00
jillingk
791f68163a Changed name of Value to BarcodeValue corresponding to docs(and API) (#1051) 2022-11-18 14:50:54 +01:00
renovate[bot]
91306b86d3 Update dependency @typescript-eslint/parser to v5.43.0 (#1046)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-18 09:09:18 +01:00
renovate[bot]
086b8bc929 Update dependency eslint to v8.27.0 (#1047)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-18 09:05:23 +01:00
Eoin Falconer
8aa158b943 Arribatec/fix terminal comms typo (#1029)
* Fix the namings of CommunicationOKFlag

* Revert "Fix the namings of CommunicationOKFlag"

This reverts commit 15e85c2665947a87ce7cfd8b6dae5df0fde16cb1.

* Updated with correct linting

* Update pOIStatus.ts

Co-authored-by: jillingk <93914435+jillingk@users.noreply.github.com>
Co-authored-by: Wouter Boereboom <62436079+wboereboom@users.noreply.github.com>
2022-11-18 08:47:40 +01:00
renovate[bot]
4ac101a30c Update dependency @types/jest to v27.5.2 (#1043)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-18 08:33:35 +01:00
renovate[bot]
533a07c87e Add renovate.json (#1042)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2022-11-18 08:30:51 +01:00
dependabot[bot]
37b752de49 Bump @typescript-eslint/eslint-plugin from 5.41.0 to 5.43.0 (#1039)
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.41.0 to 5.43.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.43.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-15 17:07:59 +01:00
50 changed files with 1168 additions and 1041 deletions

View File

@@ -1,14 +0,0 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10
reviewers:
- "zaiddreakh"
- "maassenbas"
- "AlexandrosMor"
- "peterojo"
- "wboereboom"

View File

@@ -13,7 +13,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.

View File

@@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js 16.x
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: 16.x

View File

@@ -12,9 +12,9 @@ jobs:
node-version: [12.x, 14.x, 16.x]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: npm install, lint and test

View File

@@ -9,8 +9,8 @@ jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
registry-url: https://registry.npmjs.org/

View File

@@ -9,7 +9,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
# Disabling shallow clone to improve relevancy of SonarCloud reporting
fetch-depth: 0

View File

@@ -1,11 +1,16 @@
src/
.babelrc
.eslintignore
.eslintrc.json
.eslintrc.js
.gitignore
.travis.yml
.release-it.json
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Makefile
config.ts
renovate.json
tsconfig.json
jest.config.js
tslint.json
webpack.config.js
.github
/**/__mocks__/
/**/__tests__/

View File

@@ -1,12 +1,13 @@
generator:=typescript-node
openapi-generator-cli:=docker run --user $(shell id -u):$(shell id -g) --rm -v ${PWD}:/local -w /local openapitools/openapi-generator-cli:v5.4.0
services:=binlookup checkout storedValue terminalManagement payments recurring payouts management legalEntityManagement balancePlatform platformsAccount platformsFund platformsNotificationConfiguration platformsHostedOnboardingPage transfer
services:=balancePlatform binlookup checkout dataProtection legalEntityManagement management payments payouts platformsAccount platformsFund platformsHostedOnboardingPage platformsNotificationConfiguration recurring storedValue terminalManagement transfer
# Generate models (for each service)
models: $(services)
binlookup: spec=BinLookupService-v52
checkout: spec=CheckoutService-v69
dataProtection: spec=DataProtectionService-v1
storedValue: spec=StoredValueService-v46
terminalManagement: spec=TfmAPIService-v1
payments: spec=PaymentService-v68
@@ -21,7 +22,7 @@ platformsNotificationConfiguration: spec=NotificationConfigurationService-v6
platformsHostedOnboardingPage: spec=HopService-v6
transfer: spec=TransferService-v3
$(services): build/spec
$(services): build/spec
rm -rf src/typings/$@ build/model
$(openapi-generator-cli) generate \
-i build/spec/json/$(spec).json \

136
README.md
View File

@@ -1,3 +1,6 @@
![Node js](https://user-images.githubusercontent.com/62436079/207373079-9cf9377f-f530-4b02-a515-9b64ef7b06e7.png)
# Adyen Node.js API Library
![Node.js CI](https://github.com/Adyen/adyen-node-api-library/workflows/Node.js%20CI/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/Adyen/adyen-node-api-library/badge.svg?branch=main)](https://coveralls.io/github/Adyen/adyen-node-api-library?branch=main)
@@ -5,39 +8,38 @@
![npm bundle size (scoped)](https://img.shields.io/bundlephobia/minzip/@adyen/api-library.svg)
[![Version](https://img.shields.io/npm/v/@adyen/api-library.svg)](https://www.npmjs.com/package/@adyen/api-library)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Adyen_adyen-node-api-library&metric=alert_status)](https://sonarcloud.io/dashboard?id=Adyen_adyen-node-api-library)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/Adyen/adyen-node-api-library.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Adyen/adyen-node-api-library/alerts/)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/Adyen/adyen-node-api-library.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Adyen/adyen-node-api-library/context:javascript)
This is the officially supported NodeJS library for using Adyen's APIs.
## Integration
## Supported API versions
The Library supports all APIs under the following services:
* [BIN lookup API](https://docs.adyen.com/api-explorer/#/BinLookup/v52/overview): The BIN Lookup API provides endpoints for retrieving information based on a given BIN. Current supported version: **v52**
* [Checkout API](https://docs.adyen.com/api-explorer/#/CheckoutService/v69/overview): Our latest integration for accepting online payments. Current supported version: **v69**
* [Configuration API](https://docs.adyen.com/api-explorer/#/balanceplatform/v2/overview): 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. Current supported verison: **v2**
* [Legal Entity Management API](https://docs.adyen.com/api-explorer/#/legalentity/v2/overview): Manage legal entities that contain information required for verification. Current supported version: **v2**
* [Local/Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference): Our point-of-sale integration.
* [Management API](https://docs.adyen.com/api-explorer/#/ManagementService/v1/overview): Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. Current supported version **v1**
* [Payments API](https://docs.adyen.com/api-explorer/#/Payment/v68/overview): Our classic integration for online payments. Current supported version: **v68**
* [Payouts API](https://docs.adyen.com/api-explorer/#/Payout/v68/overview): Endpoints for sending funds to your customers. Current supported version: **v68**
* [Platforms APIs](https://docs.adyen.com/platforms/api): Set of APIs when using Adyen for Platforms. This API is used for the classic integration.
* [Account API](https://docs.adyen.com/api-explorer/#/Account/v6/overview) Current supported version: **v6**
* [Fund API](https://docs.adyen.com/api-explorer/#/Fund/v6/overview) Current supported version: **v6**
* [Hosted onboarding API](https://docs.adyen.com/api-explorer/#/Hop/v6/overview): Current supported version: **v6**
* [Notification Configuration API](https://docs.adyen.com/api-explorer/#/NotificationConfigurationService/v6/overview) Current supported version: **v6**
* [Platforms Notifications Webhooks](https://docs.adyen.com/api-explorer/#/NotificationService/v6/overview) Current supported version: **v6**
* [POS Terminal Management API](https://docs.adyen.com/api-explorer/#/postfmapi/v1/overview): Endpoints for managing your point-of-sale payment terminals. Current supported version **v1**
* [Recurring API](https://docs.adyen.com/api-explorer/#/Recurring/v68/overview): Endpoints for managing saved payment details. Current supported version: **v68**
* [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api): Manage both online and point-of-sale gift cards and other stored-value cards. Current supported version: **v46**
* [Transfers API](https://docs.adyen.com/api-explorer/transfers/3/overview) The Transfers API provides endpoints that you can use to get information about all your transactions, move funds within your balance platform or send funds from your balance platform to a transfer instrument. **v3**
| API | Description | Service Name | Supported version |
| --- | ----------- | ------------ | ----------------- |
|[BIN lookup API](https://docs.adyen.com/api-explorer/#/BinLookup/v52/overview) | The BIN Lookup API provides endpoints for retrieving information based on a given BIN. | BinLookup | **v52** |
| [Checkout API](https://docs.adyen.com/api-explorer/#/CheckoutService/v69/overview)| Our latest integration for accepting online payments. | CheckoutAPI | **v69** |
| [Configuration API](https://docs.adyen.com/api-explorer/#/balanceplatform/v2/overview)| 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 | **v2** |
| [DataProtection API](https://docs.adyen.com/development-resources/data-protection-api) | 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 | **v1** |
| [Legal Entity Management API](https://docs.adyen.com/api-explorer/#/legalentity/v2/overview)| Manage legal entities that contain information required for verification. | LegalEntityManagement | **v2** |
| [Local/Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference)| Our point-of-sale integration. | TerminalLocalAPI or TerminalCloudAPI | - |
| [Management API](https://docs.adyen.com/api-explorer/#/ManagementService/v1/overview)| Configure and manage your Adyen company and merchant accounts, stores, and payment terminals. | Management | **v1** |
| [Payments API](https://docs.adyen.com/api-explorer/#/Payment/v68/overview)| Our classic integration for online payments. | ClassicIntegrationAPI | **v68** |
| [Payouts API](https://docs.adyen.com/api-explorer/#/Payout/v68/overview)| Endpoints for sending funds to your customers. | Payout | **v68** |
| [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 | - |
| [Account API](https://docs.adyen.com/api-explorer/#/Account/v6/overview) | *Platforms subclass* | Account | **v6** |
| [Fund API](https://docs.adyen.com/api-explorer/#/Fund/v6/overview) | *Platforms subclass* | Fund | **v6** |
| [Hosted onboarding API](https://docs.adyen.com/api-explorer/#/Hop/v6/overview)| *Platforms subclass* | HostedOnboardingPage | **v6** |
| [Notification Configuration API](https://docs.adyen.com/api-explorer/#/NotificationConfigurationService/v6/overview) | *Platforms subclass* | NotificationConfiguration | **v6** |
| [Platforms Notifications Webhooks](https://docs.adyen.com/api-explorer/#/NotificationService/v6/overview) || *Models only* | **v6** |
| [POS Terminal Management API](https://docs.adyen.com/api-explorer/#/postfmapi/v1/overview)| Endpoints for managing your point-of-sale payment terminals. | TerminalManagement | **v1** |
| [Recurring API](https://docs.adyen.com/api-explorer/#/Recurring/v68/overview)| Endpoints for managing saved payment details. | Recurring | **v68** |
| [Stored Value API](https://docs.adyen.com/payment-methods/gift-cards/stored-value-api) | Manage both online and point-of-sale gift cards and other stored-value cards. | StoredValue | **v46** |
| [Transfers API](https://docs.adyen.com/api-explorer/transfers/3/overview) | 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 | **v3** |
| [Webhooks](https://docs.adyen.com/api-explorer/Webhooks/1/overview) | Adyen uses webhooks to send notifications about payment status updates, newly available reports, and other events that can be subscribed to. For more information, refer to our [documentation](https://docs.adyen.com/development-resources/webhooks). | *Models only* | **v1** |
For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/).
## Prerequisites
- [Adyen test account](https://docs.adyen.com/get-started-with-adyen)
- [Adyen test account](https://docs.adyen.com/get-started-with-adyen). To start using Adyen APIs, you will need a Merchant Account.
- [API key](https://docs.adyen.com/development-resources/api-credentials#generate-api-key). For testing, your API credential needs to have the [API PCI Payments role](https://docs.adyen.com/development-resources/api-credentials#roles).
- Node 12 or higher
@@ -56,21 +58,93 @@ Alternatively, you can download the [release on GitHub](https://github.com/Adyen
## Using the library
### General use with API key
### Client initialisation
#### General use with API key
Set up the client as a singleton resource; you can then use it to create service objects for the API calls that you make to Adyen:
```typescript
const client = new Client({apiKey: "YOUR_API_KEY", environment: "TEST"});
const { Client } = require('@adyen/api-library');
const client = new Client({apiKey: "YOUR_API_KEY", environment: "TEST"});
```
### General use with API key for live environment
#### General use with API key for live environment
```typescript
const client = new Client({apiKey: "YOUR_API_KEY", environment: "LIVE"});
const { Client } = require('@adyen/api-library');
const client = new Client({apiKey: "YOUR_API_KEY", environment: "LIVE"});
```
### General use with basic auth
#### General use with basic auth
```typescript
const client = new Client({username: "YOUR_USERNAME", password: "YOUR_PASSWORD", environment: "TEST"});
const { Client } = require('@adyen/api-library');
const client = new Client({username: "YOUR_USERNAME", password: "YOUR_PASSWORD", environment: "TEST"});
```
### Consuming Services
Every API the library supports is represented by a service object. The name of the service matching the corresponding API is listed in the [Integrations](#supported-api-versions) section of this document.
```javascript
const { Client, CheckoutAPI } = require('@adyen/api-library');
const client = new Client({apiKey: "YOUR_API_KEY", environment: "TEST"});
const paymentRequest = {
amount: {
currency: "USD",
value: 1000 // value in minor units
},
reference: "Your order number",
paymentMethod: {
type: "scheme",
encryptedCardNumber: "test_4111111111111111",
encryptedExpiryMonth: "test_03",
encryptedExpiryYear: "test_2030",
encryptedSecurityCode: "test_737"
},
shopperReference: "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
storePaymentMethod: true,
shopperInteraction: "Ecommerce",
recurringProcessingModel: "CardOnFile",
returnUrl: "https://your-company.com/...",
merchantAccount: "YOUR_MERCHANT_ACCOUNT"
};
const checkoutAPI = new CheckoutAPI(client);
checkoutAPI.payments(paymentRequest)
.then( paymentResponse => console.log(paymentResponse.pspReference))
.catch(error => console.log(error));
```
Alternatively you can make use of the Types included in this library using Typescript, and/or use the async syntax:
```typescript
const { Client, CheckoutAPI } = require('@adyen/api-library');
const client = new Client({apiKey: "YOUR_API_KEY", environment: "TEST"});
import { Types } from '@adyen/api-library';
const doPaymentsRequest = async () => {
const paymentRequest : Types.checkout.PaymentRequest = {
amount: {
currency: "USD",
value: 1000 // value in minor units
},
reference: "Your order number",
paymentMethod: {
type: Types.checkout.CardDetails.TypeEnum.Scheme,
encryptedCardNumber: "test_4111111111111111",
encryptedExpiryMonth: "test_03",
encryptedExpiryYear: "test_2030",
encryptedSecurityCode: "test_737"
},
shopperReference: "YOUR_UNIQUE_SHOPPER_ID_IOfW3k9G2PvXFu2j",
storePaymentMethod: true,
shopperInteraction: Types.checkout.PaymentRequest.ShopperInteractionEnum.Ecommerce,
recurringProcessingModel: Types.checkout.PaymentRequest.RecurringProcessingModelEnum.CardOnFile,
returnUrl: "https://your-company.com/...",
merchantAccount: "YOUR_MERCHANT_ACCOUNT"
};
const checkoutAPI = new CheckoutAPI(client);
const paymentResponse : Types.checkout.PaymentResponse = await checkoutAPI.payments(paymentRequest);
console.log(paymentResponse.pspReference);
}
doPaymentsRequest();
```
### Custom HTTP Client Configuration
By default, NodeJS [https](https://nodejs.org/api/https.html) will be used to submit requests to the API. But you can change that by injecting your own HttpClient on your client instance. In the example below, we use `axios`:

View File

@@ -35,30 +35,30 @@
"author": "Ricardo Ambrogi",
"license": "MIT",
"devDependencies": {
"@types/jest": "27.5.0",
"@types/jest": "27.5.2",
"@types/nock": "11.1.0",
"@typescript-eslint/eslint-plugin": "5.41.0",
"@typescript-eslint/parser": "5.41.0",
"@typescript-eslint/eslint-plugin": "5.43.0",
"@typescript-eslint/parser": "5.45.0",
"acorn": "^8.0.1",
"coveralls": "3.1.1",
"dotenv": "^16.0.0",
"eslint": "8.26.0",
"eslint": "8.28.0",
"jest": "^27.0.6",
"jest-ts-auto-mock": "^2.0.0",
"kind-of": "^6.0.3",
"minimist": ">=1.2.3",
"nock": "13.2.9",
"nock": "13.3.0",
"release-it": "15.5.0",
"ts-auto-mock": "^3.3.5",
"ts-jest": "^27.0.4",
"ts-loader": "8.0.10",
"ts-loader": "9.4.2",
"ttypescript": "^1.5.10",
"typescript": "4.8.4"
"typescript": "4.9.4"
},
"dependencies": {
"https-proxy-agent": "5.0.1"
},
"optionalDependencies": {
"@types/node": "14.0.9"
"@types/node": "14.18.36"
}
}

6
renovate.json Normal file
View File

@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:base"
]
}

View File

@@ -50,7 +50,8 @@ export const createClient = (apiKey = process.env.ADYEN_API_KEY): Client => {
config.managementEndpoint = Client.MANAGEMENT_API_ENDPOINT_TEST;
config.balancePlatformEndpoint = Client.BALANCE_PLATFORM_API_ENDPOINT_TEST;
config.legalEntityManagementEndpoint = Client.LEGAL_ENTITY_MANAGEMENT_API_ENDPOINT_TEST;
config.transfersEndpoint = Client.TRANSFERS_API_VERSION_TEST;
config.transfersEndpoint = Client.TRANSFERS_API_ENDPOINT_TEST;
config.dataProtectionEndpoint = Client.DATA_PROTECTION_API_ENDPOINT_TEST;
return new Client({ config });
};

View File

@@ -12,7 +12,8 @@
"hmacSignature": "OzDjCMZIsdtDqrZ+cl\/FWC+WdESrorctXTzAzW33dXI=",
"NAME2": " VALUE2 ",
"fraudCheck-6-ShopperIpUsage": "10",
"paymentLinkId": "ABCDEFG"
"paymentLinkId": "ABCDEFG",
"realtimeAccountUpdaterStatus": "status"
},
"amount": {
"currency": "EUR",

View File

@@ -2,13 +2,13 @@ import nock from "nock";
import Client from "../client";
import { createClient } from "../__mocks__/base";
import BalancePlatform from "../services/balancePlatform";
import * as models from "../typings/balancePlatform/models";
import { balancePlatform } from "../typings";
import { AccountHolderUpdate } from "../services/balancePlaftform/accountHolders";
import { SweepConfigurationV2Create, SweepConfigurationV2Update } from "../services/balancePlaftform/balanceAccounts";
import { TransactionRuleInfoUpdate } from "../services/balancePlaftform/transactionRules";
let client: Client;
let balancePlatform: BalancePlatform;
let balancePlatformService: BalancePlatform;
let scope: nock.Scope;
beforeEach((): void => {
@@ -17,7 +17,7 @@ beforeEach((): void => {
}
client = createClient();
scope = nock(`${client.config.balancePlatformEndpoint}/${Client.BALANCE_PLATFORM_API_VERSION}`);
balancePlatform = new BalancePlatform(client);
balancePlatformService = new BalancePlatform(client);
});
afterEach(() => {
@@ -55,7 +55,7 @@ describe("Balance Platform", (): void => {
"id": "AH3227C223222B5CMD2SXFKGT",
"status": "active"
});
const request: models.AccountHolderInfo = {
const request: balancePlatform.AccountHolderInfo = {
"balancePlatform": "YOUR_BALANCE_PLATFORM",
"description": "S.Hopper - Staff 123",
"legalEntityId": "LE322KT223222D5FJ7THR293F",
@@ -63,7 +63,7 @@ describe("Balance Platform", (): void => {
"email": "s.hopper@example.com",
"phone": {
"number": "+315551231234",
"type": models.Phone.TypeEnum.Mobile
"type": balancePlatform.Phone.TypeEnum.Mobile
},
"address": {
"city": "Amsterdam",
@@ -75,7 +75,7 @@ describe("Balance Platform", (): void => {
}
};
const response: models.AccountHolder = await balancePlatform.AccountHolders.create(request);
const response: balancePlatform.AccountHolder = await balancePlatformService.AccountHolders.create(request);
expect(response.id).toBe("AH3227C223222B5CMD2SXFKGT");
expect(response.legalEntityId).toBe("LE322KT223222D5FJ7THR293F");
@@ -104,7 +104,7 @@ describe("Balance Platform", (): void => {
"status": "Active"
});
const response: models.AccountHolder = await balancePlatform.AccountHolders.retrieve("AH32272223222B5CM4MWJ892H");
const response: balancePlatform.AccountHolder = await balancePlatformService.AccountHolders.retrieve("AH32272223222B5CM4MWJ892H");
expect(response.id).toBe("AH32272223222B5CM4MWJ892H");
expect(response.balancePlatform).toBe("YOUR_BALANCE_PLATFORM");
@@ -133,11 +133,11 @@ describe("Balance Platform", (): void => {
"status": "Suspended"
});
const request: AccountHolderUpdate = {
status: models.AccountHolder.StatusEnum.Suspended,
status: balancePlatform.AccountHolder.StatusEnum.Suspended,
legalEntityId: "LE322KT223222D5FJ7THR293F",
};
const response: models.AccountHolder = await balancePlatform.AccountHolders.update("AH32272223222B5CM4MWJ892H", request);
const response: balancePlatform.AccountHolder = await balancePlatformService.AccountHolders.update("AH32272223222B5CM4MWJ892H", request);
expect(response.status).toBe("Suspended");
});
@@ -169,7 +169,7 @@ describe("Balance Platform", (): void => {
"hasPrevious": false
});
const response: models.PaginatedBalanceAccountsResponse = await balancePlatform.AccountHolders.listBalanceAccounts("AH32272223222B5CM4MWJ892H", {
const response: balancePlatform.PaginatedBalanceAccountsResponse = await balancePlatformService.AccountHolders.listBalanceAccounts("AH32272223222B5CM4MWJ892H", {
params: {
"limit": "5",
"offset": "10"
@@ -198,12 +198,12 @@ describe("Balance Platform", (): void => {
"id": balanceAccountId,
"status": "active"
});
const request: models.BalanceAccountInfo = {
const request: balancePlatform.BalanceAccountInfo = {
"accountHolderId": "AH32272223222B59K6ZKBBFNQ",
"description": "S.Hopper - Main balance account"
};
const response: models.BalanceAccount = await balancePlatform.BalanceAccounts.create(request);
const response: balancePlatform.BalanceAccount = await balancePlatformService.BalanceAccounts.create(request);
expect(response.id).toBe(balanceAccountId);
});
@@ -237,7 +237,7 @@ describe("Balance Platform", (): void => {
]
});
const response: models.BalanceSweepConfigurationsResponse = await balancePlatform.BalanceAccounts.listSweeps(balanceAccountId, {
const response: balancePlatform.BalanceSweepConfigurationsResponse = await balancePlatformService.BalanceAccounts.listSweeps(balanceAccountId, {
params: {
"limit": "5",
"offset": "10"
@@ -276,13 +276,13 @@ describe("Balance Platform", (): void => {
},
"currency": "EUR",
"schedule": {
"type": models.SweepSchedule.TypeEnum.Balance
"type": balancePlatform.SweepSchedule.TypeEnum.Balance
},
"type": models.SweepConfigurationV2.TypeEnum.Pull,
"status": models.SweepConfigurationV2.StatusEnum.Active
"type": balancePlatform.SweepConfigurationV2.TypeEnum.Pull,
"status": balancePlatform.SweepConfigurationV2.StatusEnum.Active
};
const response: models.SweepConfigurationV2 = await balancePlatform.BalanceAccounts.createSweep(balanceAccountId, request);
const response: balancePlatform.SweepConfigurationV2 = await balancePlatformService.BalanceAccounts.createSweep(balanceAccountId, request);
expect(response.id).toBe(sweepId);
expect(response.triggerAmount!.value).toBe(50000);
@@ -291,7 +291,7 @@ describe("Balance Platform", (): void => {
it("should support DELETE /balanceAccounts/{balanceAccountId}/sweeps/{sweepId}", async (): Promise<void> => {
scope.delete(`/balanceAccounts/${balanceAccountId}/sweeps/${sweepId}`).reply(204);
await balancePlatform.BalanceAccounts.deleteSweep(balanceAccountId, sweepId);
await balancePlatformService.BalanceAccounts.deleteSweep(balanceAccountId, sweepId);
});
it("should support GET /balanceAccounts/{balanceAccountId}/sweeps/{sweepId}", async (): Promise<void> => {
@@ -317,7 +317,7 @@ describe("Balance Platform", (): void => {
"currency": "EUR"
});
const response: models.SweepConfigurationV2 = await balancePlatform.BalanceAccounts.retrieveSweep(balanceAccountId, sweepId);
const response: balancePlatform.SweepConfigurationV2 = await balancePlatformService.BalanceAccounts.retrieveSweep(balanceAccountId, sweepId);
expect(response.id).toBe(sweepId);
expect(response.status).toBe("active");
@@ -342,10 +342,10 @@ describe("Balance Platform", (): void => {
"status": "inactive"
});
const request: SweepConfigurationV2Update = {
"status": models.SweepConfigurationV2.StatusEnum.Inactive
"status": balancePlatform.SweepConfigurationV2.StatusEnum.Inactive
};
const response: models.SweepConfigurationV2 = await balancePlatform.BalanceAccounts.updateSweep(balanceAccountId, sweepId, request);
const response: balancePlatform.SweepConfigurationV2 = await balancePlatformService.BalanceAccounts.updateSweep(balanceAccountId, sweepId, request);
expect(response.status).toBe("inactive");
});
@@ -367,7 +367,7 @@ describe("Balance Platform", (): void => {
"status": "Active"
});
const response: models.BalanceAccount = await balancePlatform.BalanceAccounts.retrieve(balanceAccountId);
const response: balancePlatform.BalanceAccount = await balancePlatformService.BalanceAccounts.retrieve(balanceAccountId);
expect(response.id).toBe(balanceAccountId);
expect(response.status).toBe("Active");
@@ -392,13 +392,13 @@ describe("Balance Platform", (): void => {
"status": "active",
"timeZone": "Europe/Amsterdam"
});
const request: models.BalanceAccountUpdateRequest = {
const request: balancePlatform.BalanceAccountUpdateRequest = {
"description": "Testing",
"status": models.BalanceAccountUpdateRequest.StatusEnum.Active,
"status": balancePlatform.BalanceAccountUpdateRequest.StatusEnum.Active,
"timeZone": "Europe/Amsterdam"
};
const response: models.BalanceAccount = await balancePlatform.BalanceAccounts.update(balanceAccountId, request);
const response: balancePlatform.BalanceAccount = await balancePlatformService.BalanceAccounts.update(balanceAccountId, request);
expect(response.status).toBe("active");
expect(response.timeZone).toBe("Europe/Amsterdam");
@@ -451,7 +451,7 @@ describe("Balance Platform", (): void => {
]
});
const response: models.PaginatedPaymentInstrumentsResponse = await balancePlatform.BalanceAccounts.listPaymentInstruments(balanceAccountId, {
const response: balancePlatform.PaginatedPaymentInstrumentsResponse = await balancePlatformService.BalanceAccounts.listPaymentInstruments(balanceAccountId, {
params: {
limit: "3",
offset: "6",
@@ -471,7 +471,7 @@ describe("Balance Platform", (): void => {
"status": "Active"
});
const response: models.BalancePlatform = await balancePlatform.General.retrieve(balanceAccountId);
const response: balancePlatform.BalancePlatform = await balancePlatformService.General.retrieve(balanceAccountId);
expect(response.id).toBe(balanceAccountId);
expect(response.status).toBe("Active");
@@ -514,7 +514,7 @@ describe("Balance Platform", (): void => {
"hasPrevious": "false"
});
const response: models.PaginatedAccountHoldersResponse = await balancePlatform.General.listAccountHolders(balanceAccountId);
const response: balancePlatform.PaginatedAccountHoldersResponse = await balancePlatformService.General.listAccountHolders(balanceAccountId);
expect(response.accountHolders.length).toBe(2);
expect(response.accountHolders[0].id).toBe("AH32272223222B59DDWSCCMP7");
@@ -545,13 +545,13 @@ describe("Balance Platform", (): void => {
},
"id": paymentInstrumentId
});
const request: models.PaymentInstrumentInfo = {
"type": models.PaymentInstrumentInfo.TypeEnum.Card,
const request: balancePlatform.PaymentInstrumentInfo = {
"type": balancePlatform.PaymentInstrumentInfo.TypeEnum.Card,
"issuingCountryCode": "NL",
"balanceAccountId": balanceAccountId,
"status": models.PaymentInstrumentInfo.StatusEnum.Inactive,
"status": balancePlatform.PaymentInstrumentInfo.StatusEnum.Inactive,
"card": {
"formFactor": models.CardInfo.FormFactorEnum.Physical,
"formFactor": balancePlatform.CardInfo.FormFactorEnum.Physical,
"brand": "mc",
"brandVariant": "mcdebit",
"cardholderName": "Sam Hopper",
@@ -576,7 +576,7 @@ describe("Balance Platform", (): void => {
"description": "S.Hopper - Main card"
};
const response: models.PaymentInstrument = await balancePlatform.PaymentInstruments.create(request);
const response: balancePlatform.PaymentInstrument = await balancePlatformService.PaymentInstruments.create(request);
expect(response.id).toBe(paymentInstrumentId);
expect(response.balanceAccountId).toBe(balanceAccountId);
@@ -606,7 +606,7 @@ describe("Balance Platform", (): void => {
"id": paymentInstrumentId
});
const response: models.PaymentInstrument = await balancePlatform.PaymentInstruments.retrieve(paymentInstrumentId);
const response: balancePlatform.PaymentInstrument = await balancePlatformService.PaymentInstruments.retrieve(paymentInstrumentId);
expect(response.id).toBe(paymentInstrumentId);
expect(response.status).toBe("active");
@@ -635,11 +635,11 @@ describe("Balance Platform", (): void => {
},
"id": paymentInstrumentId
});
const request: models.PaymentInstrumentUpdateRequest = {
const request: balancePlatform.PaymentInstrumentUpdateRequest = {
"balanceAccountId": "BA32272223222B5CM82WL892M"
};
const response: models.PaymentInstrument = await balancePlatform.PaymentInstruments.update(paymentInstrumentId, request);
const response: balancePlatform.PaymentInstrument = await balancePlatformService.PaymentInstruments.update(paymentInstrumentId, request);
expect(response.id).toBe(paymentInstrumentId);
expect(response.balanceAccountId).toBe("BA32272223222B5CM82WL892M");
@@ -681,7 +681,7 @@ describe("Balance Platform", (): void => {
]
});
const response: models.TransactionRulesResponse = await balancePlatform.PaymentInstruments.listTransactionRules(paymentInstrumentId);
const response: balancePlatform.TransactionRulesResponse = await balancePlatformService.PaymentInstruments.listTransactionRules(paymentInstrumentId);
expect(response.transactionRules!.length).toBe(2);
expect(response.transactionRules![0].id).toBe("TR32272223222B5CMDGMC9F4F");
@@ -696,12 +696,12 @@ describe("Balance Platform", (): void => {
"txVariant": "mc",
"id": paymentInstrumentGroupId
});
const request: models.PaymentInstrumentGroupInfo = {
const request: balancePlatform.PaymentInstrumentGroupInfo = {
"balancePlatform": "YOUR_BALANCE_PLATFORM",
"txVariant": "mc"
};
const response: models.PaymentInstrumentGroup = await balancePlatform.PaymentInstrumentGroups.create(request);
const response: balancePlatform.PaymentInstrumentGroup = await balancePlatformService.PaymentInstrumentGroups.create(request);
expect(response.id).toBe(paymentInstrumentGroupId);
expect(response.txVariant).toBe("mc");
@@ -715,7 +715,7 @@ describe("Balance Platform", (): void => {
"id": paymentInstrumentGroupId
});
const response: models.PaymentInstrumentGroup = await balancePlatform.PaymentInstrumentGroups.retrieve(paymentInstrumentGroupId);
const response: balancePlatform.PaymentInstrumentGroup = await balancePlatformService.PaymentInstrumentGroups.retrieve(paymentInstrumentGroupId);
expect(response.id).toBe(paymentInstrumentGroupId);
expect(response.txVariant).toBe("mc");
@@ -757,7 +757,7 @@ describe("Balance Platform", (): void => {
]
});
const response: models.TransactionRulesResponse = await balancePlatform.PaymentInstrumentGroups.listTransactionRules(paymentInstrumentGroupId);
const response: balancePlatform.TransactionRulesResponse = await balancePlatformService.PaymentInstrumentGroups.listTransactionRules(paymentInstrumentGroupId);
expect(response.transactionRules!.length).toBe(2);
expect(response.transactionRules![0].id).toBe("TR32272223222B5CMDGMC9F4F");
@@ -793,29 +793,29 @@ describe("Balance Platform", (): void => {
"type": "blockList",
"id": transactionRuleId
});
const request: models.TransactionRuleInfo = {
const request: balancePlatform.TransactionRuleInfo = {
"description": "Allow only point-of-sale transactions",
"reference": "YOUR_REFERENCE_4F7346",
"entityKey": {
"entityType": "paymentInstrument",
"entityReference": "PI3227C223222B5BPCMFXD2XG"
},
"status": models.TransactionRuleInfo.StatusEnum.Active,
"status": balancePlatform.TransactionRuleInfo.StatusEnum.Active,
"interval": {
"type": models.TransactionRuleInterval.TypeEnum.PerTransaction
"type": balancePlatform.TransactionRuleInterval.TypeEnum.PerTransaction
},
"ruleRestrictions": {
"processingTypes": {
"operation": "noneMatch",
"value": [
models.ProcessingTypesRestriction.ValueEnum.Pos
balancePlatform.ProcessingTypesRestriction.ValueEnum.Pos
]
}
},
"type": models.TransactionRuleInfo.TypeEnum.BlockList
"type": balancePlatform.TransactionRuleInfo.TypeEnum.BlockList
};
const response: models.TransactionRule = await balancePlatform.TransactionRules.create(request);
const response: balancePlatform.TransactionRule = await balancePlatformService.TransactionRules.create(request);
expect(response.id).toBe(transactionRuleId);
expect(response.status).toBe("active");
@@ -839,7 +839,7 @@ describe("Balance Platform", (): void => {
}
});
const response: models.TransactionRuleResponse = await balancePlatform.TransactionRules.retrieve(transactionRuleId);
const response: balancePlatform.TransactionRuleResponse = await balancePlatformService.TransactionRules.retrieve(transactionRuleId);
expect(response.transactionRule!.id).toBe(transactionRuleId);
expect(response.transactionRule!.type).toBe("velocity");
@@ -859,10 +859,10 @@ describe("Balance Platform", (): void => {
"id": transactionRuleId
});
const request: TransactionRuleInfoUpdate = {
"status": models.TransactionRuleInfo.StatusEnum.Inactive
"status": balancePlatform.TransactionRuleInfo.StatusEnum.Inactive
};
const response: models.TransactionRule = await balancePlatform.TransactionRules.update(transactionRuleId, request);
const response: balancePlatform.TransactionRule = await balancePlatformService.TransactionRules.update(transactionRuleId, request);
expect(response.status).toBe("inactive");
expect(response.reference).toBe("myRule12345");
@@ -886,7 +886,7 @@ describe("Balance Platform", (): void => {
"id": transactionRuleId
});
const response: models.TransactionRule = await balancePlatform.TransactionRules.delete(transactionRuleId);
const response: balancePlatform.TransactionRule = await balancePlatformService.TransactionRules.delete(transactionRuleId);
expect(response.id).toBe(transactionRuleId);
});

View File

@@ -3,11 +3,7 @@ import { createClient } from "../__mocks__/base";
import BinLookup from "../services/binLookup";
import Client from "../client";
import HttpClientException from "../httpClient/httpClientException";
import {
ThreeDSAvailabilityRequest,
ThreeDSAvailabilityResponse,
CostEstimateRequest,
} from "../typings/binlookup/models";
import { binlookup } from "../typings";
const threeDSAvailabilitySuccess = {
binDetails: {
@@ -19,7 +15,7 @@ const threeDSAvailabilitySuccess = {
};
let client: Client;
let binLookup: BinLookup;
let binLookupService: BinLookup;
let scope: nock.Scope;
beforeEach((): void => {
@@ -27,7 +23,7 @@ beforeEach((): void => {
nock.activate();
}
client = createClient();
binLookup = new BinLookup(client);
binLookupService = new BinLookup(client);
scope = nock(`${client.config.endpoint}${Client.BIN_LOOKUP_PAL_SUFFIX}${Client.BIN_LOOKUP_API_VERSION}`);
});
@@ -37,7 +33,7 @@ afterEach((): void => {
describe("Bin Lookup", function (): void {
test("should succeed on get 3ds availability", async function (): Promise<void> {
const threeDSAvailabilityRequest: ThreeDSAvailabilityRequest = {
const threeDSAvailabilityRequest: binlookup.ThreeDSAvailabilityRequest = {
merchantAccount: process.env.ADYEN_MERCHANT!,
brands: ["randomBrand"],
cardNumber: "4111111111111111"
@@ -46,13 +42,12 @@ describe("Bin Lookup", function (): void {
scope.post("/get3dsAvailability")
.reply(200, threeDSAvailabilitySuccess);
const response = await binLookup.get3dsAvailability(threeDSAvailabilityRequest);
const response = await binLookupService.get3dsAvailability(threeDSAvailabilityRequest);
expect(response).toEqual<ThreeDSAvailabilityResponse>(threeDSAvailabilitySuccess);
expect(response).toEqual< binlookup.ThreeDSAvailabilityResponse>(threeDSAvailabilitySuccess);
});
test.each([false, true])("should fail with invalid merchant. isMock: %p", async function (isMock): Promise<void> {
!isMock && nock.restore();
test("should fail with invalid merchant", async function (): Promise<void> {
const threeDSAvailabilityRequest: { [key: string]: undefined|string|[] } = {
merchantAccount: undefined,
cardNumber: "4111111111111",
@@ -63,15 +58,14 @@ describe("Bin Lookup", function (): void {
.reply(403, JSON.stringify({status: 403, message: "fail", errorCode: "171"}));
try {
await binLookup.get3dsAvailability(threeDSAvailabilityRequest as unknown as ThreeDSAvailabilityRequest);
await binLookupService.get3dsAvailability(threeDSAvailabilityRequest as unknown as binlookup.ThreeDSAvailabilityRequest);
fail("Expected request to fail");
} catch (e) {
expect(e instanceof HttpClientException).toBeTruthy();
}
});
test.each([false, true])("should succeed on get cost estimate. isMock: %p", async function (isMock): Promise<void> {
!isMock && nock.restore();
test("should succeed on get cost estimate", async function (): Promise<void> {
const expected = {
cardBin: {
bin: "",
@@ -89,7 +83,7 @@ describe("Bin Lookup", function (): void {
resultCode: "Unsupported",
surchargeType: "ZERO"
};
const costEstimateRequest: CostEstimateRequest = {
const costEstimateRequest: binlookup.CostEstimateRequest = {
amount: { currency: "EUR", value: 1000 },
assumptions: {
assumeLevel3Data: true,
@@ -102,13 +96,13 @@ describe("Bin Lookup", function (): void {
mcc: "7411",
enrolledIn3DSecure: true
},
shopperInteraction: CostEstimateRequest.ShopperInteractionEnum.Ecommerce,
shopperInteraction: binlookup.CostEstimateRequest.ShopperInteractionEnum.Ecommerce,
};
scope.post("/getCostEstimate")
.reply(200, expected);
const response = await binLookup.getCostEstimate(costEstimateRequest);
const response = await binLookupService.getCostEstimate(costEstimateRequest);
expect(response).toEqual(expected);
});

View File

@@ -1,22 +1,3 @@
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
* Adyen NodeJS API Library
* Copyright (c) 2020 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
/* eslint-disable @typescript-eslint/naming-convention */
import checkServerIdentity from "../helpers/checkServerIdentity";
import { PeerCertificate } from "tls";

View File

@@ -11,41 +11,19 @@ import {sessionsSuccess} from "../__mocks__/checkout/sessionsSuccess";
import Client from "../client";
import Checkout from "../services/checkout";
import HttpClientException from "../httpClient/httpClientException";
import {
Amount,
CardDetails,
CheckoutBalanceCheckRequest,
CheckoutBalanceCheckResponse,
CheckoutCancelOrderResponse,
CheckoutCreateOrderRequest,
CheckoutCreateOrderResponse,
CheckoutUtilityRequest,
CreatePaymentLinkRequest,
DetailsRequest,
PaymentLinkResponse,
PaymentMethodsRequest,
PaymentRequest,
PaymentResponse,
PaymentSetupRequest,
PaymentVerificationRequest,
CreateCheckoutSessionRequest,
CreateCheckoutSessionResponse,
CardDetailsRequest,
CardDetailsResponse
} from "../typings/checkout/models";
import { checkout } from "../typings";
const merchantAccount = process.env.ADYEN_MERCHANT!;
const reference = "Your order number";
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
function createAmountObject(currency: string, value: number): Amount {
function createAmountObject(currency: string, value: number): checkout.Amount {
return {
currency,
value,
};
}
function createPaymentsDetailsRequest(): DetailsRequest {
function createPaymentsDetailsRequest(): checkout.DetailsRequest {
return {
details: {
mD: "mdValue",
@@ -55,9 +33,9 @@ function createPaymentsDetailsRequest(): DetailsRequest {
};
}
export function createPaymentsCheckoutRequest(): PaymentRequest {
export function createPaymentsCheckoutRequest(): checkout.PaymentRequest {
const paymentMethodDetails = {
type: CardDetails.TypeEnum.Scheme,
type: checkout.CardDetails.TypeEnum.Scheme,
encryptedCardNumber: "test_4111111111111111",
encryptedExpiryMonth: "test_03",
encryptedExpiryYear: "test_2030",
@@ -75,18 +53,18 @@ export function createPaymentsCheckoutRequest(): PaymentRequest {
};
}
function createPaymentSessionRequest(): PaymentSetupRequest {
function createPaymentSessionRequest(): checkout.PaymentSetupRequest {
return {
amount: createAmountObject("USD", 1000),
countryCode: "NL",
merchantAccount,
reference,
returnUrl: "https://your-company.com/...",
channel: PaymentSetupRequest.ChannelEnum.Web,
channel: checkout.PaymentSetupRequest.ChannelEnum.Web,
sdkVersion: "3.7.0"
};
}
function getPaymentLinkSuccess(expiresAt: string): PaymentLinkResponse {
function getPaymentLinkSuccess(expiresAt: string): checkout.PaymentLinkResponse {
return {
amount: createAmountObject("USD", 1000),
expiresAt,
@@ -94,11 +72,11 @@ function getPaymentLinkSuccess(expiresAt: string): PaymentLinkResponse {
url: "PaymentLinkResponse.url",
id: "mocked_id",
merchantAccount,
status: PaymentLinkResponse.StatusEnum.Active
status: checkout.PaymentLinkResponse.StatusEnum.Active
};
}
function createPaymentLinkRequest(): CreatePaymentLinkRequest {
function createPaymentLinkRequest(): checkout.CreatePaymentLinkRequest {
return {
allowedPaymentMethods: ["scheme", "boletobancario"],
amount: createAmountObject("USD", 1000),
@@ -127,7 +105,7 @@ function createPaymentLinkRequest(): CreatePaymentLinkRequest {
};
}
function createSessionRequest(): CreateCheckoutSessionRequest {
function createSessionRequest(): checkout.CreateCheckoutSessionRequest {
return {
amount: createAmountObject("USD", 1000),
countryCode: "NL",
@@ -138,7 +116,7 @@ function createSessionRequest(): CreateCheckoutSessionRequest {
}
let client: Client;
let checkout: Checkout;
let checkoutService: Checkout;
let scope: nock.Scope;
beforeEach((): void => {
@@ -147,7 +125,7 @@ beforeEach((): void => {
}
client = createClient();
scope = nock(`${client.config.checkoutEndpoint}/${Client.CHECKOUT_API_VERSION}`);
checkout = new Checkout(client);
checkoutService = new Checkout(client);
});
afterEach(() => {
@@ -156,55 +134,55 @@ afterEach(() => {
describe("Checkout", (): void => {
test("should add idempotency key to request headers", async (): Promise<void> => {
const paymentsRequest: PaymentRequest = createPaymentsCheckoutRequest();
const paymentsRequest: checkout.PaymentRequest = createPaymentsCheckoutRequest();
scope.post("/payments")
.reply(200, paymentsSuccess)
.matchHeader("Idempotency-Key", "testKey");
await checkout.payments(paymentsRequest, {idempotencyKey: "testKey"});
await checkoutService.payments(paymentsRequest, {idempotencyKey: "testKey"});
const paymentMethodsRequest: PaymentMethodsRequest = {merchantAccount};
const paymentMethodsRequest: checkout.PaymentMethodsRequest = {merchantAccount};
scope.post("/paymentMethods")
.reply(200, paymentMethodsSuccess)
.matchHeader("Idempotency-Key", "testKey");
await checkout.paymentMethods(paymentMethodsRequest, {idempotencyKey: "testKey"});
await checkoutService.paymentMethods(paymentMethodsRequest, {idempotencyKey: "testKey"});
const expiresAt = "2019-12-17T10:05:29Z";
const paymentLinkSuccess: PaymentLinkResponse = getPaymentLinkSuccess(expiresAt);
const paymentLinkSuccess: checkout.PaymentLinkResponse = getPaymentLinkSuccess(expiresAt);
scope.post("/paymentLinks")
.reply(200, paymentLinkSuccess)
.matchHeader("Idempotency-Key", "testKey");
await checkout.paymentLinks(createPaymentLinkRequest(), {idempotencyKey: "testKey"});
await checkoutService.paymentLinks(createPaymentLinkRequest(), {idempotencyKey: "testKey"});
scope.patch("/paymentLinks/321")
.reply(200, { ...paymentLinkSuccess, status: "expired" })
.matchHeader("Idempotency-Key", "testKey");
await checkout.updatePaymentLinks("321", "expired", {idempotencyKey: "testKey"});
await checkoutService.updatePaymentLinks("321", "expired", {idempotencyKey: "testKey"});
scope.get("/paymentLinks/123")
.reply(200, paymentLinkSuccess)
.matchHeader("Idempotency-Key", "testKey");
await checkout.getPaymentLinks("123", {idempotencyKey: "testKey"});
await checkoutService.getPaymentLinks("123", {idempotencyKey: "testKey"});
scope.post("/payments/details")
.reply(200, paymentDetailsSuccess)
.matchHeader("Idempotency-Key", "testKey");
await checkout.paymentsDetails(createPaymentsDetailsRequest(), {idempotencyKey: "testKey"});
await checkoutService.paymentsDetails(createPaymentsDetailsRequest(), {idempotencyKey: "testKey"});
scope.post("/paymentSession")
.reply(200, paymentSessionSuccess)
.matchHeader("Idempotency-Key", "testKey");
const paymentSessionRequest: PaymentSetupRequest = createPaymentSessionRequest();
await checkout.paymentSession(paymentSessionRequest, {idempotencyKey: "testKey"});
const paymentSessionRequest: checkout.PaymentSetupRequest = createPaymentSessionRequest();
await checkoutService.paymentSession(paymentSessionRequest, {idempotencyKey: "testKey"});
scope.post("/payments/result")
.reply(200, paymentsResultSuccess)
.matchHeader("Idempotency-Key", "testKey");
const paymentResultRequest: PaymentVerificationRequest = {
const paymentResultRequest: checkout.PaymentVerificationRequest = {
payload: "This is a test payload",
};
await checkout.paymentResult(paymentResultRequest, {idempotencyKey: "testKey"});
await checkoutService.paymentResult(paymentResultRequest, {idempotencyKey: "testKey"});
const orderRequest: CheckoutCreateOrderRequest = {
const orderRequest: checkout.CheckoutCreateOrderRequest = {
amount: createAmountObject("USD", 1000),
merchantAccount,
reference
@@ -212,12 +190,12 @@ describe("Checkout", (): void => {
scope.post("/orders")
.reply(200, {})
.matchHeader("Idempotency-Key", "testKey");
await checkout.orders(orderRequest, {idempotencyKey: "testKey"});
await checkoutService.orders(orderRequest, {idempotencyKey: "testKey"});
scope.post("/orders/cancel")
.reply(200, {})
.matchHeader("Idempotency-Key", "testKey");
await checkout.ordersCancel({
await checkoutService.ordersCancel({
order: {
orderData: "mock_data",
pspReference: "mock_pspref"
@@ -229,43 +207,52 @@ describe("Checkout", (): void => {
.reply(200, sessionsSuccess)
.matchHeader("Idempotency-Key", "testKey");
const sessionsRequest: CreateCheckoutSessionRequest = createSessionRequest();
await checkout.sessions(sessionsRequest, {idempotencyKey: "testKey"});
const sessionsRequest: checkout.CreateCheckoutSessionRequest = createSessionRequest();
await checkoutService.sessions(sessionsRequest, {idempotencyKey: "testKey"});
});
test.each([false, true])("should make a payment. isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should make a payment.", async (): Promise<void> => {
scope.post("/payments")
.reply(200, paymentsSuccess);
const paymentsRequest: PaymentRequest = createPaymentsCheckoutRequest();
const paymentsResponse: PaymentResponse = await checkout.payments(paymentsRequest);
const paymentsRequest: checkout.PaymentRequest = createPaymentsCheckoutRequest();
const paymentsResponse: checkout.PaymentResponse = await checkoutService.payments(paymentsRequest);
expect(paymentsResponse.pspReference).toBeTruthy();
});
test.each([false, true])("should return correct Exception, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("Should properly handle error responses from API", async (): Promise<void> => {
try {
scope.post("/payments")
.reply(401);
.reply(422, {
"status": 422,
"errorCode": "200",
"message": "Field 'countryCode' is not valid.",
"errorType": "validation",
"pspReference": "DMB552CV6JHKGK82",
});
const paymentsRequest: PaymentRequest = createPaymentsCheckoutRequest();
await checkout.payments(paymentsRequest);
} catch (e) {
expect(e instanceof HttpClientException).toBeTruthy();
const paymentsRequest: checkout.PaymentRequest = createPaymentsCheckoutRequest();
await checkoutService.payments(paymentsRequest);
fail("No exception was thrown");
} catch (error) {
expect(error instanceof HttpClientException).toBeTruthy();
if(error instanceof HttpClientException && error.responseBody) {
expect(JSON.parse(error.responseBody).errorType).toBe("validation");
} else {
fail("Error did not contain the expected data");
}
}
});
test.each([false, true])("should have valid payment methods, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
const paymentMethodsRequest: PaymentMethodsRequest = {merchantAccount};
test("should have valid payment methods", async (): Promise<void> => {
const paymentMethodsRequest: checkout.PaymentMethodsRequest = {merchantAccount};
scope.post("/paymentMethods")
.reply(200, paymentMethodsSuccess);
const paymentMethodsResponse = await checkout.paymentMethods(paymentMethodsRequest);
const paymentMethodsResponse = await checkoutService.paymentMethods(paymentMethodsRequest);
if (paymentMethodsResponse && paymentMethodsResponse.paymentMethods) {
expect(paymentMethodsResponse.paymentMethods.length).toBeGreaterThan(0);
} else {
@@ -273,76 +260,69 @@ describe("Checkout", (): void => {
}
});
test.each([false, true])("should have valid payment link, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should have valid payment link", async (): Promise<void> => {
const expiresAt = "2019-12-17T10:05:29Z";
const paymentLinkSuccess: PaymentLinkResponse = getPaymentLinkSuccess(expiresAt);
const paymentLinkSuccess: checkout.PaymentLinkResponse = getPaymentLinkSuccess(expiresAt);
scope.post("/paymentLinks").reply(200, paymentLinkSuccess);
const paymentSuccessLinkResponse = await checkout.paymentLinks(createPaymentLinkRequest());
const paymentSuccessLinkResponse = await checkoutService.paymentLinks(createPaymentLinkRequest());
expect(paymentSuccessLinkResponse).toBeTruthy();
});
test.each([isCI, true])("should get payment link, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should get payment link", async (): Promise<void> => {
const expiresAt = "2019-12-17T10:05:29Z";
const paymentLinkSuccess: PaymentLinkResponse = getPaymentLinkSuccess(expiresAt);
const paymentLinkSuccess: checkout.PaymentLinkResponse = getPaymentLinkSuccess(expiresAt);
scope.post("/paymentLinks").reply(200, paymentLinkSuccess);
const paymentSuccessLinkResponse = await checkout.paymentLinks(createPaymentLinkRequest());
const paymentSuccessLinkResponse = await checkoutService.paymentLinks(createPaymentLinkRequest());
scope.get(`/paymentLinks/${paymentSuccessLinkResponse.id}`).reply(200, paymentLinkSuccess);
const paymentLink = await checkout.getPaymentLinks(paymentSuccessLinkResponse.id);
const paymentLink = await checkoutService.getPaymentLinks(paymentSuccessLinkResponse.id);
expect(paymentLink).toBeTruthy();
});
test.each([isCI, true])("should patch payment link, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should patch payment link", async (): Promise<void> => {
const expiresAt = "2019-12-17T10:05:29Z";
const paymentLinkSuccess: PaymentLinkResponse = getPaymentLinkSuccess(expiresAt);
const paymentLinkSuccess: checkout.PaymentLinkResponse = getPaymentLinkSuccess(expiresAt);
scope.post("/paymentLinks").reply(200, paymentLinkSuccess);
const paymentSuccessLinkResponse = await checkout.paymentLinks(createPaymentLinkRequest());
const paymentSuccessLinkResponse = await checkoutService.paymentLinks(createPaymentLinkRequest());
scope.patch(`/paymentLinks/${paymentSuccessLinkResponse.id}`).reply(200, { ...paymentLinkSuccess, status: "expired" });
const paymentLink = await checkout.updatePaymentLinks(paymentSuccessLinkResponse.id, "expired");
const paymentLink = await checkoutService.updatePaymentLinks(paymentSuccessLinkResponse.id, "expired");
expect(paymentLink.status).toEqual("expired");
});
test.each([isCI, true])("should have payment details, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should have payment details", async (): Promise<void> => {
scope.post("/payments/details")
.reply(200, paymentDetailsSuccess);
const paymentsResponse = await checkout.paymentsDetails(createPaymentsDetailsRequest());
const paymentsResponse = await checkoutService.paymentsDetails(createPaymentsDetailsRequest());
expect(paymentsResponse.resultCode).toEqual("Authorised");
});
test.each([false, true])("should have payment session success, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should have payment session success", async (): Promise<void> => {
scope.post("/paymentSession")
.reply(200, paymentSessionSuccess);
const paymentSessionRequest: PaymentSetupRequest = createPaymentSessionRequest();
const paymentSessionResponse = await checkout.paymentSession(paymentSessionRequest);
const paymentSessionRequest: checkout.PaymentSetupRequest = createPaymentSessionRequest();
const paymentSessionResponse = await checkoutService.paymentSession(paymentSessionRequest);
expect(paymentSessionResponse.paymentSession).not.toBeUndefined();
});
test.each([isCI, true])("should have payments result, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should have payments result", async (): Promise<void> => {
scope.post("/payments/result")
.reply(200, paymentsResultSuccess);
const paymentResultRequest: PaymentVerificationRequest = {
const paymentResultRequest: checkout.PaymentVerificationRequest = {
payload: "This is a test payload",
};
const paymentResultResponse = await checkout.paymentResult(paymentResultRequest);
const paymentResultResponse = await checkoutService.paymentResult(paymentResultRequest);
expect(paymentResultResponse.resultCode).toEqual("Authorised");
});
test.each([false, true])("should have missing identifier on live, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should have missing identifier on live", async (): Promise<void> => {
client.setEnvironment("LIVE");
try {
new Checkout(client);
@@ -358,22 +338,20 @@ describe("Checkout", (): void => {
});
test.each([false, true])("should succeed on multibanco payment, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should succeed on multibanco payment", async (): Promise<void> => {
scope.post("/payments")
.reply(200, paymentsResultMultibancoSuccess);
const paymentsRequest: PaymentRequest = createPaymentsCheckoutRequest();
const paymentsResponse: PaymentResponse = await checkout.payments(paymentsRequest);
const paymentsRequest: checkout.PaymentRequest = createPaymentsCheckoutRequest();
const paymentsResponse: checkout.PaymentResponse = await checkoutService.payments(paymentsRequest);
expect(paymentsResponse.pspReference).toBeTruthy();
expect(paymentsResponse.additionalData).toBeTruthy();
});
test.each([false, true])("should get origin keys. isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should get origin keys", async (): Promise<void> => {
const checkoutUtility = new Checkout(client);
const originKeysRequest: CheckoutUtilityRequest = {
const originKeysRequest: checkout.CheckoutUtilityRequest = {
originDomains: ["https://www.your-domain.com"],
};
@@ -389,78 +367,75 @@ describe("Checkout", (): void => {
});
// TODO: add gift card to PaymentMethod and unmock test
test.each([true, true])("should get payment methods balance", async (isMock): Promise<void> => {
!isMock && nock.restore();
const paymentMethodsRequest: CheckoutBalanceCheckRequest = {
test("should get payment methods balance", async (): Promise<void> => {
const paymentMethodsRequest: checkout.CheckoutBalanceCheckRequest = {
merchantAccount,
amount: createAmountObject("USD", 1000),
paymentMethod: { },
reference: "mocked_reference"
};
const paymentMethodsBalanceResponse: CheckoutBalanceCheckResponse = {
const paymentMethodsBalanceResponse: checkout.CheckoutBalanceCheckResponse = {
balance: {currency: "USD", value: 1000},
resultCode: CheckoutBalanceCheckResponse.ResultCodeEnum.Success
resultCode: checkout.CheckoutBalanceCheckResponse.ResultCodeEnum.Success
};
scope.post("/paymentMethods/balance")
.reply(200, paymentMethodsBalanceResponse);
const paymentsResponse: CheckoutBalanceCheckResponse = await checkout.paymentMethodsBalance(paymentMethodsRequest);
const paymentsResponse: checkout.CheckoutBalanceCheckResponse = await checkoutService.paymentMethodsBalance(paymentMethodsRequest);
expect(paymentsResponse.balance.value).toEqual(1000);
});
test.each([false, true])("should create order", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should create order", async (): Promise<void> => {
const expiresAt = "2019-12-17T10:05:29Z";
const orderRequest: CheckoutCreateOrderRequest = {
const orderRequest: checkout.CheckoutCreateOrderRequest = {
amount: createAmountObject("USD", 1000),
merchantAccount,
reference
};
const orderResponse: CheckoutCreateOrderResponse = {
const orderResponse: checkout.CheckoutCreateOrderResponse = {
expiresAt,
amount: createAmountObject("USD", 500),
orderData: "mocked_order_data",
remainingAmount: {currency: "USD", value: 500} ,
resultCode: CheckoutCreateOrderResponse.ResultCodeEnum.Success
resultCode: checkout.CheckoutCreateOrderResponse.ResultCodeEnum.Success
};
scope.post("/orders")
.reply(200, orderResponse);
const response: CheckoutCreateOrderResponse = await checkout.orders(orderRequest);
const response: checkout.CheckoutCreateOrderResponse = await checkoutService.orders(orderRequest);
expect(response).toBeTruthy();
});
test.each([false, true])("should cancel order", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should cancel order", async (): Promise<void> => {
const expiresAt = "2019-12-17T10:05:29Z";
const orderRequest: CheckoutCreateOrderRequest = {
const orderRequest: checkout.CheckoutCreateOrderRequest = {
amount: createAmountObject("USD", 1000),
merchantAccount,
reference
};
const orderResponse: CheckoutCreateOrderResponse = {
const orderResponse: checkout.CheckoutCreateOrderResponse = {
expiresAt,
amount: createAmountObject("USD", 500),
orderData: "mocked_order_data",
remainingAmount: {currency: "USD", value: 500},
resultCode: CheckoutCreateOrderResponse.ResultCodeEnum.Success
resultCode: checkout.CheckoutCreateOrderResponse.ResultCodeEnum.Success
};
scope.post("/orders")
.reply(200, orderResponse);
const createOrderResponse: CheckoutCreateOrderResponse = await checkout.orders(orderRequest);
const createOrderResponse: checkout.CheckoutCreateOrderResponse = await checkoutService.orders(orderRequest);
const orderCancelResponse: CheckoutCancelOrderResponse = {
const orderCancelResponse: checkout.CheckoutCancelOrderResponse = {
pspReference: "mocked_psp_ref",
resultCode: CheckoutCancelOrderResponse.ResultCodeEnum.Received
resultCode: checkout.CheckoutCancelOrderResponse.ResultCodeEnum.Received
};
scope.post("/orders/cancel")
.reply(200, orderCancelResponse);
const response: CheckoutCancelOrderResponse = await checkout.ordersCancel({
const response: checkout.CheckoutCancelOrderResponse = await checkoutService.ordersCancel({
order: {
orderData: createOrderResponse.orderData,
pspReference: createOrderResponse.pspReference!
@@ -470,13 +445,12 @@ describe("Checkout", (): void => {
expect(response).toBeTruthy();
});
test.each([false, true])("should create a session. isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should create a session.", async (): Promise<void> => {
scope.post("/sessions")
.reply(200, sessionsSuccess);
const sessionsRequest: CreateCheckoutSessionRequest = createSessionRequest();
const sessionsResponse: CreateCheckoutSessionResponse = await checkout.sessions(sessionsRequest);
const sessionsRequest: checkout.CreateCheckoutSessionRequest = createSessionRequest();
const sessionsResponse: checkout.CreateCheckoutSessionResponse = await checkoutService.sessions(sessionsRequest);
expect(sessionsResponse.sessionData).toBeTruthy();
expect(sessionsResponse.expiresAt).toBeInstanceOf(Date);
expect(sessionsResponse.expiresAt.getFullYear()).toBeGreaterThan(0);
@@ -493,11 +467,11 @@ describe("Checkout", (): void => {
]
});
const cardDetailsRequest: CardDetailsRequest = {
const cardDetailsRequest: checkout.CardDetailsRequest = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"cardNumber": "411111"
};
const cardDetailsReponse: CardDetailsResponse = await checkout.cardDetails(cardDetailsRequest);
const cardDetailsReponse: checkout.CardDetailsResponse = await checkoutService.cardDetails(cardDetailsRequest);
expect(cardDetailsReponse?.brands?.length).toBe(1);
});
});

View File

@@ -2,23 +2,7 @@ import nock from "nock";
import {createClient} from "../__mocks__/base";
import Client from "../client";
import ClassicIntegration from "../services/classicIntegration";
import { PaymentRequest } from "../typings/payments/paymentRequest";
import { PaymentResult } from "../typings/payments/paymentResult";
import { PaymentRequest3d } from "../typings/payments/paymentRequest3d";
import { PaymentRequest3ds2 } from "../typings/payments/paymentRequest3ds2";
import { AuthenticationResultRequest } from "../typings/payments/authenticationResultRequest";
import { AuthenticationResultResponse } from "../typings/payments/authenticationResultResponse";
import { ThreeDS2ResultRequest } from "../typings/payments/threeDS2ResultRequest";
import { ThreeDS2ResultResponse } from "../typings/payments/threeDS2ResultResponse";
import { ModificationResult } from "../typings/payments/modificationResult";
import { CaptureRequest } from "../typings/payments/captureRequest";
import { CancelRequest } from "../typings/payments/cancelRequest";
import { RefundRequest } from "../typings/payments/refundRequest";
import { CancelOrRefundRequest } from "../typings/payments/cancelOrRefundRequest";
import { TechnicalCancelRequest } from "../typings/payments/technicalCancelRequest";
import { AdjustAuthorisationRequest } from "../typings/payments/adjustAuthorisationRequest";
import { DonationRequest } from "../typings/payments/donationRequest";
import { VoidPendingRefundRequest } from "../typings/payments/voidPendingRefundRequest";
import { payments } from "../typings";
let client: Client;
let classicIntegration: ClassicIntegration;
@@ -50,7 +34,7 @@ describe("Classic Integration", (): void => {
"authCode": "011381"
}
);
const paymentRequest: PaymentRequest = {
const paymentRequest: payments.PaymentRequest = {
"card": {
"number": "4111111111111111",
"expiryMonth": "03",
@@ -66,7 +50,7 @@ describe("Classic Integration", (): void => {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};
const paymentResult: PaymentResult = await classicIntegration.authorise(paymentRequest);
const paymentResult: payments.PaymentResult = await classicIntegration.authorise(paymentRequest);
expect(paymentResult.pspReference).toEqual("JVBXGSDM53RZNN82");
});
@@ -82,14 +66,14 @@ describe("Classic Integration", (): void => {
"authCode": "011381"
}
);
const paymentRequest: PaymentRequest3d = {
const paymentRequest: payments.PaymentRequest3d = {
"md": "31h..........vOXek7w",
"paResponse": "eNqtmF........wGVA4Ch",
"shopperIP": "61.294.12.12",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};
const paymentResult: PaymentResult = await classicIntegration.authorise3d(paymentRequest);
const paymentResult: payments.PaymentResult = await classicIntegration.authorise3d(paymentRequest);
expect(paymentResult.pspReference).toEqual("JVBXGSDM53RZNN82");
});
@@ -105,7 +89,7 @@ describe("Classic Integration", (): void => {
"authCode": "011381"
}
);
const paymentRequest: PaymentRequest3ds2 = {
const paymentRequest: payments.PaymentRequest3ds2 = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"amount": {
"value": 1500,
@@ -119,7 +103,7 @@ describe("Classic Integration", (): void => {
"threeDS2Token": "— - BINARY DATA - -"
};
const paymentResult: PaymentResult = await classicIntegration.authorise3ds2(paymentRequest);
const paymentResult: payments.PaymentResult = await classicIntegration.authorise3ds2(paymentRequest);
expect(paymentResult.pspReference).toEqual("JVBXGSDM53RZNN82");
});
@@ -128,12 +112,12 @@ describe("Classic Integration", (): void => {
"threeDS2Result": { "authenticationValue": "THREEDS2RESULT"}
});
const getAuthenticationResultrequest: AuthenticationResultRequest = {
const getAuthenticationResultrequest: payments.AuthenticationResultRequest = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"pspReference": "9935272408535455"
};
const getAuthenticationResultResponse: AuthenticationResultResponse = await classicIntegration.getAuthenticationResult(getAuthenticationResultrequest);
const getAuthenticationResultResponse: payments.AuthenticationResultResponse = await classicIntegration.getAuthenticationResult(getAuthenticationResultrequest);
expect(getAuthenticationResultResponse?.threeDS2Result?.authenticationValue).toEqual("THREEDS2RESULT");
});
@@ -141,12 +125,12 @@ describe("Classic Integration", (): void => {
scope.post("/retrieve3ds2Result").reply(200, {
"threeDS2Result": { "authenticationValue": "THREEDS2RESULT"}
});
const retrieve3ds2ResultRequest: ThreeDS2ResultRequest = {
const retrieve3ds2ResultRequest: payments.ThreeDS2ResultRequest = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"pspReference": "9935272408535455"
};
const retrieve3ds2ResultResponse: ThreeDS2ResultResponse = await classicIntegration.retrieve3ds2Result(retrieve3ds2ResultRequest);
const retrieve3ds2ResultResponse: payments.ThreeDS2ResultResponse = await classicIntegration.retrieve3ds2Result(retrieve3ds2ResultRequest);
expect(retrieve3ds2ResultResponse?.threeDS2Result?.authenticationValue).toEqual("THREEDS2RESULT");
});
@@ -157,7 +141,7 @@ describe("Classic Integration", (): void => {
"response": "[capture-received]"
});
const modificationRequest: CaptureRequest = {
const modificationRequest: payments.CaptureRequest = {
"originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"modificationAmount": {
"value": 500,
@@ -167,8 +151,8 @@ describe("Classic Integration", (): void => {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};
const modificationResult: ModificationResult = await classicIntegration.capture(modificationRequest);
expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.CaptureReceived);
const modificationResult: payments.ModificationResult = await classicIntegration.capture(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.CaptureReceived);
});
test("Should succesfully send Cancel request", async (): Promise<void> => {
@@ -178,14 +162,14 @@ describe("Classic Integration", (): void => {
"response": "[cancel-received]"
});
const modificationRequest: CancelRequest = {
const modificationRequest: payments.CancelRequest = {
"originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"reference": "YourModificationReference",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};
const modificationResult: ModificationResult = await classicIntegration.cancel(modificationRequest);
expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.CancelReceived);
const modificationResult: payments.ModificationResult = await classicIntegration.cancel(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.CancelReceived);
});
test("Should succesfully send Refund request", async (): Promise<void> => {
@@ -195,7 +179,7 @@ describe("Classic Integration", (): void => {
"response": "[refund-received]"
});
const modificationRequest: RefundRequest = {
const modificationRequest: payments.RefundRequest = {
"originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"modificationAmount": {
"value": 500,
@@ -205,8 +189,8 @@ describe("Classic Integration", (): void => {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};
const modificationResult: ModificationResult = await classicIntegration.refund(modificationRequest);
expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.RefundReceived);
const modificationResult: payments.ModificationResult = await classicIntegration.refund(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.RefundReceived);
});
test("Should succesfully send CancelOrRefund request", async (): Promise<void> => {
@@ -216,14 +200,14 @@ describe("Classic Integration", (): void => {
"response": "[cancelOrRefund-received]"
});
const modificationRequest: CancelOrRefundRequest = {
const modificationRequest: payments.CancelOrRefundRequest = {
"originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"reference": "YourModificationReference",
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};
const modificationResult: ModificationResult = await classicIntegration.cancelOrRefund(modificationRequest);
expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.CancelOrRefundReceived);
const modificationResult: payments.ModificationResult = await classicIntegration.cancelOrRefund(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.CancelOrRefundReceived);
});
test("Should succesfully send TechnicalCancel request", async (): Promise<void> => {
@@ -233,7 +217,7 @@ describe("Classic Integration", (): void => {
"response": "[technical-cancel-received]"
});
const modificationRequest: TechnicalCancelRequest = {
const modificationRequest: payments.TechnicalCancelRequest = {
"originalMerchantReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"modificationAmount": {
"value": 500,
@@ -243,8 +227,8 @@ describe("Classic Integration", (): void => {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};
const modificationResult: ModificationResult = await classicIntegration.technicalCancel(modificationRequest);
expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.TechnicalCancelReceived);
const modificationResult: payments.ModificationResult = await classicIntegration.technicalCancel(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.TechnicalCancelReceived);
});
test("Should succesfully send AdjustAuthorisation request", async (): Promise<void> => {
@@ -254,7 +238,7 @@ describe("Classic Integration", (): void => {
"response": "[adjustAuthorisation-received]"
});
const modificationRequest: AdjustAuthorisationRequest = {
const modificationRequest: payments.AdjustAuthorisationRequest = {
"originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"modificationAmount": {
"value": 500,
@@ -264,8 +248,8 @@ describe("Classic Integration", (): void => {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};
const modificationResult: ModificationResult = await classicIntegration.adjustAuthorisation(modificationRequest);
expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.AdjustAuthorisationReceived);
const modificationResult: payments.ModificationResult = await classicIntegration.adjustAuthorisation(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.AdjustAuthorisationReceived);
});
test("Should succesfully send Donate request", async (): Promise<void> => {
@@ -275,7 +259,7 @@ describe("Classic Integration", (): void => {
"response": "[donation-received]"
});
const modificationRequest: DonationRequest = {
const modificationRequest: payments.DonationRequest = {
"originalReference": "COPY_PSP_REFERENCE_FROM_AUTHORISE_RESPONSE",
"modificationAmount": {
"value": 500,
@@ -286,8 +270,8 @@ describe("Classic Integration", (): void => {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT"
};
const modificationResult: ModificationResult = await classicIntegration.donate(modificationRequest);
expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.DonationReceived);
const modificationResult: payments.ModificationResult = await classicIntegration.donate(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.DonationReceived);
});
test("Should succesfully send VoidPendingRefund request", async (): Promise<void> => {
@@ -297,13 +281,13 @@ describe("Classic Integration", (): void => {
"response": "[voidPendingRefund-received]"
});
const modificationRequest: VoidPendingRefundRequest = {
const modificationRequest: payments.VoidPendingRefundRequest = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"tenderReference": "5Iw8001176969533005",
"uniqueTerminalId": "VX820-123456789"
};
const modificationResult: ModificationResult = await classicIntegration.voidPendingRefund(modificationRequest);
expect(modificationResult.response).toEqual(ModificationResult.ResponseEnum.VoidPendingRefundReceived);
const modificationResult: payments.ModificationResult = await classicIntegration.voidPendingRefund(modificationRequest);
expect(modificationResult.response).toEqual(payments.ModificationResult.ResponseEnum.VoidPendingRefundReceived);
});
});

View File

@@ -0,0 +1,11 @@
import Client from "../client";
describe("API Client", function (): void {
test("should be able to make a request using basic auth", async function (): Promise<void> {
new Client({
username: process.env.ADYEN_USER!,
password: process.env.ADYEN_PASSWORD!,
environment: "TEST"
});
});
});

View File

@@ -0,0 +1,59 @@
import nock from "nock";
import { createClient } from "../__mocks__/base";
import { DataProtection } from "../services";
import Client from "../client";
import HttpClientException from "../httpClient/httpClientException";
import { dataProtection } from "../typings";
let client: Client,
dataProtectionService: DataProtection,
scope: nock.Scope;
beforeEach((): void => {
if(!nock.isActive()) {
nock.activate();
}
client = createClient();
dataProtectionService = new DataProtection(client);
scope = nock(`${client.config.dataProtectionEndpoint}/${Client.DATA_PROTECTION_API_VERSION}`);
});
afterEach(() => {
nock.cleanAll();
});
describe("DataProtection", (): void => {
test("should make succesful subjectErasure call", async (): Promise<void> => {
const requestSubjectErasureSuccess: dataProtection.SubjectErasureResponse = {
"result": dataProtection.SubjectErasureResponse.ResultEnum.Success,
};
const requestSubjectErasureRequest: dataProtection.SubjectErasureByPspReferenceRequest = {
"merchantAccount": "MY_MERCHANT_ACCOUNT",
"forceErasure": true,
"pspReference": "0123456789"
};
scope.post("/requestSubjectErasure")
.reply(200, requestSubjectErasureSuccess);
const response: dataProtection.SubjectErasureResponse = await dataProtectionService.requestSubjectErasure(requestSubjectErasureRequest);
expect(response.result).toEqual(dataProtection.SubjectErasureResponse.ResultEnum.Success);
});
test("should return correct Exception", async (): Promise<void> => {
try {
scope.post("/requestSubjectErasure")
.reply(401);
const requestSubjectErasureRequest: dataProtection.SubjectErasureByPspReferenceRequest = {
"merchantAccount": "MY_MERCHANT_ACCOUNT",
"forceErasure": true,
"pspReference": "0123456789"
};
await dataProtectionService.requestSubjectErasure(requestSubjectErasureRequest);
} catch (e) {
expect(e instanceof HttpClientException).toBeTruthy();
}
});
});

View File

@@ -1,26 +1,7 @@
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
* Adyen NodeJS API Library
* Copyright (c) 2020 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
import HmacValidator from "../utils/hmacValidator";
import { AdditionalData, NotificationItem, NotificationRequestItem } from "../typings/notification/models";
import {NotificationItem, NotificationRequestItem } from "../typings/notification/models";
import { ApiConstants } from "../constants/apiConstants";
import NotificationRequest from "../notification/notificationRequest";
import NotificationRequestService from "../notification/notificationRequest";
const key = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00";
const expectedSign = "ZNBPtI+oDyyRrLyD1XirkKnQgIAlFc07Vj27TeHsDRE=";
@@ -40,7 +21,7 @@ const notificationRequestItem: { NotificationRequestItem: NotificationRequestIte
additionalData: { [ApiConstants.HMAC_SIGNATURE]: expectedSign },
}
};
const notification = new NotificationRequest({
const notification = new NotificationRequestService({
live: "false",
notificationItems: [notificationRequestItem as unknown as NotificationItem]
});
@@ -78,7 +59,7 @@ describe("HMAC Validator", function (): void {
it("should have invalid hmac", function (): void {
const invalidNotification = {
...notification.notificationItems![0],
additionalData: { [ApiConstants.HMAC_SIGNATURE as keyof AdditionalData]: "notValidSign" }
additionalData: { [ApiConstants.HMAC_SIGNATURE]: "notValidSign" }
};
const result = hmacValidator.validateHMAC(invalidNotification, key);
expect(result).toBeFalsy();
@@ -134,7 +115,7 @@ describe("HMAC Validator", function (): void {
success: "true",
additionalData: { [ApiConstants.HMAC_SIGNATURE]: expectedSign }
}} as unknown as NotificationItem;
const notification = new NotificationRequest({
const notification = new NotificationRequestService({
live: "false",
notificationItems: [notificationRequestItem]
});

View File

@@ -1,22 +1,3 @@
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
* Adyen NodeJS API Library
* Copyright (c) 2020 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
import nock, { Interceptor } from "nock";
import Client from "../client";
import Checkout from "../services/checkout";

View File

@@ -2,13 +2,13 @@ import nock from "nock";
import Client from "../client";
import { createClient } from "../__mocks__/base";
import { Management } from "../services";
import { AllowedOrigin, AllowedOriginsResponse, MeApiCredential } from "../typings/management/models";
import * as models from "../typings/management/models";
import { management } from "../typings";
import * as requests from "../__mocks__/management/requests";
import * as responses from "../__mocks__/management/responses";
import HttpClientException from "../httpClient/httpClientException";
let client: Client;
let management: Management;
let managementService: Management;
let scope: nock.Scope;
const merchantId = "merchantId";
@@ -26,7 +26,7 @@ beforeEach((): void => {
}
client = createClient();
scope = nock(`${client.config.managementEndpoint}/${Client.MANAGEMENT_API_VERSION}`);
management = new Management(client);
managementService = new Management(client);
});
afterEach(() => {
@@ -35,6 +35,32 @@ afterEach(() => {
describe("Management", (): void => {
describe("Me", (): void => {
test("Should properly handle error responses from API", async (): Promise<void> => {
scope.post("/me/allowedOrigins")
.reply(422, {
"type": "https://docs.adyen.com/errors/not-found",
"title": "Entity was not found",
"status": 422,
"detail": "The origin id is invalid or does not exist.",
"requestId": "KQZ5LXK2VMPRMC82",
"errorCode": "30_112",
});
try {
const createAllowedOriginRequest : management.CreateAllowedOriginRequest = {
domain: "test.com",
};
await managementService.Me.createAllowedOrigin(createAllowedOriginRequest);
fail("No exception was thrown");
} catch (error) {
expect(error instanceof HttpClientException).toBeTruthy();
if(error instanceof HttpClientException && error.responseBody) {
expect(JSON.parse(error.responseBody).requestId).toBe("KQZ5LXK2VMPRMC82");
} else {
fail("Error did not contain the expected data");
}
}
});
test("Should get API credential details based on the API Key used in the request", async (): Promise<void> => {
scope.get("/me")
.reply(200, {
@@ -63,7 +89,7 @@ describe("Management", (): void => {
"companyName": "Test",
"active": true,
});
const meResponse: MeApiCredential = await management.Me.retrieve();
const meResponse: management.MeApiCredential = await managementService.Me.retrieve();
expect(meResponse.id).toEqual("S2-6262224667");
});
@@ -78,11 +104,11 @@ describe("Management", (): void => {
}
}
});
const allowedOriginRequest: AllowedOrigin = {
const allowedOriginRequest: management.AllowedOrigin = {
"domain": "https://www.us.mystore.com"
};
const allowedOriginsResponse: AllowedOrigin = await management.Me.createAllowedOrigin(allowedOriginRequest);
const allowedOriginsResponse: management.AllowedOrigin = await managementService.Me.createAllowedOrigin(allowedOriginRequest);
expect(allowedOriginsResponse.domain).toEqual("https://www.us.mystore.com");
});
@@ -102,7 +128,7 @@ describe("Management", (): void => {
]
});
const allowedOriginsResponse: AllowedOriginsResponse = await management.Me.retrieveAllowedOrigins();
const allowedOriginsResponse: management.AllowedOriginsResponse = await managementService.Me.retrieveAllowedOrigins();
expect(allowedOriginsResponse.data?.length).toEqual(1);
});
});
@@ -119,13 +145,13 @@ describe("Management", (): void => {
}
});
const allowedOriginResponse: AllowedOrigin = await management.Me.retrieveAllowedOrigin("S2-123123123123123");
const allowedOriginResponse: management.AllowedOrigin = await managementService.Me.retrieveAllowedOrigin("S2-123123123123123");
expect(allowedOriginResponse.id).toEqual("S2-123123123123123");
});
test("Should remove the allowed origin specified in the path", async () => {
scope.delete("/me/allowedOrigins/S2-123123123123123").reply(204, {});
const allowedOriginResponse: Record<string, unknown> = await management.Me.deleteAllowerdOrigin("S2-123123123123123");
const allowedOriginResponse: Record<string, unknown> = await managementService.Me.deleteAllowerdOrigin("S2-123123123123123");
expect(scope.isDone()).toBe(true);
expect(Object.entries(allowedOriginResponse).length).toBe(0);
});
@@ -135,7 +161,7 @@ describe("Management", (): void => {
scope.get("/merchants?pageNumber=1&pageSize=1")
.reply(200, responses.listMerchantResponse);
const response: models.ListMerchantResponse = await management.MerchantAccount.list({
const response: management.ListMerchantResponse = await managementService.MerchantAccount.list({
params: {
"pageNumber": "1",
"pageSize": "1"
@@ -149,7 +175,7 @@ describe("Management", (): void => {
scope.post("/merchants")
.reply(200, responses.createMerchantResponse);
const response: models.CreateMerchantResponse = await management.MerchantAccount.create(requests.createMerchantRequest);
const response: management.CreateMerchantResponse = await managementService.MerchantAccount.create(requests.createMerchantRequest);
expect(response).toBeTruthy();
});
@@ -158,7 +184,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}`)
.reply(200, responses.merchant);
const response: models.Merchant = await management.MerchantAccount.retrieve(merchantId);
const response: management.Merchant = await managementService.MerchantAccount.retrieve(merchantId);
expect(response).toBeTruthy();
});
@@ -167,7 +193,7 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/activate`)
.reply(200, responses.requestActivationResponse);
const response: models.RequestActivationResponse = await management.MerchantAccount.activate(merchantId);
const response: management.RequestActivationResponse = await managementService.MerchantAccount.activate(merchantId);
expect(response).toBeTruthy();
});
@@ -178,7 +204,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/apiCredentials/${apiCredentialId}/allowedOrigins`)
.reply(200, responses.allowedOriginsResponse);
const response: models.AllowedOriginsResponse = await management.MerchantAllowedOrigins.list(merchantId, apiCredentialId);
const response: management.AllowedOriginsResponse = await managementService.MerchantAllowedOrigins.list(merchantId, apiCredentialId);
expect(response).toBeTruthy();
});
@@ -187,7 +213,7 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/apiCredentials/${apiCredentialId}/allowedOrigins`)
.reply(200, responses.allowedOriginsResponse);
const response: models.AllowedOriginsResponse = await management.MerchantAllowedOrigins.create(merchantId, apiCredentialId, requests.allowedOrigin);
const response: management.AllowedOriginsResponse = await managementService.MerchantAllowedOrigins.create(merchantId, apiCredentialId, requests.allowedOrigin);
expect(response).toBeTruthy();
});
@@ -196,14 +222,14 @@ describe("Management", (): void => {
scope.delete(`/merchants/${merchantId}/apiCredentials/${apiCredentialId}/allowedOrigins/${originId}`)
.reply(204);
await management.MerchantAllowedOrigins.delete(merchantId, apiCredentialId, originId);
await managementService.MerchantAllowedOrigins.delete(merchantId, apiCredentialId, originId);
});
it("should support GET /merchants/{merchantId}/apiCredentials/{apiCredentialId}/allowedOrigins/{originId}", async (): Promise<void> => {
scope.get(`/merchants/${merchantId}/apiCredentials/${apiCredentialId}/allowedOrigins/${originId}`)
.reply(200, responses.allowedOrigin);
const response: models.AllowedOrigin = await management.MerchantAllowedOrigins.retrieve(merchantId, apiCredentialId, originId);
const response: management.AllowedOrigin = await managementService.MerchantAllowedOrigins.retrieve(merchantId, apiCredentialId, originId);
expect(response).toBeTruthy();
});
@@ -214,7 +240,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/apiCredentials?pageNumber=1&pageSize=1`)
.reply(200, responses.listMerchantApiCredentialsResponse);
const response: models.ListMerchantApiCredentialsResponse = await management.MerchantApiCredentials.list(merchantId, {
const response: management.ListMerchantApiCredentialsResponse = await managementService.MerchantApiCredentials.list(merchantId, {
params: {
"pageNumber": "1",
"pageSize": "1"
@@ -228,7 +254,7 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/apiCredentials`)
.reply(200, responses.createApiCredentialResponse);
const response: models.CreateApiCredentialResponse = await management.MerchantApiCredentials.create(merchantId, requests.createMerchantApiCredentialRequest);
const response: management.CreateApiCredentialResponse = await managementService.MerchantApiCredentials.create(merchantId, requests.createMerchantApiCredentialRequest);
expect(response).toBeTruthy();
});
@@ -237,7 +263,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/apiCredentials/${apiCredentialId}`)
.reply(200, responses.apiCredential);
const response: models.ApiCredential = await management.MerchantApiCredentials.retrieve(merchantId, apiCredentialId);
const response: management.ApiCredential = await managementService.MerchantApiCredentials.retrieve(merchantId, apiCredentialId);
expect(response).toBeTruthy();
});
@@ -246,7 +272,7 @@ describe("Management", (): void => {
scope.patch(`/merchants/${merchantId}/apiCredentials/${apiCredentialId}`)
.reply(200, responses.apiCredential);
const response: models.ApiCredential = await management.MerchantApiCredentials.update(merchantId, apiCredentialId, requests.updateMerchantApiCredentialRequest);
const response: management.ApiCredential = await managementService.MerchantApiCredentials.update(merchantId, apiCredentialId, requests.updateMerchantApiCredentialRequest);
expect(response).toBeTruthy();
});
@@ -257,7 +283,7 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/apiCredentials/${apiCredentialId}/generateApiKey`)
.reply(200, responses.generateApiKeyResponse);
const response: models.GenerateApiKeyResponse = await management.MerchantApiKey.create(merchantId, apiCredentialId);
const response: management.GenerateApiKeyResponse = await managementService.MerchantApiKey.create(merchantId, apiCredentialId);
expect(response).toBeTruthy();
});
@@ -268,7 +294,7 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/apiCredentials/${apiCredentialId}/generateClientKey`)
.reply(200, responses.generateClientKeyResponse);
const response: models.GenerateClientKeyResponse = await management.MerchantClientKey.create(merchantId, apiCredentialId);
const response: management.GenerateClientKeyResponse = await managementService.MerchantClientKey.create(merchantId, apiCredentialId);
expect(response).toBeTruthy();
});
@@ -279,7 +305,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/paymentMethodSettings?storeId=1&businessLineId=1&pageNumber=1&pageSize=1`)
.reply(200, responses.paymentMethodResponse);
const response: models.PaymentMethodResponse = await management.MerchantPaymentMethods.listPaymentMethodSettings(merchantId, {
const response: management.PaymentMethodResponse = await managementService.MerchantPaymentMethods.listPaymentMethodSettings(merchantId, {
params: {
"storeId": "1",
"businessLineId": "1",
@@ -295,9 +321,9 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/paymentMethodSettings`)
.reply(200, responses.paymentMethod);
const response: models.PaymentMethod = await management.MerchantPaymentMethods.create(merchantId, {
const response: management.PaymentMethod = await managementService.MerchantPaymentMethods.create(merchantId, {
...requests.paymentMethodSetupInfo,
type: models.PaymentMethodSetupInfo.TypeEnum.Ideal
type: management.PaymentMethodSetupInfo.TypeEnum.Ideal
});
expect(response).toBeTruthy();
@@ -307,7 +333,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/paymentMethodSettings/${paymentMethodId}`)
.reply(200, responses.paymentMethod);
const response: models.PaymentMethod = await management.MerchantPaymentMethods.retrieve(merchantId, paymentMethodId);
const response: management.PaymentMethod = await managementService.MerchantPaymentMethods.retrieve(merchantId, paymentMethodId);
expect(response).toBeTruthy();
});
@@ -316,7 +342,7 @@ describe("Management", (): void => {
scope.patch(`/merchants/${merchantId}/paymentMethodSettings/${paymentMethodId}`)
.reply(200, responses.paymentMethod);
const response: models.PaymentMethod = await management.MerchantPaymentMethods.update(merchantId, paymentMethodId, requests.updatePaymentMethodInfo);
const response: management.PaymentMethod = await managementService.MerchantPaymentMethods.update(merchantId, paymentMethodId, requests.updatePaymentMethodInfo);
expect(response).toBeTruthy();
});
@@ -327,7 +353,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/payoutSettings`)
.reply(200, responses.payoutSettingsResponse);
const response: models.PayoutSettingsResponse = await management.MerchantPayoutSettings.listPayoutSettings(merchantId);
const response: management.PayoutSettingsResponse = await managementService.MerchantPayoutSettings.listPayoutSettings(merchantId);
expect(response).toBeTruthy();
});
@@ -336,7 +362,7 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/payoutSettings`)
.reply(200, responses.payoutSettings);
const response: models.PayoutSettings = await management.MerchantPayoutSettings.create(merchantId, requests.payoutSettingsRequest);
const response: management.PayoutSettings = await managementService.MerchantPayoutSettings.create(merchantId, requests.payoutSettingsRequest);
expect(response).toBeTruthy();
});
@@ -345,14 +371,14 @@ describe("Management", (): void => {
scope.delete(`/merchants/${merchantId}/payoutSettings/${payoutSettingsId}`)
.reply(200);
await management.MerchantPayoutSettings.delete(merchantId, payoutSettingsId);
await managementService.MerchantPayoutSettings.delete(merchantId, payoutSettingsId);
});
it("should support GET /merchants/{merchantId}/payoutSettings/{payoutSettingsId}", async (): Promise<void> => {
scope.get(`/merchants/${merchantId}/payoutSettings/${payoutSettingsId}`)
.reply(200, responses.payoutSettings);
const response: models.PayoutSettings = await management.MerchantPayoutSettings.retrieve(merchantId, payoutSettingsId);
const response: management.PayoutSettings = await managementService.MerchantPayoutSettings.retrieve(merchantId, payoutSettingsId);
expect(response).toBeTruthy();
});
@@ -361,7 +387,7 @@ describe("Management", (): void => {
scope.patch(`/merchants/${merchantId}/payoutSettings/${payoutSettingsId}`)
.reply(200, responses.payoutSettings);
const response: models.PayoutSettings = await management.MerchantPayoutSettings.update(merchantId, payoutSettingsId, requests.updatePayoutSettingsRequest);
const response: management.PayoutSettings = await managementService.MerchantPayoutSettings.update(merchantId, payoutSettingsId, requests.updatePayoutSettingsRequest);
expect(response).toBeTruthy();
});
@@ -372,7 +398,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/billingEntities?name=bill`)
.reply(200, responses.billingEntitiesResponse);
const response: models.BillingEntitiesResponse = await management.MerchantTerminalOrders.listBillingEntities(merchantId, {
const response: management.BillingEntitiesResponse = await managementService.MerchantTerminalOrders.listBillingEntities(merchantId, {
params: {
"name": "bill"
}
@@ -385,7 +411,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/shippingLocations?name=1&offset=1&limit=1`)
.reply(200, responses.shippingLocationsResponse);
const response: models.ShippingLocationsResponse = await management.MerchantTerminalOrders.listShippingLocations(merchantId, {
const response: management.ShippingLocationsResponse = await managementService.MerchantTerminalOrders.listShippingLocations(merchantId, {
params: {
"name": "1",
"offset": "1",
@@ -400,7 +426,7 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/shippingLocations`)
.reply(200, responses.shippingLocation);
const response: models.ShippingLocation = await management.MerchantTerminalOrders.createShippingLocation(merchantId, requests.shippingLocation);
const response: management.ShippingLocation = await managementService.MerchantTerminalOrders.createShippingLocation(merchantId, requests.shippingLocation);
expect(response).toBeTruthy();
});
@@ -409,7 +435,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/terminalModels`)
.reply(200, responses.terminalModelsResponse);
const response: models.TerminalModelsResponse = await management.MerchantTerminalOrders.listTerminalModels(merchantId);
const response: management.TerminalModelsResponse = await managementService.MerchantTerminalOrders.listTerminalModels(merchantId);
expect(response).toBeTruthy();
});
@@ -418,7 +444,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/terminalOrders?customerOrderReference=1&status=1&offset=1&limit=1`)
.reply(200, responses.terminalOrdersResponse);
const response: models.TerminalOrdersResponse = await management.MerchantTerminalOrders.listTerminalOrders(merchantId, {
const response: management.TerminalOrdersResponse = await managementService.MerchantTerminalOrders.listTerminalOrders(merchantId, {
params: {
"customerOrderReference": "1",
"status": "1",
@@ -434,7 +460,7 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/terminalOrders`)
.reply(200, responses.terminalOrder);
const response: models.TerminalOrder = await management.MerchantTerminalOrders.create(merchantId, requests.terminalOrderRequest);
const response: management.TerminalOrder = await managementService.MerchantTerminalOrders.create(merchantId, requests.terminalOrderRequest);
expect(response).toBeTruthy();
});
@@ -443,7 +469,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/terminalOrders/${orderId}`)
.reply(200, responses.terminalOrder);
const response: models.TerminalOrder = await management.MerchantTerminalOrders.retrieve(merchantId, orderId);
const response: management.TerminalOrder = await managementService.MerchantTerminalOrders.retrieve(merchantId, orderId);
expect(response).toBeTruthy();
});
@@ -452,7 +478,7 @@ describe("Management", (): void => {
scope.patch(`/merchants/${merchantId}/terminalOrders/${orderId}`)
.reply(200, responses.terminalOrder);
const response: models.TerminalOrder = await management.MerchantTerminalOrders.update(merchantId, orderId, requests.terminalOrderRequest);
const response: management.TerminalOrder = await managementService.MerchantTerminalOrders.update(merchantId, orderId, requests.terminalOrderRequest);
expect(response).toBeTruthy();
});
@@ -461,7 +487,7 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/terminalOrders/${orderId}/cancel`)
.reply(200, responses.terminalOrder);
const response: models.TerminalOrder = await management.MerchantTerminalOrders.cancel(merchantId, orderId);
const response: management.TerminalOrder = await managementService.MerchantTerminalOrders.cancel(merchantId, orderId);
expect(response).toBeTruthy();
});
@@ -470,7 +496,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/terminalProducts?country=1&terminalModelId=1&offset=1&limit=1`)
.reply(200, responses.terminalProductsResponse);
const response: models.TerminalProductsResponse = await management.MerchantTerminalOrders.listTerminalProducts(merchantId, {
const response: management.TerminalProductsResponse = await managementService.MerchantTerminalOrders.listTerminalProducts(merchantId, {
params: {
"country": "1",
"terminalModelId": "1",
@@ -488,7 +514,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/terminalLogos?model=1`)
.reply(200, responses.logo);
const response: models.Logo = await management.MerchantTerminalSettings.retrieveLogo(merchantId, {
const response: management.Logo = await managementService.MerchantTerminalSettings.retrieveLogo(merchantId, {
params: {
"model": "1"
}
@@ -501,7 +527,7 @@ describe("Management", (): void => {
scope.patch(`/merchants/${merchantId}/terminalLogos?model=1`)
.reply(200, responses.logo);
const response: models.Logo = await management.MerchantTerminalSettings.updateLogo(merchantId, requests.logo, {
const response: management.Logo = await managementService.MerchantTerminalSettings.updateLogo(merchantId, requests.logo, {
params: {
"model": "1"
}
@@ -514,7 +540,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/terminalSettings`)
.reply(200, responses.terminalSettings);
const response: models.TerminalSettings = await management.MerchantTerminalSettings.retrieve(merchantId);
const response: management.TerminalSettings = await managementService.MerchantTerminalSettings.retrieve(merchantId);
expect(response).toBeTruthy();
});
@@ -523,7 +549,7 @@ describe("Management", (): void => {
scope.patch(`/merchants/${merchantId}/terminalSettings`)
.reply(200, responses.terminalSettings);
const response: models.TerminalSettings = await management.MerchantTerminalSettings.update(merchantId, requests.terminalSettings);
const response: management.TerminalSettings = await managementService.MerchantTerminalSettings.update(merchantId, requests.terminalSettings);
expect(response).toBeTruthy();
});
@@ -534,7 +560,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/users?pageNumber=1&pageSize=1`)
.reply(200, responses.listMerchantUsersResponse);
const response: models.ListMerchantUsersResponse = await management.MerchantUsers.list(merchantId, {
const response: management.ListMerchantUsersResponse = await managementService.MerchantUsers.list(merchantId, {
params: {
"pageNumber": "1",
"pageSize": "1"
@@ -548,7 +574,7 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/users`)
.reply(200, responses.createUserResponse);
const response: models.CreateUserResponse = await management.MerchantUsers.create(merchantId, requests.createMerchantUserRequest);
const response: management.CreateUserResponse = await managementService.MerchantUsers.create(merchantId, requests.createMerchantUserRequest);
expect(response).toBeTruthy();
});
@@ -557,7 +583,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/users/${userId}`)
.reply(200, responses.user);
const response: models.User = await management.MerchantUsers.retrieve(merchantId, userId);
const response: management.User = await managementService.MerchantUsers.retrieve(merchantId, userId);
expect(response).toBeTruthy();
});
@@ -566,7 +592,7 @@ describe("Management", (): void => {
scope.patch(`/merchants/${merchantId}/users/${userId}`)
.reply(200, responses.user);
const response: models.User = await management.MerchantUsers.update(merchantId, userId, requests.updateMerchantUserRequest);
const response: management.User = await managementService.MerchantUsers.update(merchantId, userId, requests.updateMerchantUserRequest);
expect(response).toBeTruthy();
});
@@ -577,7 +603,7 @@ describe("Management", (): void => {
scope.get(`/merchants/${merchantId}/webhooks?pageNumber=1&pageSize=1`)
.reply(200, responses.listWebhooksResponse);
const response: models.ListWebhooksResponse = await management.MerchantWebhooks.list(merchantId, {
const response: management.ListWebhooksResponse = await managementService.MerchantWebhooks.list(merchantId, {
params: {
"pageNumber": "1",
"pageSize": "1"
@@ -591,11 +617,11 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/webhooks`)
.reply(200, responses.webhook);
const response: models.Webhook = await management.MerchantWebhooks.create(merchantId, {
const response: management.Webhook = await managementService.MerchantWebhooks.create(merchantId, {
...requests.createMerchantWebhookRequest,
communicationFormat: models.CreateMerchantWebhookRequest.CommunicationFormatEnum.Json,
networkType: models.CreateMerchantWebhookRequest.NetworkTypeEnum.Public,
sslVersion: models.CreateMerchantWebhookRequest.SslVersionEnum.Tls
communicationFormat: management.CreateMerchantWebhookRequest.CommunicationFormatEnum.Json,
networkType: management.CreateMerchantWebhookRequest.NetworkTypeEnum.Public,
sslVersion: management.CreateMerchantWebhookRequest.SslVersionEnum.Tls
});
expect(response).toBeTruthy();
@@ -605,14 +631,14 @@ describe("Management", (): void => {
scope.delete(`/merchants/${merchantId}/webhooks/${webhookId}`)
.reply(204);
await management.MerchantWebhooks.delete(merchantId, webhookId);
await managementService.MerchantWebhooks.delete(merchantId, webhookId);
});
it("should support GET /merchants/{merchantId}/webhooks/{webhookId}", async (): Promise<void> => {
scope.get(`/merchants/${merchantId}/webhooks/${webhookId}`)
.reply(200, responses.webhook);
const response: models.Webhook = await management.MerchantWebhooks.retrieve(merchantId, webhookId);
const response: management.Webhook = await managementService.MerchantWebhooks.retrieve(merchantId, webhookId);
expect(response).toBeTruthy();
});
@@ -621,11 +647,11 @@ describe("Management", (): void => {
scope.patch(`/merchants/${merchantId}/webhooks/${webhookId}`)
.reply(200, responses.webhook);
const response: models.Webhook = await management.MerchantWebhooks.update(merchantId, webhookId, {
const response: management.Webhook = await managementService.MerchantWebhooks.update(merchantId, webhookId, {
...requests.updateMerchantWebhookRequest,
communicationFormat: models.CreateMerchantWebhookRequest.CommunicationFormatEnum.Soap,
networkType: models.CreateMerchantWebhookRequest.NetworkTypeEnum.Local,
sslVersion: models.CreateMerchantWebhookRequest.SslVersionEnum.Sslv3
communicationFormat: management.CreateMerchantWebhookRequest.CommunicationFormatEnum.Soap,
networkType: management.CreateMerchantWebhookRequest.NetworkTypeEnum.Local,
sslVersion: management.CreateMerchantWebhookRequest.SslVersionEnum.Sslv3
});
expect(response).toBeTruthy();
@@ -635,7 +661,7 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/webhooks/${webhookId}/generateHmac`)
.reply(200, responses.generateHmacKeyResponse);
const response: models.GenerateHmacKeyResponse = await management.MerchantWebhooks.generateHmac(merchantId, webhookId);
const response: management.GenerateHmacKeyResponse = await managementService.MerchantWebhooks.generateHmac(merchantId, webhookId);
expect(response).toBeTruthy();
});
@@ -644,7 +670,7 @@ describe("Management", (): void => {
scope.post(`/merchants/${merchantId}/webhooks/${webhookId}/test`)
.reply(200, responses.testWebhookResponse);
const testWebhookRequest: models.TestWebhookRequest = {
const testWebhookRequest: management.TestWebhookRequest = {
"notification": {
"amount": {
"currency": "string",
@@ -659,7 +685,7 @@ describe("Management", (): void => {
},
"types": ["string"]
};
const response: models.TestWebhookResponse = await management.MerchantWebhooks.test(merchantId, webhookId, testWebhookRequest);
const response: management.TestWebhookResponse = await managementService.MerchantWebhooks.test(merchantId, webhookId, testWebhookRequest);
expect(response).toBeTruthy();
});

View File

@@ -154,7 +154,6 @@ let checkout: Checkout;
let scope: nock.Scope;
const paymentPspReference = "863620292981235A";
const invalidPaymentPspReference = "invalid_psp_reference";
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
beforeEach((): void => {
if (!nock.isActive()) {
@@ -170,8 +169,7 @@ afterEach(() => {
});
describe("Modification", (): void => {
test.each([isCI, true])("should perform an amount update request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should perform an amount update request", async (): Promise<void> => {
const request = createAmountUpdateRequest();
scope.post(`/payments/${paymentPspReference}/amountUpdates`)
.reply(200, createAmountUpdateResponse());
@@ -187,8 +185,7 @@ describe("Modification", (): void => {
}
});
test.each([false, true])("should fail to perform an amount update request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should fail to perform an amount update request", async (): Promise<void> => {
expect.assertions(2);
const request = createAmountUpdateRequest();
scope.post(`/payments/${invalidPaymentPspReference}/amountUpdates`)
@@ -206,8 +203,7 @@ describe("Modification", (): void => {
}
});
test.each([isCI, true])("should perform a cancels request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should perform a cancels request", async (): Promise<void> => {
const request = createCancelsRequest();
scope.post(`/payments/${paymentPspReference}/cancels`)
.reply(200, createCancelsResponse());
@@ -223,8 +219,7 @@ describe("Modification", (): void => {
}
});
test.each([false, true])("should fail to perform a cancels request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should fail to perform a cancels request", async (): Promise<void> => {
expect.assertions(2);
const request = createCancelsRequest();
scope.post(`/payments/${invalidPaymentPspReference}/cancels`)
@@ -241,8 +236,7 @@ describe("Modification", (): void => {
}
});
test.each([isCI, true])("should perform a standalone cancels request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should perform a standalone cancels request", async (): Promise<void> => {
const request = createStandaloneCancelsRequest();
scope.post("/cancels")
.reply(200, createStandaloneCancelsResponse());
@@ -258,8 +252,7 @@ describe("Modification", (): void => {
}
});
test.each([isCI, true])("should perform a captures request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should perform a captures request", async (): Promise<void> => {
const request = createCapturesRequest();
scope.post(`/payments/${paymentPspReference}/captures`)
.reply(200, createCapturesResponse());
@@ -275,8 +268,7 @@ describe("Modification", (): void => {
}
});
test.each([false, true])("should fail to perform a captures request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should fail to perform a captures request", async (): Promise<void> => {
expect.assertions(2);
const request = createCapturesRequest();
scope.post(`/payments/${invalidPaymentPspReference}/captures`)
@@ -293,8 +285,7 @@ describe("Modification", (): void => {
}
});
test.each([isCI, true])("should perform a refunds request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should perform a refunds request", async (): Promise<void> => {
const request = createRefundsRequest();
scope.post(`/payments/${paymentPspReference}/refunds`)
.reply(200, createRefundsResponse());
@@ -310,8 +301,7 @@ describe("Modification", (): void => {
}
});
test.each([false, true])("should fail to perform a refunds request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should fail to perform a refunds request", async (): Promise<void> => {
expect.assertions(2);
const request = createRefundsRequest();
scope.post(`/payments/${invalidPaymentPspReference}/refunds`)
@@ -328,8 +318,7 @@ describe("Modification", (): void => {
}
});
test.each([isCI, true])("should perform a reversals request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should perform a reversals request", async (): Promise<void> => {
const request = createReversalsRequest();
scope.post(`/payments/${paymentPspReference}/reversals`)
.reply(200, createReversalsResponse());
@@ -345,8 +334,7 @@ describe("Modification", (): void => {
}
});
test.each([false, true])("should fail to perform a reversals request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should fail to perform a reversals request", async (): Promise<void> => {
expect.assertions(2);
const request = createReversalsRequest();
scope.post(`/payments/${invalidPaymentPspReference}/reversals`)

View File

@@ -1,22 +1,3 @@
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
* Adyen NodeJS API Library
* Copyright (c) 2020 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
import authorisationTrue from "../__mocks__/notification/authorisationTrue.json";
import captureTrue from "../__mocks__/notification/captureTrue.json";
import captureFalse from "../__mocks__/notification/captureFalse.json";
@@ -38,6 +19,8 @@ describe("Notification Test", function (): void {
expect(notificationRequestItem.success === SuccessEnum.True).toBeTruthy();
expect(notificationRequestItem.pspReference).toEqual("123456789");
expect(notificationRequestItem.additionalData!.paymentLinkId).toEqual("ABCDEFG");
expect(notificationRequestItem.additionalData!.realtimeAccountUpdaterStatus).toEqual("status");
} else {
fail();
}

View File

@@ -2,17 +2,9 @@ import nock from "nock";
import { createClient } from "../__mocks__/base";
import Payout from "../services/payout";
import Client from "../client";
import {
ModifyRequest,
PayoutRequest,
Recurring,
StoreDetailAndSubmitRequest,
StoreDetailRequest,
SubmitRequest
} from "../typings/payouts/models";
import { payouts } from "../typings";
import { ApiConstants } from "../constants/apiConstants";
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
const storeDetailAndSubmitThirdParty = JSON.stringify({
additionalData: {
fraudResultType: "GREEN",
@@ -44,7 +36,7 @@ const defaultData = {
shopperReference: "shopperReference",
};
const mockStoreDetailRequest = (merchantAccount: string = process.env.ADYEN_MERCHANT!): StoreDetailRequest => ({
const mockStoreDetailRequest = (merchantAccount: string = process.env.ADYEN_MERCHANT!): payouts.StoreDetailRequest => ({
...defaultData,
card: {
cvc: "737",
@@ -53,29 +45,29 @@ const mockStoreDetailRequest = (merchantAccount: string = process.env.ADYEN_MERC
number: "4111111111111111",
holderName: "John Smith"
},
entityType: StoreDetailRequest.EntityTypeEnum.Company,
entityType: payouts.StoreDetailRequest.EntityTypeEnum.Company,
recurring: {
contract: Recurring.ContractEnum.Payout,
contract: payouts.Recurring.ContractEnum.Payout,
},
merchantAccount,
});
const mockSubmitRequest = (merchantAccount: string = process.env.ADYEN_MERCHANT!): SubmitRequest => ({
const mockSubmitRequest = (merchantAccount: string = process.env.ADYEN_MERCHANT!): payouts.SubmitRequest => ({
selectedRecurringDetailReference: "LATEST",
recurring: {
contract: Recurring.ContractEnum.Payout
contract: payouts.Recurring.ContractEnum.Payout
},
...defaultData,
...amountAndReference,
merchantAccount,
});
const mockStoreDetailAndSubmitRequest = (merchantAccount?: string): StoreDetailAndSubmitRequest => ({
const mockStoreDetailAndSubmitRequest = (merchantAccount?: string): payouts.StoreDetailAndSubmitRequest => ({
...amountAndReference,
...(mockStoreDetailRequest(merchantAccount)),
});
const mockPayoutRequest = (merchantAccount: string = process.env.ADYEN_MERCHANT!): PayoutRequest => ({
const mockPayoutRequest = (merchantAccount: string = process.env.ADYEN_MERCHANT!): payouts.PayoutRequest => ({
...amountAndReference,
...defaultData,
card: {
@@ -90,7 +82,7 @@ const mockPayoutRequest = (merchantAccount: string = process.env.ADYEN_MERCHANT!
let client: Client;
let clientStore: Client;
let clientReview: Client;
let payout: Payout;
let payoutService: Payout;
let scope: nock.Scope;
beforeEach((): void => {
@@ -101,7 +93,7 @@ beforeEach((): void => {
clientStore = createClient(process.env.ADYEN_STOREPAYOUT_APIKEY);
clientReview = createClient(process.env.ADYEN_REVIEWPAYOUT_APIKEY);
scope = nock(`${client.config.endpoint}/pal/servlet/Payout/${Client.API_VERSION}`);
payout = new Payout(client);
payoutService = new Payout(client);
});
afterEach((): void => {
@@ -109,60 +101,56 @@ afterEach((): void => {
});
describe("PayoutTest", function (): void {
test.each([isCI, true])("should succeed on store detail and submit third party, isMock: %p", async function (isMock): Promise<void> {
!isMock && nock.restore();
payout = new Payout(clientStore);
const request: StoreDetailAndSubmitRequest = mockStoreDetailAndSubmitRequest();
test("should succeed on store detail and submit third party", async function (): Promise<void> {
payoutService = new Payout(clientStore);
const request: payouts.StoreDetailAndSubmitRequest = mockStoreDetailAndSubmitRequest();
scope.post("/storeDetailAndSubmitThirdParty").reply(200, storeDetailAndSubmitThirdParty);
const result = await payout.storeDetailAndSubmitThirdParty(request);
const result = await payoutService.storeDetailAndSubmitThirdParty(request);
expect(result.resultCode).toEqual("[payout-submit-received]");
expect(result.pspReference).toBeTruthy();
});
test.each([false, true])("should succeed on store detail, isMock: %p", async function (isMock): Promise<void> {
!isMock && nock.restore();
payout = new Payout(clientStore);
test("should succeed on store detail", async function (): Promise<void> {
payoutService = new Payout(clientStore);
scope.post("/storeDetail").reply(200, storeDetail);
const request: StoreDetailRequest = mockStoreDetailRequest();
const result = await payout.storeDetail(request);
const request: payouts.StoreDetailRequest = mockStoreDetailRequest();
const result = await payoutService.storeDetail(request);
expect("Success").toEqual(result.resultCode);
expect(result.pspReference).toBeTruthy();
expect(result.recurringDetailReference).toBeTruthy();
});
test.each([isCI, true])("should succeed on confirm third party, isMock: %p", async function (isMock): Promise<void> {
!isMock && nock.restore();
payout = new Payout(clientStore);
test("should succeed on confirm third party", async function (): Promise<void> {
payoutService = new Payout(clientStore);
scope.post("/storeDetail").reply(200, storeDetail);
const storeRequest: StoreDetailRequest = mockStoreDetailRequest();
const storeResult = await payout.storeDetail(storeRequest);
const storeRequest: payouts.StoreDetailRequest = mockStoreDetailRequest();
const storeResult = await payoutService.storeDetail(storeRequest);
payout = new Payout(clientReview);
payoutService = new Payout(clientReview);
scope.post("/confirmThirdParty")
.reply(200, {
pspReference: "8815131762537886",
response: "[payout-confirm-received]"
});
const request: ModifyRequest = {
const request: payouts.ModifyRequest = {
merchantAccount: process.env.ADYEN_MERCHANT!,
originalReference: storeResult.pspReference
};
const result = await payout.confirmThirdParty(request);
const result = await payoutService.confirmThirdParty(request);
expect(result.response).toEqual("[payout-confirm-received]");
expect(result.pspReference).toBeTruthy();
});
test.each([isCI, true])("should succeed on submit third party, isMock: %p", async function (isMock): Promise<void> {
!isMock && nock.restore();
payout = new Payout(clientStore);
test("should succeed on submit third party", async function (): Promise<void> {
payoutService = new Payout(clientStore);
scope.post("/submitThirdParty").reply(200, storeDetailAndSubmitThirdParty);
const request: SubmitRequest = mockSubmitRequest();
const result = await payout.submitThirdparty(request);
const request: payouts.SubmitRequest = mockSubmitRequest();
const result = await payoutService.submitThirdparty(request);
expect(result.resultCode).toEqual("[payout-submit-received]");
expect(result.pspReference).toBeTruthy();
@@ -173,15 +161,14 @@ describe("PayoutTest", function (): void {
}
});
test.each([false, true])("should succeed on decline third party, isMock: %p", async function (isMock): Promise<void> {
!isMock && nock.restore();
payout = new Payout(clientStore);
test("should succeed on decline third party", async function (): Promise<void> {
payoutService = new Payout(clientStore);
scope.post("/storeDetail").reply(200, storeDetail);
const storeRequest: StoreDetailRequest = mockStoreDetailRequest();
const storeResult = await payout.storeDetail(storeRequest);
const storeRequest: payouts.StoreDetailRequest = mockStoreDetailRequest();
const storeResult = await payoutService.storeDetail(storeRequest);
payout = new Payout(clientReview);
const request: ModifyRequest = {
payoutService = new Payout(clientReview);
const request: payouts.ModifyRequest = {
merchantAccount: process.env.ADYEN_MERCHANT!,
originalReference: storeResult.pspReference
};
@@ -190,21 +177,20 @@ describe("PayoutTest", function (): void {
pspReference: "8815131762537886",
response: "[payout-decline-received]"
});
const result = await payout.declineThirdParty(request);
const result = await payoutService.declineThirdParty(request);
expect(result.response).toEqual("[payout-decline-received]");
expect(result.pspReference).toBeTruthy();
});
test.each([isCI, true])("should succeed on payout, isMock: %p", async function (isMock): Promise<void> {
!isMock && nock.restore();
test("should succeed on payout", async function (): Promise<void> {
scope.post("/payout").reply(200, {
pspReference: "8815131762537886",
resultCode: "Received",
});
const request = mockPayoutRequest();
const result = await payout.payout(request);
const result = await payoutService.payout(request);
expect(result.resultCode).toEqual("Received");
expect(result.pspReference).toBeTruthy();

View File

@@ -1,22 +1,3 @@
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
* Adyen NodeJS API Library
* Copyright (c) 2020 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
import nock from "nock";
import { createMock } from "ts-auto-mock";
import { createBasicAuthClient } from "../__mocks__/base";

View File

@@ -5,30 +5,18 @@ import { listRecurringDetailsSuccess } from "../__mocks__/recurring/listRecurrin
import { notifyShopperSuccess } from "../__mocks__/recurring/notifyShopperSuccess";
import RecurringService from "../services/recurring";
import Client from "../client";
import { paymentsSuccess } from "../__mocks__/checkout/paymentsSuccess";
import { createPaymentsCheckoutRequest } from "./checkout.spec";
import Checkout from "../services/checkout";
import { PaymentRequest } from "../typings/checkout/models";
import {
ScheduleAccountUpdaterRequest,
ScheduleAccountUpdaterResult,
DisableRequest,
RecurringDetailsRequest,
Recurring,
NotifyShopperRequest
} from "../typings/recurring/models";
import { recurring } from "../typings";
const createRecurringDetailsRequest = (): RecurringDetailsRequest => {
const createRecurringDetailsRequest = (): recurring.RecurringDetailsRequest => {
return {
merchantAccount: process.env.ADYEN_MERCHANT!,
recurring: { contract: Recurring.ContractEnum.Recurring },
recurring: { contract: recurring.Recurring.ContractEnum.Recurring },
shopperReference: "shopperReference",
};
};
let client: Client;
let recurring: RecurringService;
let checkout: Checkout;
let recurringService: RecurringService;
let scope: nock.Scope;
beforeEach((): void => {
@@ -36,8 +24,7 @@ beforeEach((): void => {
nock.activate();
}
client = createClient();
recurring = new RecurringService(client);
checkout = new Checkout(client);
recurringService = new RecurringService(client);
scope = nock(`${client.config.endpoint}/pal/servlet/Recurring/${Client.RECURRING_API_VERSION}`);
});
@@ -51,30 +38,24 @@ describe("Recurring", (): void => {
.reply(200, listRecurringDetailsSuccess);
const request = createRecurringDetailsRequest();
const result = await recurring.listRecurringDetails(request);
const result = await recurringService.listRecurringDetails(request);
expect(result).toBeTruthy();
expect(result.details?.[0].recurringDetailReference).toBe("recurringReference");
});
test("should disable", async (): Promise<void> => {
scope.post("/payments")
.reply(200, paymentsSuccess);
const paymentsRequest: PaymentRequest = createPaymentsCheckoutRequest();
const res = await checkout.payments(paymentsRequest);
scope.post("/disable")
.reply(200, disableSuccess);
const request: DisableRequest = {
const request: recurring.DisableRequest = {
merchantAccount: process.env.ADYEN_MERCHANT!,
shopperReference: "shopperReference",
recurringDetailReference: res.additionalData!["recurring.recurringDetailReference"]
recurringDetailReference: "recurring.recurringDetailReference",
};
try {
const result = await recurring.disable(request);
const result = await recurringService.disable(request);
expect(result).toBeTruthy();
} catch (e) {
fail(e);
@@ -85,7 +66,7 @@ describe("Recurring", (): void => {
scope.post("/notifyShopper")
.reply(200, notifyShopperSuccess);
const notifyShopperRequest: NotifyShopperRequest = {
const notifyShopperRequest: recurring.NotifyShopperRequest = {
merchantAccount: process.env.ADYEN_MERCHANT!,
shopperReference: "shopperReference",
storedPaymentMethodId: "8415995487234100",
@@ -99,7 +80,7 @@ describe("Recurring", (): void => {
};
try {
const result = await recurring.notifyShopper(notifyShopperRequest);
const result = await recurringService.notifyShopper(notifyShopperRequest);
expect(result).toBeTruthy();
} catch (e) {
fail(e);
@@ -108,7 +89,7 @@ describe("Recurring", (): void => {
test("should schedule account updater", async (): Promise<void> => {
const scheduleAccountUpdaterSuccess: ScheduleAccountUpdaterResult = {
const scheduleAccountUpdaterSuccess: recurring.ScheduleAccountUpdaterResult = {
pspReference: "mocked_psp",
result: "SUCCESS"
};
@@ -116,7 +97,7 @@ describe("Recurring", (): void => {
scope.post("/scheduleAccountUpdater")
.reply(200, scheduleAccountUpdaterSuccess);
const request: ScheduleAccountUpdaterRequest = {
const request: recurring.ScheduleAccountUpdaterRequest = {
merchantAccount: process.env.ADYEN_MERCHANT!,
reference: "ref",
card: {
@@ -128,7 +109,7 @@ describe("Recurring", (): void => {
};
try {
const result = await recurring.scheduleAccountUpdater(request);
const result = await recurringService.scheduleAccountUpdater(request);
expect(result).toBeTruthy();
} catch (e) {
fail(e);

View File

@@ -2,23 +2,11 @@ import nock from "nock";
import Client from "../client";
import {createClient} from "../__mocks__/base";
import {StoredValue} from "../services";
import { StoredValueIssueRequest,
StoredValueIssueResponse,
StoredValueStatusChangeRequest,
StoredValueStatusChangeResponse,
StoredValueLoadRequest,
StoredValueLoadResponse,
StoredValueBalanceCheckRequest,
StoredValueBalanceCheckResponse,
StoredValueBalanceMergeRequest,
StoredValueBalanceMergeResponse,
StoredValueVoidRequest,
StoredValueVoidResponse
} from "../typings/storedValue/models";
import { storedValue } from "../typings";
let client: Client;
let storedValue: StoredValue;
let storedValueService: StoredValue;
let scope: nock.Scope;
beforeEach((): void => {
@@ -27,7 +15,7 @@ beforeEach((): void => {
}
client = createClient();
scope = nock(`${client.config.storedValueEndpoint}/${Client.STOREDVALUE_API_VERSION}`);
storedValue = new StoredValue(client);
storedValueService = new StoredValue(client);
});
afterEach(() => {
@@ -50,7 +38,7 @@ describe("StoredValue", (): void => {
"type": "givex"
}
});
const issueRequest: StoredValueIssueRequest = {
const issueRequest: storedValue.StoredValueIssueRequest = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"store": "YOUR_STORE_ID",
"paymentMethod": {
@@ -63,7 +51,7 @@ describe("StoredValue", (): void => {
"reference": "YOUR_REFERENCE"
};
const issueResponse: StoredValueIssueResponse = await storedValue.issue(issueRequest);
const issueResponse: storedValue.StoredValueIssueResponse = await storedValueService.issue(issueRequest);
expect(issueResponse.pspReference).toEqual("851564651069192J");
});
@@ -83,7 +71,7 @@ describe("StoredValue", (): void => {
"type": "givex"
}
});
const issueRequest: StoredValueIssueRequest = {
const issueRequest: storedValue.StoredValueIssueRequest = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"store": "YOUR_STORE_ID",
"paymentMethod": {
@@ -93,7 +81,7 @@ describe("StoredValue", (): void => {
"reference": "YOUR_REFERENCE"
};
const issueResponse: StoredValueIssueResponse = await storedValue.issue(issueRequest);
const issueResponse: storedValue.StoredValueIssueResponse = await storedValueService.issue(issueRequest);
expect(issueResponse.pspReference).toEqual("851564651069192J");
});
@@ -109,8 +97,8 @@ describe("StoredValue", (): void => {
"resultCode": "Success"
});
const statusRequest: StoredValueStatusChangeRequest = {
"status": StoredValueStatusChangeRequest.StatusEnum.Active,
const statusRequest: storedValue.StoredValueStatusChangeRequest = {
"status": storedValue.StoredValueStatusChangeRequest.StatusEnum.Active,
"amount": {
"currency": "USD",
"value": 1000
@@ -125,7 +113,7 @@ describe("StoredValue", (): void => {
"reference": "YOUR_REFERENCE"
};
const changeStatusResponse: StoredValueStatusChangeResponse = await storedValue.changeStatus(statusRequest);
const changeStatusResponse: storedValue.StoredValueStatusChangeResponse = await storedValueService.changeStatus(statusRequest);
expect(changeStatusResponse.pspReference).toEqual("851564652149588K");
});
@@ -140,8 +128,8 @@ describe("StoredValue", (): void => {
"resultCode": "Success"
});
const statusRequest: StoredValueStatusChangeRequest = {
"status": StoredValueStatusChangeRequest.StatusEnum.Inactive,
const statusRequest: storedValue.StoredValueStatusChangeRequest = {
"status": storedValue.StoredValueStatusChangeRequest.StatusEnum.Inactive,
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"store":"YOUR_STORE_ID",
"paymentMethod": {
@@ -149,11 +137,11 @@ describe("StoredValue", (): void => {
},
"recurringDetailReference": "7219627091701347",
"shopperReference": "YOUR_UNIQUE_SHOPPER_ID_P3fW3k9D2tvXFu6l",
"shopperInteraction": StoredValueStatusChangeRequest.ShopperInteractionEnum.Ecommerce,
"shopperInteraction": storedValue.StoredValueStatusChangeRequest.ShopperInteractionEnum.Ecommerce,
"reference": "YOUR_REFERENCE"
};
const changeStatusResponse: StoredValueStatusChangeResponse = await storedValue.changeStatus(statusRequest);
const changeStatusResponse: storedValue.StoredValueStatusChangeResponse = await storedValueService.changeStatus(statusRequest);
expect(changeStatusResponse.pspReference).toEqual("851564652149588K");
});
@@ -168,12 +156,12 @@ describe("StoredValue", (): void => {
"resultCode": "Success"
});
const loadRequest: StoredValueLoadRequest = {
const loadRequest: storedValue.StoredValueLoadRequest = {
"amount": {
"currency": "USD",
"value": 2000
},
"loadType": StoredValueLoadRequest.LoadTypeEnum.MerchandiseReturn,
"loadType": storedValue.StoredValueLoadRequest.LoadTypeEnum.MerchandiseReturn,
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"store":"YOUR_STORE_ID",
"paymentMethod": {
@@ -184,7 +172,7 @@ describe("StoredValue", (): void => {
"reference": "YOUR_REFERENCE"
};
const loadResponse: StoredValueLoadResponse = await storedValue.load(loadRequest);
const loadResponse: storedValue.StoredValueLoadResponse = await storedValueService.load(loadRequest);
expect(loadResponse.pspReference).toEqual("851564654294247B");
});
@@ -199,7 +187,7 @@ describe("StoredValue", (): void => {
"resultCode": "Success"
});
const checkBalanceRequest: StoredValueBalanceCheckRequest = {
const checkBalanceRequest: storedValue.StoredValueBalanceCheckRequest = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"store":"YOUR_STORE_ID",
"paymentMethod": {
@@ -210,7 +198,7 @@ describe("StoredValue", (): void => {
"reference": "YOUR_REFERENCE"
};
const checkBalanceResponse: StoredValueBalanceCheckResponse = await storedValue.checkBalance(checkBalanceRequest);
const checkBalanceResponse: storedValue.StoredValueBalanceCheckResponse = await storedValueService.checkBalance(checkBalanceRequest);
expect(checkBalanceResponse.pspReference).toEqual("881564657480267D");
});
@@ -225,7 +213,7 @@ describe("StoredValue", (): void => {
"resultCode": "Success"
});
const mergeBalanceRequest: StoredValueBalanceMergeRequest = {
const mergeBalanceRequest: storedValue.StoredValueBalanceMergeRequest = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"store":"YOUR_STORE_ID",
"sourcePaymentMethod": {
@@ -240,7 +228,7 @@ describe("StoredValue", (): void => {
"reference": "YOUR_REFERENCE"
};
const mergeBalanceResponse: StoredValueBalanceMergeResponse = await storedValue.mergebalance(mergeBalanceRequest);
const mergeBalanceResponse: storedValue.StoredValueBalanceMergeResponse = await storedValueService.mergebalance(mergeBalanceRequest);
expect(mergeBalanceResponse.pspReference).toEqual("881564657480267D");
});
@@ -255,13 +243,13 @@ describe("StoredValue", (): void => {
"resultCode": "Success"
});
const voidTransactionRequest: StoredValueVoidRequest = {
const voidTransactionRequest: storedValue.StoredValueVoidRequest = {
"merchantAccount": "YOUR_MERCHANT_ACCOUNT",
"originalReference": "851564654294247B",
"reference": "YOUR_REFERENCE"
};
const voidTransactionResponse: StoredValueVoidResponse = await storedValue.voidTransaction(voidTransactionRequest);
const voidTransactionResponse: storedValue.StoredValueVoidResponse = await storedValueService.voidTransaction(voidTransactionRequest);
expect(voidTransactionResponse.pspReference).toEqual("851564673300692A");
});
});

View File

@@ -1,29 +1,10 @@
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
* Adyen NodeJS API Library
* Copyright (c) 2022 Adyen N.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
import nock from "nock";
import { createClient, createTerminalAPIPaymentRequest, createTerminalAPIRefundRequest } from "../__mocks__/base";
import { asyncRes } from "../__mocks__/terminalApi/async";
import { syncRefund, syncRes, syncResEventNotification } from "../__mocks__/terminalApi/sync";
import Client from "../client";
import TerminalCloudAPI from "../services/terminalCloudAPI";
import { SaleToAcquirerData, TerminalApiResponse } from "../typings/terminal/models";
import { terminal} from "../typings";
let client: Client;
let terminalCloudAPI: TerminalCloudAPI;
@@ -44,10 +25,8 @@ afterEach((): void => {
nock.cleanAll();
});
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
describe("Terminal Cloud API", (): void => {
test.each([isCI])("should make an async payment request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should make an async payment request", async (): Promise<void> => {
scope.post("/async").reply(200, asyncRes);
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();
@@ -57,19 +36,17 @@ describe("Terminal Cloud API", (): void => {
expect(requestResponse).toEqual("ok");
});
test.each([isCI])("should make a sync payment request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should make a sync payment request", async (): Promise<void> => {
scope.post("/sync").reply(200, syncRes);
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();
const terminalAPIResponse: TerminalApiResponse = await terminalCloudAPI.sync(terminalAPIPaymentRequest);
const terminalAPIResponse: terminal.TerminalApiResponse = await terminalCloudAPI.sync(terminalAPIPaymentRequest);
expect(terminalAPIResponse.SaleToPOIResponse?.PaymentResponse).toBeDefined();
expect(terminalAPIResponse.SaleToPOIResponse?.MessageHeader).toBeDefined();
});
test.each([isCI])("should return event notification if response contains it, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should return event notification if response contains it", async (): Promise<void> => {
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();
scope.post("/sync").reply(200, syncResEventNotification);
@@ -79,12 +56,11 @@ describe("Terminal Cloud API", (): void => {
expect(terminalAPIResponse.SaleToPOIRequest?.EventNotification).toBeDefined();
});
test.each([isCI])("should make an async refund request, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should make an async refund request", async (): Promise<void> => {
scope.post("/sync").reply(200, syncRes);
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();
const terminalAPIResponse: TerminalApiResponse = await terminalCloudAPI.sync(terminalAPIPaymentRequest);
const terminalAPIResponse: terminal.TerminalApiResponse = await terminalCloudAPI.sync(terminalAPIPaymentRequest);
const pOITransactionId = terminalAPIResponse.SaleToPOIResponse!.PaymentResponse!.POIData!.POITransactionID;
expect(pOITransactionId).toBeTruthy();
@@ -94,7 +70,7 @@ describe("Terminal Cloud API", (): void => {
const terminalAPIRefundRequest = createTerminalAPIRefundRequest(pOITransactionId);
const id = Math.floor(Math.random() * Math.floor(10000000)).toString();
terminalAPIRefundRequest.SaleToPOIRequest.MessageHeader.ServiceID = id;
const saleToAcquirerData: SaleToAcquirerData = new SaleToAcquirerData();
const saleToAcquirerData: terminal.SaleToAcquirerData = new terminal.SaleToAcquirerData();
saleToAcquirerData.currency = "EUR";
terminalAPIRefundRequest.SaleToPOIRequest.ReversalRequest!.SaleData!.SaleToAcquirerData = saleToAcquirerData;
const terminalAPIRefundResponse = await terminalCloudAPI.sync(terminalAPIRefundRequest);

View File

@@ -1,28 +1,9 @@
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
* Adyen NodeJS API Library
* Copyright (c) 2021 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
import nock from "nock";
import { createClient, createTerminalAPIPaymentRequest } from "../__mocks__/base";
import { localEncRes, wrongEncRes } from "../__mocks__/terminalApi/local";
import Client from "../client";
import TerminalLocalAPI from "../services/terminalLocalAPI";
import { SecurityKey, TerminalApiResponse } from "../typings/terminal/models";
import { terminal } from "../typings";
import NexoCryptoException from "../services/exception/nexoCryptoException";
let client: Client;
@@ -43,34 +24,30 @@ afterEach((): void => {
nock.cleanAll();
});
const isCI = process.env.CI === "true" || (typeof process.env.CI === "boolean" && process.env.CI);
describe("Terminal Local API", (): void => {
test.each([isCI, true])("should make a local payment, isMock: %p", async (isMock): Promise<void> => {
!isMock && nock.restore();
test("should make a local payment", async (): Promise<void> => {
scope.post("/").reply(200, localEncRes);
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();
const securityKey: SecurityKey = {
const securityKey: terminal.SecurityKey = {
AdyenCryptoVersion: 0,
KeyIdentifier: "CryptoKeyIdentifier12345",
KeyVersion: 0,
Passphrase: "p@ssw0rd123456",
};
const terminalApiResponse: TerminalApiResponse =
const terminalApiResponse: terminal.TerminalApiResponse =
await terminalLocalAPI.request(terminalAPIPaymentRequest, securityKey);
expect(terminalApiResponse.SaleToPOIResponse?.PaymentResponse).toBeDefined();
expect(terminalApiResponse.SaleToPOIResponse?.MessageHeader).toBeDefined();
});
test.each([isCI, true])("should return NexoCryptoException, isMock: %p", async (isMock: boolean): Promise<void> => {
!isMock && nock.restore();
test("should return NexoCryptoException", async (): Promise<void> => {
scope.post("/").reply(200, wrongEncRes);
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();
const securityKey: SecurityKey = {
const securityKey: terminal.SecurityKey = {
AdyenCryptoVersion: 0,
KeyIdentifier: "CryptoKeyIdentifier12345",
KeyVersion: 0,

View File

@@ -2,21 +2,10 @@ import nock from "nock";
import Client from "../client";
import { createClient } from "../__mocks__/base";
import TerminalManagement from "../services/terminalManagement";
import {
AssignTerminalsRequest,
AssignTerminalsResponse,
FindTerminalRequest,
FindTerminalResponse,
GetStoresUnderAccountRequest,
GetStoresUnderAccountResponse,
GetTerminalDetailsRequest,
GetTerminalDetailsResponse,
GetTerminalsUnderAccountRequest,
GetTerminalsUnderAccountResponse
} from "../typings/terminalManagement/models";
import { terminalManagement } from "../typings";
let client: Client;
let terminalManagement: TerminalManagement;
let terminalManagementService: TerminalManagement;
let scope: nock.Scope;
beforeEach((): void => {
@@ -25,7 +14,7 @@ beforeEach((): void => {
}
client = createClient();
scope = nock(`${client.config.terminalManagementEndpoint}/${Client.TERMINAL_MANAGEMENT_API_VERSION}`);
terminalManagement = new TerminalManagement(client);
terminalManagementService = new TerminalManagement(client);
});
afterEach(() => {
@@ -40,14 +29,14 @@ describe("POS Terminal Management API", (): void => {
"P400Plus-275479597": "RemoveConfigScheduled"
}
});
const request: AssignTerminalsRequest = {
const request: terminalManagement.AssignTerminalsRequest = {
"companyAccount": "YOUR_COMPANY_ACCOUNT",
"terminals": [
"P400Plus-275479597"
]
};
const response: AssignTerminalsResponse = await terminalManagement.assignTerminals(request);
const response: terminalManagement.AssignTerminalsResponse = await terminalManagementService.assignTerminals(request);
expect(response.results["P400Plus-275479597"]).toEqual("RemoveConfigScheduled");
});
@@ -60,11 +49,11 @@ describe("POS Terminal Management API", (): void => {
"merchantInventory": false,
"terminal": "P400Plus-275479597"
});
const request: FindTerminalRequest = {
const request: terminalManagement.FindTerminalRequest = {
"terminal": "P400Plus-275479597"
};
const response: FindTerminalResponse = await terminalManagement.findTerminal(request);
const response: terminalManagement.FindTerminalResponse = await terminalManagementService.findTerminal(request);
expect(response.terminal).toEqual("P400Plus-275479597");
});
@@ -87,11 +76,11 @@ describe("POS Terminal Management API", (): void => {
}
]
});
const request: GetStoresUnderAccountRequest = {
const request: terminalManagement.GetStoresUnderAccountRequest = {
"companyAccount": "YOUR_COMPANY_ACCOUNT"
};
const response: GetStoresUnderAccountResponse = await terminalManagement.getStoresUnderAccount(request);
const response: terminalManagement.GetStoresUnderAccountResponse = await terminalManagementService.getStoresUnderAccount(request);
expect(response.stores).toHaveLength(1);
expect(response.stores![0].status).toEqual("Active");
@@ -113,11 +102,11 @@ describe("POS Terminal Management API", (): void => {
"country": "NETHERLANDS",
"dhcpEnabled": false
});
const request: GetTerminalDetailsRequest = {
const request: terminalManagement.GetTerminalDetailsRequest = {
"terminal": "P400Plus-275479597"
};
const response: GetTerminalDetailsResponse = await terminalManagement.getTerminalDetails(request);
const response: terminalManagement.GetTerminalDetailsResponse = await terminalManagementService.getTerminalDetails(request);
expect(response.deviceModel).toBe("P400Plus");
});
@@ -144,11 +133,11 @@ describe("POS Terminal Management API", (): void => {
}
]
});
const request: GetTerminalsUnderAccountRequest = {
const request: terminalManagement.GetTerminalsUnderAccountRequest = {
"companyAccount": "YOUR_COMPANY_ACCOUNT"
};
const response: GetTerminalsUnderAccountResponse = await terminalManagement.getTerminalsUnderAccount(request);
const response: terminalManagement.GetTerminalsUnderAccountResponse = await terminalManagementService.getTerminalsUnderAccount(request);
expect(response.merchantAccounts).toHaveLength(1);
expect(response.merchantAccounts![0].stores).toHaveLength(1);

View File

@@ -3,7 +3,7 @@ import { createClient } from "../__mocks__/base";
import { transfersSuccess, getTransactionSuccess, listTransactionsSuccess } from "../__mocks__/transfers/responses";
import Client from "../client";
import { Transfers } from "../services";
import { TransferInfo, Transfer, Transaction, TransactionSearchResponse, IbanAccountIdentification} from "../typings/transfer/models";
import { transfer} from "../typings";
let client: Client;
let transferService: Transfers;
@@ -26,9 +26,9 @@ describe("Transfers", (): void => {
test("should transfer fund", async (): Promise<void> => {
scope.post("/transfers")
.reply(200, transfersSuccess);
const request = new TransferInfo();
const request = new transfer.TransferInfo();
request.amount = { currency: "EUR", value: 1000};
request.category = TransferInfo.CategoryEnum.Bank;
request.category = transfer.TransferInfo.CategoryEnum.Bank;
request.counterparty = {
balanceAccountId: "123",
transferInstrumentId: "transfer_id",
@@ -38,26 +38,26 @@ describe("Transfers", (): void => {
},
accountIdentification: {
iban: "NLRABO12321",
type: IbanAccountIdentification.TypeEnum.Iban
type: transfer.IbanAccountIdentification.TypeEnum.Iban
}
},
};
const response: Transfer = await transferService.transfers(request);
const response: transfer.Transfer = await transferService.transfers(request);
expect(response.id).toEqual("1W1UG35U8A9J5ZLG");
});
test("should get transaction", async (): Promise<void> => {
scope.get("/transactions/123")
.reply(200, getTransactionSuccess);
const response: Transaction = await transferService.getTransaction("123");
const response: transfer.Transaction = await transferService.getTransaction("123");
expect(response.id).toEqual("IZK7C25U7DYVX03Y");
});
test("should list transactions", async (): Promise<void> => {
scope.get("/transactions")
.reply(200, listTransactionsSuccess);
const response: TransactionSearchResponse = await transferService.listTransactions();
const response: transfer.TransactionSearchResponse = await transferService.listTransactions();
expect(response.data?.length).toEqual(3);
if(response.data && response.data?.length > 0) {
expect(response?.data[0]?.id).toEqual("1VVF0D5U66PIUIVP");

View File

@@ -6,6 +6,10 @@ import ClientInterface from "./httpClient/clientInterface";
type ClientParametersOverload =
| { config: Config }
| { config: Config; httpClient: ClientInterface }
| { username: string; password: string; environment: Environment}
| { username: string; password: string; environment: Environment; httpClient: ClientInterface }
| { username: string; password: string; environment: Environment; liveEndpointUrlPrefix: string }
| { username: string; password: string; environment: Environment; liveEndpointUrlPrefix: string; httpClient: ClientInterface }
| { username: string; password: string; environment: Environment; applicationName: string }
| { username: string; password: string; environment: Environment; applicationName: string; httpClient: ClientInterface }
| { username: string; password: string; environment: Environment; applicationName: string; liveEndpointUrlPrefix: string }
@@ -68,9 +72,12 @@ class Client {
public static LEGAL_ENTITY_MANAGEMENT_API_VERSION = "v2";
public static LEGAL_ENTITY_MANAGEMENT_API_ENDPOINT_TEST = "https://kyc-test.adyen.com/lem";
public static LEGAL_ENTITY_MANAGEMENT_API_ENDPOINT_LIVE = "https://kyc-live.adyen.com/lem";
public static TRANSFERS_API_VERSION="v3";
public static TRANSFERS_API_VERSION_TEST = "https://balanceplatform-api-test.adyen.com/btl";
public static TRANSFERS_API_VERSION_LIVE = "https://balanceplatform-api-live.adyen.com/btl";
public static TRANSFERS_API_VERSION = "v3";
public static TRANSFERS_API_ENDPOINT_TEST = "https://balanceplatform-api-test.adyen.com/btl";
public static TRANSFERS_API_ENDPOINT_LIVE = "https://balanceplatform-api-live.adyen.com/btl";
public static DATA_PROTECTION_API_VERSION = "v1";
public static DATA_PROTECTION_API_ENDPOINT_TEST = "https://ca-test.adyen.com/ca/services/DataProtectionService";
public static DATA_PROTECTION_API_ENDPOINT_LIVE = "https://ca-live.adyen.com/ca/services/DataProtectionService";
private _httpClient!: ClientInterface;
@@ -87,10 +94,12 @@ class Client {
const environment = options.environment || this.config.environment;
if (environment) {
this.setEnvironment(environment, options.liveEndpointUrlPrefix);
if (options.username && options.password && options.applicationName) {
if (options.username && options.password) {
this.config.username = options.username;
this.config.password = options.password;
this.config.applicationName = options.applicationName;
if(options.applicationName) {
this.config.applicationName = options.applicationName;
}
}
if (options.apiKey) {
@@ -116,7 +125,8 @@ class Client {
this.config.managementEndpoint = Client.MANAGEMENT_API_ENDPOINT_TEST;
this.config.balancePlatformEndpoint = Client.BALANCE_PLATFORM_API_ENDPOINT_TEST;
this.config.legalEntityManagementEndpoint = Client.LEGAL_ENTITY_MANAGEMENT_API_ENDPOINT_TEST;
this.config.transfersEndpoint = Client.TRANSFERS_API_VERSION_TEST;
this.config.transfersEndpoint = Client.TRANSFERS_API_ENDPOINT_TEST;
this.config.dataProtectionEndpoint = Client.DATA_PROTECTION_API_ENDPOINT_TEST;
} else if (environment === "LIVE") {
this.config.endpoint = Client.ENDPOINT_LIVE;
this.config.marketPayEndpoint = Client.MARKETPAY_ENDPOINT_LIVE;
@@ -128,7 +138,8 @@ class Client {
this.config.managementEndpoint = Client.MANAGEMENT_API_ENDPOINT_LIVE;
this.config.balancePlatformEndpoint = Client.BALANCE_PLATFORM_API_ENDPOINT_LIVE;
this.config.legalEntityManagementEndpoint = Client.LEGAL_ENTITY_MANAGEMENT_API_ENDPOINT_LIVE;
this.config.transfersEndpoint = Client.TRANSFERS_API_VERSION_LIVE;
this.config.transfersEndpoint = Client.TRANSFERS_API_ENDPOINT_LIVE;
this.config.dataProtectionEndpoint = Client.DATA_PROTECTION_API_ENDPOINT_LIVE;
if (liveEndpointUrlPrefix) {
this.config.endpoint =
@@ -164,4 +175,4 @@ class Client {
}
}
export default Client;
export default Client;

View File

@@ -41,6 +41,7 @@ interface ConfigConstructor {
balancePlatformEndpoint?: string;
legalEntityManagementEndpoint?: string;
transfersEndpoint?: string;
dataProtectionEndpoint?: string;
}
class Config {
@@ -72,6 +73,7 @@ class Config {
public balancePlatformEndpoint?: string;
public legalEntityManagementEndpoint?: string;
public transfersEndpoint?: string;
public dataProtectionEndpoint?: string;
public constructor(options: ConfigConstructor = {}) {
if (options.username) this.username = options.username;
@@ -98,6 +100,7 @@ class Config {
if (options.balancePlatformEndpoint) this.balancePlatformEndpoint = options.balancePlatformEndpoint;
if (options.legalEntityManagementEndpoint) this.legalEntityManagementEndpoint = options.legalEntityManagementEndpoint;
if (options.transfersEndpoint) this.transfersEndpoint = options.transfersEndpoint;
if (options.dataProtectionEndpoint) this.dataProtectionEndpoint = options.dataProtectionEndpoint;
}
public set checkoutEndpoint(checkoutEndpoint: string | undefined) {

View File

@@ -0,0 +1,25 @@
import Client from "../client";
import getJsonResponse from "../helpers/getJsonResponse";
import Service from "../service";
import { SubjectErasureByPspReferenceRequest, SubjectErasureResponse, ObjectSerializer } from "../typings/dataProtection/models";
import DataProtectionResource from "./resource/dataProtectionresource";
import { IRequest } from "../typings/requestOptions";
class DataProtection extends Service {
private readonly _dataProtectionResource: DataProtectionResource;
public constructor(client: Client) {
super(client);
this._dataProtectionResource = new DataProtectionResource(this, "/requestSubjectErasure");
}
public async requestSubjectErasure(subjectErasureByPspReferenceRequest: SubjectErasureByPspReferenceRequest, requestOptions?: IRequest.Options): Promise<SubjectErasureResponse> {
const response = await getJsonResponse<SubjectErasureByPspReferenceRequest, SubjectErasureResponse>(
this._dataProtectionResource,
subjectErasureByPspReferenceRequest,
requestOptions,
);
return ObjectSerializer.deserialize(response, "SubjectErasureResponse");
}
}
export default DataProtection;

View File

@@ -11,3 +11,5 @@ export { default as TerminalManagement} from "./terminalManagement";
export { default as Management } from "./management";
export { default as LegalEntityManagement } from "./legalEntityManagement";
export { default as Transfers } from "./transfers";
export { default as BalancePlatform } from "./balancePlatform";
export { default as DataProtection } from "./dataProtection";

View File

@@ -0,0 +1,14 @@
import Client from "../../client";
import Service from "../../service";
import Resource from "../resource";
class DataProtectionResource extends Resource {
public constructor(service: Service, endpoint: string) {
super(
service,
`${service.client.config.dataProtectionEndpoint}/${Client.DATA_PROTECTION_API_VERSION}${endpoint}`
);
}
}
export default DataProtectionResource;

View File

@@ -0,0 +1,154 @@
/*
* The version of the OpenAPI document: v1
* Contact: developer-experience@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/
export * from './serviceError';
export * from './subjectErasureByPspReferenceRequest';
export * from './subjectErasureResponse';
import { ServiceError } from './serviceError';
import { SubjectErasureByPspReferenceRequest } from './subjectErasureByPspReferenceRequest';
import { SubjectErasureResponse } from './subjectErasureResponse';
/* tslint:disable:no-unused-variable */
let primitives = [
"string",
"boolean",
"double",
"integer",
"long",
"float",
"number",
"any"
];
let enumsMap: {[index: string]: any} = {
"SubjectErasureResponse.ResultEnum": SubjectErasureResponse.ResultEnum,
}
let typeMap: {[index: string]: any} = {
"ServiceError": ServiceError,
"SubjectErasureByPspReferenceRequest": SubjectErasureByPspReferenceRequest,
"SubjectErasureResponse": SubjectErasureResponse,
}
export class ObjectSerializer {
public static findCorrectType(data: any, expectedType: string) {
if (data == undefined) {
return expectedType;
} else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
return expectedType;
} else if (expectedType === "Date") {
return expectedType;
} else {
if (enumsMap[expectedType]) {
return expectedType;
}
if (!typeMap[expectedType]) {
return expectedType; // w/e we don't know the type
}
// Check the discriminator
let discriminatorProperty = typeMap[expectedType].discriminator;
if (discriminatorProperty == null) {
return expectedType; // the type does not have a discriminator. use it.
} else {
if (data[discriminatorProperty]) {
var discriminatorType = data[discriminatorProperty];
if(typeMap[discriminatorType]){
return discriminatorType; // use the type given in the discriminator
} else {
return expectedType; // discriminator did not map to a type
}
} else {
return expectedType; // discriminator was not present (or an empty string)
}
}
}
}
public static serialize(data: any, type: string) {
if (data == undefined) {
return data;
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
return data;
} else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
let subType: string = type.replace("Array<", ""); // Array<Type> => Type>
subType = subType.substring(0, subType.length - 1); // Type> => Type
let transformedData: any[] = [];
for (let index = 0; index < data.length; index++) {
let datum = data[index];
transformedData.push(ObjectSerializer.serialize(datum, subType));
}
return transformedData;
} else if (type === "Date") {
return data.toISOString();
} else if (type === "SaleToAcquirerData") {
const dataString = JSON.stringify(data);
return Buffer.from(dataString).toString("base64");
} else {
if (enumsMap[type]) {
return data;
}
if (!typeMap[type]) { // in case we dont know the type
return data;
}
// Get the actual type of this object
type = this.findCorrectType(data, type);
// get the map for the correct type.
let attributeTypes = typeMap[type].getAttributeTypeMap();
let instance: {[index: string]: any} = {};
for (let index = 0; index < attributeTypes.length; index++) {
let attributeType = attributeTypes[index];
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
}
return instance;
}
}
public static deserialize(data: any, type: string) {
// polymorphism may change the actual type.
type = ObjectSerializer.findCorrectType(data, type);
if (data == undefined) {
return data;
} else if (primitives.indexOf(type.toLowerCase()) !== -1) {
return data;
} else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
let subType: string = type.replace("Array<", ""); // Array<Type> => Type>
subType = subType.substring(0, subType.length - 1); // Type> => Type
let transformedData: any[] = [];
for (let index = 0; index < data.length; index++) {
let datum = data[index];
transformedData.push(ObjectSerializer.deserialize(datum, subType));
}
return transformedData;
} else if (type === "Date") {
return new Date(data);
} else {
if (enumsMap[type]) {// is Enum
return data;
}
if (!typeMap[type]) { // dont know the type
return data;
}
let instance = new typeMap[type]();
let attributeTypes = typeMap[type].getAttributeTypeMap();
for (let index = 0; index < attributeTypes.length; index++) {
let attributeType = attributeTypes[index];
instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
}
return instance;
}
}
}

View File

@@ -0,0 +1,66 @@
/*
* The version of the OpenAPI document: v1
* Contact: developer-experience@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/
export class ServiceError {
/**
* The error code mapped to the error message.
*/
'errorCode'?: string;
/**
* The category of the error.
*/
'errorType'?: string;
/**
* A short explanation of the issue.
*/
'message'?: string;
/**
* The PSP reference of the payment.
*/
'pspReference'?: string;
/**
* The HTTP response status.
*/
'status'?: number;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "errorCode",
"baseName": "errorCode",
"type": "string"
},
{
"name": "errorType",
"baseName": "errorType",
"type": "string"
},
{
"name": "message",
"baseName": "message",
"type": "string"
},
{
"name": "pspReference",
"baseName": "pspReference",
"type": "string"
},
{
"name": "status",
"baseName": "status",
"type": "number"
} ];
static getAttributeTypeMap() {
return ServiceError.attributeTypeMap;
}
}

View File

@@ -0,0 +1,48 @@
/*
* The version of the OpenAPI document: v1
* Contact: developer-experience@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/
export class SubjectErasureByPspReferenceRequest {
/**
* Set this to **true** if you want to delete shopper-related data, even if the shopper has an existing recurring transaction. This only deletes the shopper-related data for the specific payment, but does not cancel the existing recurring transaction.
*/
'forceErasure'?: boolean;
/**
* Your merchant account
*/
'merchantAccount'?: string;
/**
* The PSP reference of the payment. We will delete all shopper-related data for this payment.
*/
'pspReference'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "forceErasure",
"baseName": "forceErasure",
"type": "boolean"
},
{
"name": "merchantAccount",
"baseName": "merchantAccount",
"type": "string"
},
{
"name": "pspReference",
"baseName": "pspReference",
"type": "string"
} ];
static getAttributeTypeMap() {
return SubjectErasureByPspReferenceRequest.attributeTypeMap;
}
}

View File

@@ -0,0 +1,38 @@
/*
* The version of the OpenAPI document: v1
* Contact: developer-experience@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit this class manually.
*/
export class SubjectErasureResponse {
/**
* The result of this operation.
*/
'result'?: SubjectErasureResponse.ResultEnum;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "result",
"baseName": "result",
"type": "SubjectErasureResponse.ResultEnum"
} ];
static getAttributeTypeMap() {
return SubjectErasureResponse.attributeTypeMap;
}
}
export namespace SubjectErasureResponse {
export enum ResultEnum {
ActiveRecurringTokenExists = <any> 'ACTIVE_RECURRING_TOKEN_EXISTS',
AlreadyProcessed = <any> 'ALREADY_PROCESSED',
PaymentNotFound = <any> 'PAYMENT_NOT_FOUND',
Success = <any> 'SUCCESS'
}
}

View File

@@ -9,9 +9,11 @@
/// <reference path="platformsFund.ts" />
/// <reference path="platformsNotificationConfiguration.ts" />
export * as balancePlatform from './balancePlatform/models';
export * as binlookup from './binlookup/models';
export * as checkout from './checkout/models';
export * as notification from './notification/models';
export * as payments from './payments/models';
export * as payouts from './payouts/models';
export * as platformsNotifications from './platformsNotifications/models';
export * as platformsAccount from './platformsAccount/models';
@@ -24,3 +26,4 @@ export * as terminalManagement from './terminalManagement/models';
export * as management from './management/models';
export * as legalEntityManagement from './legalEntityManagement/models';
export * as transfer from './transfer/models';
export * as dataProtection from './dataProtection/models';

View File

@@ -1,127 +0,0 @@
/*
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
* Adyen NodeJS API Library
* Copyright (c) 2021 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
/**
* Notification API
* Definition of Notification API Schema
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
/**
* The additionalData object is a generic container that can hold extra fields. For more information, refer to NotificationRequestItem.additionalData .
*/
export class AdditionalData {
/**
* The ID that uniquely identifies the shopper. This shopperReference is the same as the shopperReference used in the initial payment.
*/
'shopperReference'?: string;
/**
* The shopper\'s email address.
*/
'shopperEmail'?: string;
/**
* Authorisation code: When the payment is authorised successfully, this field holds the authorisation code for the payment. When the payment is not authorised, this field is empty.
*/
'authCode'?: string;
/**
* Returns the last 4 digits of the credit card.
*/
'cardSummary'?: string;
/**
* Returns the card expiry date.
*/
'expiryDate'?: string;
/**
* Value of the amount authorised.
*/
'authorisedAmountValue'?: string;
/**
* Currency of the authorised amount.
*/
'authorisedAmountCurrency'?: string;
/**
* HMAC Key from customer area
*/
'hmacSignature'?: string;
/**
* A unique identifier for the payment link
*/
'paymentLinkId'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "shopperReference",
"baseName": "shopperReference",
"type": "string"
},
{
"name": "shopperEmail",
"baseName": "shopperEmail",
"type": "string"
},
{
"name": "authCode",
"baseName": "authCode",
"type": "string"
},
{
"name": "cardSummary",
"baseName": "cardSummary",
"type": "string"
},
{
"name": "expiryDate",
"baseName": "expiryDate",
"type": "string"
},
{
"name": "authorisedAmountValue",
"baseName": "authorisedAmountValue",
"type": "string"
},
{
"name": "authorisedAmountCurrency",
"baseName": "authorisedAmountCurrency",
"type": "string"
},
{
"name": "hmacSignature",
"baseName": "hmacSignature",
"type": "string"
},
{
"name": "paymentLinkId",
"baseName": "paymentLinkId",
"type": "string"
}
];
static getAttributeTypeMap() {
return AdditionalData.attributeTypeMap;
}
}

View File

@@ -16,8 +16,7 @@
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
export * from './additionalData';
export * from './amount';
export * from './notification';
export * from './notificationItem';
@@ -36,7 +35,6 @@ export interface RequestDetailedFile {
export type RequestFile = string | Buffer | fs.ReadStream | RequestDetailedFile;
import { AdditionalData } from './additionalData';
import { Amount } from './amount';
import { Notification } from './notification';
import { NotificationItem } from './notificationItem';
@@ -61,7 +59,6 @@ let enumsMap: {[index: string]: any} = {
}
let typeMap: {[index: string]: any} = {
"AdditionalData": AdditionalData,
"Amount": Amount,
"Notification": Notification,
"NotificationItem": NotificationItem,

View File

@@ -29,11 +29,10 @@
* Do not edit the class manually.
*/
import { AdditionalData } from './additionalData';
import { Amount } from './amount';
export class NotificationRequestItem {
'additionalData'?: AdditionalData;
'additionalData'?: { [key: string]: string; };
'amount': Amount;
/**
* Adyen\'s 16-character unique reference associated with the transaction/the request. This value is globally unique; quote it when communicating with us about this request.

View File

@@ -25,7 +25,8 @@ import * as https from "https";
import { URLSearchParams } from "url";
export namespace IRequest {
type QueryString = URLSearchParams | string | NodeJS.Dict<string | string[]> | Iterable<[string, string]> | Array<[string, string]>;
type QueryString = ConstructorParameters<typeof URLSearchParams>[0];
export type Options = https.RequestOptions & {
idempotencyKey?: string;
params?: QueryString;

View File

@@ -33,7 +33,7 @@
export class OutputBarcode {
'BarcodeType'?: OutputBarcode.BarcodeTypeEnum;
'Value'?: string;
'BarcodeValue'?: string;
static discriminator: string | undefined = undefined;
@@ -44,8 +44,8 @@ export class OutputBarcode {
"type": "OutputBarcode.BarcodeTypeEnum"
},
{
"name": "Value",
"baseName": "Value",
"name": "BarcodeValue",
"baseName": "BarcodeValue",
"type": "string"
} ];

View File

@@ -16,13 +16,13 @@
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*/
/**
* Terminal API
* Definition of Terminal API Schema
*
* The version of the OpenAPI document: 1.0.0
*
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
@@ -34,21 +34,21 @@ import { CashHandlingDevice } from './cashHandlingDevice';
import { GlobalStatusType } from './globalStatusType';
export class POIStatus {
'CardReaderOkFlag'?: boolean;
'CardReaderOKFlag'?: boolean;
'CashHandlingDevice'?: Array<CashHandlingDevice>;
'CommunicationOkFlag'?: boolean;
'CommunicationOKFlag'?: boolean;
'FraudPreventionFlag'?: boolean;
'GlobalStatus': GlobalStatusType;
'PEDOKFlag'?: boolean;
'PrinterStatus'?: POIStatus.PrinterStatusEnum;
'SecurityOkFlag'?: boolean;
'SecurityOKFlag'?: boolean;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "CardReaderOkFlag",
"baseName": "CardReaderOkFlag",
"name": "CardReaderOKFlag",
"baseName": "CardReaderOKFlag",
"type": "boolean"
},
{
@@ -57,8 +57,8 @@ export class POIStatus {
"type": "Array<CashHandlingDevice>"
},
{
"name": "CommunicationOkFlag",
"baseName": "CommunicationOkFlag",
"name": "CommunicationOKFlag",
"baseName": "CommunicationOKFlag",
"type": "boolean"
},
{
@@ -82,8 +82,8 @@ export class POIStatus {
"type": "POIStatus.PrinterStatusEnum"
},
{
"name": "SecurityOkFlag",
"baseName": "SecurityOkFlag",
"name": "SecurityOKFlag",
"baseName": "SecurityOKFlag",
"type": "boolean"
} ];

311
yarn.lock
View File

@@ -818,10 +818,10 @@
dependencies:
"@types/istanbul-lib-report" "*"
"@types/jest@27.5.0":
version "27.5.0"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.5.0.tgz#e04ed1824ca6b1dd0438997ba60f99a7405d4c7b"
integrity sha512-9RBFx7r4k+msyj/arpfaa0WOOEcaAZNmN+j80KFbFCoSqCJGHTz7YMAMGQW9Xmqm5w6l5c25vbSjMwlikJi5+g==
"@types/jest@27.5.2":
version "27.5.2"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-27.5.2.tgz#ec49d29d926500ffb9fd22b84262e862049c026c"
integrity sha512-mpT8LJJ4CMeeahobofYWIjFo0xonRS/HfxnVEPMPFSQdGUt1uHCnoPT7Zhb+sjDU2wz0oKV0OLUR0WzrHNgfeA==
dependencies:
jest-matcher-utils "^27.0.0"
pretty-format "^27.0.0"
@@ -843,10 +843,10 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.3.tgz#463fc47f13ec0688a33aec75d078a0541a447199"
integrity sha512-HzNRZtp4eepNitP+BD6k2L6DROIDG4Q0fm4x+dwfsr6LGmROENnok75VGw40628xf+iR24WeMFcHuuBDUAzzsQ==
"@types/node@14.0.9":
version "14.0.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.9.tgz#43896ab87fc82bda1dfd600cdf44a0c8a64e11d2"
integrity sha512-0sCTiXKXELOBxvZLN4krQ0FPOAA7ij+6WwvD0k/PHd9/KAkr4dXel5J9fh6F4x1FwAQILqAWkmpeuS6mjf1iKA==
"@types/node@14.18.36":
version "14.18.36"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.36.tgz#c414052cb9d43fab67d679d5f3c641be911f5835"
integrity sha512-FXKWbsJ6a1hIrRxv+FoukuHnGTgEzKYGi7kilfMae96AL9UNkPFNWJEEYWzdRI9ooIkbr4AKldyuSTLql06vLQ==
"@types/parse-json@^4.0.0":
version "4.0.0"
@@ -880,86 +880,121 @@
dependencies:
"@types/yargs-parser" "*"
"@typescript-eslint/eslint-plugin@5.41.0":
version "5.41.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.41.0.tgz#f8eeb1c6bb2549f795f3ba71aec3b38d1ab6b1e1"
integrity sha512-DXUS22Y57/LAFSg3x7Vi6RNAuLpTXwxB9S2nIA7msBb/Zt8p7XqMwdpdc1IU7CkOQUPgAqR5fWvxuKCbneKGmA==
"@typescript-eslint/eslint-plugin@5.43.0":
version "5.43.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.43.0.tgz#4a5248eb31b454715ddfbf8cfbf497529a0a78bc"
integrity sha512-wNPzG+eDR6+hhW4yobEmpR36jrqqQv1vxBq5LJO3fBAktjkvekfr4BRl+3Fn1CM/A+s8/EiGUbOMDoYqWdbtXA==
dependencies:
"@typescript-eslint/scope-manager" "5.41.0"
"@typescript-eslint/type-utils" "5.41.0"
"@typescript-eslint/utils" "5.41.0"
"@typescript-eslint/scope-manager" "5.43.0"
"@typescript-eslint/type-utils" "5.43.0"
"@typescript-eslint/utils" "5.43.0"
debug "^4.3.4"
ignore "^5.2.0"
natural-compare-lite "^1.4.0"
regexpp "^3.2.0"
semver "^7.3.7"
tsutils "^3.21.0"
"@typescript-eslint/parser@5.41.0":
version "5.41.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.41.0.tgz#0414a6405007e463dc527b459af1f19430382d67"
integrity sha512-HQVfix4+RL5YRWZboMD1pUfFN8MpRH4laziWkkAzyO1fvNOY/uinZcvo3QiFJVS/siNHupV8E5+xSwQZrl6PZA==
"@typescript-eslint/parser@5.45.0":
version "5.45.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.45.0.tgz#b18a5f6b3cf1c2b3e399e9d2df4be40d6b0ddd0e"
integrity sha512-brvs/WSM4fKUmF5Ot/gEve6qYiCMjm6w4HkHPfS6ZNmxTS0m0iNN4yOChImaCkqc1hRwFGqUyanMXuGal6oyyQ==
dependencies:
"@typescript-eslint/scope-manager" "5.41.0"
"@typescript-eslint/types" "5.41.0"
"@typescript-eslint/typescript-estree" "5.41.0"
"@typescript-eslint/scope-manager" "5.45.0"
"@typescript-eslint/types" "5.45.0"
"@typescript-eslint/typescript-estree" "5.45.0"
debug "^4.3.4"
"@typescript-eslint/scope-manager@5.41.0":
version "5.41.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.41.0.tgz#28e3a41d626288d0628be14cf9de8d49fc30fadf"
integrity sha512-xOxPJCnuktUkY2xoEZBKXO5DBCugFzjrVndKdUnyQr3+9aDWZReKq9MhaoVnbL+maVwWJu/N0SEtrtEUNb62QQ==
"@typescript-eslint/scope-manager@5.43.0":
version "5.43.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.43.0.tgz#566e46303392014d5d163704724872e1f2dd3c15"
integrity sha512-XNWnGaqAtTJsUiZaoiGIrdJYHsUOd3BZ3Qj5zKp9w6km6HsrjPk/TGZv0qMTWyWj0+1QOqpHQ2gZOLXaGA9Ekw==
dependencies:
"@typescript-eslint/types" "5.41.0"
"@typescript-eslint/visitor-keys" "5.41.0"
"@typescript-eslint/types" "5.43.0"
"@typescript-eslint/visitor-keys" "5.43.0"
"@typescript-eslint/type-utils@5.41.0":
version "5.41.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.41.0.tgz#2371601171e9f26a4e6da918a7913f7266890cdf"
integrity sha512-L30HNvIG6A1Q0R58e4hu4h+fZqaO909UcnnPbwKiN6Rc3BUEx6ez2wgN7aC0cBfcAjZfwkzE+E2PQQ9nEuoqfA==
"@typescript-eslint/scope-manager@5.45.0":
version "5.45.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.45.0.tgz#7a4ac1bfa9544bff3f620ab85947945938319a96"
integrity sha512-noDMjr87Arp/PuVrtvN3dXiJstQR1+XlQ4R1EvzG+NMgXi8CuMCXpb8JqNtFHKceVSQ985BZhfRdowJzbv4yKw==
dependencies:
"@typescript-eslint/typescript-estree" "5.41.0"
"@typescript-eslint/utils" "5.41.0"
"@typescript-eslint/types" "5.45.0"
"@typescript-eslint/visitor-keys" "5.45.0"
"@typescript-eslint/type-utils@5.43.0":
version "5.43.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.43.0.tgz#91110fb827df5161209ecca06f70d19a96030be6"
integrity sha512-K21f+KY2/VvYggLf5Pk4tgBOPs2otTaIHy2zjclo7UZGLyFH86VfUOm5iq+OtDtxq/Zwu2I3ujDBykVW4Xtmtg==
dependencies:
"@typescript-eslint/typescript-estree" "5.43.0"
"@typescript-eslint/utils" "5.43.0"
debug "^4.3.4"
tsutils "^3.21.0"
"@typescript-eslint/types@5.41.0":
version "5.41.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.41.0.tgz#6800abebc4e6abaf24cdf220fb4ce28f4ab09a85"
integrity sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==
"@typescript-eslint/types@5.43.0":
version "5.43.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.43.0.tgz#e4ddd7846fcbc074325293515fa98e844d8d2578"
integrity sha512-jpsbcD0x6AUvV7tyOlyvon0aUsQpF8W+7TpJntfCUWU1qaIKu2K34pMwQKSzQH8ORgUrGYY6pVIh1Pi8TNeteg==
"@typescript-eslint/typescript-estree@5.41.0":
version "5.41.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.41.0.tgz#bf5c6b3138adbdc73ba4871d060ae12c59366c61"
integrity sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==
"@typescript-eslint/types@5.45.0":
version "5.45.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.45.0.tgz#794760b9037ee4154c09549ef5a96599621109c5"
integrity sha512-QQij+u/vgskA66azc9dCmx+rev79PzX8uDHpsqSjEFtfF2gBUTRCpvYMh2gw2ghkJabNkPlSUCimsyBEQZd1DA==
"@typescript-eslint/typescript-estree@5.43.0":
version "5.43.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.43.0.tgz#b6883e58ba236a602c334be116bfc00b58b3b9f2"
integrity sha512-BZ1WVe+QQ+igWal2tDbNg1j2HWUkAa+CVqdU79L4HP9izQY6CNhXfkNwd1SS4+sSZAP/EthI1uiCSY/+H0pROg==
dependencies:
"@typescript-eslint/types" "5.41.0"
"@typescript-eslint/visitor-keys" "5.41.0"
"@typescript-eslint/types" "5.43.0"
"@typescript-eslint/visitor-keys" "5.43.0"
debug "^4.3.4"
globby "^11.1.0"
is-glob "^4.0.3"
semver "^7.3.7"
tsutils "^3.21.0"
"@typescript-eslint/utils@5.41.0":
version "5.41.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.41.0.tgz#f41ae5883994a249d00b2ce69f4188f3a23fa0f9"
integrity sha512-QlvfwaN9jaMga9EBazQ+5DDx/4sAdqDkcs05AsQHMaopluVCUyu1bTRUVKzXbgjDlrRAQrYVoi/sXJ9fmG+KLQ==
"@typescript-eslint/typescript-estree@5.45.0":
version "5.45.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.45.0.tgz#f70a0d646d7f38c0dfd6936a5e171a77f1e5291d"
integrity sha512-maRhLGSzqUpFcZgXxg1qc/+H0bT36lHK4APhp0AEUVrpSwXiRAomm/JGjSG+kNUio5kAa3uekCYu/47cnGn5EQ==
dependencies:
"@typescript-eslint/types" "5.45.0"
"@typescript-eslint/visitor-keys" "5.45.0"
debug "^4.3.4"
globby "^11.1.0"
is-glob "^4.0.3"
semver "^7.3.7"
tsutils "^3.21.0"
"@typescript-eslint/utils@5.43.0":
version "5.43.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.43.0.tgz#00fdeea07811dbdf68774a6f6eacfee17fcc669f"
integrity sha512-8nVpA6yX0sCjf7v/NDfeaOlyaIIqL7OaIGOWSPFqUKK59Gnumd3Wa+2l8oAaYO2lk0sO+SbWFWRSvhu8gLGv4A==
dependencies:
"@types/json-schema" "^7.0.9"
"@types/semver" "^7.3.12"
"@typescript-eslint/scope-manager" "5.41.0"
"@typescript-eslint/types" "5.41.0"
"@typescript-eslint/typescript-estree" "5.41.0"
"@typescript-eslint/scope-manager" "5.43.0"
"@typescript-eslint/types" "5.43.0"
"@typescript-eslint/typescript-estree" "5.43.0"
eslint-scope "^5.1.1"
eslint-utils "^3.0.0"
semver "^7.3.7"
"@typescript-eslint/visitor-keys@5.41.0":
version "5.41.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.41.0.tgz#d3510712bc07d5540160ed3c0f8f213b73e3bcd9"
integrity sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==
"@typescript-eslint/visitor-keys@5.43.0":
version "5.43.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.43.0.tgz#cbbdadfdfea385310a20a962afda728ea106befa"
integrity sha512-icl1jNH/d18OVHLfcwdL3bWUKsBeIiKYTGxMJCoGe7xFht+E4QgzOqoWYrU8XSLJWhVw8nTacbm03v23J/hFTg==
dependencies:
"@typescript-eslint/types" "5.41.0"
"@typescript-eslint/types" "5.43.0"
eslint-visitor-keys "^3.3.0"
"@typescript-eslint/visitor-keys@5.45.0":
version "5.45.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.45.0.tgz#e0d160e9e7fdb7f8da697a5b78e7a14a22a70528"
integrity sha512-jc6Eccbn2RtQPr1s7th6jJWQHBHI6GBVQkCHoJFQ5UreaKm59Vxw+ynQUPPY2u2Amquc+7tmEoC2G52ApsGNNg==
dependencies:
"@typescript-eslint/types" "5.45.0"
eslint-visitor-keys "^3.3.0"
abab@^2.0.3, abab@^2.0.5:
@@ -1237,11 +1272,6 @@ before-after-hook@^2.2.0:
resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.2.tgz#a6e8ca41028d90ee2c24222f201c90956091613e"
integrity sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==
big.js@^5.2.2:
version "5.2.2"
resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328"
integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==
bl@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/bl/-/bl-5.0.0.tgz#6928804a41e9da9034868e1c50ca88f21f57aea2"
@@ -1388,7 +1418,7 @@ chalk@5.0.1, chalk@^5.0.0, chalk@^5.0.1:
resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.0.1.tgz#ca57d71e82bb534a296df63bbacc4a1c22b2a4b6"
integrity sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==
chalk@^2.0.0, chalk@^2.3.0:
chalk@^2.0.0:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
@@ -1397,7 +1427,7 @@ chalk@^2.0.0, chalk@^2.3.0:
escape-string-regexp "^1.0.5"
supports-color "^5.3.0"
chalk@^4.0.0:
chalk@^4.0.0, chalk@^4.1.0:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
@@ -1813,31 +1843,18 @@ emoji-regex@^9.2.2:
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72"
integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==
emojis-list@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78"
integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==
enabled@2.0.x:
version "2.0.0"
resolved "https://registry.yarnpkg.com/enabled/-/enabled-2.0.0.tgz#f9dd92ec2d6f4bbc0d5d1e64e21d61cd4665e7c2"
integrity sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==
enhanced-resolve@^4.0.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-4.5.0.tgz#2f3cfd84dbe3b487f18f2db2ef1e064a571ca5ec"
integrity sha512-Nv9m36S/vxpsI+Hc4/ZGRs0n9mXqSWGGq49zxb/cJfPAQMbUtttJAlNPS4AQzaBdw/pKskw5bMbekT/Y7W/Wlg==
enhanced-resolve@^5.0.0:
version "5.12.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.12.0.tgz#300e1c90228f5b570c4d35babf263f6da7155634"
integrity sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==
dependencies:
graceful-fs "^4.1.2"
memory-fs "^0.5.0"
tapable "^1.0.0"
errno@^0.1.3:
version "0.1.8"
resolved "https://registry.yarnpkg.com/errno/-/errno-0.1.8.tgz#8bb3e9c7d463be4976ff888f76b4809ebc2e811f"
integrity sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==
dependencies:
prr "~1.0.1"
graceful-fs "^4.2.4"
tapable "^2.2.0"
error-ex@^1.3.1:
version "1.3.2"
@@ -1990,10 +2007,10 @@ eslint-visitor-keys@^3.3.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826"
integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==
eslint@8.26.0:
version "8.26.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.26.0.tgz#2bcc8836e6c424c4ac26a5674a70d44d84f2181d"
integrity sha512-kzJkpaw1Bfwheq4VXUezFriD1GxszX6dUekM7Z3aC2o4hju+tsR/XyTC3RcoSD7jmy9VkPU3+N6YjVU2e96Oyg==
eslint@8.28.0:
version "8.28.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.28.0.tgz#81a680732634677cc890134bcdd9fdfea8e63d6e"
integrity sha512-S27Di+EVyMxcHiwDrFzk8dJYAaD+/5SoWKxL1ri/71CRHsnJnRDPNt2Kzj24+MT9FDupf4aqqyqPrvI8MvQ4VQ==
dependencies:
"@eslint/eslintrc" "^1.3.3"
"@humanwhocodes/config-array" "^0.11.6"
@@ -2508,7 +2525,7 @@ got@12.5.1, got@^12.1.0:
p-cancelable "^3.0.0"
responselike "^3.0.0"
graceful-fs@4.2.10, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.6, graceful-fs@^4.2.9:
graceful-fs@4.2.10, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9:
version "4.2.10"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c"
integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==
@@ -2700,7 +2717,7 @@ inflight@^1.0.4:
once "^1.3.0"
wrappy "1"
inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3:
inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
@@ -2991,11 +3008,6 @@ isarray@^2.0.5:
resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723"
integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==
isarray@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
@@ -3574,13 +3586,6 @@ json5@2.x, json5@^2.2.1:
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c"
integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==
json5@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe"
integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==
dependencies:
minimist "^1.2.0"
jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
@@ -3658,15 +3663,6 @@ lines-and-columns@^1.1.6:
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==
loader-utils@^1.0.2:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.4.0.tgz#c579b5e34cb34b1a74edc6c1fb36bfa371d5a613"
integrity sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==
dependencies:
big.js "^5.2.2"
emojis-list "^3.0.0"
json5 "^1.0.1"
locate-path@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0"
@@ -3768,14 +3764,6 @@ makeerror@1.0.12:
dependencies:
tmpl "1.0.5"
memory-fs@^0.5.0:
version "0.5.0"
resolved "https://registry.yarnpkg.com/memory-fs/-/memory-fs-0.5.0.tgz#324c01288b88652966d161db77838720845a8e3c"
integrity sha512-jA0rdU5KoQMC0e6ppoNRtpp6vjFq6+NY7r8hywnC7V+1Xj/MtHwGIbB1QaK/dunyjWteJzmkpd7ooeWg10T7GA==
dependencies:
errno "^0.1.3"
readable-stream "^2.0.1"
merge-stream@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60"
@@ -3853,6 +3841,11 @@ mute-stream@0.0.8:
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==
natural-compare-lite@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4"
integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==
natural-compare@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
@@ -3870,7 +3863,7 @@ new-github-release-url@2.0.0:
dependencies:
type-fest "^2.5.1"
nock@*, nock@13.2.9:
nock@*:
version "13.2.9"
resolved "https://registry.yarnpkg.com/nock/-/nock-13.2.9.tgz#4faf6c28175d36044da4cfa68e33e5a15086ad4c"
integrity sha512-1+XfJNYF1cjGB+TKMWi29eZ0b82QOvQs2YoLNzbpWGqFMtRQHTa57osqdGj4FrFPgkO4D4AZinzUJR9VvW3QUA==
@@ -3880,6 +3873,16 @@ nock@*, nock@13.2.9:
lodash "^4.17.21"
propagate "^2.0.0"
nock@13.3.0:
version "13.3.0"
resolved "https://registry.yarnpkg.com/nock/-/nock-13.3.0.tgz#b13069c1a03f1ad63120f994b04bfd2556925768"
integrity sha512-HHqYQ6mBeiMc+N038w8LkMpDCRquCHWeNmN3v6645P3NhN2+qXOBqvPqo7Rt1VyCMzKhJ733wZqw5B7cQVFNPg==
dependencies:
debug "^4.1.0"
json-stringify-safe "^5.0.1"
lodash "^4.17.21"
propagate "^2.0.0"
node-domexception@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5"
@@ -4238,11 +4241,6 @@ pretty-format@^27.0.0, pretty-format@^27.5.1:
ansi-styles "^5.0.0"
react-is "^17.0.1"
process-nextick-args@~2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
promise.allsettled@1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/promise.allsettled/-/promise.allsettled-1.0.5.tgz#2443f3d4b2aa8dfa560f6ac2aa6c4ea999d75f53"
@@ -4297,11 +4295,6 @@ proxy-from-env@^1.0.0:
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
prr@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476"
integrity sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==
psl@^1.1.28, psl@^1.1.33:
version "1.9.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7"
@@ -4369,19 +4362,6 @@ readable-stream@1.1.x:
isarray "0.0.1"
string_decoder "~0.10.x"
readable-stream@^2.0.1:
version "2.3.7"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
dependencies:
core-util-is "~1.0.0"
inherits "~2.0.3"
isarray "~1.0.0"
process-nextick-args "~2.0.0"
safe-buffer "~5.1.1"
string_decoder "~1.1.1"
util-deprecate "~1.0.1"
readable-stream@^3.4.0, readable-stream@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198"
@@ -4582,7 +4562,7 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.2, safe-buffer@~5.2.0:
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
safe-buffer@~5.1.0, safe-buffer@~5.1.1:
safe-buffer@~5.1.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
@@ -4623,6 +4603,13 @@ semver@^6.0.0, semver@^6.3.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d"
integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==
semver@^7.3.4:
version "7.3.8"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798"
integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==
dependencies:
lru-cache "^6.0.0"
setprototypeof@1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
@@ -4818,13 +4805,6 @@ string_decoder@~0.10.x:
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-0.10.31.tgz#62e203bc41766c6c28c9fc84301dab1c5310fa94"
integrity sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==
string_decoder@~1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
dependencies:
safe-buffer "~5.1.0"
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
@@ -4903,10 +4883,10 @@ symbol-tree@^3.2.4:
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==
tapable@^1.0.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2"
integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==
tapable@^2.2.0:
version "2.2.1"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==
terminal-link@^2.0.0:
version "2.1.1"
@@ -5031,16 +5011,15 @@ ts-jest@^27.0.4:
semver "7.x"
yargs-parser "20.x"
ts-loader@8.0.10:
version "8.0.10"
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-8.0.10.tgz#4af4afb8d26847290cd010df93a4c172df92278f"
integrity sha512-5fVbbZldz6LQi6RQ0v1P7lZ98CZGlQyM8b4xGZXw3G/XUqL8GIH+Ib6H01nImPhkHZ9+PVXZgTb+v3fRsaIHlg==
ts-loader@9.4.2:
version "9.4.2"
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.4.2.tgz#80a45eee92dd5170b900b3d00abcfa14949aeb78"
integrity sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==
dependencies:
chalk "^2.3.0"
enhanced-resolve "^4.0.0"
loader-utils "^1.0.2"
chalk "^4.1.0"
enhanced-resolve "^5.0.0"
micromatch "^4.0.0"
semver "^6.0.0"
semver "^7.3.4"
tslib@^1.8.1:
version "1.14.1"
@@ -5124,10 +5103,10 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"
typescript@4.8.4:
version "4.8.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6"
integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==
typescript@4.9.4:
version "4.9.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78"
integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==
unbox-primitive@^1.0.2:
version "1.0.2"
@@ -5201,7 +5180,7 @@ url-join@5.0.0:
resolved "https://registry.yarnpkg.com/url-join/-/url-join-5.0.0.tgz#c2f1e5cbd95fa91082a93b58a1f42fecb4bdbcf1"
integrity sha512-n2huDr9h9yzd6exQVnH/jU5mr+Pfx08LRXXZhkLLetAMESRj+anQsTAh940iMrIetKAmry9coFuZQ2jY8/p3WA==
util-deprecate@^1.0.1, util-deprecate@~1.0.1:
util-deprecate@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==