Merge branch 'develop' into pw-4466/notifyShopper_endpoint

This commit is contained in:
Wouter Boereboom
2021-05-05 15:27:11 +02:00
committed by GitHub
6 changed files with 65 additions and 41 deletions

View File

@@ -8,24 +8,28 @@
[![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)
The Adyen API Library for NodeJS enables you to work with Adyen APIs.
This is the officially supported NodeJS library for using Adyen's APIs.
## Integration
The Library supports all APIs under the following services:
* [x] checkout
* [x] checkout utility
* [x] payments
* [x] modifications
* [x] payouts
* [x] recurring
* [x] notifications
* [x] BIN lookup
* [x] Terminal API
* [Checkout API](https://docs.adyen.com/api-explorer/#/CheckoutService/v67/overview): Our latest integration for accepting online payments. Current supported version: **v67**
* [Payments API](https://docs.adyen.com/api-explorer/#/Payment/v64/overview): Our classic integration for online payments. Current supported version: **v64**
* [Recurring API](https://docs.adyen.com/api-explorer/#/Recurring/v49/overview): Endpoints for managing saved payment details. Current supported version: **v49**
* [Payouts API](https://docs.adyen.com/api-explorer/#/Payout/v64/overview): Endpoints for sending funds to your customers. Current supported version: **v64**
* [Platforms APIs](https://docs.adyen.com/platforms/api): Set of APIs when using Adyen for Platforms.
* [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**
* [Notification Configuration API](https://docs.adyen.com/api-explorer/#/NotificationConfigurationService/v6/overview) Current supported version: **v6**
* [Local/Cloud-based Terminal API](https://docs.adyen.com/point-of-sale/terminal-api-reference): Our point-of-sale integration.
* [BIN lookup API](https://docs.adyen.com/api-explorer/#/BinLookup/v50/overview): The BIN Lookup API provides endpoints for retrieving information based on a given BIN. Current supported version: **v50**
## Requirements
For more information, refer to our [documentation](https://docs.adyen.com/) or the [API Explorer](https://docs.adyen.com/api-explorer/).
* Node 10 or higher
## Prerequisites
- [Adyen test account](https://docs.adyen.com/get-started-with-adyen)
- [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 10 or higher
## Installation
@@ -37,12 +41,28 @@ You can use NPM to add our library to your project
npm install --save @adyen/api-library
```
## Documentation
* https://docs.adyen.com/developers/development-resources/libraries
* https://docs.adyen.com/developers/checkout
Alternatively, you can download the [release on GitHub](https://github.com/Adyen/adyen-node-api-library/releases).
## HTTP Client Configuration
## Using the library
### 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"});
```
### General use with API key for live environment
```typescript
const client = new Client({apiKey: "YOUR_API_KEY", environment: "LIVE"});
```
### General use with basic auth
```typescript
const client = new Client({username: "YOUR_USERNAME", password: "YOUR_PASSWORD", environment: "TEST"});
```
### 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`:
```javascript
@@ -89,20 +109,23 @@ client.httpClient = httpClient;
...
```
## Testing
`$ npm run test`
### Example integration
For a closer look at how our PHP library works, clone our [example integration](https://github.com/adyen-examples/adyen-node-online-payments). This includes commented code, highlighting key features and concepts, and examples of API calls that can be made using the library.
## Support
If you have a feature request, or spotted a bug or a technical problem, create a GitHub issue. For other questions, contact our [support team](https://support.adyen.com/hc/en-us/requests/new?ticket_form_id=360000705420).
## Contributing
## Contributing
We strongly encourage you to join us in contributing to this repository so everyone can benefit from:
* New features and functionality
* Resolved bug fixes and issues
* Any general improvements
Read our [**contribution guidelines**](CONTRIBUTING.md) to find out how.
Read our [**contribution guidelines**](CONTRIBUTING.md) to find out how to create a pull request.
## Support
If you have a feature request, or spotted a bug or a technical problem, create a GitHub issue. For other questions, contact our [support team](https://support.adyen.com/).
## Licence
This repository is available under the [MIT license](LICENSE).
MIT license. For more information, see the LICENSE file.
## See also
* [example integration](https://github.com/adyen-examples/adyen-node-online-payments)

12
package-lock.json generated
View File

@@ -1185,9 +1185,9 @@
"dev": true
},
"acorn": {
"version": "8.2.2",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.2.2.tgz",
"integrity": "sha512-VrMS8kxT0e7J1EX0p6rI/E0FbfOVcvBpbIqHThFv+f8YrZIlMfVotYcXKVPmTvPW8sW5miJzfUFrrvthUZg8VQ==",
"version": "8.2.4",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.2.4.tgz",
"integrity": "sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg==",
"dev": true
},
"acorn-globals": {
@@ -2373,9 +2373,9 @@
}
},
"dotenv": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz",
"integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==",
"version": "8.4.0",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.4.0.tgz",
"integrity": "sha512-l+pIWjvRva0AhnLerv9VvpscgXa72iPW1qKlCgA7COzJA414vGQ/PMcOuNfR1CmQbK208WWYeVwQUa8yfuqH8Q==",
"dev": true
},
"duplexer3": {

View File

@@ -61,8 +61,8 @@ function createAmountObject(currency: string, value: number): Amount {
function createPaymentsDetailsRequest(): DetailsRequest {
return {
details: {
mD: "mdValue",
paRes: "paResValue",
MD: "mdValue",
PaRes: "paResValue",
},
paymentData: "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...",
};

View File

@@ -111,6 +111,7 @@ class Client {
this.config.endpoint = Client.ENDPOINT_LIVE;
this.config.marketPayEndpoint = Client.MARKETPAY_ENDPOINT_LIVE;
this.config.hppEndpoint = Client.HPP_LIVE;
this.config.terminalApiCloudEndpoint = Client.TERMINAL_API_ENDPOINT_LIVE;
if (liveEndpointUrlPrefix) {
this.config.endpoint =
`${Client.ENDPOINT_PROTOCOL}${liveEndpointUrlPrefix}${Client.ENDPOINT_LIVE_SUFFIX}`;

View File

@@ -14,15 +14,15 @@ export class PaymentCompletionDetails {
/**
* A payment session identifier returned by the card issuer.
*/
'mD'?: string;
'MD'?: string;
/**
* (3D) Payment Authentication Request data for the card issuer.
*/
'paReq'?: string;
'PaReq'?: string;
/**
* (3D) Payment Authentication Response data by the card issuer.
*/
'paRes'?: string;
'PaRes'?: string;
/**
* PayPal-generated token for recurring payments.
*/

View File

@@ -908,9 +908,9 @@ acorn@^7.1.0, acorn@^7.1.1:
integrity sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==
acorn@^8.0.1:
version "8.2.2"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.2.2.tgz#c4574e4fea298d6e6ed4b85ab844b06dd59f26d6"
integrity sha512-VrMS8kxT0e7J1EX0p6rI/E0FbfOVcvBpbIqHThFv+f8YrZIlMfVotYcXKVPmTvPW8sW5miJzfUFrrvthUZg8VQ==
version "8.2.4"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.2.4.tgz#caba24b08185c3b56e3168e97d15ed17f4d31fd0"
integrity sha512-Ibt84YwBDDA890eDiDCEqcbwvHlBvzzDkU2cGBBDDI1QWT12jTiXIOn2CIw5KK4i6N5Z2HUxwYjzriDyqaqqZg==
agent-base@6:
version "6.0.1"
@@ -1784,9 +1784,9 @@ dot-prop@^5.2.0:
is-obj "^2.0.0"
dotenv@^8.2.0:
version "8.2.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a"
integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==
version "8.4.0"
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.4.0.tgz#08576a9d5dc63b4fc58df087015c768eb102e0f3"
integrity sha512-l+pIWjvRva0AhnLerv9VvpscgXa72iPW1qKlCgA7COzJA414vGQ/PMcOuNfR1CmQbK208WWYeVwQUa8yfuqH8Q==
duplexer3@^0.1.4:
version "0.1.4"