Compare commits

...

94 Commits

Author SHA1 Message Date
Ricardo Ambrogi
5be7c38302 Release v2.1.7 2019-10-30 10:46:13 +01:00
Ricardo Ambrogi
fabd41584e Merge branch 'master' into develop 2019-10-30 08:21:38 +01:00
Ricardo Ambrogi
98a7741107 Update package.json 2019-10-30 08:20:58 +01:00
Renovate Bot
b06c2ccf1b Update dependency @types/jest to v24.0.21 (#160) 2019-10-30 08:15:45 +01:00
Ricardo Ambrogi
158843ec69 Hotfix/notification typing (#158)
* fix NotificationRequestItem casing
2019-10-29 08:08:27 +01:00
Renovate Bot
4b2f875c7a Update typescript-eslint monorepo to v2.6.0 (#159) 2019-10-29 08:08:05 +01:00
Ricardo Ambrogi
675377448a Update CODEOWNERS 2019-10-28 12:45:11 +01:00
Ricardo Ambrogi
3e1042b4ce Update CODEOWNERS 2019-10-28 12:37:25 +01:00
Renovate Bot
d9afdd2fe9 Update dependency eslint to v6.6.0 (#155) 2019-10-27 08:51:27 +01:00
Renovate Bot
cb2c7d9872 Update dependency @types/jest to v24.0.20 (#156) 2019-10-27 08:51:13 +01:00
Renovate Bot
30caa5a3c2 Update dependency @types/node to v11.15.0 (#154) 2019-10-25 09:00:55 +02:00
Renovate Bot
93f25fd687 Update dependency nock to v11.6.0 (#153) 2019-10-25 09:00:42 +02:00
Renovate Bot
5e09e336bc Update dependency https-proxy-agent to v3.0.1 (#151) 2019-10-24 08:10:28 +02:00
Renovate Bot
1dff362706 Update dependency @types/node to v11.13.23 (#152) 2019-10-24 08:10:05 +02:00
Renovate Bot
76e6904b89 Update dependency ts-loader to v6.2.1 (#150) 2019-10-23 08:33:16 +02:00
Renovate Bot
d2819aa9e2 Update dependency nock to v11.5.0 (#149) 2019-10-23 08:33:05 +02:00
Ricardo Ambrogi
409f1fd405 Release v2.1.6 2019-10-23 08:21:14 +02:00
Ricardo Ambrogi
b81e4a4e41 fix types with invalid syntax (#147) 2019-10-22 13:23:11 +02:00
Ricardo Ambrogi
5594ff573c Merge branch 'master' into develop 2019-10-22 13:17:21 +02:00
Ricardo Ambrogi
fff61d8eb7 fix types with invalid syntax (#147) 2019-10-22 13:16:37 +02:00
Ricardo Ambrogi
15eddcbac2 Merge pull request #146 from Adyen/develop
v2.1.6
2019-10-22 12:49:03 +02:00
Ricardo Ambrogi
0288acd7a3 Merge branch 'master' into develop 2019-10-22 12:42:45 +02:00
Renovate Bot
98b55e9438 Update typescript-eslint monorepo to v2.5.0 (#145) 2019-10-22 08:10:00 +02:00
Renovate Bot
fae77fc1ca Update dependency webpack to v4.41.2 (#144) 2019-10-15 15:18:03 +02:00
Ricardo Ambrogi
36f5d7e920 Create CODEOWNERS (#143)
* Create CODEOWNERS

* Update CODEOWNERS
2019-10-15 10:42:08 +02:00
Renovate Bot
ff993a2e8d Update dependency @types/jest to v24.0.19 (#142) 2019-10-15 08:10:12 +02:00
Renovate Bot
e5f60ecfed Update dependency webpack to v4.41.1 (#140) 2019-10-11 15:34:01 +02:00
Renovate Bot
0d95a73f41 Update dependency coveralls to v3.0.7 (#139) 2019-10-11 11:23:21 +02:00
Renovate Bot
5ebf1966f2 Update dependency @babel/core to v7.6.4 (#138) 2019-10-11 11:23:07 +02:00
Renovate Bot
63e6e1979c Update dependency typescript to v3.6.4 (#137) 2019-10-10 10:45:26 +02:00
Renovate Bot
7231957e37 Update babel monorepo to v7.6.3 (#136) 2019-10-09 08:07:44 +02:00
Renovate Bot
074a9d708d Update dependency release-it to v12.4.3 (#135) 2019-10-09 08:07:32 +02:00
Ricardo Ambrogi
c0d6257573 Update API types version (#134) 2019-10-09 08:07:20 +02:00
Renovate Bot
8e3cb93756 Update dependency https-proxy-agent to v3 (#133) 2019-10-08 11:42:51 +02:00
Renovate Bot
427427619d Update typescript-eslint monorepo to v2.3.3 (#132) 2019-10-08 11:42:20 +02:00
Renovate Bot
2463523aaf Update dependency nock to v11.4.0 (#131) 2019-10-08 11:42:10 +02:00
Renovate Bot
0128f5f89a Update dependency nock to v11.3.6 (#129) 2019-10-07 08:41:22 +02:00
Renovate Bot
3799f21851 Update dependency @types/node to v11.13.22 (#128) 2019-10-04 15:04:06 +02:00
Renovate Bot
1bd4829b7a Update dependency release-it to v12.4.2 (#127) 2019-10-02 09:28:45 +02:00
Renovate Bot
eb6577bb7c Update typescript-eslint monorepo to v2.3.2 (#125) 2019-10-01 14:25:30 +02:00
Renovate Bot
b7e14948ad Update dependency eslint to v6.5.1 (#126) 2019-10-01 14:25:20 +02:00
Ricardo Ambrogi
b70dc70070 Update README.md 2019-10-01 14:25:01 +02:00
Renovate Bot
97f9a5a3bc Update dependency eslint to v6.5.0 (#123) 2019-09-30 08:21:38 +02:00
Renovate Bot
68822e485a Update dependency ts-loader to v6.2.0 (#124) 2019-09-30 08:21:27 +02:00
Ricardo Ambrogi
1ff792277a Merge pull request #122 from Adyen/develop
Remove unused type
2019-09-27 09:17:58 +02:00
Ricardo Ambrogi
097a6c423b Remove unused type 2019-09-27 08:52:29 +02:00
Ricardo Ambrogi
842fe1a50b Merge pull request #118 from Adyen/develop
v2.1.5 release
2019-09-27 08:42:04 +02:00
Renovate Bot
11728b3db5 Update dependency @types/node to v11.13.21 (#120) 2019-09-25 08:31:47 +02:00
Renovate Bot
c171f7b674 Update dependency webpack to v4.41.0 (#119) 2019-09-25 08:31:39 +02:00
Renovate Bot
431297593f Update babel monorepo to v7.6.2 (#117) 2019-09-25 08:31:23 +02:00
Ricardo Ambrogi
0af9e8b589 Merge branch 'master' into develop 2019-09-24 15:15:23 +02:00
KadoBOT
71fd431c46 Release 2.1.5 2019-09-24 13:12:19 +00:00
KadoBOT
170685f6c4 change release-it run script 2019-09-24 13:10:13 +00:00
Renovate Bot
f6a1716714 Update typescript-eslint monorepo to v2.3.1 (#116) 2019-09-24 14:45:39 +02:00
Renovate Bot
b3dc185851 Pin dependency release-it to 12.4.1 (#115) 2019-09-24 14:45:26 +02:00
Ricardo Ambrogi
57e3dccb11 adds release-it (#114) 2019-09-23 16:02:03 +02:00
Renovate Bot
9a194e7752 Update dependency nock to v11.3.5 (#111) 2019-09-23 10:58:33 +02:00
Renovate Bot
7e76d1b4c8 Update dependency ts-loader to v6.1.2 (#112) 2019-09-23 08:24:14 +02:00
Hans Otto Wirtz
e5b8b70ecd Fix escaping in HMAC Validator (#113)
* Fix escaping in HMAC Validator

Previously, when using a DataToSign object with a `shipBeforeDate`, the date would be escaped incorrectly.
`2019-09-21T11:45:24.637Z` should become `2019-09-21T11\:45\:24.637Z`, but became `2019-09-21T11\:45:24.637Z` as only the first `:` would be escaped.

* Add test for hmac date string escaping
2019-09-23 08:24:00 +02:00
Renovate Bot
90f0e664b9 Update dependency ts-loader to v6.1.1 (#110) 2019-09-20 09:52:13 +02:00
Renovate Bot
f87c525cf8 Update dependency webpack-cli to v3.3.9 (#109) 2019-09-17 10:28:44 +02:00
Renovate Bot
61ef73c0d1 Update typescript-eslint monorepo to v2.3.0 (#108) 2019-09-17 10:27:17 +02:00
Renovate Bot
d89f0974a5 Update dependency eslint to v6.4.0 (#107) 2019-09-16 08:38:47 +02:00
Renovate Bot
282fc30e28 Update dependency webpack to v4.40.2 (#106) 2019-09-16 08:38:33 +02:00
Renovate Bot
8c635a7855 Update dependency webpack to v4.40.1 (#104) 2019-09-13 15:31:46 +02:00
Renovate Bot
edbdd6cc7d Update dependency nock to v11.3.4 (#105) 2019-09-13 15:31:31 +02:00
Renovate Bot
2f5408d436 Update dependency ts-loader to v6.1.0 (#103) 2019-09-12 09:50:22 +02:00
Renovate Bot
3ea6181d91 Update dependency typescript to v3.6.3 (#102) 2019-09-12 09:39:06 +02:00
Ricardo Ambrogi
5d02fc148b DRY (#101)
* DRY

* shortened logic
2019-09-11 08:26:16 +02:00
Ricardo Ambrogi
8acd312ab0 Update README.md 2019-09-10 15:24:16 +02:00
Renovate Bot
f1e3848439 Update typescript-eslint monorepo to v2.2.0 (#100) 2019-09-10 09:15:27 +02:00
Ricardo Ambrogi
dd56326255 remove unnecessary cast 2019-09-09 13:34:52 +02:00
Ricardo Ambrogi
0d6406694b Update .sonarcloud.properties 2019-09-09 13:29:42 +02:00
Ricardo Ambrogi
5742a463ae Create .sonarcloud.properties 2019-09-09 13:15:49 +02:00
Renovate Bot
7c49bc466b Update babel monorepo to v7.6.0 (#99) 2019-09-09 08:48:42 +02:00
Renovate Bot
ffa63e8204 Update dependency nock to v11.3.3 (#98) 2019-09-09 08:48:28 +02:00
Renovate Bot
91f38e0272 Update dependency webpack-cli to v3.3.8 (#97) 2019-09-09 08:48:06 +02:00
Ricardo Ambrogi
7cd93d6512 Pw 1662/payment methods v49 (#95)
* remove examples

* improve http client error handling

* add brand
2019-09-03 09:47:12 +02:00
Renovate Bot
0facfe2419 Update typescript-eslint monorepo to v2.1.0 (#96) 2019-09-03 08:39:22 +02:00
Renovate Bot
37f6085d24 Update dependency eslint to v6.3.0 (#94) 2019-09-02 10:00:05 +02:00
Renovate Bot
437c062788 Update dependency @types/node to v11.13.20 (#93) 2019-08-30 08:50:44 +02:00
Renovate Bot
780fb5bbf1 Update dependency typescript to v3.6.2 (#92) 2019-08-30 08:50:32 +02:00
Renovate Bot
db6716a85a Update dependency webpack to v4.39.3 (#91) 2019-08-28 15:44:23 +02:00
Marcos Garcia
9e6c216aae PW-1507: Add merchantName on ThreeDS2RequestData model (#90) 2019-08-26 15:36:45 +02:00
Renovate Bot
7d3b2731f6 Update dependency eslint to v6.2.2 (#89) 2019-08-26 08:45:21 +02:00
Renovate Bot
b1fd794054 Update dependency nock to v11.3.2 (#88) 2019-08-26 08:45:01 +02:00
Renovate Bot
af80b86594 Update dependency nock to v11.3.1 (#87) 2019-08-23 08:41:58 +02:00
Renovate Bot
fc5010078b Update dependency eslint to v6.2.1 (#86) 2019-08-22 10:56:20 +02:00
Ricardo Ambrogi
5385ca5bb6 Release v2.1.4 2019-08-20 11:58:25 +02:00
Renovate Bot
87f87d0181 Update dependency @types/jest to v24.0.18 (#82) 2019-08-20 11:53:08 +02:00
Renovate Bot
42b71d41a2 Update dependency nock to v11.3.0 (#83) 2019-08-20 11:52:53 +02:00
Ricardo Ambrogi
ec0e711fd8 Merge branch 'master' into develop 2019-08-20 11:52:04 +02:00
Ricardo Ambrogi
a61f51d43b Release v2.1.4 2019-08-20 11:51:16 +02:00
Ricardo Ambrogi
5b8c2b2ff8 fix exception handler in http client (#84) 2019-08-20 11:50:42 +02:00
40 changed files with 12452 additions and 615 deletions

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @KadoBOT @msilvagarcia @cyattilakiss @rkewlani @Aleffio @rikterbeek

12
.release-it.json Normal file
View File

@@ -0,0 +1,12 @@
{
"git": {
"tagName": "v${version}",
"changelog": "npx auto-changelog --stdout --commit-limit false -u"
},
"github": {
"release": true
},
"hooks": {
"after:bump": "npx auto-changelog -p"
}
}

19
.sonarcloud.properties Normal file
View File

@@ -0,0 +1,19 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the ODPi Egeria project.
# Path to sources
#sonar.sources=.
sonar.exclusions=src/__mocks__/*
sonar.exclusions=src/typings/*
#sonar.inclusions=
# Path to tests
#sonar.tests=
#sonar.test.exclusions=
#sonar.test.inclusions=
# Source encoding
#sonar.sourceEncoding=UTF-8
# Exclusions for copy-paste detection
#sonar.cpd.exclusions=

View File

@@ -4,6 +4,7 @@
[![Downloads](https://img.shields.io/npm/dm/@adyen/api-library.svg)](https://www.npmjs.com/package/@adyen/api-library)
![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)
The Adyen API Library for NodeJS enables you to work with Adyen APIs and Hosted Payment Pages.
@@ -92,7 +93,3 @@ If you have any problems, questions or suggestions, create an issue here or send
## Licence
MIT license. For more information, see the LICENSE file.
## Other
You can find examples inside the `examples` folder in this repo.

View File

@@ -1,24 +0,0 @@
const TerminalAPI = require("./terminalApi");
const terminalAPI = new TerminalAPI();
const asyncPayment = async () => {
console.log("Starting transaction...");
const sentRequest = await terminalAPI.paymentRequestAsync();
console.log("Request sent. Waiting to retrieve status...");
setTimeout(async () => {
console.log("Retrieving status...");
const statusResponse = await terminalAPI.transactionStatusRequestSync(sentRequest);
const {TransactionStatusResponse} = statusResponse.SaleToPOIResponse;
if (TransactionStatusResponse && TransactionStatusResponse.Response.Result === 'Success') {
console.log("Response [result:%s data:%s]",
statusResponse.SaleToPOIResponse.TransactionStatusResponse.RepeatedMessageResponse.RepeatedResponseMessageBody.PaymentResponse.Response.Result,
statusResponse.SaleToPOIResponse.TransactionStatusResponse.RepeatedMessageResponse.RepeatedResponseMessageBody.PaymentResponse.Response.AdditionalResponse
);
} else {
console.log("Response [result:%s]", statusResponse.SaleToPOIResponse.TransactionStatusResponse.Response.Result)
}
}, 10000);
}

View File

@@ -1,12 +0,0 @@
const TerminalAPI = require("./terminalApi");
const terminalAPI = new TerminalAPI();
const localPayment = async () => {
const paymentsResponse = await terminalAPI.paymentRequestLocal();
console.log("Response [result:%s data:%s]",
paymentsResponse.SaleToPOIResponse.PaymentResponse.Response.Result,
paymentsResponse.SaleToPOIResponse.PaymentResponse.Response.AdditionalResponse
);
};

View File

@@ -1,13 +0,0 @@
const TerminalAPI = require("./terminalApi");
const terminalAPI = new TerminalAPI();
const syncPayment = async () => {
console.log("Starting transaction...");
const paymentsResponse = await terminalAPI.paymentRequestSync();
console.log("Response [result:%s data:%s]",
paymentsResponse.SaleToPOIResponse.PaymentResponse.Response.Result,
paymentsResponse.SaleToPOIResponse.PaymentResponse.Response.AdditionalResponse
);
};

View File

@@ -1,135 +0,0 @@
const {Client, Config, TerminalCloudAPI, TerminalLocalAPI} = require("../../src");
class TerminalApi {
terminalCloudAPI;
terminalLocalAPI;
constructor() {
const merchantAccount = "[MERCHANT ACCOUNT]";
const xApiKey = "[X_API_KEY]";
const config = new Config();
config.merchantAccount = merchantAccount;
config.apiKey = xApiKey; // alternatively you can authenticate with your username + password
// config.username = "[USERNAME]"
// config.password = "[PASSWORD]"
const client = new Client({config});
client.setEnvironment("[LIVE | TEST]");
this.terminalCloudAPI = new TerminalCloudAPI(client);
const localConfig = new Config();
localConfig.merchantAccount = merchantAccount;
localConfig.apiKey = xApiKey; // or username + password
localConfig.terminalApiLocalEndpoint = "[PROTOCOL]//[TERMINAL_IP]:[PORT]";
const localClient = new Client({config: localConfig});
this.terminalLocalAPI = new TerminalLocalAPI(localClient);
}
async paymentRequestLocal() {
const paymentsRequest = this.createPaymentRequest();
const securityKey = {
keyVersion: 1,
adyenCryptoVersion: 1,
keyIdentifier: "[CRYPTO_KEY_IDENTIFIER]",
passphrase: "[CRYPTO_KEY_PASSPHRASE]"
};
return this.terminalLocalAPI.request(paymentsRequest, securityKey);
}
paymentRequestSync() {
const paymentsRequest = this.createPaymentRequest();
console.log(`Payment [poiId:${paymentsRequest.SaleToPOIRequest.MessageHeader.POIID} serviceId:${paymentsRequest.SaleToPOIRequest.MessageHeader.ServiceID} saleId:${paymentsRequest.SaleToPOIRequest.MessageHeader.SaleID} amount:${paymentsRequest.SaleToPOIRequest.PaymentRequest.PaymentTransaction.AmountsReq.RequestedAmount} ${paymentsRequest.SaleToPOIRequest.PaymentRequest.PaymentTransaction.AmountsReq.Currency}]`)
return this.terminalCloudAPI.sync(paymentsRequest);
}
async paymentRequestAsync() {
const paymentsRequest = this.createPaymentRequest();
console.log(`Payment [poiId:${paymentsRequest.SaleToPOIRequest.MessageHeader.POIID} serviceId:${paymentsRequest.SaleToPOIRequest.MessageHeader.ServiceID} saleId:${paymentsRequest.SaleToPOIRequest.MessageHeader.SaleID} amount:${paymentsRequest.SaleToPOIRequest.PaymentRequest.PaymentTransaction.AmountsReq.RequestedAmount} ${paymentsRequest.SaleToPOIRequest.PaymentRequest.PaymentTransaction.AmountsReq.Currency}]`);
const response = await this.terminalCloudAPI.async(paymentsRequest);
return response === "ok" ? paymentsRequest : undefined;
}
createPaymentRequest() {
const saleToPOIRequest = {};
const messageHeader = this.createMessageHeader("Payment");
saleToPOIRequest.MessageHeader = messageHeader;
const paymentRequest = {};
const saleData = {};
const transactionIdentification = {};
transactionIdentification.TransactionID = "[TRANSACTION_ID]";
transactionIdentification.TimeStamp = new Date().toISOString();
saleData.SaleTransactionID = transactionIdentification;
const paymentTransation = {};
const amountsReq = {};
amountsReq.Currency = "EUR";
amountsReq.RequestedAmount = 1;
paymentTransation.AmountsReq = amountsReq;
paymentRequest.SaleData = saleData;
paymentRequest.PaymentTransaction = paymentTransation;
saleToPOIRequest.PaymentRequest = paymentRequest;
const terminalApiRequest = {};
terminalApiRequest.SaleToPOIRequest = saleToPOIRequest;
return terminalApiRequest;
}
createMessageHeader(messageCategoryType) {
const id = new Date().getTime() % 1000000000;
const messageHeader = {};
messageHeader.ProtocolVersion = "3.0";
messageHeader.MessageClass = "Service";
messageHeader.MessageCategory = messageCategoryType;
messageHeader.MessageType = "Request";
messageHeader.SaleID = id.toString();
messageHeader.ServiceID = id.toString();
messageHeader.POIID = "[POI_ID]";
return messageHeader;
}
createTransactionStatusRequest(paymentRequest) {
const saleToPOIRequest = {};
const messageHeader = this.createMessageHeader("TransactionStatus");
saleToPOIRequest.MessageHeader = messageHeader;
const transactionStatusRequest = {};
const messageReference = {};
messageReference.MessageCategory = "Payment";
messageReference.SaleID = paymentRequest.SaleToPOIRequest.MessageHeader.SaleID;
messageReference.ServiceID = paymentRequest.SaleToPOIRequest.MessageHeader.ServiceID;
transactionStatusRequest.MessageReference = messageReference;
saleToPOIRequest.TransactionStatusRequest = transactionStatusRequest;
const terminalAPIRequest = {};
terminalAPIRequest.SaleToPOIRequest = saleToPOIRequest;
return terminalAPIRequest;
}
transactionStatusRequestSync(terminalAPIRequest) {
const transactionStatusRequest = this.createTransactionStatusRequest(terminalAPIRequest);
return this.terminalCloudAPI.sync(transactionStatusRequest);
}
}
module.exports = TerminalApi;

10141
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@adyen/api-library",
"version": "2.1.3",
"version": "2.1.7",
"description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs and Hosted Payment Pages.",
"main": "dist/lib/src/index.js",
"types": "dist/lib/src/index.d.ts",
@@ -32,34 +32,36 @@
"test": "jest",
"preversion": "npm test",
"version": "npm run build && git add -A dist",
"postversion": "git push && git push --tags && rm -rf build/temp"
"postversion": "git push && git push --tags && rm -rf build/temp",
"release": "release-it --no-npm.publish"
},
"author": "Ricardo Ambrogi",
"license": "MIT",
"devDependencies": {
"@babel/core": "7.5.5",
"@babel/core": "7.6.4",
"@babel/plugin-proposal-class-properties": "7.5.5",
"@babel/plugin-proposal-object-rest-spread": "7.5.5",
"@babel/plugin-transform-runtime": "7.5.5",
"@babel/preset-env": "7.5.5",
"@babel/preset-typescript": "7.3.3",
"@babel/runtime": "7.5.5",
"@types/jest": "24.0.17",
"@babel/plugin-proposal-object-rest-spread": "7.6.2",
"@babel/plugin-transform-runtime": "7.6.2",
"@babel/preset-env": "7.6.3",
"@babel/preset-typescript": "7.6.0",
"@babel/runtime": "7.6.3",
"@types/jest": "24.0.21",
"@types/nock": "10.0.3",
"@types/node": "11.13.18",
"@typescript-eslint/eslint-plugin": "2.0.0",
"@typescript-eslint/parser": "2.0.0",
"@types/node": "11.15.0",
"@typescript-eslint/eslint-plugin": "2.6.0",
"@typescript-eslint/parser": "2.6.0",
"babel-loader": "8.0.6",
"coveralls": "3.0.6",
"eslint": "6.2.0",
"coveralls": "3.0.7",
"eslint": "6.6.0",
"jest": "24.9.0",
"nock": "11.0.0",
"ts-loader": "6.0.4",
"typescript": "3.5.3",
"webpack": "4.39.2",
"webpack-cli": "3.3.7"
"nock": "11.6.0",
"release-it": "12.4.3",
"ts-loader": "6.2.1",
"typescript": "3.6.4",
"webpack": "4.41.2",
"webpack-cli": "3.3.9"
},
"dependencies": {
"https-proxy-agent": "2.2.2"
"https-proxy-agent": "3.0.1"
}
}

View File

@@ -26,8 +26,8 @@ describe("HMAC Validator", function (): void {
});
it("should get correct data with escaped characters", function (): void {
const hmacValidator = new HmacValidator();
const dataToSign = hmacValidator.getDataToSign({currencyCode: "EUR", merchantAccount: "ACC:\\"});
expect(dataToSign).toEqual("currencyCode:merchantAccount:EUR:ACC\\:\\\\");
const dataToSign = hmacValidator.getDataToSign({currencyCode: "EUR", merchantAccount: "ACC:\\", sessionValidity: "2019-09-21T11:45:24.637Z"});
expect(dataToSign).toEqual("currencyCode:merchantAccount:sessionValidity:EUR:ACC\\:\\\\:2019-09-21T11\\:45\\:24.637Z");
});
it("should encrypt correctly", function (): void {
const data = "countryCode:currencyCode:merchantAccount:merchantReference:paymentAmount:sessionValidity:skinCode:NL:EUR:MagentoMerchantTest2:TEST-PAYMENT-2017-02-01-14\\:02\\:05:199:2017-02-02T14\\:02\\:05+01\\:00:PKz2KML1";

View File

@@ -1,43 +1,51 @@
import nock from "nock";
import nock, {Interceptor} from "nock";
import Client from "../client";
import Checkout from "../services/checkout";
import ApiException from "../services/exception/apiException";
import {createPaymentsCheckoutRequest} from "./checkout.spec";
import HttpClientException from "../httpClient/httpClientException";
import {Environment} from "../typings/enums/environment";
beforeEach((): void => {
nock.cleanAll();
});
type errorType = "HttpClientException" | "ApiException";
type testOptions = { errorType: errorType; errorMessageContains?: string; errorMessageEquals?: string };
const getResponse = async ({apiKey , environment }: { apiKey: string; environment: Environment}, cb: (scope: Interceptor) => testOptions) => {
const client = new Client({ apiKey, environment });
const checkout = new Checkout(client);
const scope = nock(`${client.config.checkoutEndpoint}/${Client.CHECKOUT_API_VERSION}`)
.post("/payments");
const { errorMessageContains, errorMessageEquals, errorType } = cb(scope);
const ErrorException = errorType === "ApiException" ? ApiException : HttpClientException;
try {
await checkout.payments(createPaymentsCheckoutRequest());
fail("request should fail");
} catch (e) {
expect(e instanceof ErrorException).toBeTruthy();
if(errorMessageEquals) expect(e.message).toEqual(errorMessageEquals);
if(errorMessageContains) expect(e.message.toLowerCase()).toContain(errorMessageContains);
}
};
describe("HTTP Client", function (): void {
it("should return ApiException when no API Key is provided", async (): Promise<void> => {
const client = new Client({apiKey: "", environment: "TEST"});
const checkout = new Checkout(client);
it.each`
apiKey | environment | withError | args | errorType | contains | equals
${""} | ${"TEST"} | ${true} | ${["mocked_error_response"]} | ${"ApiException"} | ${"x-api-key"} | ${""}
${"MOCKED_API_KEY"} | ${"TEST"} | ${true} | ${["some_error"]} | ${"ApiException"} | ${""} | ${"some_error"}
${"API_KEY"} | ${"TEST"} | ${false} | ${[401, { status: 401, message: "Invalid Request", errorCode: "171", errorType: "validationError"}]} | ${"HttpClientException"} | ${""} | ${"HTTP Exception: 401. null: Invalid Request"}
${"API_KEY"} | ${"TEST"} | ${false} | ${[401, {}]} | ${"HttpClientException"} | ${""} | ${"HTTP Exception: 401. null"}
${"API_KEY"} | ${"TEST"} | ${false} | ${[401, "fail"]} | ${"HttpClientException"} | ${""} | ${"HTTP Exception: 401. null"}
`("Should return $errorType, $contains, $equals", async ({ apiKey, environment, withError, args, errorType, contains, equals }) => {
await getResponse({ apiKey, environment }, (scope) => {
if (withError) scope.replyWithError(args[0]);
else scope.reply(args[0], args[1]);
nock(`${client.config.checkoutEndpoint}/${Client.CHECKOUT_API_VERSION}`)
.post("/payments")
.replyWithError("error");
try {
await checkout.payments(createPaymentsCheckoutRequest());
} catch (e) {
expect(e instanceof ApiException);
expect(e.message).toContain("x-api-key");
}
});
it("should return ApiException on request error", async (): Promise<void> => {
const client = new Client({apiKey: "API_KEY", environment: "TEST"});
const checkout = new Checkout(client);
nock(`${client.config.checkoutEndpoint}/${Client.CHECKOUT_API_VERSION}`)
.post("/payments")
.replyWithError({message: "error_message", statusCode: 500});
try {
await checkout.payments(createPaymentsCheckoutRequest());
} catch (e) {
expect(e instanceof ApiException);
expect(e.message).toEqual("error_message");
}
return { errorType, errorMessageContains: contains, errorMessageEquals: equals };
});
});
});

View File

@@ -4,62 +4,82 @@ import captureFalse from "../__mocks__/notification/captureFalse.json";
import refundTrue from "../__mocks__/notification/refundTrue.json";
import refundFalse from "../__mocks__/notification/refundFalse.json";
import NotificationRequest from "../notification/notificationRequest";
import {NotificationEnum, NotificationRequestItem} from "../typings/notification";
import {Notification, NotificationEnum, NotificationRequestItem} from "../typings/notification";
describe("Notification Test", function (): void {
it("should return authorisation success", function (): void {
const notificationRequest = new NotificationRequest(authorisationTrue);
const notificationRequest = new NotificationRequest(authorisationTrue as unknown as Notification);
expect(notificationRequest.notificationItems).toHaveLength(1);
const notificationRequestItem: NotificationRequestItem = notificationRequest.notificationItems[0];
expect(NotificationEnum.EVENT_CODE_AUTHORISATION).toEqual(notificationRequestItem.eventCode);
expect(notificationRequestItem.success === "true").toBeTruthy();
expect(notificationRequestItem.pspReference).toEqual("123456789");
if (notificationRequest.notificationItems) {
const notificationRequestItem: NotificationRequestItem = notificationRequest.notificationItems[0];
expect(NotificationEnum.EVENT_CODE_AUTHORISATION).toEqual(notificationRequestItem.eventCode);
expect(notificationRequestItem.success === "true").toBeTruthy();
expect(notificationRequestItem.pspReference).toEqual("123456789");
} else {
fail();
}
});
it("should return capture success", function (): void {
const notificationRequest = new NotificationRequest(captureTrue);
const notificationRequest = new NotificationRequest(captureTrue as unknown as Notification);
expect(notificationRequest.notificationItems).toHaveLength(1);
const notificationRequestItem = notificationRequest.notificationItems[0];
expect(NotificationEnum.EVENT_CODE_CAPTURE).toEqual(notificationRequestItem.eventCode);
expect(notificationRequestItem.success === "true").toBeTruthy();
expect(notificationRequestItem.pspReference).toEqual("PSP_REFERENCE");
expect(notificationRequestItem.originalReference).toEqual("ORIGINAL_PSP");
if (notificationRequest.notificationItems) {
const notificationRequestItem = notificationRequest.notificationItems[0];
expect(NotificationEnum.EVENT_CODE_CAPTURE).toEqual(notificationRequestItem.eventCode);
expect(notificationRequestItem.success === "true").toBeTruthy();
expect(notificationRequestItem.pspReference).toEqual("PSP_REFERENCE");
expect(notificationRequestItem.originalReference).toEqual("ORIGINAL_PSP");
} else {
fail();
}
});
it("should return capture fail", function (): void {
const notificationRequest = new NotificationRequest(captureFalse);
const notificationRequest = new NotificationRequest(captureFalse as unknown as Notification);
expect(notificationRequest.notificationItems).toHaveLength(1);
const notificationRequestItem = notificationRequest.notificationItems[0];
expect(NotificationEnum.EVENT_CODE_CAPTURE).toEqual(notificationRequestItem.eventCode);
expect(notificationRequestItem.success === "true").toBeFalsy();
expect(notificationRequestItem.pspReference).toEqual("PSP_REFERENCE");
expect(notificationRequestItem.originalReference).toEqual("ORIGINAL_PSP");
if (notificationRequest.notificationItems) {
const notificationRequestItem = notificationRequest.notificationItems[0];
expect(NotificationEnum.EVENT_CODE_CAPTURE).toEqual(notificationRequestItem.eventCode);
expect(notificationRequestItem.success === "true").toBeFalsy();
expect(notificationRequestItem.pspReference).toEqual("PSP_REFERENCE");
expect(notificationRequestItem.originalReference).toEqual("ORIGINAL_PSP");
} else {
fail();
}
});
it("should return refund success", function (): void {
const notificationRequest = new NotificationRequest(refundTrue);
const notificationRequest = new NotificationRequest(refundTrue as unknown as Notification);
expect(notificationRequest.notificationItems).toHaveLength(1);
const notificationRequestItem = notificationRequest.notificationItems[0];
expect(NotificationEnum.EVENT_CODE_REFUND).toEqual(notificationRequestItem.eventCode);
expect(notificationRequestItem.success === "true").toBeTruthy();
expect(notificationRequestItem.pspReference).toEqual("PSP_REFERENCE");
expect(notificationRequestItem.originalReference).toEqual("ORIGINAL_PSP");
expect(notificationRequestItem.eventDate).toBeDefined();
if (notificationRequest.notificationItems) {
const notificationRequestItem = notificationRequest.notificationItems[0];
expect(NotificationEnum.EVENT_CODE_REFUND).toEqual(notificationRequestItem.eventCode);
expect(notificationRequestItem.success === "true").toBeTruthy();
expect(notificationRequestItem.pspReference).toEqual("PSP_REFERENCE");
expect(notificationRequestItem.originalReference).toEqual("ORIGINAL_PSP");
expect(notificationRequestItem.eventDate).toBeDefined();
} else {
fail();
}
});
it("should return refund fail", function (): void {
const notificationRequest = new NotificationRequest(refundFalse);
const notificationRequest = new NotificationRequest(refundFalse as unknown as Notification);
expect(notificationRequest.notificationItems).toHaveLength(1);
const notificationRequestItem = notificationRequest.notificationItems[0];
expect(NotificationEnum.EVENT_CODE_REFUND).toEqual(notificationRequestItem.eventCode);
expect(notificationRequestItem.success === "true").toBeFalsy();
expect(notificationRequestItem.pspReference).toEqual("PSP_REFERENCE");
expect(notificationRequestItem.originalReference).toEqual("ORIGINAL_PSP");
expect(notificationRequestItem.eventDate).toBeDefined();
if (notificationRequest.notificationItems) {
const notificationRequestItem = notificationRequest.notificationItems[0];
expect(NotificationEnum.EVENT_CODE_REFUND).toEqual(notificationRequestItem.eventCode);
expect(notificationRequestItem.success === "true").toBeFalsy();
expect(notificationRequestItem.pspReference).toEqual("PSP_REFERENCE");
expect(notificationRequestItem.originalReference).toEqual("ORIGINAL_PSP");
expect(notificationRequestItem.eventDate).toBeDefined();
} else {
fail();
}
});
});

View File

@@ -4,7 +4,7 @@ import {asyncRes} from "../__mocks__/terminalApi/async";
import {syncRes} from "../__mocks__/terminalApi/sync";
import Client from "../client";
import TerminalCloudAPI from "../services/terminalCloudAPI";
import {Convert, TerminalApiRequest, TerminalApiResponse} from "../typings/terminal";
import {Convert, TerminalApiResponse} from "../typings/terminal";
let client: Client;
@@ -21,7 +21,7 @@ describe("Terminal Cloud API", (): void => {
it("should make an async payment request", async (): Promise<void> => {
scope.post("/async").reply(200, asyncRes);
const terminalAPIPaymentRequest: TerminalApiRequest = createTerminalAPIPaymentRequest() as TerminalApiRequest;
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();
const requestResponse: string = await terminalCloudAPI.async(terminalAPIPaymentRequest);
@@ -32,7 +32,7 @@ describe("Terminal Cloud API", (): void => {
const response = Convert.toTerminalApiResponse(syncRes);
scope.post("/sync").reply(200, response);
const terminalAPIPaymentRequest: TerminalApiRequest = createTerminalAPIPaymentRequest() as TerminalApiRequest;
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();
const terminalAPIResponse: TerminalApiResponse = await terminalCloudAPI.sync(terminalAPIPaymentRequest);
expect(terminalAPIResponse).toEqual(response);

View File

@@ -3,7 +3,7 @@ import {createMockClientFromResponse, createTerminalAPIPaymentRequest} from "../
import {localEncRes, localSecuredRes, wrongEncRes} from "../__mocks__/terminalApi/local";
import Client from "../client";
import TerminalLocalAPI from "../services/terminalLocalAPI";
import {Convert, SecurityKey, TerminalApiRequest, TerminalApiResponse} from "../typings/terminal";
import {Convert, SecurityKey, TerminalApiResponse} from "../typings/terminal";
import NexoCryptoException from "../services/exception/nexoCryptoException";
let client: Client;
@@ -22,7 +22,7 @@ describe("Terminal Local API", (): void => {
const response = Convert.toTerminalApiResponse(localSecuredRes);
scope.post("/").reply(200, securedResponse);
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest() as TerminalApiRequest;
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();
const securityKey: SecurityKey = {
adyenCryptoVersion: 1,
@@ -41,7 +41,7 @@ describe("Terminal Local API", (): void => {
const securedResponse = Convert.toTerminalApiSecuredResponse(wrongEncRes);
scope.post("/").reply(200, securedResponse);
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest() as TerminalApiRequest;
const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();
const securityKey: SecurityKey = {
adyenCryptoVersion: 1,

View File

@@ -21,6 +21,8 @@
import Resource from "../services/resource";
import { RequestOptions } from "../typings/requestOptions";
import HttpClientException from "../httpClient/httpClientException";
import ApiException from "../services/exception/apiException";
async function getJsonResponse<T>(resource: Resource, jsonRequest: T | string, requestOptions?: RequestOptions): Promise<string>;
async function getJsonResponse<T, R>(resource: Resource, jsonRequest: T | string, requestOptions?: RequestOptions): Promise<R>;
@@ -29,11 +31,11 @@ async function getJsonResponse<T, R>(
resource: Resource,
jsonRequest: T | string,
requestOptions: RequestOptions = {},
): Promise<R | string> {
): Promise<R | string | HttpClientException | ApiException> {
const request = typeof jsonRequest === "string" ? jsonRequest : JSON.stringify(jsonRequest);
const response = await resource.request(request, requestOptions);
try {
return JSON.parse(response);
return typeof response === "string" ? JSON.parse(response) : response;
} catch (e) {
return response;
}

View File

@@ -41,6 +41,7 @@ import ClientInterface from "../typings/httpClient/clientInterface";
import HttpClientException from "./httpClientException";
import checkServerIdentity from "../helpers/checkServerIdentity";
import {ApiError} from "../typings/apiError";
import ApiException from "../services/exception/apiException";
class HttpURLConnectionClient implements ClientInterface {
private static CHARSET = "utf-8";
@@ -50,7 +51,7 @@ class HttpURLConnectionClient implements ClientInterface {
public request(
endpoint: string, json: string, config: Config, isApiRequired: boolean,
requestOptions: RequestOptions,
): Promise<string> {
): Promise<string | HttpClientException | ApiException> {
requestOptions.headers = {};
requestOptions.timeout = config.connectionTimeoutMillis;
@@ -60,7 +61,11 @@ class HttpURLConnectionClient implements ClientInterface {
const apiKey = config.apiKey;
if (isApiRequired || apiKey) {
if (isApiRequired && !apiKey) {
return Promise.reject(new ApiException("Invalid X-API-Key was used", 401));
}
if (apiKey) {
requestOptions.headers[API_KEY] = apiKey;
} else {
const authString = `${config.username}:${config.password}`;
@@ -75,7 +80,7 @@ class HttpURLConnectionClient implements ClientInterface {
return this.doPostRequest(httpConnection, json);
}
public post(endpoint: string, postParameters: [string, string][], config: Config): Promise<string> {
public post(endpoint: string, postParameters: [string, string][], config: Config): Promise<HttpClientException | string> {
const postQuery: string = this.getQuery(postParameters);
const connectionRequest: ClientRequest = this.createRequest(endpoint, {}, config.applicationName);
return this.doPostRequest(connectionRequest, postQuery);
@@ -99,8 +104,7 @@ class HttpURLConnectionClient implements ClientInterface {
if (this.proxy && this.proxy.host) {
const { host, port, ...options } = this.proxy;
const agent = new HttpsProxyAgent({ host, port: port || 443, ...options });
requestOptions.agent = agent;
requestOptions.agent = new HttpsProxyAgent({ host, port: port || 443, ...options });
} else {
requestOptions.agent = new Agent(this.agentOptions);
}
@@ -117,23 +121,44 @@ class HttpURLConnectionClient implements ClientInterface {
return params.map(([key, value]): string => `${key}=${value}`).join("&");
}
private doPostRequest(connectionRequest: ClientRequest, json: string): Promise<string> {
private doPostRequest(connectionRequest: ClientRequest, json: string): Promise<HttpClientException | string> {
return new Promise((resolve, reject): void => {
connectionRequest.flushHeaders();
connectionRequest.on("response", (res: IncomingMessage): void => {
let resData = "";
const getException = (): HttpClientException => new HttpClientException(
`HTTP Exception: ${res.statusCode}. ${res.statusMessage}`,
res.statusCode,
undefined,
res.headers,
res,
);
let exception: HttpClientException | Error = getException();
res.on("data", (data): void => {
if (res.statusCode && res.statusCode !== 200) {
const formattedData: ApiError = JSON.parse(data.toString());
const exception = new HttpClientException(
`HTTP Exception: ${formattedData.status}. ${res.statusMessage}: ${formattedData.message}`,
formattedData.status,
formattedData.errorCode,
res.headers,
res,
);
return reject(exception);
try {
const formattedData: ApiError = JSON.parse(data.toString() as string);
const isApiError = "status" in formattedData;
const isRequestError = "errors" in formattedData;
if (isApiError) {
exception = new HttpClientException(
`HTTP Exception: ${formattedData.status}. ${res.statusMessage}: ${formattedData.message}`,
formattedData.status,
formattedData.errorCode,
res.headers,
res,
);
} else if (isRequestError) {
exception = new Error(data);
}
} catch (e) {
reject(exception);
} finally {
reject(exception);
}
}
resData += data;
@@ -152,13 +177,13 @@ class HttpURLConnectionClient implements ClientInterface {
connectionRequest.on("timeout", (): void => {
connectionRequest.abort();
});
connectionRequest.on("error", reject);
connectionRequest.on("error", (e) => reject(new ApiException(e.message)));
connectionRequest.write(Buffer.from(json));
connectionRequest.end();
});
}
private installCertificateVerifier(terminalCertificatePath: string): void {
private installCertificateVerifier(terminalCertificatePath: string): void | Promise<HttpClientException> {
try {
const certificateInput = fs.readFileSync(terminalCertificatePath);
@@ -168,7 +193,7 @@ class HttpURLConnectionClient implements ClientInterface {
};
} catch (e) {
throw new HttpClientException(`Error loading certificate from path: ${e.message}`);
return Promise.reject(new HttpClientException(`Error loading certificate from path: ${e.message}`));
}
}

View File

@@ -32,7 +32,7 @@ class NotificationRequest {
return undefined;
}
return this.notificationItemContainers.map((container): NotificationRequestItem => container.notificationRequestItem);
return this.notificationItemContainers.map((container): NotificationRequestItem => container.NotificationRequestItem);
}
public live: string;

View File

@@ -27,7 +27,7 @@ class ApiException implements Error {
public readonly message: string;
public readonly name: string;
public constructor(message: string, statusCode: number) {
public constructor(message: string, statusCode = 500) {
this.name = "ApiException";
this.message = message;
this.statusCode = statusCode;

View File

@@ -23,6 +23,7 @@ import Config from "../config";
import ClientInterface from "../typings/httpClient/clientInterface";
import Service from "../service";
import { RequestOptions } from "../typings/requestOptions";
import HttpClientException from "../httpClient/httpClientException";
import ApiException from "./exception/apiException";
abstract class Resource {
@@ -34,28 +35,16 @@ abstract class Resource {
this.endpoint = endpoint;
}
public request(json: string, requestOptions?: RequestOptions): Promise<string> {
public request(json: string, requestOptions?: RequestOptions): Promise<string | HttpClientException | ApiException> {
const clientInterface: ClientInterface = this.service.client.httpClient;
const config: Config = this.service.client.config;
try {
return clientInterface.request(
this.endpoint,
json, config,
this.service.apiKeyRequired,
requestOptions,
);
} catch (e) {
const apiException: ApiException = new ApiException(e.message, e.statusCode);
try {
apiException.error = e.responseBody;
} catch (err) {
throw new ApiException("Invalid response or an invalid X-API-Key key was used", err.statusCode);
}
throw apiException;
}
return clientInterface.request(
this.endpoint,
json, config,
this.service.apiKeyRequired,
requestOptions,
);
}
}

View File

@@ -38,4 +38,4 @@ export interface ShopperInteractionDevice {
os?: string;
osVersion?: string;
locale?: string;
}
}

View File

@@ -0,0 +1,33 @@
/**
* Adyen BinLookup API
* The BIN Lookup API provides endpoints for retrieving information, such as cost estimates, and 3D Secure supported version based on a given BIN.
*
* The version of the OpenAPI document: 50
* Contact: support@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export class BinDetail {
/**
* The country where the card was issued.
*/
'issuerCountry'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "issuerCountry",
"baseName": "issuerCountry",
"type": "string"
} ];
static getAttributeTypeMap() {
return BinDetail.attributeTypeMap;
}
}

View File

@@ -0,0 +1,64 @@
/**
* Adyen Checkout API
* Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including One-Click and 3D Secure), mobile wallets, and local payment methods (e.g. iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [Checkout documentation](https://docs.adyen.com/checkout). ## Authentication Each request to the Checkout API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/user-management/how-to-get-the-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_Checkout_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Checkout API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v50/payments ```
*
* The version of the OpenAPI document: 50
* Contact: support@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { CommonField } from './commonField';
import { ExternalPlatform } from './externalPlatform';
import { MerchantDevice } from './merchantDevice';
import { ShopperInteractionDevice } from './shopperInteractionDevice';
export class ApplicationInfo {
'adyenLibrary'?: CommonField;
'adyenPaymentSource'?: CommonField;
'externalPlatform'?: ExternalPlatform;
'merchantApplication'?: CommonField;
'merchantDevice'?: MerchantDevice;
'shopperInteractionDevice'?: ShopperInteractionDevice;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "adyenLibrary",
"baseName": "adyenLibrary",
"type": "CommonField"
},
{
"name": "adyenPaymentSource",
"baseName": "adyenPaymentSource",
"type": "CommonField"
},
{
"name": "externalPlatform",
"baseName": "externalPlatform",
"type": "ExternalPlatform"
},
{
"name": "merchantApplication",
"baseName": "merchantApplication",
"type": "CommonField"
},
{
"name": "merchantDevice",
"baseName": "merchantDevice",
"type": "MerchantDevice"
},
{
"name": "shopperInteractionDevice",
"baseName": "shopperInteractionDevice",
"type": "ShopperInteractionDevice"
} ];
static getAttributeTypeMap() {
return ApplicationInfo.attributeTypeMap;
}
}

View File

@@ -0,0 +1,42 @@
/**
* Adyen Checkout API
* Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including One-Click and 3D Secure), mobile wallets, and local payment methods (e.g. iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [Checkout documentation](https://docs.adyen.com/checkout). ## Authentication Each request to the Checkout API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/user-management/how-to-get-the-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_Checkout_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Checkout API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v50/payments ```
*
* The version of the OpenAPI document: 50
* Contact: support@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export class CommonField {
/**
* Name of the field. For example, Name of External Platform.
*/
'name'?: string;
/**
* Version of the field. For example, Version of External Platform.
*/
'version'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "name",
"baseName": "name",
"type": "string"
},
{
"name": "version",
"baseName": "version",
"type": "string"
} ];
static getAttributeTypeMap() {
return CommonField.attributeTypeMap;
}
}

View File

@@ -0,0 +1,51 @@
/**
* Adyen Checkout API
* Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including One-Click and 3D Secure), mobile wallets, and local payment methods (e.g. iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [Checkout documentation](https://docs.adyen.com/checkout). ## Authentication Each request to the Checkout API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/user-management/how-to-get-the-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_Checkout_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Checkout API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v50/payments ```
*
* The version of the OpenAPI document: 50
* Contact: support@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export class ExternalPlatform {
/**
* External platform integrator.
*/
'integrator'?: string;
/**
* Name of the field. For example, Name of External Platform.
*/
'name'?: string;
/**
* Version of the field. For example, Version of External Platform.
*/
'version'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "integrator",
"baseName": "integrator",
"type": "string"
},
{
"name": "name",
"baseName": "name",
"type": "string"
},
{
"name": "version",
"baseName": "version",
"type": "string"
} ];
static getAttributeTypeMap() {
return ExternalPlatform.attributeTypeMap;
}
}

View File

@@ -0,0 +1,51 @@
/**
* Adyen Checkout API
* Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including One-Click and 3D Secure), mobile wallets, and local payment methods (e.g. iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [Checkout documentation](https://docs.adyen.com/checkout). ## Authentication Each request to the Checkout API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/user-management/how-to-get-the-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_Checkout_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Checkout API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v50/payments ```
*
* The version of the OpenAPI document: 50
* Contact: support@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export class MerchantDevice {
/**
* Operating system running on the merchant device.
*/
'os'?: string;
/**
* Version of the operating system on the merchant device.
*/
'osVersion'?: string;
/**
* Merchant device reference.
*/
'reference'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "os",
"baseName": "os",
"type": "string"
},
{
"name": "osVersion",
"baseName": "osVersion",
"type": "string"
},
{
"name": "reference",
"baseName": "reference",
"type": "string"
} ];
static getAttributeTypeMap() {
return MerchantDevice.attributeTypeMap;
}
}

View File

@@ -1,10 +1,8 @@
/**
* Adyen Checkout Service
* Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including One-Click and 3D Secure), mobile wallets, and local payment methods (e.g. iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [Checkout documentation](https://docs.adyen.com/checkout). ## Authentication Each request to the Checkout API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/user-management/how-to-get-the-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_Checkout_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Checkout API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v46/payments ```
* Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including One-Click and 3D Secure), mobile wallets, and local payment methods (e.g. iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [Checkout documentation](https://docs.adyen.com/checkout). ## Authentication Each request to the Checkout API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/user-management/how-to-get-the-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_Checkout_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Checkout API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v49/payments ```
*
* OpenAPI spec version: 46
* OpenAPI spec version: 49
* Contact: support@adyen.com
*
* NOTE: This class is auto generated by the swagger code generator program.
@@ -14,7 +12,11 @@
import { PaymentMethodGroup } from './paymentMethodGroup';
export interface PaymentMethod {
export interface PaymentMethod {
/**
* List of possible brands. For example: visa, mc.
*/
brands?: Array<string>;
/**
* The configuration of the payment method.
*/
@@ -24,6 +26,10 @@ export interface PaymentMethod {
*/
details?: Array<InputDetail>;
group?: PaymentMethodGroup;
/**
* All input details to be provided to complete the payment with this payment method.
*/
inputDetails?: Array<InputDetail>;
/**
* The displayable name of this payment method.
*/

View File

@@ -0,0 +1,51 @@
/**
* Adyen Checkout API
* Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including One-Click and 3D Secure), mobile wallets, and local payment methods (e.g. iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [Checkout documentation](https://docs.adyen.com/checkout). ## Authentication Each request to the Checkout API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/user-management/how-to-get-the-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_Checkout_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Checkout API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v50/payments ```
*
* The version of the OpenAPI document: 50
* Contact: support@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export class ShopperInteractionDevice {
/**
* Locale on the shopper interaction device.
*/
'locale'?: string;
/**
* Operating system running on the shopper interaction device.
*/
'os'?: string;
/**
* Version of the operating system on the shopper interaction device.
*/
'osVersion'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "locale",
"baseName": "locale",
"type": "string"
},
{
"name": "os",
"baseName": "os",
"type": "string"
},
{
"name": "osVersion",
"baseName": "osVersion",
"type": "string"
} ];
static getAttributeTypeMap() {
return ShopperInteractionDevice.attributeTypeMap;
}
}

View File

@@ -0,0 +1,114 @@
/**
* Adyen Checkout API
* Adyen Checkout API provides a simple and flexible way to initiate and authorise online payments. You can use the same integration for payments made with cards (including One-Click and 3D Secure), mobile wallets, and local payment methods (e.g. iDEAL and Sofort). This API reference provides information on available endpoints and how to interact with them. To learn more about the API, visit [Checkout documentation](https://docs.adyen.com/checkout). ## Authentication Each request to the Checkout API must be signed with an API key. For this, obtain an API Key from your Customer Area, as described in [How to get the API key](https://docs.adyen.com/user-management/how-to-get-the-api-key). Then set this key to the `X-API-Key` header value, for example: ``` curl -H \"Content-Type: application/json\" \\ -H \"X-API-Key: Your_Checkout_API_key\" \\ ... ``` Note that when going live, you need to generate a new API Key to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Checkout API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://checkout-test.adyen.com/v50/payments ```
*
* The version of the OpenAPI document: 50
* Contact: support@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export class StoredPaymentMethod {
/**
* The brand of the card.
*/
'brand'?: string;
/**
* The month the card expires.
*/
'expiryMonth'?: string;
/**
* The year the card expires.
*/
'expiryYear'?: string;
/**
* The unique payment method code.
*/
'holderName'?: string;
/**
* A unique identifier of this stored payment method.
*/
'id'?: string;
/**
* The last four digits of the PAN.
*/
'lastFour'?: string;
/**
* The display name of the stored payment method.
*/
'name'?: string;
/**
* The shoppers email address.
*/
'shopperEmail'?: string;
/**
* The supported shopper interactions for this stored payment method.
*/
'supportedShopperInteractions'?: Array<string>;
/**
* The type of payment method.
*/
'type'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "brand",
"baseName": "brand",
"type": "string"
},
{
"name": "expiryMonth",
"baseName": "expiryMonth",
"type": "string"
},
{
"name": "expiryYear",
"baseName": "expiryYear",
"type": "string"
},
{
"name": "holderName",
"baseName": "holderName",
"type": "string"
},
{
"name": "id",
"baseName": "id",
"type": "string"
},
{
"name": "lastFour",
"baseName": "lastFour",
"type": "string"
},
{
"name": "name",
"baseName": "name",
"type": "string"
},
{
"name": "shopperEmail",
"baseName": "shopperEmail",
"type": "string"
},
{
"name": "supportedShopperInteractions",
"baseName": "supportedShopperInteractions",
"type": "Array<string>"
},
{
"name": "type",
"baseName": "type",
"type": "string"
} ];
static getAttributeTypeMap() {
return StoredPaymentMethod.attributeTypeMap;
}
}

View File

@@ -28,6 +28,11 @@ export interface ThreeDS2RequestData {
*/
deviceChannel: string;
deviceRenderOptions?: DeviceRenderOptions;
/**
* Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure/native-3ds2/authentication-only). The merchant name that the issuer presents to the shopper if they get a challenge. We recommend to use the same value that you will use in the authorization. Maximum length is 40 characters.
* Optional for a [full 3D Secure 2 integration](https://docs.adyen.com/checkout/3d-secure/native-3ds2/api-integration). Use this field if you are enrolled for 3D Secure 2 with us and want to override the merchant name already configured on your account.
*/
merchantName?: string;
/**
* The `messageVersion` value indicating the 3D Secure 2 protocol version.
*/

View File

@@ -21,12 +21,14 @@
import Config from "../../config";
import { RequestOptions } from "../requestOptions";
import { AgentOptions } from "https";
import HttpClientException from "../../httpClient/httpClientException";
import ApiException from "../../services/exception/apiException";
interface ClientInterface {
request(
endpoint: string, json: string, config: Config, isApiKeyRequired: boolean, requestOptions?: RequestOptions,
): Promise<string>;
post(endpoint: string, postParameters: [string, string][], config: Config): Promise<string>;
): Promise<string | HttpClientException | ApiException>;
post(endpoint: string, postParameters: [string, string][], config: Config): Promise<HttpClientException | string>;
proxy?: AgentOptions;
}

View File

@@ -13,7 +13,7 @@ export interface Notification {
}
export interface NotificationItem {
notificationRequestItem: NotificationRequestItem;
NotificationRequestItem: NotificationRequestItem;
}
export interface NotificationRequestItem {
@@ -206,7 +206,7 @@ const typeMap: any = {
{ json: "notificationItems", js: "notificationItems", typ: a(r("NotificationItem")) },
], false),
"NotificationItem": o([
{ json: "NotificationRequestItem", js: "notificationRequestItem", typ: r("NotificationRequestItem") },
{ json: "NotificationRequestItem", js: "NotificationRequestItem", typ: r("NotificationRequestItem") },
], false),
"NotificationRequestItem": o([
{ json: "additionalData", js: "additionalData", typ: u(undefined, m("any")) },
@@ -226,4 +226,4 @@ const typeMap: any = {
{ json: "currency", js: "currency", typ: "" },
{ json: "value", js: "value", typ: 0 },
], false),
};
};

View File

@@ -0,0 +1,64 @@
/**
* Adyen Payment API
* A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v50/authorise ```
*
* The version of the OpenAPI document: 50
* Contact: support@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { CommonField } from './commonField';
import { ExternalPlatform } from './externalPlatform';
import { MerchantDevice } from './merchantDevice';
import { ShopperInteractionDevice } from './shopperInteractionDevice';
export class ApplicationInfo {
'adyenLibrary'?: CommonField;
'adyenPaymentSource'?: CommonField;
'externalPlatform'?: ExternalPlatform;
'merchantApplication'?: CommonField;
'merchantDevice'?: MerchantDevice;
'shopperInteractionDevice'?: ShopperInteractionDevice;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "adyenLibrary",
"baseName": "adyenLibrary",
"type": "CommonField"
},
{
"name": "adyenPaymentSource",
"baseName": "adyenPaymentSource",
"type": "CommonField"
},
{
"name": "externalPlatform",
"baseName": "externalPlatform",
"type": "ExternalPlatform"
},
{
"name": "merchantApplication",
"baseName": "merchantApplication",
"type": "CommonField"
},
{
"name": "merchantDevice",
"baseName": "merchantDevice",
"type": "MerchantDevice"
},
{
"name": "shopperInteractionDevice",
"baseName": "shopperInteractionDevice",
"type": "ShopperInteractionDevice"
} ];
static getAttributeTypeMap() {
return ApplicationInfo.attributeTypeMap;
}
}

View File

@@ -0,0 +1,42 @@
/**
* Adyen Payment API
* A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v50/authorise ```
*
* The version of the OpenAPI document: 50
* Contact: support@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export class CommonField {
/**
* Name of the field. For example, Name of External Platform.
*/
'name'?: string;
/**
* Version of the field. For example, Version of External Platform.
*/
'version'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "name",
"baseName": "name",
"type": "string"
},
{
"name": "version",
"baseName": "version",
"type": "string"
} ];
static getAttributeTypeMap() {
return CommonField.attributeTypeMap;
}
}

View File

@@ -0,0 +1,51 @@
/**
* Adyen Payment API
* A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v50/authorise ```
*
* The version of the OpenAPI document: 50
* Contact: support@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export class ExternalPlatform {
/**
* External platform integrator.
*/
'integrator'?: string;
/**
* Name of the field. For example, Name of External Platform.
*/
'name'?: string;
/**
* Version of the field. For example, Version of External Platform.
*/
'version'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "integrator",
"baseName": "integrator",
"type": "string"
},
{
"name": "name",
"baseName": "name",
"type": "string"
},
{
"name": "version",
"baseName": "version",
"type": "string"
} ];
static getAttributeTypeMap() {
return ExternalPlatform.attributeTypeMap;
}
}

View File

@@ -0,0 +1,51 @@
/**
* Adyen Payment API
* A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v50/authorise ```
*
* The version of the OpenAPI document: 50
* Contact: support@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export class MerchantDevice {
/**
* Operating system running on the merchant device.
*/
'os'?: string;
/**
* Version of the operating system on the merchant device.
*/
'osVersion'?: string;
/**
* Merchant device reference.
*/
'reference'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "os",
"baseName": "os",
"type": "string"
},
{
"name": "osVersion",
"baseName": "osVersion",
"type": "string"
},
{
"name": "reference",
"baseName": "reference",
"type": "string"
} ];
static getAttributeTypeMap() {
return MerchantDevice.attributeTypeMap;
}
}

View File

@@ -0,0 +1,51 @@
/**
* Adyen Payment API
* A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v50/authorise ```
*
* The version of the OpenAPI document: 50
* Contact: support@adyen.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export class ShopperInteractionDevice {
/**
* Locale on the shopper interaction device.
*/
'locale'?: string;
/**
* Operating system running on the shopper interaction device.
*/
'os'?: string;
/**
* Version of the operating system on the shopper interaction device.
*/
'osVersion'?: string;
static discriminator: string | undefined = undefined;
static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [
{
"name": "locale",
"baseName": "locale",
"type": "string"
},
{
"name": "os",
"baseName": "os",
"type": "string"
},
{
"name": "osVersion",
"baseName": "osVersion",
"type": "string"
} ];
static getAttributeTypeMap() {
return ShopperInteractionDevice.attributeTypeMap;
}
}

View File

@@ -5529,4 +5529,4 @@ const typeMap: any = {
"PrinterReceipt",
"PrinterVoucher",
],
};
};

View File

@@ -42,7 +42,7 @@ class HmacValidator {
const keys: string[] = [];
const values: string[] = [];
const replacer = (str: string): string =>
str.replace("\\", "\\\\").replace(":", "\\:");
str.replace(/\\/g, "\\\\").replace(/:/g, "\\:");
Object.entries(notificationRequestItem).sort().forEach(([key, value]): void => {
keys.push(replacer(key));
values.push(replacer(value));
@@ -53,4 +53,4 @@ class HmacValidator {
}
}
export default HmacValidator;
export default HmacValidator;

1691
yarn.lock

File diff suppressed because it is too large Load Diff