mirror of
https://github.com/jlengrand/adyen-node-api-library.git
synced 2026-04-16 23:51:21 +00:00
Compare commits
163 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd8fa55cef | ||
|
|
6d9b17609c | ||
|
|
7f5f8cf2a2 | ||
|
|
6fbbff62fa | ||
|
|
2733ba9302 | ||
|
|
2e9e50bcc0 | ||
|
|
e11bdc2f93 | ||
|
|
05b06709f3 | ||
|
|
043c166fa6 | ||
|
|
edb56e3a2a | ||
|
|
d775655d86 | ||
|
|
5a8d3f0147 | ||
|
|
04747ce27f | ||
|
|
ef269b7ab1 | ||
|
|
4fbc665977 | ||
|
|
99edca9ad8 | ||
|
|
5e39f22b27 | ||
|
|
77d1175be1 | ||
|
|
395957d996 | ||
|
|
a9542bd568 | ||
|
|
bf4648af0f | ||
|
|
6208bd4b72 | ||
|
|
68431357b8 | ||
|
|
14dc2285bc | ||
|
|
75d056c1b1 | ||
|
|
7ca2c61b1a | ||
|
|
bb3874fc9c | ||
|
|
6377fe9f4d | ||
|
|
d2581b491c | ||
|
|
52ce784767 | ||
|
|
e69d27fa30 | ||
|
|
62497d123c | ||
|
|
5135a538e0 | ||
|
|
54e7b903bf | ||
|
|
6ad466654a | ||
|
|
d9457857cb | ||
|
|
cbfccd9d05 | ||
|
|
2ca3321605 | ||
|
|
53546d639e | ||
|
|
732752ee61 | ||
|
|
cb7dace017 | ||
|
|
11b21d03c2 | ||
|
|
4294caac37 | ||
|
|
7626667f99 | ||
|
|
554f8c8a01 | ||
|
|
4c528dbe71 | ||
|
|
0db48543f5 | ||
|
|
02796824cc | ||
|
|
a5259a443c | ||
|
|
4fe9e4f6a0 | ||
|
|
9f7d71759d | ||
|
|
9d98388b2a | ||
|
|
5d31670290 | ||
|
|
bdc7336b2f | ||
|
|
99a9b58528 | ||
|
|
0a2fcda73a | ||
|
|
fa19242b0c | ||
|
|
5f7ad68339 | ||
|
|
439e95b2f3 | ||
|
|
af9bbc5630 | ||
|
|
5f7a9b3611 | ||
|
|
a2447c6a09 | ||
|
|
0a4349b86d | ||
|
|
43556da382 | ||
|
|
b8062f7a94 | ||
|
|
2990f71d11 | ||
|
|
fbe374e394 | ||
|
|
5b28d9d806 | ||
|
|
d4891fe97d | ||
|
|
5be7c38302 | ||
|
|
fabd41584e | ||
|
|
98a7741107 | ||
|
|
b06c2ccf1b | ||
|
|
158843ec69 | ||
|
|
4b2f875c7a | ||
|
|
675377448a | ||
|
|
3e1042b4ce | ||
|
|
d9afdd2fe9 | ||
|
|
cb2c7d9872 | ||
|
|
30caa5a3c2 | ||
|
|
93f25fd687 | ||
|
|
5e09e336bc | ||
|
|
1dff362706 | ||
|
|
76e6904b89 | ||
|
|
d2819aa9e2 | ||
|
|
409f1fd405 | ||
|
|
b81e4a4e41 | ||
|
|
5594ff573c | ||
|
|
fff61d8eb7 | ||
|
|
15eddcbac2 | ||
|
|
0288acd7a3 | ||
|
|
98b55e9438 | ||
|
|
fae77fc1ca | ||
|
|
36f5d7e920 | ||
|
|
ff993a2e8d | ||
|
|
e5f60ecfed | ||
|
|
0d95a73f41 | ||
|
|
5ebf1966f2 | ||
|
|
63e6e1979c | ||
|
|
7231957e37 | ||
|
|
074a9d708d | ||
|
|
c0d6257573 | ||
|
|
8e3cb93756 | ||
|
|
427427619d | ||
|
|
2463523aaf | ||
|
|
0128f5f89a | ||
|
|
3799f21851 | ||
|
|
1bd4829b7a | ||
|
|
eb6577bb7c | ||
|
|
b7e14948ad | ||
|
|
b70dc70070 | ||
|
|
97f9a5a3bc | ||
|
|
68822e485a | ||
|
|
1ff792277a | ||
|
|
097a6c423b | ||
|
|
842fe1a50b | ||
|
|
11728b3db5 | ||
|
|
c171f7b674 | ||
|
|
431297593f | ||
|
|
0af9e8b589 | ||
|
|
71fd431c46 | ||
|
|
170685f6c4 | ||
|
|
f6a1716714 | ||
|
|
b3dc185851 | ||
|
|
57e3dccb11 | ||
|
|
9a194e7752 | ||
|
|
7e76d1b4c8 | ||
|
|
e5b8b70ecd | ||
|
|
90f0e664b9 | ||
|
|
f87c525cf8 | ||
|
|
61ef73c0d1 | ||
|
|
d89f0974a5 | ||
|
|
282fc30e28 | ||
|
|
8c635a7855 | ||
|
|
edbdd6cc7d | ||
|
|
2f5408d436 | ||
|
|
3ea6181d91 | ||
|
|
5d02fc148b | ||
|
|
8acd312ab0 | ||
|
|
f1e3848439 | ||
|
|
dd56326255 | ||
|
|
0d6406694b | ||
|
|
5742a463ae | ||
|
|
7c49bc466b | ||
|
|
ffa63e8204 | ||
|
|
91f38e0272 | ||
|
|
7cd93d6512 | ||
|
|
0facfe2419 | ||
|
|
37f6085d24 | ||
|
|
437c062788 | ||
|
|
780fb5bbf1 | ||
|
|
db6716a85a | ||
|
|
9e6c216aae | ||
|
|
7d3b2731f6 | ||
|
|
b1fd794054 | ||
|
|
af80b86594 | ||
|
|
fc5010078b | ||
|
|
5385ca5bb6 | ||
|
|
87f87d0181 | ||
|
|
42b71d41a2 | ||
|
|
ec0e711fd8 | ||
|
|
a61f51d43b | ||
|
|
5b8c2b2ff8 |
22
.babelrc
22
.babelrc
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"presets": [
|
||||
"@babel/env",
|
||||
[
|
||||
"@babel/preset-typescript",
|
||||
{
|
||||
"targets": {
|
||||
"node": "current"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
"plugins": [
|
||||
"@babel/proposal-class-properties",
|
||||
"@babel/proposal-object-rest-spread"
|
||||
],
|
||||
"env": {
|
||||
"test": {
|
||||
"plugins": ["@babel/plugin-transform-runtime"]
|
||||
}
|
||||
}
|
||||
}
|
||||
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* @KadoBOT @msilvagarcia @cyattilakiss @rkewlani @Aleffio @rikterbeek
|
||||
12
.release-it.json
Normal file
12
.release-it.json
Normal 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
19
.sonarcloud.properties
Normal 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=
|
||||
20
CONTRIBUTING.md
Normal file
20
CONTRIBUTING.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# Contribution guidelines
|
||||
|
||||
## How to contribute step-by-step
|
||||
|
||||
1. Fork the `Adyen/adyen-node-api-library` repository.
|
||||
2. Create a new branch from `develop` in your fork. This makes it easier for you to keep track of your changes.
|
||||
3. Make the desired changes to the code.
|
||||
* If you are adding new functionality or fixing a bug, we recommend you add unit tests that cover it.
|
||||
4. Push the changes to your fork.
|
||||
5. Create a pull request to the `Adyen/adyen-node-api-library` repository.
|
||||
6. In your pull request, please describe in detail:
|
||||
* What problem you’re solving
|
||||
* Your approach to fixing the problem
|
||||
* Any tests you wrote
|
||||
7. Check Allow edits from maintainers.
|
||||
8. Create the pull request.
|
||||
9. Ensure that all checks have passed.
|
||||
|
||||
After you create your pull request, one of the code owners will review your code.
|
||||
We aim to review your request within 2-3 business days.
|
||||
15
README.md
15
README.md
@@ -4,8 +4,9 @@
|
||||
[](https://www.npmjs.com/package/@adyen/api-library)
|
||||

|
||||
[](https://www.npmjs.com/package/@adyen/api-library)
|
||||
[](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.
|
||||
The Adyen API Library for NodeJS enables you to work with Adyen APIs.
|
||||
|
||||
## Integration
|
||||
The Library supports all APIs under the following services:
|
||||
@@ -89,10 +90,14 @@ client.httpClient = httpClient;
|
||||
|
||||
If you have any problems, questions or suggestions, create an issue here or send your inquiry to support@adyen.com.
|
||||
|
||||
## 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.
|
||||
|
||||
## Licence
|
||||
|
||||
MIT license. For more information, see the LICENSE file.
|
||||
|
||||
## Other
|
||||
|
||||
You can find examples inside the `examples` folder in this repo.
|
||||
|
||||
25
babel.config.js
Executable file
25
babel.config.js
Executable file
@@ -0,0 +1,25 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
"@babel/env",
|
||||
[
|
||||
"@babel/preset-typescript",
|
||||
{
|
||||
targets: {
|
||||
node: "current"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
plugins: [
|
||||
"@babel/proposal-class-properties",
|
||||
"@babel/proposal-object-rest-spread"
|
||||
],
|
||||
env: {
|
||||
test: {
|
||||
plugins: [
|
||||
"@babel/plugin-transform-runtime",
|
||||
"@babel/plugin-transform-typescript"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
);
|
||||
};
|
||||
|
||||
@@ -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
|
||||
);
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
preset: "ts-jest",
|
||||
moduleFileExtensions: [
|
||||
"ts",
|
||||
"js"
|
||||
@@ -32,5 +33,9 @@ module.exports = {
|
||||
],
|
||||
testMatch: [
|
||||
"**/__tests__/*.ts"
|
||||
],
|
||||
testPathIgnorePatterns : [
|
||||
"/node_modules",
|
||||
"/dist"
|
||||
]
|
||||
};
|
||||
|
||||
11806
package-lock.json
generated
Normal file
11806
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
48
package.json
48
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@adyen/api-library",
|
||||
"version": "2.1.3",
|
||||
"description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs and Hosted Payment Pages.",
|
||||
"version": "2.2.1",
|
||||
"description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs.",
|
||||
"main": "dist/lib/src/index.js",
|
||||
"types": "dist/lib/src/index.d.ts",
|
||||
"module": "dist/lib-esm/src/index.js",
|
||||
@@ -32,34 +32,38 @@
|
||||
"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/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/core": "7.8.3",
|
||||
"@babel/plugin-proposal-class-properties": "7.8.3",
|
||||
"@babel/plugin-proposal-object-rest-spread": "7.8.3",
|
||||
"@babel/plugin-transform-runtime": "7.8.3",
|
||||
"@babel/plugin-transform-typescript": "7.8.3",
|
||||
"@babel/preset-env": "7.8.3",
|
||||
"@babel/preset-typescript": "7.8.3",
|
||||
"@babel/runtime": "7.8.3",
|
||||
"@types/nock": "10.0.3",
|
||||
"@types/node": "11.13.18",
|
||||
"@typescript-eslint/eslint-plugin": "2.0.0",
|
||||
"@typescript-eslint/parser": "2.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "2.16.0",
|
||||
"@typescript-eslint/parser": "2.16.0",
|
||||
"babel-loader": "8.0.6",
|
||||
"coveralls": "3.0.6",
|
||||
"eslint": "6.2.0",
|
||||
"coveralls": "3.0.9",
|
||||
"eslint": "6.8.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.7.2",
|
||||
"release-it": "12.4.3",
|
||||
"ts-jest": "24.3.0",
|
||||
"ts-loader": "6.2.1",
|
||||
"typescript": "3.7.4",
|
||||
"webpack": "4.41.5",
|
||||
"webpack-cli": "3.3.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"https-proxy-agent": "2.2.2"
|
||||
"@types/node": "13.1.7",
|
||||
"@types/jest": "24.0.25",
|
||||
"https-proxy-agent": "4.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,9 +19,8 @@
|
||||
* See the LICENSE file for more info.
|
||||
*/
|
||||
import nock from "nock";
|
||||
import { createMockClientFromResponse } from "../__mocks__/base";
|
||||
import {createMockClientFromResponse} from "../__mocks__/base";
|
||||
import BinLookup from "../services/binLookup";
|
||||
import {CostEstimateRequest, ThreeDSAvailabilityRequest} from "../typings/binLookup";
|
||||
import Client from "../client";
|
||||
import HttpClientException from "../httpClient/httpClientException";
|
||||
|
||||
@@ -54,7 +53,7 @@ beforeEach((): void => {
|
||||
|
||||
describe("Bin Lookup", function (): void {
|
||||
it("should succeed on get 3ds availability", async function (): Promise<void> {
|
||||
const threeDSAvailabilityRequest: ThreeDSAvailabilityRequest = {
|
||||
const threeDSAvailabilityRequest: IBinLookup.ThreeDSAvailabilityRequest = {
|
||||
merchantAccount: "MOCK_MERCHANT_ACCOUNT",
|
||||
brands: ["randomBrand"],
|
||||
cardNumber: "4111111111111111"
|
||||
@@ -79,7 +78,7 @@ 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 binLookup.get3dsAvailability(threeDSAvailabilityRequest as unknown as IBinLookup.ThreeDSAvailabilityRequest);
|
||||
fail("Expected request to fail");
|
||||
} catch (e) {
|
||||
expect(e instanceof HttpClientException).toBeTruthy();
|
||||
@@ -92,7 +91,7 @@ describe("Bin Lookup", function (): void {
|
||||
resultCode: "Unsupported",
|
||||
surchargeType: "ZERO"
|
||||
};
|
||||
const costEstimateRequest: CostEstimateRequest = {
|
||||
const costEstimateRequest: IBinLookup.CostEstimateRequest = {
|
||||
amount: { currency: "EUR", value: 1000 },
|
||||
assumptions: {
|
||||
assumeLevel3Data: true,
|
||||
|
||||
@@ -28,26 +28,20 @@ import {paymentSessionSuccess} from "../__mocks__/checkout/paymentSessionSucess"
|
||||
import {paymentsResultMultibancoSuccess} from "../__mocks__/checkout/paymentsResultMultibancoSuccess";
|
||||
import {paymentsResultSuccess} from "../__mocks__/checkout/paymentsResultSucess";
|
||||
import Client from "../client";
|
||||
import { TYPE_SCHEME } from "../typings/constants/apiConstants";
|
||||
import Checkout from "../services/checkout";
|
||||
import {
|
||||
Amount,
|
||||
DetailsRequest,
|
||||
PaymentMethodsRequest,
|
||||
PaymentRequest,
|
||||
PaymentResponse,
|
||||
PaymentSetupRequest, PaymentVerificationRequest
|
||||
} from "../typings/checkout";
|
||||
import HttpClientException from "../httpClient/httpClientException";
|
||||
|
||||
function createAmountObject(currency: string, value: number): Amount {
|
||||
const merchantAccount = "MagentoMerchantTest";
|
||||
const reference = "Your order number";
|
||||
|
||||
function createAmountObject(currency: string, value: number): ICheckout.Amount {
|
||||
return {
|
||||
currency,
|
||||
value,
|
||||
};
|
||||
}
|
||||
|
||||
function createPaymentsDetailsRequest(): DetailsRequest {
|
||||
function createPaymentsDetailsRequest(): ICheckout.DetailsRequest {
|
||||
return {
|
||||
details: {
|
||||
MD: "mdValue",
|
||||
@@ -57,31 +51,31 @@ function createPaymentsDetailsRequest(): DetailsRequest {
|
||||
};
|
||||
}
|
||||
|
||||
export function createPaymentsCheckoutRequest(): PaymentRequest {
|
||||
export function createPaymentsCheckoutRequest(): ICheckout.PaymentRequest {
|
||||
const paymentMethodDetails = {
|
||||
cvc: "737",
|
||||
expiryMonth: "10",
|
||||
expiryYear: "2018",
|
||||
holderName: "John Smith",
|
||||
number: "4111111111111111",
|
||||
type: TYPE_SCHEME,
|
||||
type: "scheme",
|
||||
};
|
||||
|
||||
return {
|
||||
amount: createAmountObject("USD", 1000),
|
||||
merchantAccount: "MagentoMerchantTest",
|
||||
merchantAccount,
|
||||
paymentMethod: paymentMethodDetails,
|
||||
reference: "Your order number",
|
||||
reference,
|
||||
returnUrl: "https://your-company.com/...",
|
||||
};
|
||||
}
|
||||
|
||||
function createPaymentSessionRequest(): PaymentSetupRequest {
|
||||
function createPaymentSessionRequest(): ICheckout.PaymentSetupRequest {
|
||||
return {
|
||||
amount: createAmountObject("USD", 1000),
|
||||
countryCode: "NL",
|
||||
merchantAccount: "MagentoMerchantTest",
|
||||
reference: "Your order number",
|
||||
merchantAccount,
|
||||
reference,
|
||||
returnUrl: "https://your-company.com/...",
|
||||
};
|
||||
}
|
||||
@@ -101,8 +95,8 @@ describe("Checkout", (): void => {
|
||||
scope.post("/payments")
|
||||
.reply(200, paymentsSuccess);
|
||||
|
||||
const paymentsRequest: PaymentRequest = createPaymentsCheckoutRequest();
|
||||
const paymentsResponse: PaymentResponse = await checkout.payments(paymentsRequest);
|
||||
const paymentsRequest: ICheckout.PaymentRequest = createPaymentsCheckoutRequest();
|
||||
const paymentsResponse: ICheckout.PaymentResponse = await checkout.payments(paymentsRequest);
|
||||
expect(paymentsResponse.pspReference).toEqual("8535296650153317");
|
||||
});
|
||||
|
||||
@@ -111,7 +105,7 @@ describe("Checkout", (): void => {
|
||||
scope.post("/payments")
|
||||
.reply(401);
|
||||
|
||||
const paymentsRequest: PaymentRequest = createPaymentsCheckoutRequest();
|
||||
const paymentsRequest: ICheckout.PaymentRequest = createPaymentsCheckoutRequest();
|
||||
await checkout.payments(paymentsRequest);
|
||||
} catch (e) {
|
||||
expect(e instanceof HttpClientException).toBeTruthy();
|
||||
@@ -119,7 +113,7 @@ describe("Checkout", (): void => {
|
||||
});
|
||||
|
||||
it("should have valid payment methods", async (): Promise<void> => {
|
||||
const paymentMethodsRequest: PaymentMethodsRequest = {merchantAccount: "MagentoMerchantTest"};
|
||||
const paymentMethodsRequest: ICheckout.PaymentMethodsRequest = {merchantAccount: "MagentoMerchantTest"};
|
||||
|
||||
scope.post("/paymentMethods")
|
||||
.reply(200, paymentMethodsSuccess);
|
||||
@@ -133,6 +127,50 @@ describe("Checkout", (): void => {
|
||||
}
|
||||
});
|
||||
|
||||
it("should have valid payment link", async (): Promise<void> => {
|
||||
const amount = createAmountObject("BRL", 1000);
|
||||
const expiresAt = "2019-12-17T10:05:29Z";
|
||||
const paymentLinkRequest: ICheckout.CreatePaymentLinkRequest = {
|
||||
allowedPaymentMethods: ["scheme", "boletobancario"],
|
||||
amount,
|
||||
countryCode: "BR",
|
||||
merchantAccount,
|
||||
shopperReference: "shopperReference",
|
||||
shopperEmail: "test@email.com",
|
||||
shopperLocale: "pt_BR",
|
||||
billingAddress: {
|
||||
street: "Roque Petroni Jr",
|
||||
postalCode: "59000060",
|
||||
city: "São Paulo",
|
||||
houseNumberOrName: "999",
|
||||
country: "BR",
|
||||
stateOrProvince: "SP"
|
||||
},
|
||||
deliveryAddress: {
|
||||
street: "Roque Petroni Jr",
|
||||
postalCode: "59000060",
|
||||
city: "São Paulo",
|
||||
houseNumberOrName: "999",
|
||||
country: "BR",
|
||||
stateOrProvince: "SP"
|
||||
},
|
||||
expiresAt,
|
||||
reference
|
||||
};
|
||||
|
||||
const paymentLinkSuccess: ICheckout.CreatePaymentLinkResponse = {
|
||||
amount,
|
||||
expiresAt,
|
||||
reference,
|
||||
url: "paymentLinkResponse.url"
|
||||
};
|
||||
|
||||
scope.post("/paymentLinks").reply(200, paymentLinkSuccess);
|
||||
|
||||
const paymentSuccessLinkResponse = await checkout.paymentLinks(paymentLinkRequest);
|
||||
expect(paymentLinkSuccess).toEqual(paymentSuccessLinkResponse);
|
||||
});
|
||||
|
||||
it("should have payment details", async (): Promise<void> => {
|
||||
scope.post("/payments/details")
|
||||
.reply(200, paymentDetailsSuccess);
|
||||
@@ -142,21 +180,17 @@ describe("Checkout", (): void => {
|
||||
});
|
||||
|
||||
it("should have payment session success", async (): Promise<void> => {
|
||||
const client: Client = createMockClientFromResponse();
|
||||
scope.post("/paymentSession")
|
||||
.reply(200, paymentSessionSuccess);
|
||||
const checkout: Checkout = new Checkout(client);
|
||||
const paymentSessionRequest: PaymentSetupRequest = createPaymentSessionRequest();
|
||||
const paymentSessionRequest: ICheckout.PaymentSetupRequest = createPaymentSessionRequest();
|
||||
const paymentSessionResponse = await checkout.paymentSession(paymentSessionRequest);
|
||||
expect(paymentSessionResponse.paymentSession).not.toBeUndefined();
|
||||
});
|
||||
|
||||
it("should have payments result", async (): Promise<void> => {
|
||||
const client = createMockClientFromResponse();
|
||||
scope.post("/payments/result")
|
||||
.reply(200, paymentsResultSuccess);
|
||||
const checkout = new Checkout(client);
|
||||
const paymentResultRequest: PaymentVerificationRequest = {
|
||||
const paymentResultRequest: ICheckout.PaymentVerificationRequest = {
|
||||
payload: "This is a test payload",
|
||||
};
|
||||
const paymentResultResponse = await checkout.paymentResult(paymentResultRequest);
|
||||
@@ -164,10 +198,10 @@ describe("Checkout", (): void => {
|
||||
});
|
||||
|
||||
it("should have missing identifier on live", async (): Promise<void> => {
|
||||
const client = createMockClientFromResponse();
|
||||
client.setEnvironment("LIVE");
|
||||
try {
|
||||
new Checkout(client);
|
||||
fail();
|
||||
} catch (e) {
|
||||
expect(e.message).toEqual("Please provide your unique live url prefix on the setEnvironment() call on the Client or provide checkoutEndpoint in your config object.");
|
||||
}
|
||||
@@ -175,17 +209,18 @@ describe("Checkout", (): void => {
|
||||
|
||||
|
||||
it("should succeed on multibanco payment", async (): Promise<void> => {
|
||||
const client: Client = createMockClientFromResponse();
|
||||
scope.post("/payments")
|
||||
.reply(200, paymentsResultMultibancoSuccess);
|
||||
|
||||
const checkout: Checkout = new Checkout(client);
|
||||
const paymentsRequest: PaymentRequest = createPaymentsCheckoutRequest();
|
||||
const paymentsResponse: PaymentResponse = await checkout.payments(paymentsRequest);
|
||||
const paymentsRequest: ICheckout.PaymentRequest = createPaymentsCheckoutRequest();
|
||||
const paymentsResponse: ICheckout.PaymentResponse = await checkout.payments(paymentsRequest);
|
||||
expect(paymentsResponse.pspReference).toEqual("8111111111111111");
|
||||
expect(paymentsResponse.additionalData["comprafacil.amount"]).toEqual("101.01");
|
||||
expect(paymentsResponse.additionalData["comprafacil.deadline"]).toEqual("3");
|
||||
expect(paymentsResponse.additionalData["comprafacil.entity"]).toEqual("12345");
|
||||
|
||||
if (paymentsResponse.additionalData) {
|
||||
expect(paymentsResponse.additionalData["comprafacil.amount"]).toEqual("101.01");
|
||||
expect(paymentsResponse.additionalData["comprafacil.deadline"]).toEqual("3");
|
||||
expect(paymentsResponse.additionalData["comprafacil.entity"]).toEqual("12345");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -23,14 +23,13 @@ import nock from "nock";
|
||||
import { createMockClientFromResponse } from "../__mocks__/base";
|
||||
import {originKeysSuccess} from "../__mocks__/checkoutUtility/originkeysSuccess";
|
||||
import CheckoutUtility from "../services/checkoutUtility";
|
||||
import {CheckoutUtilityRequest} from "../typings/checkoutUtility";
|
||||
import Client from "../client";
|
||||
|
||||
describe("Checkout Utility", (): void => {
|
||||
it("should get origin keys", async (): Promise<void> => {
|
||||
const client = createMockClientFromResponse();
|
||||
const checkoutUtility = new CheckoutUtility(client);
|
||||
const originKeysRequest: CheckoutUtilityRequest = {
|
||||
const originKeysRequest: ICheckoutUtility.CheckoutUtilityRequest = {
|
||||
originDomains: ["www.test.com", "https://www.your-domain2.com"],
|
||||
};
|
||||
|
||||
@@ -39,7 +38,10 @@ describe("Checkout Utility", (): void => {
|
||||
.reply(200, originKeysSuccess);
|
||||
|
||||
const originKeysResponse = await checkoutUtility.originKeys(originKeysRequest);
|
||||
expect(originKeysResponse.originKeys["https://www.your-domain1.com"])
|
||||
.toEqual("pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4xLmNvbQ.UEwIBmW9-c_uXo5wSEr2w8Hz8hVIpujXPHjpcEse3xI");
|
||||
if (originKeysResponse.originKeys) {
|
||||
return expect(originKeysResponse.originKeys["https://www.your-domain1.com"])
|
||||
.toEqual("pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4xLmNvbQ.UEwIBmW9-c_uXo5wSEr2w8Hz8hVIpujXPHjpcEse3xI");
|
||||
}
|
||||
fail("Error: originKeysResponse.originKeys is empty");
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import HmacValidator from "../utils/hmacValidator";
|
||||
import {NotificationRequestItem} from "../typings/notification";
|
||||
import {HMAC_SIGNATURE} from "../typings/constants/apiConstants";
|
||||
import {ApiConstants} from "../constants/apiConstants";
|
||||
|
||||
const key = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00";
|
||||
const expectedSign = "ipnxGCaUZ4l8TUW75a71/ghd2Fe5ffvX0pV4TLTntIc=";
|
||||
@@ -15,35 +15,34 @@ const notificationRequestItem: NotificationRequestItem = {
|
||||
paymentMethod: "VISA",
|
||||
reason: "reason",
|
||||
success: "true",
|
||||
additionalData: { [HMAC_SIGNATURE]: expectedSign },
|
||||
additionalData: { [ApiConstants.HMAC_SIGNATURE]: expectedSign },
|
||||
};
|
||||
|
||||
describe("HMAC Validator", function (): void {
|
||||
let hmacValidator: HmacValidator;
|
||||
beforeEach(() => {
|
||||
hmacValidator = new HmacValidator();
|
||||
});
|
||||
|
||||
it("should get correct data", function (): void {
|
||||
const hmacValidator = new HmacValidator();
|
||||
const dataToSign = hmacValidator.getDataToSign({merchantAccount: "ACC", currencyCode: "EUR"});
|
||||
expect(dataToSign).toEqual("currencyCode:merchantAccount:EUR:ACC");
|
||||
});
|
||||
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";
|
||||
const key = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00";
|
||||
const hmacValidator = new HmacValidator();
|
||||
const encrypted = hmacValidator.calculateHmac(data, key);
|
||||
const encrypted = hmacValidator.calculateHmac(data, "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00");
|
||||
expect(encrypted).toEqual("34oR8T1whkQWTv9P+SzKyp8zhusf9n0dpqrm9nsqSJs=");
|
||||
});
|
||||
it("should get correct data to sign", function (): void {
|
||||
const hmacValidator = new HmacValidator();
|
||||
const data = hmacValidator.getDataToSign(notificationRequestItem);
|
||||
expect(data).toEqual("pspReference:originalReference:merchantAccount:reference:1000:EUR:EVENT:true");
|
||||
});
|
||||
|
||||
it("should have valid hmac", function (): void {
|
||||
const hmacValidator = new HmacValidator();
|
||||
const encrypted = hmacValidator.calculateHmac(notificationRequestItem, key);
|
||||
expect(expectedSign).toEqual(encrypted);
|
||||
expect(hmacValidator.validateHMAC(notificationRequestItem, key)).toBeTruthy();
|
||||
@@ -52,9 +51,8 @@ describe("HMAC Validator", function (): void {
|
||||
it("should have invalid hmac", function (): void {
|
||||
const invalidNotification = {
|
||||
...notificationRequestItem,
|
||||
additionalData: { [HMAC_SIGNATURE]: "notValidSign" }
|
||||
additionalData: { [ApiConstants.HMAC_SIGNATURE]: "notValidSign" }
|
||||
};
|
||||
const hmacValidator = new HmacValidator();
|
||||
const result = hmacValidator.validateHMAC(invalidNotification, key);
|
||||
expect(result).toBeFalsy();
|
||||
});
|
||||
|
||||
@@ -1,43 +1,50 @@
|
||||
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";
|
||||
|
||||
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 };
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1,13 +1,9 @@
|
||||
import nock from "nock";
|
||||
import { createMockClientFromResponse } from "../__mocks__/base";
|
||||
import {createMockClientFromResponse} from "../__mocks__/base";
|
||||
import Payout from "../services/payout";
|
||||
import {
|
||||
ModifyRequest,
|
||||
StoreDetailAndSubmitRequest,
|
||||
StoreDetailRequest, SubmitRequest, PayoutRequest
|
||||
} from "../typings/payout";
|
||||
import { FRAUD_MANUAL_REVIEW, FRAUD_RESULT_TYPE } from "../typings/constants/apiConstants";
|
||||
import Client from "../client";
|
||||
import StoreDetailRequest = IPayouts.StoreDetailRequest;
|
||||
import {ApiConstants} from "../constants/apiConstants";
|
||||
|
||||
const storeDetailAndSubmitThirdParty = JSON.stringify({
|
||||
additionalData: {
|
||||
@@ -35,13 +31,13 @@ const amountAndReference = {
|
||||
};
|
||||
|
||||
const defaultData = {
|
||||
dateOfBirth: new Date(),
|
||||
dateOfBirth: (new Date()).toISOString(),
|
||||
nationality: "NL",
|
||||
shopperEmail: "johndoe@email.com",
|
||||
shopperReference: "shopperReference",
|
||||
};
|
||||
|
||||
const mockStoreDetailRequest = (merchantAccount: string): StoreDetailRequest => ({
|
||||
const mockStoreDetailRequest = (merchantAccount: string): IPayouts.StoreDetailRequest => ({
|
||||
...defaultData,
|
||||
entityType: "NaturalPerson",
|
||||
recurring: {
|
||||
@@ -50,7 +46,7 @@ const mockStoreDetailRequest = (merchantAccount: string): StoreDetailRequest =>
|
||||
merchantAccount,
|
||||
});
|
||||
|
||||
const mockSubmitRequest = (merchantAccount: string): SubmitRequest => ({
|
||||
const mockSubmitRequest = (merchantAccount: string): IPayouts.SubmitRequest => ({
|
||||
selectedRecurringDetailReference: "LATEST",
|
||||
recurring: {
|
||||
contract: "ONECLICK"
|
||||
@@ -60,12 +56,12 @@ const mockSubmitRequest = (merchantAccount: string): SubmitRequest => ({
|
||||
merchantAccount,
|
||||
});
|
||||
|
||||
const mockStoreDetailAndSubmitRequest = (merchantAccount: string): StoreDetailAndSubmitRequest => ({
|
||||
const mockStoreDetailAndSubmitRequest = (merchantAccount: string): IPayouts.StoreDetailAndSubmitRequest => ({
|
||||
...amountAndReference,
|
||||
...(mockStoreDetailRequest(merchantAccount)),
|
||||
});
|
||||
|
||||
const mockPayoutRequest = (merchantAccount: string): PayoutRequest => ({
|
||||
const mockPayoutRequest = (merchantAccount: string): IPayouts.PayoutRequest => ({
|
||||
...amountAndReference,
|
||||
...defaultData,
|
||||
card: {
|
||||
@@ -89,14 +85,17 @@ beforeEach((): void => {
|
||||
|
||||
describe("PayoutTest", function (): void {
|
||||
it("should succeed on store detail and submit third party", async function (): Promise<void> {
|
||||
const request: StoreDetailAndSubmitRequest = mockStoreDetailAndSubmitRequest(`${client.config.merchantAccount}`);
|
||||
const request: IPayouts.StoreDetailAndSubmitRequest = mockStoreDetailAndSubmitRequest(`${client.config.merchantAccount}`);
|
||||
scope.post("/storeDetail").reply(200, storeDetailAndSubmitThirdParty);
|
||||
|
||||
const result = await payout.storeDetail(request);
|
||||
expect(result.resultCode).toEqual("[payout-submit-received]");
|
||||
expect(result.pspReference).toEqual("8515131751004933");
|
||||
expect(result.additionalData[FRAUD_RESULT_TYPE]).toEqual("GREEN");
|
||||
expect(result.additionalData[FRAUD_MANUAL_REVIEW]).toEqual("false");
|
||||
|
||||
if (result.additionalData) {
|
||||
expect(result.additionalData[ApiConstants.FRAUD_RESULT_TYPE]).toEqual("GREEN");
|
||||
expect(result.additionalData[ApiConstants.FRAUD_MANUAL_REVIEW]).toEqual("false");
|
||||
}
|
||||
});
|
||||
|
||||
it("should succeed on store detail", async function (): Promise<void> {
|
||||
@@ -116,7 +115,7 @@ describe("PayoutTest", function (): void {
|
||||
response: "[payout-confirm-received]"
|
||||
});
|
||||
|
||||
const request: ModifyRequest = {
|
||||
const request: IPayouts.ModifyRequest = {
|
||||
merchantAccount: "MOCKED_MERCHANT_ACCOUNT",
|
||||
originalReference: "reference"
|
||||
};
|
||||
@@ -129,13 +128,16 @@ describe("PayoutTest", function (): void {
|
||||
it("should succeed on submit third party", async function (): Promise<void> {
|
||||
scope.post("/submitThirdParty").reply(200, storeDetailAndSubmitThirdParty);
|
||||
|
||||
const request: SubmitRequest = mockSubmitRequest("MOCKED_MERCHANT_ACC");
|
||||
const request: IPayouts.SubmitRequest = mockSubmitRequest("MOCKED_MERCHANT_ACC");
|
||||
const result = await payout.submitThirdparty(request);
|
||||
|
||||
expect(result.resultCode).toEqual("[payout-submit-received]");
|
||||
expect(result.pspReference).toEqual("8515131751004933");
|
||||
expect(result.additionalData[FRAUD_RESULT_TYPE]).toEqual("GREEN");
|
||||
expect(result.additionalData[FRAUD_MANUAL_REVIEW]).toEqual("false");
|
||||
|
||||
if (result.additionalData) {
|
||||
expect(result.additionalData[ApiConstants.FRAUD_RESULT_TYPE]).toEqual("GREEN");
|
||||
expect(result.additionalData[ApiConstants.FRAUD_MANUAL_REVIEW]).toEqual("false");
|
||||
}
|
||||
});
|
||||
|
||||
it("should succeed on decline third party", async function (): Promise<void> {
|
||||
@@ -144,7 +146,7 @@ describe("PayoutTest", function (): void {
|
||||
response: "[payout-confirm-received]"
|
||||
});
|
||||
|
||||
const request: ModifyRequest = {
|
||||
const request: IPayouts.ModifyRequest = {
|
||||
merchantAccount: "MOCKED_MERCHANT_ACC",
|
||||
originalReference: "reference"
|
||||
};
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
import nock from "nock";
|
||||
import { createMockClientFromResponse } from "../__mocks__/base";
|
||||
import { disableSuccess } from "../__mocks__/recurring/disableSuccess";
|
||||
import { listRecurringDetailsSuccess } from "../__mocks__/recurring/listRecurringDetailsSuccess";
|
||||
import {createMockClientFromResponse} from "../__mocks__/base";
|
||||
import {disableSuccess} from "../__mocks__/recurring/disableSuccess";
|
||||
import {listRecurringDetailsSuccess} from "../__mocks__/recurring/listRecurringDetailsSuccess";
|
||||
import Recurring from "../services/recurring";
|
||||
import { DisableRequest, RecurringDetailsRequest } from "../typings/recurring";
|
||||
import Client from "../client";
|
||||
|
||||
const createRecurringDetailsRequest = (): RecurringDetailsRequest => {
|
||||
const createRecurringDetailsRequest = (): IRecurring.RecurringDetailsRequest => {
|
||||
return {
|
||||
merchantAccount: "MerchantAccount",
|
||||
recurring: {contract: "ONECLICK"},
|
||||
recurring: { contract: "ONECLICK" },
|
||||
shopperReference: "test-123",
|
||||
};
|
||||
};
|
||||
@@ -38,7 +37,7 @@ describe("Recurring", (): void => {
|
||||
scope.post("/disable")
|
||||
.reply(200, disableSuccess);
|
||||
|
||||
const request: DisableRequest = {
|
||||
const request: IRecurring.DisableRequest = {
|
||||
merchantAccount: "MerchantAccount",
|
||||
recurringDetailReference: "reference",
|
||||
shopperReference: "test-123",
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -20,10 +20,9 @@
|
||||
*/
|
||||
|
||||
import Config from "./config";
|
||||
import ClientInterface from "./typings/httpClient/clientInterface";
|
||||
import HttpURLConnectionClient from "./httpClient/httpURLConnectionClient";
|
||||
import { Environment } from "./typings/enums/environment";
|
||||
import {version} from "../package.json";
|
||||
import ClientInterface from "./httpClient/clientInterface";
|
||||
|
||||
type ClientParametersOverload =
|
||||
| { config: Config }
|
||||
@@ -55,18 +54,18 @@ class Client {
|
||||
public static HPP_LIVE = "https://live.adyen.com/hpp";
|
||||
public static MARKETPAY_ENDPOINT_TEST = "https://cal-test.adyen.com/cal/services";
|
||||
public static MARKETPAY_ENDPOINT_LIVE = "https://cal-live.adyen.com/cal/services";
|
||||
public static API_VERSION = "v49";
|
||||
public static RECURRING_API_VERSION = "v30";
|
||||
public static MARKETPAY_ACCOUNT_API_VERSION = "v4";
|
||||
public static MARKETPAY_FUND_API_VERSION = "v3";
|
||||
public static MARKETPAY_NOTIFICATION_API_VERSION = "v1";
|
||||
public static API_VERSION = "v51";
|
||||
public static RECURRING_API_VERSION = "v49";
|
||||
public static MARKETPAY_ACCOUNT_API_VERSION = "v5";
|
||||
public static MARKETPAY_FUND_API_VERSION = "v5";
|
||||
public static MARKETPAY_NOTIFICATION_API_VERSION = "v5";
|
||||
public static LIB_NAME = "adyen-node-api-library";
|
||||
public static LIB_VERSION: string = version;
|
||||
public static CHECKOUT_ENDPOINT_TEST = "https://checkout-test.adyen.com/checkout";
|
||||
public static CHECKOUT_ENDPOINT_LIVE_SUFFIX = "-checkout-live.adyenpayments.com/checkout";
|
||||
public static CHECKOUT_API_VERSION = "v49";
|
||||
public static CHECKOUT_API_VERSION = "v51";
|
||||
public static BIN_LOOKUP_PAL_SUFFIX = "/pal/servlet/BinLookup/";
|
||||
public static BIN_LOOKUP_API_VERSION = "v40";
|
||||
public static BIN_LOOKUP_API_VERSION = "v50";
|
||||
public static CHECKOUT_UTILITY_API_VERSION = "v1";
|
||||
public static TERMINAL_API_ENDPOINT_TEST = "https://terminal-api-test.adyen.com";
|
||||
public static TERMINAL_API_ENDPOINT_LIVE = "https://terminal-api-live.adyen.com";
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
* This file is open source and available under the MIT license.
|
||||
* See the LICENSE file for more info.
|
||||
*/
|
||||
import { Environment } from "./typings/enums/environment";
|
||||
|
||||
interface ConfigConstructor {
|
||||
username?: string;
|
||||
password?: string;
|
||||
|
||||
85
src/constants/apiConstants.ts
Normal file
85
src/constants/apiConstants.ts
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* ######
|
||||
* ######
|
||||
* ############ ####( ###### #####. ###### ############ ############
|
||||
* ############# #####( ###### #####. ###### ############# #############
|
||||
* ###### #####( ###### #####. ###### ##### ###### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ######
|
||||
* ############# ############# ############# ############# ##### ######
|
||||
* ############ ############ ############# ############ ##### ######
|
||||
* ######
|
||||
* #############
|
||||
* ############
|
||||
*
|
||||
* Adyen NodeJS API Library
|
||||
*
|
||||
* Copyright (c) 2019 Adyen B.V.
|
||||
* This file is open source and available under the MIT license.
|
||||
* See the LICENSE file for more info.
|
||||
*/
|
||||
|
||||
export enum ApiConstants {
|
||||
TRANSACTION_NOT_PERMITTED = "Transaction Not Permitted",
|
||||
CVC_DECLINED = "CVC Declined",
|
||||
RESTRICTED_CARD = "Restricted Card",
|
||||
PAYMENT_DETAIL_NOT_FOUND = "803 PaymentDetail not found",
|
||||
REFUSED = "Refused",
|
||||
|
||||
REFUSAL_REASON_RAW = "refusalReasonRaw",
|
||||
PAYMENT_METHOD = "paymentMethod",
|
||||
EXPIRY_DATE = "expiryDate",
|
||||
CARD_BIN = "cardBin",
|
||||
CARD_HOLDER_NAME = "cardHolderName",
|
||||
CARD_SUMMARY = "cardSummary",
|
||||
THREE_D_OFFERERED = "threeDOffered",
|
||||
THREE_D_AUTHENTICATED = "threeDAuthenticated",
|
||||
AVS_RESULT = "avsResult",
|
||||
PAYMENT_TOKEN = "payment.token",
|
||||
FRAUD_RESULT_TYPE = "fraudResultType",
|
||||
FRAUD_MANUAL_REVIEW = "fraudManualReview",
|
||||
AUTH_CODE = "authCode",
|
||||
|
||||
BOLETO_BARCODE_REFERENCE = "boletobancario.barCodeReference",
|
||||
BOLETO_DATA = "boletobancario.data",
|
||||
BOLETO_DUE_DATE = "boletobancario.dueDate",
|
||||
BOLETO_URL = "boletobancario.url",
|
||||
BOLETO_EXPIRATION_DATE = "boletobancario.expirationDate",
|
||||
|
||||
MULTIBANCO_ENTITY = "comprafacil.entity",
|
||||
MULTIBANCO_AMOUNT = "comprafacil.amount",
|
||||
MULTIBANCO_DEADLINE = "comprafacil.deadline",
|
||||
MULTIBANCO_REFERENCE = "comprafacil.reference",
|
||||
|
||||
HMAC_SIGNATURE = "hmacSignature",
|
||||
|
||||
JSON = "card.encrypted.json",
|
||||
|
||||
BOLETO_SANTANDER = "boletobancario_santander",
|
||||
|
||||
NUMBER = "number",
|
||||
EXPIRY_MONTH = "expiryMonth",
|
||||
EXPIRY_YEAR = "expiryYear",
|
||||
CVC = "cvc",
|
||||
ENCRYPTED_CARD_NUMBER = "encryptedCardNumber",
|
||||
ENCRYPTED_EXPIRY_MONTH = "encryptedExpiryMonth",
|
||||
ENCRYPTED_EXPIRY_YEAR = "encryptedExpiryYear",
|
||||
ENCRYPTED_SECURITY_CODE = "encryptedSecurityCode",
|
||||
METHOD_TYPE = "type",
|
||||
HOLDER_NAME = "holderName",
|
||||
RECURRING_DETAIL_REFERENCE = "recurringDetailReference",
|
||||
STORE_DETAILS = "storeDetails",
|
||||
|
||||
MD = "MD",
|
||||
PAREQ = "PaReq",
|
||||
|
||||
TYPE_SCHEME = "scheme",
|
||||
|
||||
IDEMPOTENCY_KEY = "Idempotency-Key",
|
||||
ACCEPT_CHARSET = "Accept-Charset",
|
||||
USER_AGENT = "User-Agent",
|
||||
METHOD_POST = "POST",
|
||||
CONTENT_TYPE = "Content-Type",
|
||||
API_KEY = "X-API-Key",
|
||||
APPLICATION_JSON_TYPE = "application/json",
|
||||
}
|
||||
@@ -19,6 +19,8 @@
|
||||
* See the LICENSE file for more info.
|
||||
*/
|
||||
|
||||
export const NEXO_HMAC_KEY_LENGTH = 32;
|
||||
export const NEXO_CIPHER_KEY_LENGTH = 32;
|
||||
export const NEXO_IV_LENGTH = 16;
|
||||
export enum NexoEnum {
|
||||
HMAC_KEY_LENGTH = 32,
|
||||
CIPHER_KEY_LENGTH = 32,
|
||||
IV_LENGTH = 16
|
||||
}
|
||||
@@ -20,20 +20,22 @@
|
||||
*/
|
||||
|
||||
import Resource from "../services/resource";
|
||||
import { RequestOptions } from "../typings/requestOptions";
|
||||
import HttpClientException from "../httpClient/httpClientException";
|
||||
import ApiException from "../services/exception/apiException";
|
||||
import {IRequest} from "../typings/requestOptions";
|
||||
|
||||
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>;
|
||||
async function getJsonResponse<T>(resource: Resource, jsonRequest: T | string, requestOptions?: IRequest.Options): Promise<string>;
|
||||
async function getJsonResponse<T, R>(resource: Resource, jsonRequest: T | string, requestOptions?: IRequest.Options): Promise<R>;
|
||||
|
||||
async function getJsonResponse<T, R>(
|
||||
resource: Resource,
|
||||
jsonRequest: T | string,
|
||||
requestOptions: RequestOptions = {},
|
||||
): Promise<R | string> {
|
||||
requestOptions: IRequest.Options = {},
|
||||
): 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;
|
||||
}
|
||||
|
||||
@@ -18,15 +18,17 @@
|
||||
* This file is open source and available under the MIT license.
|
||||
* See the LICENSE file for more info.
|
||||
*/
|
||||
import Config from "../../config";
|
||||
import { RequestOptions } from "../requestOptions";
|
||||
import { AgentOptions } from "https";
|
||||
import HttpClientException from "./httpClientException";
|
||||
import ApiException from "../services/exception/apiException";
|
||||
import {Config} from "../index";
|
||||
import {IRequest} from "../typings/requestOptions";
|
||||
|
||||
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>;
|
||||
endpoint: string, json: string, config: Config, isApiKeyRequired: boolean, requestOptions?: IRequest.Options,
|
||||
): Promise<string | HttpClientException | ApiException>;
|
||||
post(endpoint: string, postParameters: [string, string][], config: Config): Promise<HttpClientException | string>;
|
||||
proxy?: AgentOptions;
|
||||
}
|
||||
|
||||
@@ -27,20 +27,13 @@ import * as fs from "fs";
|
||||
import {URL} from "url";
|
||||
import Client from "../client";
|
||||
import Config from "../config";
|
||||
import {
|
||||
ACCEPT_CHARSET,
|
||||
API_KEY,
|
||||
APPLICATION_JSON_TYPE,
|
||||
CONTENT_TYPE,
|
||||
IDEMPOTENCY_KEY,
|
||||
METHOD_POST,
|
||||
USER_AGENT,
|
||||
} from "../typings/constants/apiConstants";
|
||||
import { RequestOptions } from "../typings/requestOptions";
|
||||
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";
|
||||
import ClientInterface from "./clientInterface";
|
||||
import {ApiConstants} from "../constants/apiConstants";
|
||||
import {IRequest} from "../typings/requestOptions";
|
||||
|
||||
class HttpURLConnectionClient implements ClientInterface {
|
||||
private static CHARSET = "utf-8";
|
||||
@@ -49,8 +42,8 @@ class HttpURLConnectionClient implements ClientInterface {
|
||||
|
||||
public request(
|
||||
endpoint: string, json: string, config: Config, isApiRequired: boolean,
|
||||
requestOptions: RequestOptions,
|
||||
): Promise<string> {
|
||||
requestOptions: IRequest.Options,
|
||||
): Promise<string | HttpClientException | ApiException> {
|
||||
requestOptions.headers = {};
|
||||
requestOptions.timeout = config.connectionTimeoutMillis;
|
||||
|
||||
@@ -60,8 +53,12 @@ class HttpURLConnectionClient implements ClientInterface {
|
||||
|
||||
const apiKey = config.apiKey;
|
||||
|
||||
if (isApiRequired || apiKey) {
|
||||
requestOptions.headers[API_KEY] = apiKey;
|
||||
if (isApiRequired && !apiKey) {
|
||||
return Promise.reject(new ApiException("Invalid X-API-Key was used", 401));
|
||||
}
|
||||
|
||||
if (apiKey) {
|
||||
requestOptions.headers[ApiConstants.API_KEY] = apiKey;
|
||||
} else {
|
||||
const authString = `${config.username}:${config.password}`;
|
||||
const authStringEnc = new Buffer(authString).toString("base64");
|
||||
@@ -69,19 +66,19 @@ class HttpURLConnectionClient implements ClientInterface {
|
||||
requestOptions.headers.Authorization = `Basic ${authStringEnc}`;
|
||||
}
|
||||
|
||||
requestOptions.headers[CONTENT_TYPE] = APPLICATION_JSON_TYPE;
|
||||
requestOptions.headers[ApiConstants.CONTENT_TYPE] = ApiConstants.APPLICATION_JSON_TYPE;
|
||||
|
||||
const httpConnection: ClientRequest = this.createRequest(endpoint, requestOptions, config.applicationName);
|
||||
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);
|
||||
}
|
||||
|
||||
private createRequest(endpoint: string, requestOptions: RequestOptions, applicationName?: string): ClientRequest {
|
||||
private createRequest(endpoint: string, requestOptions: IRequest.Options, applicationName?: string): ClientRequest {
|
||||
if (!requestOptions.headers) {
|
||||
requestOptions.headers = {};
|
||||
}
|
||||
@@ -93,22 +90,21 @@ class HttpURLConnectionClient implements ClientInterface {
|
||||
requestOptions.path = url.pathname;
|
||||
|
||||
if (requestOptions && requestOptions.idempotencyKey) {
|
||||
requestOptions.headers[IDEMPOTENCY_KEY] = requestOptions.idempotencyKey;
|
||||
requestOptions.headers[ApiConstants.IDEMPOTENCY_KEY] = requestOptions.idempotencyKey;
|
||||
delete requestOptions.idempotencyKey;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
requestOptions.headers["Cache-Control"] = "no-cache";
|
||||
requestOptions.method = METHOD_POST;
|
||||
requestOptions.headers[ACCEPT_CHARSET] = HttpURLConnectionClient.CHARSET;
|
||||
requestOptions.headers[USER_AGENT] = `${applicationName} ${Client.LIB_NAME}/${Client.LIB_VERSION}`;
|
||||
requestOptions.method = ApiConstants.METHOD_POST;
|
||||
requestOptions.headers[ApiConstants.ACCEPT_CHARSET] = HttpURLConnectionClient.CHARSET;
|
||||
requestOptions.headers[ApiConstants.USER_AGENT] = `${applicationName} ${Client.LIB_NAME}/${Client.LIB_VERSION}`;
|
||||
|
||||
return httpsRequest(requestOptions);
|
||||
}
|
||||
@@ -117,23 +113,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 +169,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 +185,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}`));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
* See the LICENSE file for more info.
|
||||
*/
|
||||
|
||||
import "./typings";
|
||||
|
||||
export { default as Client } from "./client";
|
||||
export { default as Config } from "./config";
|
||||
export * from "./services/";
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
import {Cipher, createCipheriv, createDecipheriv, createHmac, randomBytes} from "crypto";
|
||||
import NexoCryptoException from "../services/exception/nexoCryptoException";
|
||||
import {NEXO_IV_LENGTH} from "../typings/constants/nexoConstants";
|
||||
import {
|
||||
MessageHeader,
|
||||
NexoDerivedKey,
|
||||
@@ -31,6 +30,7 @@ import {
|
||||
} from "../typings/terminal";
|
||||
import InvalidSecurityKeyException from "./exception/invalidSecurityKeyException";
|
||||
import NexoDerivedKeyGenerator from "./nexoDerivedKeyGenerator";
|
||||
import {NexoEnum} from "../constants/nexoConstants";
|
||||
|
||||
enum Modes {
|
||||
ENCRYPT,
|
||||
@@ -91,8 +91,8 @@ class NexoCrypto {
|
||||
}
|
||||
|
||||
private static crypt(bytes: Buffer, dk: NexoDerivedKey, ivNonce: Buffer, mode: Modes): Buffer {
|
||||
const actualIV = Buffer.alloc(NEXO_IV_LENGTH);
|
||||
for (let i = 0; i < NEXO_IV_LENGTH; i++) {
|
||||
const actualIV = Buffer.alloc(NexoEnum.IV_LENGTH);
|
||||
for (let i = 0; i < NexoEnum.IV_LENGTH; i++) {
|
||||
actualIV[i] = dk.iv[i] ^ ivNonce[i];
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ class NexoCrypto {
|
||||
}
|
||||
|
||||
private static generateRandomIvNonce(): Buffer {
|
||||
return randomBytes(NEXO_IV_LENGTH);
|
||||
return randomBytes(NexoEnum.IV_LENGTH);
|
||||
}
|
||||
|
||||
private validateHmac(receivedHmac: Buffer, decryptedMessage: Buffer, derivedKey: NexoDerivedKey): void {
|
||||
|
||||
@@ -20,26 +20,26 @@
|
||||
*/
|
||||
|
||||
import {pbkdf2Sync} from "crypto";
|
||||
import {NEXO_CIPHER_KEY_LENGTH, NEXO_HMAC_KEY_LENGTH, NEXO_IV_LENGTH} from "../typings/constants/nexoConstants";
|
||||
import { NexoDerivedKey } from "../typings/terminal";
|
||||
import {NexoEnum} from "../constants/nexoConstants";
|
||||
|
||||
class NexoDerivedKeyGenerator {
|
||||
public static deriveKeyMaterial(passphrase: string): NexoDerivedKey {
|
||||
const pass = Buffer.from(passphrase, "binary");
|
||||
const salt = Buffer.from("AdyenNexoV1Salt", "binary");
|
||||
const iterations = 4000;
|
||||
const keylen = NEXO_CIPHER_KEY_LENGTH + NEXO_HMAC_KEY_LENGTH + NEXO_IV_LENGTH;
|
||||
const keylen = NexoEnum.CIPHER_KEY_LENGTH + NexoEnum.HMAC_KEY_LENGTH + NexoEnum.IV_LENGTH;
|
||||
const key = pbkdf2Sync(pass, salt, iterations, keylen * 8, "sha1");
|
||||
return NexoDerivedKeyGenerator.readKeyData(key);
|
||||
}
|
||||
|
||||
private static readKeyData(key: Buffer): NexoDerivedKey {
|
||||
return {
|
||||
cipherKey: key.slice(NEXO_HMAC_KEY_LENGTH, NEXO_HMAC_KEY_LENGTH + NEXO_CIPHER_KEY_LENGTH),
|
||||
hmacKey: key.slice(0, NEXO_HMAC_KEY_LENGTH),
|
||||
cipherKey: key.slice(NexoEnum.HMAC_KEY_LENGTH, NexoEnum.HMAC_KEY_LENGTH + NexoEnum.CIPHER_KEY_LENGTH),
|
||||
hmacKey: key.slice(0, NexoEnum.HMAC_KEY_LENGTH),
|
||||
iv: key.slice(
|
||||
NEXO_HMAC_KEY_LENGTH + NEXO_CIPHER_KEY_LENGTH,
|
||||
NEXO_CIPHER_KEY_LENGTH + NEXO_HMAC_KEY_LENGTH + NEXO_IV_LENGTH,
|
||||
NexoEnum.HMAC_KEY_LENGTH + NexoEnum.CIPHER_KEY_LENGTH,
|
||||
NexoEnum.CIPHER_KEY_LENGTH + NexoEnum.HMAC_KEY_LENGTH + NexoEnum.IV_LENGTH,
|
||||
),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -22,12 +22,6 @@ import ApiKeyAuthenticatedService from "../apiKeyAuthenticatedService";
|
||||
import Client from "../client";
|
||||
import GetCostEstimate from "./resource/binLookup/getCostEstimate";
|
||||
import Get3dsAvailability from "./resource/binLookup/get3dsAvailability";
|
||||
import {
|
||||
CostEstimateRequest,
|
||||
CostEstimateResponse,
|
||||
ThreeDSAvailabilityRequest,
|
||||
ThreeDSAvailabilityResponse
|
||||
} from "../typings/binLookup";
|
||||
import getJsonResponse from "../helpers/getJsonResponse";
|
||||
|
||||
class BinLookup extends ApiKeyAuthenticatedService {
|
||||
@@ -40,15 +34,15 @@ class BinLookup extends ApiKeyAuthenticatedService {
|
||||
this._getCostEstimate = new GetCostEstimate(this);
|
||||
}
|
||||
|
||||
public get3dsAvailability(request: ThreeDSAvailabilityRequest): Promise<ThreeDSAvailabilityResponse> {
|
||||
return getJsonResponse<ThreeDSAvailabilityRequest, ThreeDSAvailabilityResponse>(
|
||||
public get3dsAvailability(request: IBinLookup.ThreeDSAvailabilityRequest): Promise<IBinLookup.ThreeDSAvailabilityResponse> {
|
||||
return getJsonResponse<IBinLookup.ThreeDSAvailabilityRequest, IBinLookup.ThreeDSAvailabilityResponse>(
|
||||
this._get3dsAvailability,
|
||||
request
|
||||
);
|
||||
}
|
||||
|
||||
public getCostEstimate(request: CostEstimateRequest): Promise<CostEstimateResponse> {
|
||||
return getJsonResponse<CostEstimateRequest, CostEstimateResponse>(
|
||||
public getCostEstimate(request: IBinLookup.CostEstimateRequest): Promise<IBinLookup.CostEstimateResponse> {
|
||||
return getJsonResponse<IBinLookup.CostEstimateRequest, IBinLookup.CostEstimateResponse>(
|
||||
this._getCostEstimate,
|
||||
request
|
||||
);
|
||||
|
||||
@@ -22,17 +22,14 @@
|
||||
import ApiKeyAuthenticatedService from "../apiKeyAuthenticatedService";
|
||||
import Client from "../client";
|
||||
import getJsonResponse from "../helpers/getJsonResponse";
|
||||
import {
|
||||
DetailsRequest, PaymentMethodsRequest, PaymentMethodsResponse, PaymentRequest, PaymentResponse, PaymentSetupRequest,
|
||||
PaymentSetupResponse, PaymentVerificationRequest, PaymentVerificationResponse,
|
||||
} from "../typings/checkout";
|
||||
import { RequestOptions } from "../typings/requestOptions";
|
||||
import PaymentMethods from "./resource/checkout/paymentMethods";
|
||||
import Payments from "./resource/checkout/payments";
|
||||
import PaymentsDetails from "./resource/checkout/paymentsDetails";
|
||||
import PaymentSession from "./resource/checkout/paymentSession";
|
||||
import PaymentsResult from "./resource/checkout/paymentsResult";
|
||||
import PaymentLinks from "./resource/checkout/paymentLinks";
|
||||
import setApplicationInfo from "../helpers/setApplicationInfo";
|
||||
import {IRequest} from "../typings/requestOptions";
|
||||
|
||||
class Checkout extends ApiKeyAuthenticatedService {
|
||||
private readonly _payments: Payments;
|
||||
@@ -40,6 +37,7 @@ class Checkout extends ApiKeyAuthenticatedService {
|
||||
private readonly _paymentsDetails: PaymentsDetails;
|
||||
private readonly _paymentSession: PaymentSession;
|
||||
private readonly _paymentsResult: PaymentsResult;
|
||||
private readonly _paymentLinks: PaymentLinks;
|
||||
|
||||
public constructor(client: Client) {
|
||||
super(client);
|
||||
@@ -48,43 +46,51 @@ class Checkout extends ApiKeyAuthenticatedService {
|
||||
this._paymentsDetails = new PaymentsDetails(this);
|
||||
this._paymentSession = new PaymentSession(this);
|
||||
this._paymentsResult = new PaymentsResult(this);
|
||||
this._paymentLinks = new PaymentLinks(this);
|
||||
}
|
||||
|
||||
public payments(paymentsRequest: PaymentRequest, requestOptions?: RequestOptions): Promise<PaymentResponse> {
|
||||
return getJsonResponse<PaymentRequest, PaymentResponse>(
|
||||
public payments(paymentsRequest: ICheckout.PaymentRequest, requestOptions?: IRequest.Options): Promise<ICheckout.PaymentResponse> {
|
||||
return getJsonResponse<ICheckout.PaymentRequest, ICheckout.PaymentResponse>(
|
||||
this._payments,
|
||||
setApplicationInfo(paymentsRequest),
|
||||
requestOptions,
|
||||
);
|
||||
}
|
||||
|
||||
public paymentMethods(paymentMethodsRequest: PaymentMethodsRequest): Promise<PaymentMethodsResponse> {
|
||||
return getJsonResponse<PaymentMethodsRequest, PaymentMethodsResponse>(
|
||||
public paymentMethods(paymentMethodsRequest: ICheckout.PaymentMethodsRequest): Promise<ICheckout.PaymentMethodsResponse> {
|
||||
return getJsonResponse<ICheckout.PaymentMethodsRequest, ICheckout.PaymentMethodsResponse>(
|
||||
this._paymentMethods,
|
||||
paymentMethodsRequest,
|
||||
);
|
||||
}
|
||||
|
||||
public paymentsDetails(paymentsDetailsRequest: DetailsRequest): Promise<PaymentResponse> {
|
||||
return getJsonResponse<DetailsRequest, PaymentResponse>(
|
||||
public paymentLinks(paymentLinkRequest: ICheckout.CreatePaymentLinkRequest): Promise<ICheckout.CreatePaymentLinkResponse> {
|
||||
return getJsonResponse<ICheckout.CreatePaymentLinkRequest, ICheckout.CreatePaymentLinkResponse>(
|
||||
this._paymentLinks,
|
||||
paymentLinkRequest
|
||||
);
|
||||
}
|
||||
|
||||
public paymentsDetails(paymentsDetailsRequest: ICheckout.DetailsRequest): Promise<ICheckout.PaymentResponse> {
|
||||
return getJsonResponse<ICheckout.DetailsRequest, ICheckout.PaymentResponse>(
|
||||
this._paymentsDetails,
|
||||
paymentsDetailsRequest,
|
||||
);
|
||||
}
|
||||
|
||||
public paymentSession(
|
||||
paymentSessionRequest: PaymentSetupRequest,
|
||||
requestOptions?: RequestOptions,
|
||||
): Promise<PaymentSetupResponse> {
|
||||
return getJsonResponse<PaymentSetupRequest, PaymentSetupResponse>(
|
||||
paymentSessionRequest: ICheckout.PaymentSetupRequest,
|
||||
requestOptions?: IRequest.Options,
|
||||
): Promise<ICheckout.PaymentSetupResponse> {
|
||||
return getJsonResponse<ICheckout.PaymentSetupRequest, ICheckout.PaymentSetupResponse>(
|
||||
this._paymentSession,
|
||||
paymentSessionRequest,
|
||||
requestOptions,
|
||||
);
|
||||
}
|
||||
|
||||
public paymentResult(paymentResultRequest: PaymentVerificationRequest): Promise<PaymentVerificationResponse> {
|
||||
return getJsonResponse<PaymentVerificationRequest, PaymentVerificationResponse>(
|
||||
public paymentResult(paymentResultRequest: ICheckout.PaymentVerificationRequest): Promise<ICheckout.PaymentVerificationResponse> {
|
||||
return getJsonResponse<ICheckout.PaymentVerificationRequest, ICheckout.PaymentVerificationResponse>(
|
||||
this._paymentsResult,
|
||||
paymentResultRequest,
|
||||
);
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
import ApiKeyAuthenticatedService from "../apiKeyAuthenticatedService";
|
||||
import Client from "../client";
|
||||
import getJsonResponse from "../helpers/getJsonResponse";
|
||||
import { CheckoutUtilityRequest, CheckoutUtilityResponse } from "../typings/checkoutUtility";
|
||||
import OriginKeys from "./resource/checkoutUtility/originKeys";
|
||||
|
||||
class CheckoutUtility extends ApiKeyAuthenticatedService {
|
||||
@@ -33,8 +32,8 @@ class CheckoutUtility extends ApiKeyAuthenticatedService {
|
||||
this._originKeys = new OriginKeys(this);
|
||||
}
|
||||
|
||||
public originKeys(originKeysRequest: CheckoutUtilityRequest): Promise<CheckoutUtilityResponse> {
|
||||
return getJsonResponse<CheckoutUtilityRequest, CheckoutUtilityResponse>(
|
||||
public originKeys(originKeysRequest: ICheckoutUtility.CheckoutUtilityRequest): Promise<ICheckoutUtility.CheckoutUtilityResponse> {
|
||||
return getJsonResponse<ICheckoutUtility.CheckoutUtilityRequest, ICheckoutUtility.CheckoutUtilityResponse>(
|
||||
this._originKeys,
|
||||
originKeysRequest,
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -21,8 +21,6 @@
|
||||
import Client from "../client";
|
||||
import getJsonResponse from "../helpers/getJsonResponse";
|
||||
import Service from "../service";
|
||||
import { ModificationRequest, ModificationResult } from "../typings/payments";
|
||||
import { RequestOptions } from "../typings/requestOptions";
|
||||
import AdjustAuthorisation from "./resource/modification/adjustAuthorisation";
|
||||
import Cancel from "./resource/modification/cancel";
|
||||
import CancelOrRefund from "./resource/modification/cancelOrRefund";
|
||||
@@ -30,6 +28,11 @@ import Capture from "./resource/modification/capture";
|
||||
import Refund from "./resource/modification/refund";
|
||||
import TechnicalCancel from "./resource/modification/technicalCancel";
|
||||
import setApplicationInfo from "../helpers/setApplicationInfo";
|
||||
import {ApplicationInfo} from "../typings/applicationInfo";
|
||||
import {IRequest} from "../typings/requestOptions";
|
||||
|
||||
interface AppInfo { applicationInfo?: ApplicationInfo }
|
||||
type GenericRequest<T> = T & AppInfo;
|
||||
|
||||
class Modification extends Service {
|
||||
private readonly _cancelOrRefund: CancelOrRefund;
|
||||
@@ -50,10 +53,10 @@ class Modification extends Service {
|
||||
}
|
||||
|
||||
public capture(
|
||||
captureRequest: ModificationRequest,
|
||||
requestOptions?: RequestOptions,
|
||||
): Promise<ModificationResult> {
|
||||
return getJsonResponse<ModificationRequest, ModificationResult>(
|
||||
captureRequest: GenericRequest<IPayments.ModificationRequest>,
|
||||
requestOptions?: IRequest.Options,
|
||||
): Promise<IPayments.ModificationResult> {
|
||||
return getJsonResponse<IPayments.ModificationRequest, IPayments.ModificationResult>(
|
||||
this._capture,
|
||||
setApplicationInfo(captureRequest),
|
||||
requestOptions,
|
||||
@@ -61,10 +64,10 @@ class Modification extends Service {
|
||||
}
|
||||
|
||||
public cancelOrRefund(
|
||||
cancelOrRefundRequest: ModificationRequest,
|
||||
requestOptions?: RequestOptions,
|
||||
): Promise<ModificationResult> {
|
||||
return getJsonResponse<ModificationRequest, ModificationResult>(
|
||||
cancelOrRefundRequest: GenericRequest<IPayments.ModificationRequest>,
|
||||
requestOptions?: IRequest.Options,
|
||||
): Promise<IPayments.ModificationResult> {
|
||||
return getJsonResponse<IPayments.ModificationRequest, IPayments.ModificationResult>(
|
||||
this._cancelOrRefund,
|
||||
setApplicationInfo(cancelOrRefundRequest),
|
||||
requestOptions,
|
||||
@@ -72,10 +75,10 @@ class Modification extends Service {
|
||||
}
|
||||
|
||||
public refund(
|
||||
refundRequest: ModificationRequest,
|
||||
requestOptions?: RequestOptions,
|
||||
): Promise<ModificationResult> {
|
||||
return getJsonResponse<ModificationRequest, ModificationResult>(
|
||||
refundRequest: GenericRequest<IPayments.ModificationRequest>,
|
||||
requestOptions?: IRequest.Options,
|
||||
): Promise<IPayments.ModificationResult> {
|
||||
return getJsonResponse<IPayments.ModificationRequest, IPayments.ModificationResult>(
|
||||
this._refund,
|
||||
setApplicationInfo(refundRequest),
|
||||
requestOptions,
|
||||
@@ -83,10 +86,10 @@ class Modification extends Service {
|
||||
}
|
||||
|
||||
public cancel(
|
||||
cancelRequest: ModificationRequest,
|
||||
requestOptions?: RequestOptions,
|
||||
): Promise<ModificationResult> {
|
||||
return getJsonResponse<ModificationRequest, ModificationResult>(
|
||||
cancelRequest: GenericRequest<IPayments.ModificationRequest>,
|
||||
requestOptions?: IRequest.Options,
|
||||
): Promise<IPayments.ModificationResult> {
|
||||
return getJsonResponse<IPayments.ModificationRequest, IPayments.ModificationResult>(
|
||||
this._cancel,
|
||||
setApplicationInfo(cancelRequest),
|
||||
requestOptions,
|
||||
@@ -94,10 +97,10 @@ class Modification extends Service {
|
||||
}
|
||||
|
||||
public technicalCancel(
|
||||
technicalCancelRequest: ModificationRequest,
|
||||
requestOptions?: RequestOptions,
|
||||
): Promise<ModificationResult> {
|
||||
return getJsonResponse<ModificationRequest, ModificationResult>(
|
||||
technicalCancelRequest: GenericRequest<IPayments.ModificationRequest>,
|
||||
requestOptions?: IRequest.Options,
|
||||
): Promise<IPayments.ModificationResult> {
|
||||
return getJsonResponse<IPayments.ModificationRequest, IPayments.ModificationResult>(
|
||||
this._technicalCancel,
|
||||
setApplicationInfo(technicalCancelRequest),
|
||||
requestOptions,
|
||||
@@ -105,10 +108,10 @@ class Modification extends Service {
|
||||
}
|
||||
|
||||
public adjustAuthorisation(
|
||||
adjustAuthorisationRequest: ModificationRequest,
|
||||
requestOptions?: RequestOptions,
|
||||
): Promise<ModificationResult> {
|
||||
return getJsonResponse<ModificationRequest, ModificationResult>(
|
||||
adjustAuthorisationRequest: GenericRequest<IPayments.ModificationRequest>,
|
||||
requestOptions?: IRequest.Options,
|
||||
): Promise<IPayments.ModificationResult> {
|
||||
return getJsonResponse<IPayments.ModificationRequest, IPayments.ModificationResult>(
|
||||
this._adjustAuthorisation,
|
||||
setApplicationInfo(adjustAuthorisationRequest),
|
||||
requestOptions,
|
||||
|
||||
@@ -26,12 +26,6 @@ import SubmitThirdParty from "./resource/payout/submitThirdParty";
|
||||
import ConfirmThirdParty from "./resource/payout/confirmThirdParty";
|
||||
import PayoutResource from "./resource/payout/payout";
|
||||
import StoreDetailAndSubmitThirdParty from "./resource/payout/storeDetailAndSubmitThirdParty";
|
||||
import {
|
||||
ModifyRequest,
|
||||
ModifyResponse,
|
||||
StoreDetailAndSubmitRequest,
|
||||
StoreDetailAndSubmitResponse, StoreDetailRequest, StoreDetailResponse, SubmitRequest, SubmitResponse, PayoutRequest, PayoutResponse
|
||||
} from "../typings/payout";
|
||||
import getJsonResponse from "../helpers/getJsonResponse";
|
||||
|
||||
class Payout extends Service {
|
||||
@@ -53,43 +47,43 @@ class Payout extends Service {
|
||||
this._payout = new PayoutResource(this);
|
||||
}
|
||||
|
||||
public storeDetailAndSubmitThirdParty(request: StoreDetailAndSubmitRequest): Promise<StoreDetailAndSubmitResponse> {
|
||||
return getJsonResponse<StoreDetailAndSubmitRequest, StoreDetailAndSubmitResponse>(
|
||||
public storeDetailAndSubmitThirdParty(request: IPayouts.StoreDetailAndSubmitRequest): Promise<IPayouts.StoreDetailAndSubmitResponse> {
|
||||
return getJsonResponse<IPayouts.StoreDetailAndSubmitRequest, IPayouts.StoreDetailAndSubmitResponse>(
|
||||
this._storeDetailAndSubmitThirdParty,
|
||||
request
|
||||
);
|
||||
}
|
||||
|
||||
public confirmThirdParty(request: ModifyRequest): Promise<ModifyResponse> {
|
||||
return getJsonResponse<ModifyRequest, ModifyResponse>(
|
||||
public confirmThirdParty(request: IPayouts.ModifyRequest): Promise<IPayouts.ModifyResponse> {
|
||||
return getJsonResponse<IPayouts.ModifyRequest, IPayouts.ModifyResponse>(
|
||||
this._confirmThirdParty,
|
||||
request
|
||||
);
|
||||
}
|
||||
|
||||
public declineThirdParty(request: ModifyRequest): Promise<ModifyResponse> {
|
||||
return getJsonResponse<ModifyRequest, ModifyResponse>(
|
||||
public declineThirdParty(request: IPayouts.ModifyRequest): Promise<IPayouts.ModifyResponse> {
|
||||
return getJsonResponse<IPayouts.ModifyRequest, IPayouts.ModifyResponse>(
|
||||
this._declineThirdParty,
|
||||
request
|
||||
);
|
||||
}
|
||||
|
||||
public storeDetail(request: StoreDetailRequest): Promise<StoreDetailResponse> {
|
||||
return getJsonResponse<StoreDetailRequest, StoreDetailResponse>(
|
||||
public storeDetail(request: IPayouts.StoreDetailRequest): Promise<IPayouts.StoreDetailResponse> {
|
||||
return getJsonResponse<IPayouts.StoreDetailRequest, IPayouts.StoreDetailResponse>(
|
||||
this._storeDetail,
|
||||
request
|
||||
);
|
||||
}
|
||||
|
||||
public submitThirdparty(request: SubmitRequest): Promise<SubmitResponse> {
|
||||
return getJsonResponse<SubmitRequest, SubmitResponse>(
|
||||
public submitThirdparty(request: IPayouts.SubmitRequest): Promise<IPayouts.SubmitResponse> {
|
||||
return getJsonResponse<IPayouts.SubmitRequest, IPayouts.SubmitResponse>(
|
||||
this._submitThirdParty,
|
||||
request
|
||||
);
|
||||
}
|
||||
|
||||
public payout(request: PayoutRequest): Promise<PayoutResponse> {
|
||||
return getJsonResponse<PayoutRequest, PayoutResponse>(
|
||||
public payout(request: IPayouts.PayoutRequest): Promise<IPayouts.PayoutResponse> {
|
||||
return getJsonResponse<IPayouts.PayoutRequest, IPayouts.PayoutResponse>(
|
||||
this._payout,
|
||||
request
|
||||
);
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
import Client from "../client";
|
||||
import getJsonResponse from "../helpers/getJsonResponse";
|
||||
import Service from "../service";
|
||||
import { DisableRequest, DisableResult, RecurringDetailsRequest, RecurringDetailsResult } from "../typings/recurring";
|
||||
import Disable from "./resource/recurring/disable";
|
||||
import ListRecurringDetails from "./resource/recurring/listRecurringDetails";
|
||||
|
||||
@@ -36,15 +35,15 @@ class Recurring extends Service {
|
||||
this._disable = new Disable(this);
|
||||
}
|
||||
|
||||
public listRecurringDetails(request: RecurringDetailsRequest): Promise<RecurringDetailsResult> {
|
||||
return getJsonResponse<RecurringDetailsRequest, RecurringDetailsResult>(
|
||||
public listRecurringDetails(request: IRecurring.RecurringDetailsRequest): Promise<IRecurring.RecurringDetailsResult> {
|
||||
return getJsonResponse<IRecurring.RecurringDetailsRequest, IRecurring.RecurringDetailsResult>(
|
||||
this._listRecurringDetails,
|
||||
request,
|
||||
);
|
||||
}
|
||||
|
||||
public disable(request: DisableRequest): Promise<DisableResult> {
|
||||
return getJsonResponse<DisableRequest, DisableResult>(
|
||||
public disable(request: IRecurring.DisableRequest): Promise<IRecurring.DisableResult> {
|
||||
return getJsonResponse<IRecurring.DisableRequest, IRecurring.DisableResult>(
|
||||
this._disable,
|
||||
request,
|
||||
);
|
||||
|
||||
@@ -20,10 +20,11 @@
|
||||
*/
|
||||
|
||||
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";
|
||||
import ClientInterface from "../httpClient/clientInterface";
|
||||
import {IRequest} from "../typings/requestOptions";
|
||||
|
||||
abstract class Resource {
|
||||
protected endpoint: string;
|
||||
@@ -34,28 +35,16 @@ abstract class Resource {
|
||||
this.endpoint = endpoint;
|
||||
}
|
||||
|
||||
public request(json: string, requestOptions?: RequestOptions): Promise<string> {
|
||||
public request(json: string, requestOptions?: IRequest.Options): 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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
35
src/services/resource/checkout/paymentLinks.ts
Normal file
35
src/services/resource/checkout/paymentLinks.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* ######
|
||||
* ######
|
||||
* ############ ####( ###### #####. ###### ############ ############
|
||||
* ############# #####( ###### #####. ###### ############# #############
|
||||
* ###### #####( ###### #####. ###### ##### ###### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ######
|
||||
* ############# ############# ############# ############# ##### ######
|
||||
* ############ ############ ############# ############ ##### ######
|
||||
* ######
|
||||
* #############
|
||||
* ############
|
||||
*
|
||||
* Adyen NodeJS API Library
|
||||
*
|
||||
* Copyright (c) 2019 Adyen B.V.
|
||||
* This file is open source and available under the MIT license.
|
||||
* See the LICENSE file for more info.
|
||||
*/
|
||||
|
||||
import Client from "../../../client";
|
||||
import Service from "../../../service";
|
||||
import Resource from "../../resource";
|
||||
|
||||
class PaymentLinks extends Resource {
|
||||
public constructor(service: Service) {
|
||||
super(
|
||||
service,
|
||||
`${service.client.config.checkoutEndpoint}/${Client.CHECKOUT_API_VERSION}/paymentLinks`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default PaymentLinks;
|
||||
@@ -25,6 +25,8 @@ import getJsonResponse from "../helpers/getJsonResponse";
|
||||
import {Convert, TerminalApiRequest, TerminalApiResponse} from "../typings/terminal";
|
||||
import Async from "./resource/terminal/cloud/async";
|
||||
import Sync from "./resource/terminal/cloud/sync";
|
||||
import mergeDeep from "../utils/mergeDeep";
|
||||
import {ApplicationInfo} from "../typings/applicationInfo";
|
||||
|
||||
class TerminalCloudAPI extends ApiKeyAuthenticatedService {
|
||||
private readonly terminalApiAsync: Async;
|
||||
@@ -36,17 +38,28 @@ class TerminalCloudAPI extends ApiKeyAuthenticatedService {
|
||||
this.terminalApiSync = new Sync(this);
|
||||
}
|
||||
|
||||
private static setApplicationInfo(request: TerminalApiRequest): TerminalApiRequest {
|
||||
const applicationInfo = new ApplicationInfo();
|
||||
|
||||
const saleToAcquirerData = {applicationInfo};
|
||||
const saleData = {saleToAcquirerData};
|
||||
const paymentRequest = {saleData};
|
||||
const saleToPoiRequest = {paymentRequest};
|
||||
const newRequest = {saleToPoiRequest};
|
||||
|
||||
return mergeDeep(request, newRequest);
|
||||
}
|
||||
|
||||
public async(terminalApiRequest: TerminalApiRequest): Promise<string> {
|
||||
return getJsonResponse<TerminalApiRequest>(
|
||||
this.terminalApiAsync,
|
||||
Convert.terminalApiRequestToJson(terminalApiRequest),
|
||||
);
|
||||
const request = TerminalCloudAPI.setApplicationInfo(terminalApiRequest);
|
||||
return getJsonResponse<TerminalApiRequest>(this.terminalApiAsync, Convert.terminalApiRequestToJson(request));
|
||||
}
|
||||
|
||||
public async sync(terminalApiRequest: TerminalApiRequest): Promise<TerminalApiResponse> {
|
||||
const request = TerminalCloudAPI.setApplicationInfo(terminalApiRequest);
|
||||
const response = await getJsonResponse<TerminalApiRequest, TerminalApiResponse>(
|
||||
this.terminalApiSync,
|
||||
Convert.terminalApiRequestToJson(terminalApiRequest),
|
||||
Convert.terminalApiRequestToJson(request),
|
||||
);
|
||||
|
||||
return Convert.toTerminalApiResponse(JSON.stringify(response));
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
/*
|
||||
* ######
|
||||
* ######
|
||||
* ############ ####( ###### #####. ###### ############ ############
|
||||
* ############# #####( ###### #####. ###### ############# #############
|
||||
* ###### #####( ###### #####. ###### ##### ###### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ######
|
||||
* ############# ############# ############# ############# ##### ######
|
||||
* ############ ############ ############# ############ ##### ######
|
||||
* ######
|
||||
* #############
|
||||
* ############
|
||||
*
|
||||
* Adyen NodeJS API Library
|
||||
*
|
||||
*
|
||||
* Copyright (c) 2019 Adyen B.V.
|
||||
* This file is open source and available under the MIT license.
|
||||
* See the LICENSE file for more info.
|
||||
*/
|
||||
|
||||
export interface Amount {
|
||||
currency: string;
|
||||
value: number;
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
/*
|
||||
* ######
|
||||
* ######
|
||||
* ############ ####( ###### #####. ###### ############ ############
|
||||
* ############# #####( ###### #####. ###### ############# #############
|
||||
* ###### #####( ###### #####. ###### ##### ###### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ######
|
||||
* ############# ############# ############# ############# ##### ######
|
||||
* ############ ############ ############# ############ ##### ######
|
||||
* ######
|
||||
* #############
|
||||
* ############
|
||||
*
|
||||
* Adyen NodeJS API Library
|
||||
*
|
||||
* Copyright (c) 2019 Adyen B.V.
|
||||
* This file is open source and available under the MIT license.
|
||||
* See the LICENSE file for more info.
|
||||
*/
|
||||
|
||||
// Generated using typescript-generator version 2.14.505 on 2019-06-04 08:51:10.
|
||||
|
||||
export interface ApiError {
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
/*
|
||||
* ######
|
||||
* ######
|
||||
* ############ ####( ###### #####. ###### ############ ############
|
||||
* ############# #####( ###### #####. ###### ############# #############
|
||||
* ###### #####( ###### #####. ###### ##### ###### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ######
|
||||
* ############# ############# ############# ############# ##### ######
|
||||
* ############ ############ ############# ############ ##### ######
|
||||
* ######
|
||||
* #############
|
||||
* ############
|
||||
*
|
||||
* Adyen NodeJS API Library
|
||||
*
|
||||
* Copyright (c) 2019 Adyen B.V.
|
||||
* This file is open source and available under the MIT license.
|
||||
* See the LICENSE file for more info.
|
||||
*/
|
||||
|
||||
// Generated using typescript-generator version 2.14.505 on 2019-06-11 10:28:22.
|
||||
|
||||
import Client from "../client";
|
||||
@@ -19,23 +40,23 @@ export class ApplicationInfo {
|
||||
}
|
||||
}
|
||||
|
||||
export interface CommonField {
|
||||
declare interface CommonField {
|
||||
name?: string;
|
||||
version?: string;
|
||||
}
|
||||
|
||||
export interface ExternalPlatform extends CommonField {
|
||||
declare interface ExternalPlatform extends CommonField {
|
||||
integrator?: string;
|
||||
}
|
||||
|
||||
export interface MerchantDevice {
|
||||
declare interface MerchantDevice {
|
||||
os?: string;
|
||||
osVersion?: string;
|
||||
reference?: string;
|
||||
}
|
||||
|
||||
export interface ShopperInteractionDevice {
|
||||
declare interface ShopperInteractionDevice {
|
||||
os?: string;
|
||||
osVersion?: string;
|
||||
locale?: string;
|
||||
}
|
||||
}
|
||||
341
src/typings/binLookup.ts
Normal file
341
src/typings/binLookup.ts
Normal file
@@ -0,0 +1,341 @@
|
||||
|
||||
/*
|
||||
* ######
|
||||
* ######
|
||||
* ############ ####( ###### #####. ###### ############ ############
|
||||
* ############# #####( ###### #####. ###### ############# #############
|
||||
* ###### #####( ###### #####. ###### ##### ###### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ######
|
||||
* ############# ############# ############# ############# ##### ######
|
||||
* ############ ############ ############# ############ ##### ######
|
||||
* ######
|
||||
* #############
|
||||
* ############
|
||||
*
|
||||
* Adyen NodeJS API Library
|
||||
*
|
||||
* Version of BinLookup: v50
|
||||
*
|
||||
* Copyright (c) 2019 Adyen B.V.
|
||||
* This file is open source and available under the MIT license.
|
||||
* See the LICENSE file for more info.
|
||||
*/
|
||||
|
||||
|
||||
declare namespace IBinLookup {
|
||||
export interface Amount {
|
||||
/**
|
||||
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
|
||||
*/
|
||||
currency: string;
|
||||
/**
|
||||
* The payable amount that can be charged for the transaction.
|
||||
*
|
||||
* The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes).
|
||||
*/
|
||||
value: number; // int64
|
||||
}
|
||||
export interface BinDetail {
|
||||
/**
|
||||
* The country where the card was issued.
|
||||
*/
|
||||
issuerCountry?: string;
|
||||
}
|
||||
export interface CardBin {
|
||||
/**
|
||||
* The first 6 digit of the card number. Enable this field via merchant account settings.
|
||||
*/
|
||||
bin?: string;
|
||||
/**
|
||||
* If true, it indicates a commercial card. Enable this field via merchant account settings.
|
||||
*/
|
||||
commercial?: boolean;
|
||||
/**
|
||||
* The card funding source. Valid values are:
|
||||
* * CHARGE
|
||||
* * CREDIT
|
||||
* * DEBIT
|
||||
* * DEFERRED_DEBIT
|
||||
* * PREPAID
|
||||
* * PREPAID_RELOADABLE
|
||||
* * PREPAID_NONRELOADABLE
|
||||
* > Enable this field via merchant account settings.
|
||||
*/
|
||||
fundingSource?: string;
|
||||
/**
|
||||
* Indicates availability of funds.
|
||||
*
|
||||
* Visa:
|
||||
* * "I" (fast funds are supported)
|
||||
* * "N" (otherwise)
|
||||
*
|
||||
* Mastercard:
|
||||
* * "I" (product type is Prepaid or Debit, or issuing country is in CEE/HGEM list)
|
||||
* * "N" (otherwise)
|
||||
* > Returned when you verify a card BIN or estimate costs, and only if `payoutEligible` is different from "N" or "U".
|
||||
*/
|
||||
fundsAvailability?: string;
|
||||
/**
|
||||
* The issuing bank of the card.
|
||||
*/
|
||||
issuingBank?: string;
|
||||
/**
|
||||
* The country where the card was issued from.
|
||||
*/
|
||||
issuingCountry?: string;
|
||||
/**
|
||||
* The currency of the card.
|
||||
*/
|
||||
issuingCurrency?: string;
|
||||
/**
|
||||
* The payment method associated with the card (e.g. visa, mc, or amex).
|
||||
*/
|
||||
paymentMethod?: string;
|
||||
/**
|
||||
* Indicates whether a payout is eligible or not for this card.
|
||||
*
|
||||
* Visa:
|
||||
* * "Y"
|
||||
* * "N"
|
||||
*
|
||||
* Mastercard:
|
||||
* * "Y" (domestic and cross-border)
|
||||
* * "D" (only domestic)
|
||||
* * "N" (no MoneySend)
|
||||
* * "U" (unknown)
|
||||
* > Returned when you verify a card BIN or estimate costs, and only if `payoutEligible` is different from "N" or "U".
|
||||
*/
|
||||
payoutEligible?: string;
|
||||
/**
|
||||
* The last four digits of the card number.
|
||||
*/
|
||||
summary?: string;
|
||||
}
|
||||
export interface CostEstimateAssumptions {
|
||||
/**
|
||||
* If true, the cardholder is expected to successfully authorise via 3D Secure.
|
||||
*/
|
||||
assume3DSecureAuthenticated?: boolean;
|
||||
/**
|
||||
* If true, the transaction is expected to have valid Level 3 data.
|
||||
*/
|
||||
assumeLevel3Data?: boolean;
|
||||
/**
|
||||
* If not zero, the number of installments.
|
||||
*/
|
||||
installments?: number; // int32
|
||||
}
|
||||
export interface CostEstimateRequest {
|
||||
/**
|
||||
* The transaction amount used as a base for the cost estimation.
|
||||
*/
|
||||
amount: IBinLookup.Amount;
|
||||
/**
|
||||
* Assumptions made for the expected characteristics of the transaction, for which the charges are being estimated.
|
||||
*/
|
||||
assumptions?: IBinLookup.CostEstimateAssumptions;
|
||||
/**
|
||||
* The card number (4-19 characters) for PCI compliant use cases. Do not use any separators.
|
||||
*
|
||||
* > Either the `cardNumber` or `encryptedCard` field must be provided in a payment request.
|
||||
*/
|
||||
cardNumber?: string;
|
||||
/**
|
||||
* Encrypted data that stores card information for non PCI-compliant use cases. The encrypted data must be created with the Checkout Card Component or Secured Fields Component, and must contain the `encryptedCardNumber` field.
|
||||
*
|
||||
* > Either the `cardNumber` or `encryptedCard` field must be provided in a payment request.
|
||||
*/
|
||||
encryptedCard?: string;
|
||||
/**
|
||||
* The merchant account identifier you want to process the (transaction) request with.
|
||||
*/
|
||||
merchantAccount: string;
|
||||
/**
|
||||
* Additional data for merchants who don't use Adyen as the payment authorisation gateway.
|
||||
*/
|
||||
merchantDetails?: IBinLookup.MerchantDetails;
|
||||
/**
|
||||
* The recurring settings for the payment. Use this property when you want to enable [recurring payments](https://docs.adyen.com/checkout/tokenization).
|
||||
*/
|
||||
recurring?: IBinLookup.Recurring;
|
||||
/**
|
||||
* The `recurringDetailReference` you want to use for this cost estimate. The value `LATEST` can be used to select the most recently stored recurring detail.
|
||||
*/
|
||||
selectedRecurringDetailReference?: string;
|
||||
/**
|
||||
* Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer.
|
||||
* For the web service API, Adyen assumes Ecommerce shopper interaction by default.
|
||||
*
|
||||
* This field has the following possible values:
|
||||
* * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request.
|
||||
* * `ContAuth` - Card on file and/or subscription transactions, where the card holder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment).
|
||||
* * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone.
|
||||
* * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.
|
||||
*/
|
||||
shopperInteraction?: "Ecommerce" | "ContAuth" | "Moto" | "POS";
|
||||
/**
|
||||
* The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID).
|
||||
* > This field is required for recurring payments.
|
||||
*/
|
||||
shopperReference?: string;
|
||||
}
|
||||
export interface CostEstimateResponse {
|
||||
/**
|
||||
* Card BIN details.
|
||||
*/
|
||||
cardBin?: IBinLookup.CardBin;
|
||||
/**
|
||||
* The estimated cost (scheme fee + interchange) in the settlement currency. If the settlement currency cannot be determined, the fee in EUR is returned.
|
||||
*/
|
||||
costEstimateAmount?: IBinLookup.Amount;
|
||||
/**
|
||||
* The result of the cost estimation.
|
||||
*/
|
||||
resultCode?: string;
|
||||
/**
|
||||
* Indicates the way the charges can be passed on to the cardholder. The following values are possible:
|
||||
* * `ZERO` - the charges are not allowed to pass on
|
||||
* * `PASSTHROUGH` - the charges can be passed on
|
||||
* * `UNLIMITED` - there is no limit on how much surcharge is passed on
|
||||
*/
|
||||
surchargeType?: string;
|
||||
}
|
||||
export interface DSPublicKeyDetail {
|
||||
/**
|
||||
* Card brand.
|
||||
*/
|
||||
brand?: string;
|
||||
/**
|
||||
* Directory Server (DS) identifier.
|
||||
*/
|
||||
directoryServerId?: string;
|
||||
/**
|
||||
* Public key. The 3D Secure 2 SDK encrypts the device information by using the DS public key.
|
||||
*/
|
||||
publicKey?: string; // byte
|
||||
}
|
||||
export interface MerchantDetails {
|
||||
/**
|
||||
* 2-letter ISO 3166 country code of the card acceptor location.
|
||||
* > This parameter is required for the merchants who don't use Adyen as the payment authorisation gateway.
|
||||
*/
|
||||
countryCode?: string;
|
||||
/**
|
||||
* If true, indicates that the merchant is enrolled in 3D Secure for the card network.
|
||||
*/
|
||||
enrolledIn3DSecure?: boolean;
|
||||
/**
|
||||
* The merchant category code (MCC) is a four-digit number which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.
|
||||
*
|
||||
* The list of MCCs can be found [here](https://en.wikipedia.org/wiki/Merchant_category_code).
|
||||
*/
|
||||
mcc?: string;
|
||||
}
|
||||
namespace Post {
|
||||
export type RequestBody = IBinLookup.CostEstimateRequest;
|
||||
namespace Responses {
|
||||
export type $200 = IBinLookup.CostEstimateResponse;
|
||||
}
|
||||
}
|
||||
export interface Recurring {
|
||||
/**
|
||||
* The type of recurring contract to be used.
|
||||
* Possible values:
|
||||
* * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid).
|
||||
* * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-not-present-cnp).
|
||||
* * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not.
|
||||
* * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/checkout/online-payouts).
|
||||
*/
|
||||
contract?: "ONECLICK" | "RECURRING" | "PAYOUT";
|
||||
/**
|
||||
* A descriptive name for this detail.
|
||||
*/
|
||||
recurringDetailName?: string;
|
||||
/**
|
||||
* Date after which no further authorisations shall be performed. Only for 3D Secure 2.
|
||||
*/
|
||||
recurringExpiry?: string; // date-time
|
||||
/**
|
||||
* Minimum number of days between authorisations. Only for 3D Secure 2.
|
||||
*/
|
||||
recurringFrequency?: string;
|
||||
/**
|
||||
* The name of the token service.
|
||||
*/
|
||||
tokenService?: "VISATOKENSERVICE" | "MCTOKENSERVICE";
|
||||
}
|
||||
export interface ThreeDS2CardRangeDetail {
|
||||
/**
|
||||
* Card brand.
|
||||
*/
|
||||
brandCode?: string;
|
||||
/**
|
||||
* BIN end range.
|
||||
*/
|
||||
endRange?: string;
|
||||
/**
|
||||
* BIN start range.
|
||||
*/
|
||||
startRange?: string;
|
||||
/**
|
||||
* 3D Secure protocol version.
|
||||
*/
|
||||
threeDS2Version?: string;
|
||||
/**
|
||||
* In a 3D Secure 2 browser-based flow, this is the URL where you should send the device fingerprint to.
|
||||
*/
|
||||
threeDSMethodURL?: string;
|
||||
}
|
||||
export interface ThreeDSAvailabilityRequest {
|
||||
/**
|
||||
* This field contains additional data, which may be required for a particular request.
|
||||
*
|
||||
* The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/api-reference/payments-api/paymentrequest/paymentrequest-additionaldata).
|
||||
*/
|
||||
additionalData?: {
|
||||
};
|
||||
/**
|
||||
* List of brands.
|
||||
*/
|
||||
brands: string[];
|
||||
/**
|
||||
* Card number or BIN.
|
||||
*/
|
||||
cardNumber?: string;
|
||||
/**
|
||||
* The merchant account identifier.
|
||||
*/
|
||||
merchantAccount: string;
|
||||
/**
|
||||
* A recurring detail reference corresponding to a card.
|
||||
*/
|
||||
recurringDetailReference?: string;
|
||||
/**
|
||||
* The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID).
|
||||
*/
|
||||
shopperReference?: string;
|
||||
}
|
||||
export interface ThreeDSAvailabilityResponse {
|
||||
/**
|
||||
* Bin Group Details
|
||||
*/
|
||||
binDetails?: IBinLookup.BinDetail;
|
||||
/**
|
||||
* List of Directory Server (DS) public keys.
|
||||
*/
|
||||
dsPublicKeys?: IBinLookup.DSPublicKeyDetail[];
|
||||
/**
|
||||
* Indicator if 3D Secure 1 is supported.
|
||||
*/
|
||||
threeDS1Supported?: boolean;
|
||||
/**
|
||||
* List of brand and card range pairs.
|
||||
*/
|
||||
threeDS2CardRangeDetails?: IBinLookup.ThreeDS2CardRangeDetail[];
|
||||
/**
|
||||
* Indicator if 3D Secure 2 is supported.
|
||||
*/
|
||||
threeDS2supported?: boolean;
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* Adyen BinLookup Service
|
||||
* The BIN Lookup API provides endpoints for retrieving information, such as [cost estimates](https://docs.adyen.com/features/cost-estimation), and 3D Secure supported version based on a given [BIN](https://docs.adyen.com/payments-basics/payment-glossary#bankidentificationnumberbin).
|
||||
*
|
||||
* OpenAPI spec version: 40
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface Amount {
|
||||
/**
|
||||
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
|
||||
*/
|
||||
currency: string;
|
||||
/**
|
||||
* The payable amount that can be charged for the transaction. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes).
|
||||
*/
|
||||
value: number;
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
/**
|
||||
* Adyen BinLookup Service
|
||||
* The BIN Lookup API provides endpoints for retrieving information, such as [cost estimates](https://docs.adyen.com/features/cost-estimation), and 3D Secure supported version based on a given [BIN](https://docs.adyen.com/payments-basics/payment-glossary#bankidentificationnumberbin).
|
||||
*
|
||||
* OpenAPI spec version: 40
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface CardBin {
|
||||
/**
|
||||
* The first 6 digit of the card number. Enable this field via merchant account settings.
|
||||
*/
|
||||
bin?: string;
|
||||
/**
|
||||
* If true, it indicates a commercial card. Enable this field via merchant account settings.
|
||||
*/
|
||||
commercial?: boolean;
|
||||
/**
|
||||
* The card funding source. Valid values are: * CREDIT * DEBIT * PREPAID * PREPAID_RELOADABLE * DEFERRED_DEBIT * CHARGED > Enable this field via merchant account settings.
|
||||
*/
|
||||
fundingSource?: string;
|
||||
/**
|
||||
* Indicates availability of funds. Visa: * \"I\" (fast funds are supported) * \"N\" (otherwise) Mastercard: * \"I\" (product type is Prepaid or Debit, or issuing country is in CEE/HGEM list) * \"N\" (otherwise) > Returned when you verify a card BIN or estimate costs, and only if `payoutEligible` is different from \"N\" or \"U\".
|
||||
*/
|
||||
fundsAvailability?: string;
|
||||
/**
|
||||
* The issuing bank of the card.
|
||||
*/
|
||||
issuingBank?: string;
|
||||
/**
|
||||
* The country where the card was issued from.
|
||||
*/
|
||||
issuingCountry?: string;
|
||||
/**
|
||||
* The currency of the card.
|
||||
*/
|
||||
issuingCurrency?: string;
|
||||
/**
|
||||
* The payment method associated with the card (e.g. visa, mc, or amex).
|
||||
*/
|
||||
paymentMethod?: string;
|
||||
/**
|
||||
* Indicates whether a payout is eligible or not for this card. Visa: * \"Y\" * \"N\" Mastercard: * \"Y\" (domestic and cross-border) * \"D\" (only domestic) * \"N\" (no MoneySend) * \"U\" (unknown) > Returned when you verify a card BIN or estimate costs, and only if `payoutEligible` is different from \"N\" or \"U\".
|
||||
*/
|
||||
payoutEligible?: string;
|
||||
/**
|
||||
* The last four digits of the card number.
|
||||
*/
|
||||
summary?: string;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* Adyen BinLookup Service
|
||||
* The BIN Lookup API provides endpoints for retrieving information, such as [cost estimates](https://docs.adyen.com/features/cost-estimation), and 3D Secure supported version based on a given [BIN](https://docs.adyen.com/payments-basics/payment-glossary#bankidentificationnumberbin).
|
||||
*
|
||||
* OpenAPI spec version: 40
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface CostEstimateAssumptions {
|
||||
/**
|
||||
* If true, the cardholder is expected to successfully authorise via 3D Secure.
|
||||
*/
|
||||
assume3DSecureAuthenticated?: boolean;
|
||||
/**
|
||||
* If true, the transaction is expected to have valid Level 3 data.
|
||||
*/
|
||||
assumeLevel3Data?: boolean;
|
||||
/**
|
||||
* If not zero, the number of installments.
|
||||
*/
|
||||
installments?: number;
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
/**
|
||||
* Adyen BinLookup Service
|
||||
* The BIN Lookup API provides endpoints for retrieving information, such as [cost estimates](https://docs.adyen.com/features/cost-estimation), and 3D Secure supported version based on a given [BIN](https://docs.adyen.com/payments-basics/payment-glossary#bankidentificationnumberbin).
|
||||
*
|
||||
* OpenAPI spec version: 40
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { Amount } from './amount';
|
||||
import { CostEstimateAssumptions } from './costEstimateAssumptions';
|
||||
import { MerchantDetails } from './merchantDetails';
|
||||
import { Recurring } from './recurring';
|
||||
|
||||
|
||||
export interface CostEstimateRequest {
|
||||
amount: Amount;
|
||||
assumptions?: CostEstimateAssumptions;
|
||||
/**
|
||||
* The card number (4-19 characters) for PCI compliant use cases. Do not use any separators. > Either the `cardNumber` or `encryptedCard` field must be provided in a payment request.
|
||||
*/
|
||||
cardNumber?: string;
|
||||
/**
|
||||
* Encrypted data that stores card information for non PCI-compliant use cases. The encrypted data must be created with the Client-Side Encryption library and must contain at least the `number` and `generationtime` fields. > Either the `cardNumber` or `encryptedCard` field must be provided in a payment request.
|
||||
*/
|
||||
encryptedCard?: string;
|
||||
/**
|
||||
* The merchant account identifier you want to process the (transaction) request with.
|
||||
*/
|
||||
merchantAccount: string;
|
||||
merchantDetails?: MerchantDetails;
|
||||
recurring?: Recurring;
|
||||
/**
|
||||
* The `recurringDetailReference` you want to use for this cost estimate. The value `LATEST` can be used to select the most recently stored recurring detail.
|
||||
*/
|
||||
selectedRecurringDetailReference?: string;
|
||||
/**
|
||||
* Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the card holder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.
|
||||
*/
|
||||
shopperInteraction?: CostEstimateRequest.ShopperInteractionEnum;
|
||||
/**
|
||||
* The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments.
|
||||
*/
|
||||
shopperReference?: string;
|
||||
}
|
||||
export namespace CostEstimateRequest {
|
||||
export type ShopperInteractionEnum = 'Ecommerce' | 'ContAuth' | 'Moto' | 'POS';
|
||||
export const ShopperInteractionEnum = {
|
||||
Ecommerce: 'Ecommerce' as ShopperInteractionEnum,
|
||||
ContAuth: 'ContAuth' as ShopperInteractionEnum,
|
||||
Moto: 'Moto' as ShopperInteractionEnum,
|
||||
POS: 'POS' as ShopperInteractionEnum
|
||||
};
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* Adyen BinLookup Service
|
||||
* The BIN Lookup API provides endpoints for retrieving information, such as [cost estimates](https://docs.adyen.com/features/cost-estimation), and 3D Secure supported version based on a given [BIN](https://docs.adyen.com/payments-basics/payment-glossary#bankidentificationnumberbin).
|
||||
*
|
||||
* OpenAPI spec version: 40
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { Amount } from './amount';
|
||||
import { CardBin } from './cardBin';
|
||||
|
||||
|
||||
export interface CostEstimateResponse {
|
||||
cardBin?: CardBin;
|
||||
costEstimateAmount?: Amount;
|
||||
/**
|
||||
* The result of the cost estimation.
|
||||
*/
|
||||
resultCode?: string;
|
||||
/**
|
||||
* Indicates the way the charges can be passed on to the cardholder. The following values are possible: * `ZERO` - the charges are not allowed to pass on * `PASSTHROUGH` - the charges can be passed on * `UNLIMITED` - there is no limit on how much surcharge is passed on
|
||||
*/
|
||||
surchargeType?: string;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* Adyen BinLookup Service
|
||||
* The BIN Lookup API provides endpoints for retrieving information, such as [cost estimates](https://docs.adyen.com/features/cost-estimation), and 3D Secure supported version based on a given [BIN](https://docs.adyen.com/payments-basics/payment-glossary#bankidentificationnumberbin).
|
||||
*
|
||||
* OpenAPI spec version: 40
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface DSPublicKeyDetail {
|
||||
/**
|
||||
* Card brand.
|
||||
*/
|
||||
brand?: string;
|
||||
/**
|
||||
* Directory Server (DS) identifier.
|
||||
*/
|
||||
directoryServerId?: string;
|
||||
/**
|
||||
* Public key. The 3D Secure 2 SDK encrypts the device information by using the DS public key.
|
||||
*/
|
||||
publicKey?: string;
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
export * from './amount';
|
||||
export * from './cardBin';
|
||||
export * from './costEstimateAssumptions';
|
||||
export * from './costEstimateRequest';
|
||||
export * from './costEstimateResponse';
|
||||
export * from './dSPublicKeyDetail';
|
||||
export * from './merchantDetails';
|
||||
export * from './recurring';
|
||||
export * from './threeDS2CardRangeDetail';
|
||||
export * from './threeDSAvailabilityRequest';
|
||||
export * from './threeDSAvailabilityResponse';
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* Adyen BinLookup Service
|
||||
* The BIN Lookup API provides endpoints for retrieving information, such as [cost estimates](https://docs.adyen.com/features/cost-estimation), and 3D Secure supported version based on a given [BIN](https://docs.adyen.com/payments-basics/payment-glossary#bankidentificationnumberbin).
|
||||
*
|
||||
* OpenAPI spec version: 40
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface MerchantDetails {
|
||||
/**
|
||||
* 2-letter ISO 3166 country code of the card acceptor location. > This parameter is required for the merchants who don't use Adyen as the payment authorisation gateway.
|
||||
*/
|
||||
countryCode?: string;
|
||||
/**
|
||||
* If true, indicates that the merchant is enrolled in 3D Secure for the card network.
|
||||
*/
|
||||
enrolledIn3DSecure?: boolean;
|
||||
/**
|
||||
* The merchant category code (MCC) is a four-digit number which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant. The list of MCCs can be found [here](https://en.wikipedia.org/wiki/Merchant_category_code).
|
||||
*/
|
||||
mcc?: string;
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/**
|
||||
* Adyen BinLookup Service
|
||||
* The BIN Lookup API provides endpoints for retrieving information, such as [cost estimates](https://docs.adyen.com/features/cost-estimation), and 3D Secure supported version based on a given [BIN](https://docs.adyen.com/payments-basics/payment-glossary#bankidentificationnumberbin).
|
||||
*
|
||||
* OpenAPI spec version: 40
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface Recurring {
|
||||
/**
|
||||
* The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payment-glossary#cardsecuritycodecvccvvcid). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payment-glossary#cardnotpresentcnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/features/third-party-payouts).
|
||||
*/
|
||||
contract?: Recurring.ContractEnum;
|
||||
/**
|
||||
* A descriptive name for this detail.
|
||||
*/
|
||||
recurringDetailName?: string;
|
||||
/**
|
||||
* Date after which no further authorisations shall be performed. Only for 3D Secure 2.
|
||||
*/
|
||||
recurringExpiry?: Date;
|
||||
/**
|
||||
* Minimum number of days between authorisations. Only for 3D Secure 2.
|
||||
*/
|
||||
recurringFrequency?: string;
|
||||
/**
|
||||
* The name of the token service.
|
||||
*/
|
||||
tokenService?: Recurring.TokenServiceEnum;
|
||||
}
|
||||
export namespace Recurring {
|
||||
export type ContractEnum = 'ONECLICK' | 'RECURRING' | 'PAYOUT';
|
||||
export const ContractEnum = {
|
||||
ONECLICK: 'ONECLICK' as ContractEnum,
|
||||
RECURRING: 'RECURRING' as ContractEnum,
|
||||
PAYOUT: 'PAYOUT' as ContractEnum
|
||||
};
|
||||
export type TokenServiceEnum = 'VISATOKENSERVICE' | 'MCTOKENSERVICE';
|
||||
export const TokenServiceEnum = {
|
||||
VISATOKENSERVICE: 'VISATOKENSERVICE' as TokenServiceEnum,
|
||||
MCTOKENSERVICE: 'MCTOKENSERVICE' as TokenServiceEnum
|
||||
};
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
/**
|
||||
* Adyen BinLookup Service
|
||||
* The BIN Lookup API provides endpoints for retrieving information, such as [cost estimates](https://docs.adyen.com/features/cost-estimation), and 3D Secure supported version based on a given [BIN](https://docs.adyen.com/payments-basics/payment-glossary#bankidentificationnumberbin).
|
||||
*
|
||||
* OpenAPI spec version: 40
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface ThreeDS2CardRangeDetail {
|
||||
/**
|
||||
* Card brand.
|
||||
*/
|
||||
brandCode?: string;
|
||||
/**
|
||||
* BIN end range.
|
||||
*/
|
||||
endRange?: string;
|
||||
/**
|
||||
* BIN start range.
|
||||
*/
|
||||
startRange?: string;
|
||||
/**
|
||||
* 3D Secure protocol version.
|
||||
*/
|
||||
threeDS2Version?: string;
|
||||
/**
|
||||
* In a 3D Secure 2 browser-based flow, this is the URL where you should send the device fingerprint to.
|
||||
*/
|
||||
threeDSMethodURL?: string;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/**
|
||||
* Adyen BinLookup Service
|
||||
* The BIN Lookup API provides endpoints for retrieving information, such as [cost estimates](https://docs.adyen.com/features/cost-estimation), and 3D Secure supported version based on a given [BIN](https://docs.adyen.com/payments-basics/payment-glossary#bankidentificationnumberbin).
|
||||
*
|
||||
* OpenAPI spec version: 40
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface ThreeDSAvailabilityRequest {
|
||||
/**
|
||||
* This field contains additional data, which may be required for a particular request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/api-reference/payments-api#paymentrequestadditionaldata).
|
||||
*/
|
||||
additionalData?: any;
|
||||
/**
|
||||
* List of brands.
|
||||
*/
|
||||
brands: Array<string>;
|
||||
/**
|
||||
* Card number or BIN.
|
||||
*/
|
||||
cardNumber?: string;
|
||||
/**
|
||||
* The merchant account identifier.
|
||||
*/
|
||||
merchantAccount: string;
|
||||
/**
|
||||
* A recurring detail reference corresponding to a card.
|
||||
*/
|
||||
recurringDetailReference?: string;
|
||||
/**
|
||||
* The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID).
|
||||
*/
|
||||
shopperReference?: string;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/**
|
||||
* Adyen BinLookup Service
|
||||
* The BIN Lookup API provides endpoints for retrieving information, such as [cost estimates](https://docs.adyen.com/features/cost-estimation), and 3D Secure supported version based on a given [BIN](https://docs.adyen.com/payments-basics/payment-glossary#bankidentificationnumberbin).
|
||||
*
|
||||
* OpenAPI spec version: 40
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { DSPublicKeyDetail } from './dSPublicKeyDetail';
|
||||
import { ThreeDS2CardRangeDetail } from './threeDS2CardRangeDetail';
|
||||
|
||||
|
||||
export interface ThreeDSAvailabilityResponse {
|
||||
/**
|
||||
* List of Directory Server (DS) public keys.
|
||||
*/
|
||||
dsPublicKeys?: Array<DSPublicKeyDetail>;
|
||||
/**
|
||||
* Indicator if 3D Secure 1 is supported.
|
||||
*/
|
||||
threeDS1Supported?: boolean;
|
||||
/**
|
||||
* List of brand and card range pairs.
|
||||
*/
|
||||
threeDS2CardRangeDetails?: Array<ThreeDS2CardRangeDetail>;
|
||||
/**
|
||||
* Indicator if 3D Secure 2 is supported.
|
||||
*/
|
||||
threeDS2supported?: boolean;
|
||||
}
|
||||
3528
src/typings/checkout.ts
Normal file
3528
src/typings/checkout.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,126 +0,0 @@
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface AccountInfo {
|
||||
/**
|
||||
* Indicator for the length of time since this shopper account was created in the merchant's environment. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days
|
||||
*/
|
||||
accountAgeIndicator?: AccountInfo.AccountAgeIndicatorEnum;
|
||||
/**
|
||||
* Date when the shopper's account was last changed.
|
||||
*/
|
||||
accountChangeDate?: Date;
|
||||
/**
|
||||
* Indicator for the length of time since the shopper's account was last updated. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days
|
||||
*/
|
||||
accountChangeIndicator?: AccountInfo.AccountChangeIndicatorEnum;
|
||||
/**
|
||||
* Date when the shopper's account was created.
|
||||
*/
|
||||
accountCreationDate?: Date;
|
||||
/**
|
||||
* Number of attempts the shopper tried to add a card to their account in the last day.
|
||||
*/
|
||||
addCardAttemptsDay?: number;
|
||||
/**
|
||||
* Date the selected delivery address was last used.
|
||||
*/
|
||||
deliveryAddressUsageDate?: Date;
|
||||
/**
|
||||
* Indicator for the length of time since this delivery address was last used. Allowed values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days
|
||||
*/
|
||||
deliveryAddressUsageIndicator?: AccountInfo.DeliveryAddressUsageIndicatorEnum;
|
||||
/**
|
||||
* Shopper's home phone number (including the country code).
|
||||
*/
|
||||
homePhone?: string;
|
||||
/**
|
||||
* Shopper's mobile phone number (including the country code).
|
||||
*/
|
||||
mobilePhone?: string;
|
||||
/**
|
||||
* Date when the shopper last changed their password.
|
||||
*/
|
||||
passwordChangeDate?: Date;
|
||||
/**
|
||||
* Indicator when the shopper has changed their password. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days
|
||||
*/
|
||||
passwordChangeIndicator?: AccountInfo.PasswordChangeIndicatorEnum;
|
||||
/**
|
||||
* Number of all transactions (successful and abandoned) from this shopper in the past 24 hours.
|
||||
*/
|
||||
pastTransactionsDay?: number;
|
||||
/**
|
||||
* Number of all transactions (successful and abandoned) from this shopper in the past year.
|
||||
*/
|
||||
pastTransactionsYear?: number;
|
||||
/**
|
||||
* Date this payment method was added to the shopper's account.
|
||||
*/
|
||||
paymentAccountAge?: Date;
|
||||
/**
|
||||
* Indicator for the length of time since this payment method was added to this shopper's account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days
|
||||
*/
|
||||
paymentAccountIndicator?: AccountInfo.PaymentAccountIndicatorEnum;
|
||||
/**
|
||||
* Number of successful purchases in the last six months.
|
||||
*/
|
||||
purchasesLast6Months?: number;
|
||||
/**
|
||||
* Whether suspicious activity was recorded on this account.
|
||||
*/
|
||||
suspiciousActivity?: boolean;
|
||||
/**
|
||||
* Shopper's work phone number (including the country code).
|
||||
*/
|
||||
workPhone?: string;
|
||||
}
|
||||
export namespace AccountInfo {
|
||||
export type AccountAgeIndicatorEnum = 'notApplicable' | 'thisTransaction' | 'lessThan30Days' | 'from30To60Days' | 'moreThan60Days';
|
||||
export const AccountAgeIndicatorEnum = {
|
||||
NotApplicable: 'notApplicable' as AccountAgeIndicatorEnum,
|
||||
ThisTransaction: 'thisTransaction' as AccountAgeIndicatorEnum,
|
||||
LessThan30Days: 'lessThan30Days' as AccountAgeIndicatorEnum,
|
||||
From30To60Days: 'from30To60Days' as AccountAgeIndicatorEnum,
|
||||
MoreThan60Days: 'moreThan60Days' as AccountAgeIndicatorEnum
|
||||
};
|
||||
export type AccountChangeIndicatorEnum = 'thisTransaction' | 'lessThan30Days' | 'from30To60Days' | 'moreThan60Days';
|
||||
export const AccountChangeIndicatorEnum = {
|
||||
ThisTransaction: 'thisTransaction' as AccountChangeIndicatorEnum,
|
||||
LessThan30Days: 'lessThan30Days' as AccountChangeIndicatorEnum,
|
||||
From30To60Days: 'from30To60Days' as AccountChangeIndicatorEnum,
|
||||
MoreThan60Days: 'moreThan60Days' as AccountChangeIndicatorEnum
|
||||
};
|
||||
export type DeliveryAddressUsageIndicatorEnum = 'thisTransaction' | 'lessThan30Days' | 'from30To60Days' | 'moreThan60Days';
|
||||
export const DeliveryAddressUsageIndicatorEnum = {
|
||||
ThisTransaction: 'thisTransaction' as DeliveryAddressUsageIndicatorEnum,
|
||||
LessThan30Days: 'lessThan30Days' as DeliveryAddressUsageIndicatorEnum,
|
||||
From30To60Days: 'from30To60Days' as DeliveryAddressUsageIndicatorEnum,
|
||||
MoreThan60Days: 'moreThan60Days' as DeliveryAddressUsageIndicatorEnum
|
||||
};
|
||||
export type PasswordChangeIndicatorEnum = 'notApplicable' | 'thisTransaction' | 'lessThan30Days' | 'from30To60Days' | 'moreThan60Days';
|
||||
export const PasswordChangeIndicatorEnum = {
|
||||
NotApplicable: 'notApplicable' as PasswordChangeIndicatorEnum,
|
||||
ThisTransaction: 'thisTransaction' as PasswordChangeIndicatorEnum,
|
||||
LessThan30Days: 'lessThan30Days' as PasswordChangeIndicatorEnum,
|
||||
From30To60Days: 'from30To60Days' as PasswordChangeIndicatorEnum,
|
||||
MoreThan60Days: 'moreThan60Days' as PasswordChangeIndicatorEnum
|
||||
};
|
||||
export type PaymentAccountIndicatorEnum = 'notApplicable' | 'thisTransaction' | 'lessThan30Days' | 'from30To60Days' | 'moreThan60Days';
|
||||
export const PaymentAccountIndicatorEnum = {
|
||||
NotApplicable: 'notApplicable' as PaymentAccountIndicatorEnum,
|
||||
ThisTransaction: 'thisTransaction' as PaymentAccountIndicatorEnum,
|
||||
LessThan30Days: 'lessThan30Days' as PaymentAccountIndicatorEnum,
|
||||
From30To60Days: 'from30To60Days' as PaymentAccountIndicatorEnum,
|
||||
MoreThan60Days: 'moreThan60Days' as PaymentAccountIndicatorEnum
|
||||
};
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface Address {
|
||||
/**
|
||||
* The name of the city. >Required if either houseNumberOrName, street, postalCode, or stateOrProvince are provided.
|
||||
*/
|
||||
city?: string;
|
||||
/**
|
||||
* The two-character country code of the address >The permitted country codes are defined in ISO-3166-1 alpha-2 (e.g. 'NL').
|
||||
*/
|
||||
country: string;
|
||||
/**
|
||||
* The number or name of the house.
|
||||
*/
|
||||
houseNumberOrName?: string;
|
||||
/**
|
||||
* The postal code. >A maximum of five (5) digits for an address in the USA, or a maximum of ten (10) characters for an address in all other countries.
|
||||
*/
|
||||
postalCode?: string;
|
||||
/**
|
||||
* The abbreviation of the state or province. >Two (2) characters for an address in the USA or Canada, or a maximum of three (3) characters for an address in all other countries. >Required for an address in the USA or Canada if either houseNumberOrName, street, city, or postalCode are provided.
|
||||
*/
|
||||
stateOrProvince?: string;
|
||||
/**
|
||||
* The name of the street. >The house number should not be included in this field; it should be separately provided via `houseNumberOrName`. >Required if either houseNumberOrName, city, postalCode, or stateOrProvince are provided.
|
||||
*/
|
||||
street?: string;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface Amount {
|
||||
/**
|
||||
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
|
||||
*/
|
||||
currency: string;
|
||||
/**
|
||||
* The payable amount that can be charged for the transaction. The transaction amount needs to be represented in minor units according to the [following table](https://docs.adyen.com/development-resources/currency-codes).
|
||||
*/
|
||||
value: number;
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface Avs {
|
||||
/**
|
||||
* Indicates whether the shopper is allowed to modify the billing address for the current payment request.
|
||||
*/
|
||||
addressEditable?: boolean;
|
||||
/**
|
||||
* Specifies whether the shopper should enter their billing address during checkout. Allowed values: * yes — Perform AVS checks for every card payment. * automatic — Perform AVS checks only when required to optimize the conversion rate. * no — Do not perform AVS checks.
|
||||
*/
|
||||
enabled?: Avs.EnabledEnum;
|
||||
}
|
||||
export namespace Avs {
|
||||
export type EnabledEnum = 'yes' | 'no' | 'automatic';
|
||||
export const EnabledEnum = {
|
||||
Yes: 'yes' as EnabledEnum,
|
||||
No: 'no' as EnabledEnum,
|
||||
Automatic: 'automatic' as EnabledEnum
|
||||
};
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface BankAccount {
|
||||
/**
|
||||
* The bank account number (without separators).
|
||||
*/
|
||||
bankAccountNumber?: string;
|
||||
/**
|
||||
* The bank city.
|
||||
*/
|
||||
bankCity?: string;
|
||||
/**
|
||||
* The location id of the bank. The field value is `nil` in most cases.
|
||||
*/
|
||||
bankLocationId?: string;
|
||||
/**
|
||||
* The name of the bank.
|
||||
*/
|
||||
bankName?: string;
|
||||
/**
|
||||
* The [Business Identifier Code](https://en.wikipedia.org/wiki/ISO_9362) (BIC) is the SWIFT address assigned to a bank. The field value is `nil` in most cases.
|
||||
*/
|
||||
bic?: string;
|
||||
/**
|
||||
* Country code where the bank is located. A valid value is an ISO two-character country code (e.g. 'NL').
|
||||
*/
|
||||
countryCode?: string;
|
||||
/**
|
||||
* The [International Bank Account Number](https://en.wikipedia.org/wiki/International_Bank_Account_Number) (IBAN).
|
||||
*/
|
||||
iban?: string;
|
||||
/**
|
||||
* The name of the bank account holder. If you submit a name with non-Latin characters, we automatically replace some of them with corresponding Latin characters to meet the FATF recommendations. For example: * χ12 is converted to ch12. * üA is converted to euA. * Peter Møller is converted to Peter Mller, because banks don't accept 'ø'. After replacement, the ownerName must have at least three alphanumeric characters (A-Z, a-z, 0-9), and at least one of them must be a valid Latin character (A-Z, a-z). For example: * John17 - allowed. * J17 - allowed. * 171 - not allowed. * John-7 - allowed. > If provided details don't match the required format, the response returns the error message: 203 'Invalid bank account holder name'.
|
||||
*/
|
||||
ownerName?: string;
|
||||
/**
|
||||
* The bank account holder's tax ID.
|
||||
*/
|
||||
taxId?: string;
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface BrowserInfo {
|
||||
/**
|
||||
* The accept header value of the shopper's browser.
|
||||
*/
|
||||
acceptHeader: string;
|
||||
/**
|
||||
* The color depth of the shopper's browser in bits per pixel. This should be obtained by using the browser's `screen.colorDepth` property. Accepted values: 1, 4, 8, 15, 16, 24, 32 or 48 bit color depth.
|
||||
*/
|
||||
colorDepth: number;
|
||||
/**
|
||||
* Boolean value indicating if the shopper's browser is able to execute Java.
|
||||
*/
|
||||
javaEnabled: boolean;
|
||||
/**
|
||||
* Boolean value indicating if the shopper's browser is able to execute JavaScript. A default 'true' value is assumed if the field is not present.
|
||||
*/
|
||||
javaScriptEnabled?: boolean;
|
||||
/**
|
||||
* The `navigator.language` value of the shopper's browser (as defined in IETF BCP 47).
|
||||
*/
|
||||
language: string;
|
||||
/**
|
||||
* The total height of the shopper's device screen in pixels.
|
||||
*/
|
||||
screenHeight: number;
|
||||
/**
|
||||
* The total width of the shopper's device screen in pixels.
|
||||
*/
|
||||
screenWidth: number;
|
||||
/**
|
||||
* Time difference between UTC time and the shopper's browser local time, in minutes.
|
||||
*/
|
||||
timeZoneOffset: number;
|
||||
/**
|
||||
* The user agent value of the shopper's browser.
|
||||
*/
|
||||
userAgent: string;
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface Card {
|
||||
/**
|
||||
* The [card verification code](https://docs.adyen.com/payments-essentials/payment-glossary#card_security_code_cvc_cvv_cid_) (1-20 characters). Depending on the card brand, it is known also as: * CVV2/CVC2 – length: 3 digits * CID – length: 4 digits > If you are using [Client-Side Encryption](https://docs.adyen.com/classic-integration/cse-integration-ecommerce), the CVC code is present in the encrypted data. You must never post the card details to the server. > This field must be always present in a [one-click payment request](https://docs.adyen.com/classic-integration/recurring-payments). > When this value is returned in a response, it is always empty because it is not stored.
|
||||
*/
|
||||
cvc?: string;
|
||||
/**
|
||||
* The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 = March * 11 = November
|
||||
*/
|
||||
expiryMonth: string;
|
||||
/**
|
||||
* The card expiry year. Format: 4 digits. For example: 2020
|
||||
*/
|
||||
expiryYear: string;
|
||||
/**
|
||||
* The name of the cardholder, as printed on the card.
|
||||
*/
|
||||
holderName: string;
|
||||
/**
|
||||
* The issue number of the card (for some UK debit cards only).
|
||||
*/
|
||||
issueNumber?: string;
|
||||
/**
|
||||
* The card number (4-19 characters). Do not use any separators. When this value is returned in a response, only the last 4 digits of the card number are returned.
|
||||
*/
|
||||
number: string;
|
||||
/**
|
||||
* The month component of the start date (for some UK debit cards only).
|
||||
*/
|
||||
startMonth?: string;
|
||||
/**
|
||||
* The year component of the start date (for some UK debit cards only).
|
||||
*/
|
||||
startYear?: string;
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface Company {
|
||||
/**
|
||||
* The company website's home page.
|
||||
*/
|
||||
homepage?: string;
|
||||
/**
|
||||
* The company name.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Registration number of the company.
|
||||
*/
|
||||
registrationNumber?: string;
|
||||
/**
|
||||
* Registry location of the company.
|
||||
*/
|
||||
registryLocation?: string;
|
||||
/**
|
||||
* Tax ID of the company.
|
||||
*/
|
||||
taxId?: string;
|
||||
/**
|
||||
* The company type.
|
||||
*/
|
||||
type?: string;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { Avs } from './avs';
|
||||
import { Installments } from './installments';
|
||||
import { ShopperInput } from './shopperInput';
|
||||
|
||||
|
||||
export interface Configuration {
|
||||
avs?: Avs;
|
||||
/**
|
||||
* Determines whether the cardholder name should be provided or not. Permitted values: * NONE * OPTIONAL * REQUIRED
|
||||
*/
|
||||
cardHolderName?: Configuration.CardHolderNameEnum;
|
||||
installments?: Installments;
|
||||
shopperInput?: ShopperInput;
|
||||
}
|
||||
export namespace Configuration {
|
||||
export type CardHolderNameEnum = 'NONE' | 'OPTIONAL' | 'REQUIRED';
|
||||
export const CardHolderNameEnum = {
|
||||
NONE: 'NONE' as CardHolderNameEnum,
|
||||
OPTIONAL: 'OPTIONAL' as CardHolderNameEnum,
|
||||
REQUIRED: 'REQUIRED' as CardHolderNameEnum
|
||||
};
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface DetailsRequest {
|
||||
/**
|
||||
* Use this collection to submit the details that were returned as a result of the `/payments` call.
|
||||
*/
|
||||
details: any;
|
||||
/**
|
||||
* The `paymentData` value that you received in the response to the `/payments` call.
|
||||
*/
|
||||
paymentData?: string;
|
||||
/**
|
||||
* Change the `authenticationOnly` indicator originally set in the `/payments` request. Only needs to be set if you want to modify the value set previously.
|
||||
*/
|
||||
threeDSAuthenticationOnly?: boolean;
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface DeviceRenderOptions {
|
||||
/**
|
||||
* Supported SDK interface types. Allowed values: * Native * Html * both
|
||||
*/
|
||||
sdkInterface?: DeviceRenderOptions.SdkInterfaceEnum;
|
||||
/**
|
||||
* UI types supported for displaying specific challenges. Allowed values: * text * singleSelect * outOfBand * otherHtml * multiSelect
|
||||
*/
|
||||
sdkUiType?: Array<DeviceRenderOptions.SdkUiTypeEnum>;
|
||||
}
|
||||
export namespace DeviceRenderOptions {
|
||||
export type SdkInterfaceEnum = 'Html' | 'Native' | 'both';
|
||||
export const SdkInterfaceEnum = {
|
||||
Html: 'Html' as SdkInterfaceEnum,
|
||||
Native: 'Native' as SdkInterfaceEnum,
|
||||
Both: 'both' as SdkInterfaceEnum
|
||||
};
|
||||
export type SdkUiTypeEnum = 'multiSelect' | 'otherHtml' | 'outOfBand' | 'singleSelect' | 'text';
|
||||
export const SdkUiTypeEnum = {
|
||||
MultiSelect: 'multiSelect' as SdkUiTypeEnum,
|
||||
OtherHtml: 'otherHtml' as SdkUiTypeEnum,
|
||||
OutOfBand: 'outOfBand' as SdkUiTypeEnum,
|
||||
SingleSelect: 'singleSelect' as SdkUiTypeEnum,
|
||||
Text: 'text' as SdkUiTypeEnum
|
||||
};
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { Amount } from './amount';
|
||||
|
||||
|
||||
export interface ForexQuote {
|
||||
/**
|
||||
* The account name.
|
||||
*/
|
||||
account?: string;
|
||||
/**
|
||||
* The account type.
|
||||
*/
|
||||
accountType?: string;
|
||||
baseAmount?: Amount;
|
||||
/**
|
||||
* The base points.
|
||||
*/
|
||||
basePoints: number;
|
||||
buy?: Amount;
|
||||
interbank?: Amount;
|
||||
/**
|
||||
* The reference assigned to the forex quote request.
|
||||
*/
|
||||
reference?: string;
|
||||
sell?: Amount;
|
||||
/**
|
||||
* The signature to validate the integrity.
|
||||
*/
|
||||
signature?: string;
|
||||
/**
|
||||
* The source of the forex quote.
|
||||
*/
|
||||
source?: string;
|
||||
/**
|
||||
* The type of forex.
|
||||
*/
|
||||
type?: string;
|
||||
/**
|
||||
* The date until which the forex quote is valid.
|
||||
*/
|
||||
validTill: Date;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface FraudCheckResult {
|
||||
/**
|
||||
* The fraud score generated by the risk check.
|
||||
*/
|
||||
accountScore: number;
|
||||
/**
|
||||
* The ID of the risk check.
|
||||
*/
|
||||
checkId: number;
|
||||
/**
|
||||
* The name of the risk check.
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { FraudCheckResult } from './fraudCheckResult';
|
||||
|
||||
|
||||
export interface FraudResult {
|
||||
/**
|
||||
* The total fraud score generated by the risk checks.
|
||||
*/
|
||||
accountScore: number;
|
||||
/**
|
||||
* The result of the individual risk checks.
|
||||
*/
|
||||
results?: Array<FraudCheckResult>;
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
|
||||
|
||||
export * from './accountInfo';
|
||||
export * from './address';
|
||||
export * from './amount';
|
||||
export * from './avs';
|
||||
export * from './bankAccount';
|
||||
export * from './browserInfo';
|
||||
export * from './card';
|
||||
export * from './company';
|
||||
export * from './configuration';
|
||||
export * from './detailsRequest';
|
||||
export * from './deviceRenderOptions';
|
||||
export * from './forexQuote';
|
||||
export * from './fraudCheckResult';
|
||||
export * from './fraudResult';
|
||||
export * from './inputDetail';
|
||||
export * from './installments';
|
||||
export * from './item';
|
||||
export * from './lineItem';
|
||||
export * from './merchantRiskIndicator';
|
||||
export * from './name';
|
||||
export * from './paymentMethod';
|
||||
export * from './paymentMethodGroup';
|
||||
export * from './paymentMethodsGroup';
|
||||
export * from './paymentMethodsRequest';
|
||||
export * from './paymentMethodsResponse';
|
||||
export * from './paymentRequest';
|
||||
export * from './paymentResponse';
|
||||
export * from './paymentSetupRequest';
|
||||
export * from './paymentSetupResponse';
|
||||
export * from './paymentVerificationRequest';
|
||||
export * from './paymentVerificationResponse';
|
||||
export * from './recurring';
|
||||
export * from './recurringDetail';
|
||||
export * from './redirect';
|
||||
export * from './sDKEphemPubKey';
|
||||
export * from './serviceError';
|
||||
export * from './shopperInput';
|
||||
export * from './split';
|
||||
export * from './splitAmount';
|
||||
export * from './storedDetails';
|
||||
export * from './subInputDetail';
|
||||
export * from './threeDS2RequestData';
|
||||
export * from './threeDSecureData';
|
||||
@@ -1,50 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { Item } from './item';
|
||||
import { SubInputDetail } from './subInputDetail';
|
||||
|
||||
|
||||
export interface InputDetail {
|
||||
/**
|
||||
* Configuration parameters for the required input.
|
||||
*/
|
||||
configuration?: any;
|
||||
/**
|
||||
* Input details can also be provided recursively.
|
||||
*/
|
||||
details?: Array<SubInputDetail>;
|
||||
/**
|
||||
* In case of a select, the URL from which to query the items.
|
||||
*/
|
||||
itemSearchUrl?: string;
|
||||
/**
|
||||
* In case of a select, the items to choose from.
|
||||
*/
|
||||
items?: Array<Item>;
|
||||
/**
|
||||
* The value to provide in the result.
|
||||
*/
|
||||
key?: string;
|
||||
/**
|
||||
* True if this input value is optional.
|
||||
*/
|
||||
optional?: boolean;
|
||||
/**
|
||||
* The type of the required input.
|
||||
*/
|
||||
type?: string;
|
||||
/**
|
||||
* The value can be pre-filled, if available.
|
||||
*/
|
||||
value?: string;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface Installments {
|
||||
/**
|
||||
* Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary.
|
||||
*/
|
||||
value: number;
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface Item {
|
||||
/**
|
||||
* The value to provide in the result.
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* The display name.
|
||||
*/
|
||||
name?: string;
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface LineItem {
|
||||
/**
|
||||
* Item amount excluding the tax, in minor units.
|
||||
*/
|
||||
amountExcludingTax?: number;
|
||||
/**
|
||||
* Item amount including the tax, in minor units.
|
||||
*/
|
||||
amountIncludingTax?: number;
|
||||
/**
|
||||
* Description of the line item.
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* ID of the line item.
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* Number of items.
|
||||
*/
|
||||
quantity?: number;
|
||||
/**
|
||||
* Tax amount, in minor units.
|
||||
*/
|
||||
taxAmount?: number;
|
||||
/**
|
||||
* Tax category: High, Low, None, Zero
|
||||
*/
|
||||
taxCategory?: LineItem.TaxCategoryEnum;
|
||||
/**
|
||||
* Tax percentage, in minor units.
|
||||
*/
|
||||
taxPercentage?: number;
|
||||
}
|
||||
export namespace LineItem {
|
||||
export type TaxCategoryEnum = 'High' | 'Low' | 'None' | 'Zero';
|
||||
export const TaxCategoryEnum = {
|
||||
High: 'High' as TaxCategoryEnum,
|
||||
Low: 'Low' as TaxCategoryEnum,
|
||||
None: 'None' as TaxCategoryEnum,
|
||||
Zero: 'Zero' as TaxCategoryEnum
|
||||
};
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { Amount } from './amount';
|
||||
|
||||
|
||||
export interface MerchantRiskIndicator {
|
||||
/**
|
||||
* Whether the chosen delivery address is identical to the billing address.
|
||||
*/
|
||||
addressMatch?: boolean;
|
||||
/**
|
||||
* Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * `digitalGoods` * `goodsNotShipped` * `other`
|
||||
*/
|
||||
deliveryAddressIndicator?: MerchantRiskIndicator.DeliveryAddressIndicatorEnum;
|
||||
/**
|
||||
* The delivery email address (for digital goods).
|
||||
*/
|
||||
deliveryEmail?: string;
|
||||
/**
|
||||
* The estimated delivery time for the shopper to receive the goods. Allowed values: * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * `twoOrMoreDaysShipping`
|
||||
*/
|
||||
deliveryTimeframe?: MerchantRiskIndicator.DeliveryTimeframeEnum;
|
||||
giftCardAmount?: Amount;
|
||||
/**
|
||||
* Number of individual prepaid or gift cards used for this purchase.
|
||||
*/
|
||||
giftCardCount?: number;
|
||||
/**
|
||||
* For pre-order purchases, the expected date this product will be available to the shopper.
|
||||
*/
|
||||
preOrderDate?: Date;
|
||||
/**
|
||||
* Indicator for whether this transaction is for pre-ordering a product.
|
||||
*/
|
||||
preOrderPurchase?: boolean;
|
||||
/**
|
||||
* Indicator for whether the shopper has already purchased the same items in the past.
|
||||
*/
|
||||
reorderItems?: boolean;
|
||||
}
|
||||
export namespace MerchantRiskIndicator {
|
||||
export type DeliveryAddressIndicatorEnum = 'shipToBillingAddress' | 'shipToVerifiedAddress' | 'shipToNewAddress' | 'shipToStore' | 'digitalGoods' | 'goodsNotShipped' | 'other';
|
||||
export const DeliveryAddressIndicatorEnum = {
|
||||
ShipToBillingAddress: 'shipToBillingAddress' as DeliveryAddressIndicatorEnum,
|
||||
ShipToVerifiedAddress: 'shipToVerifiedAddress' as DeliveryAddressIndicatorEnum,
|
||||
ShipToNewAddress: 'shipToNewAddress' as DeliveryAddressIndicatorEnum,
|
||||
ShipToStore: 'shipToStore' as DeliveryAddressIndicatorEnum,
|
||||
DigitalGoods: 'digitalGoods' as DeliveryAddressIndicatorEnum,
|
||||
GoodsNotShipped: 'goodsNotShipped' as DeliveryAddressIndicatorEnum,
|
||||
Other: 'other' as DeliveryAddressIndicatorEnum
|
||||
};
|
||||
export type DeliveryTimeframeEnum = 'electronicDelivery' | 'sameDayShipping' | 'overnightShipping' | 'twoOrMoreDaysShipping';
|
||||
export const DeliveryTimeframeEnum = {
|
||||
ElectronicDelivery: 'electronicDelivery' as DeliveryTimeframeEnum,
|
||||
SameDayShipping: 'sameDayShipping' as DeliveryTimeframeEnum,
|
||||
OvernightShipping: 'overnightShipping' as DeliveryTimeframeEnum,
|
||||
TwoOrMoreDaysShipping: 'twoOrMoreDaysShipping' as DeliveryTimeframeEnum
|
||||
};
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface Name {
|
||||
/**
|
||||
* The first name.
|
||||
*/
|
||||
firstName: string;
|
||||
/**
|
||||
* The gender. >The following values are permitted: `MALE`, `FEMALE`, `UNKNOWN`.
|
||||
*/
|
||||
gender: Name.GenderEnum;
|
||||
/**
|
||||
* The name's infix, if applicable. >A maximum length of twenty (20) characters is imposed.
|
||||
*/
|
||||
infix?: string;
|
||||
/**
|
||||
* The last name.
|
||||
*/
|
||||
lastName: string;
|
||||
}
|
||||
export namespace Name {
|
||||
export type GenderEnum = 'MALE' | 'FEMALE' | 'UNKNOWN';
|
||||
export const GenderEnum = {
|
||||
MALE: 'MALE' as GenderEnum,
|
||||
FEMALE: 'FEMALE' as GenderEnum,
|
||||
UNKNOWN: 'UNKNOWN' as GenderEnum
|
||||
};
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { InputDetail } from './inputDetail';
|
||||
import { PaymentMethodGroup } from './paymentMethodGroup';
|
||||
|
||||
|
||||
export interface PaymentMethod {
|
||||
/**
|
||||
* The configuration of the payment method.
|
||||
*/
|
||||
configuration?: any;
|
||||
/**
|
||||
* All input details to be provided to complete the payment with this payment method.
|
||||
*/
|
||||
details?: Array<InputDetail>;
|
||||
group?: PaymentMethodGroup;
|
||||
/**
|
||||
* The displayable name of this payment method.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Echo data required to send in next calls.
|
||||
*/
|
||||
paymentMethodData?: string;
|
||||
/**
|
||||
* Indicates whether this payment method supports tokenization or not.
|
||||
*/
|
||||
supportsRecurring?: boolean;
|
||||
/**
|
||||
* The unique payment method code.
|
||||
*/
|
||||
type?: string;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface PaymentMethodGroup {
|
||||
/**
|
||||
* The name of the group.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Echo data to be used if the payment method is displayed as part of this group.
|
||||
*/
|
||||
paymentMethodData?: string;
|
||||
/**
|
||||
* The unique code of the group.
|
||||
*/
|
||||
type?: string;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface PaymentMethodsGroup {
|
||||
/**
|
||||
* The type to submit for any payment method in this group.
|
||||
*/
|
||||
groupType?: string;
|
||||
/**
|
||||
* The human-readable name of this group.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* The types of payment methods that belong in this group.
|
||||
*/
|
||||
types?: Array<string>;
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { Amount } from './amount';
|
||||
|
||||
|
||||
export interface PaymentMethodsRequest {
|
||||
/**
|
||||
* This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/api-reference/payments-api#paymentrequestadditionaldata).
|
||||
*/
|
||||
additionalData?: any;
|
||||
/**
|
||||
* List of payments methods to be presented to the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods/payment-methods-overview).
|
||||
*/
|
||||
allowedPaymentMethods?: Array<string>;
|
||||
amount?: Amount;
|
||||
/**
|
||||
* List of payments methods to be hidden from the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods/payment-methods-overview).
|
||||
*/
|
||||
blockedPaymentMethods?: Array<string>;
|
||||
/**
|
||||
* The platform where a payment transaction takes place. This field can be used for filtering out payment methods that are only available on specific platforms. Possible values: * iOS * Android * Web
|
||||
*/
|
||||
channel?: PaymentMethodsRequest.ChannelEnum;
|
||||
/**
|
||||
* The shopper's country code.
|
||||
*/
|
||||
countryCode?: string;
|
||||
/**
|
||||
* The merchant account identifier, with which you want to process the transaction.
|
||||
*/
|
||||
merchantAccount: string;
|
||||
/**
|
||||
* The combination of a language code and a country code to specify the language to be used in the payment.
|
||||
*/
|
||||
shopperLocale?: string;
|
||||
/**
|
||||
* The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments.
|
||||
*/
|
||||
shopperReference?: string;
|
||||
}
|
||||
export namespace PaymentMethodsRequest {
|
||||
export type ChannelEnum = 'iOS' | 'Android' | 'Web';
|
||||
export const ChannelEnum = {
|
||||
IOS: 'iOS' as ChannelEnum,
|
||||
Android: 'Android' as ChannelEnum,
|
||||
Web: 'Web' as ChannelEnum
|
||||
};
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { PaymentMethod } from './paymentMethod';
|
||||
import { PaymentMethodsGroup } from './paymentMethodsGroup';
|
||||
import { RecurringDetail } from './recurringDetail';
|
||||
|
||||
|
||||
export interface PaymentMethodsResponse {
|
||||
/**
|
||||
* Groups of payment methods.
|
||||
*/
|
||||
groups?: Array<PaymentMethodsGroup>;
|
||||
/**
|
||||
* Detailed list of one-click payment methods.
|
||||
*/
|
||||
oneClickPaymentMethods?: Array<RecurringDetail>;
|
||||
/**
|
||||
* Detailed list of payment methods required to generate payment forms.
|
||||
*/
|
||||
paymentMethods?: Array<PaymentMethod>;
|
||||
}
|
||||
@@ -1,214 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { AccountInfo } from './accountInfo';
|
||||
import { Address } from './address';
|
||||
import { Amount } from './amount';
|
||||
import { BrowserInfo } from './browserInfo';
|
||||
import { Company } from './company';
|
||||
import { ForexQuote } from './forexQuote';
|
||||
import { Installments } from './installments';
|
||||
import { LineItem } from './lineItem';
|
||||
import { MerchantRiskIndicator } from './merchantRiskIndicator';
|
||||
import { Name } from './name';
|
||||
import { Split } from './split';
|
||||
import { ThreeDS2RequestData } from './threeDS2RequestData';
|
||||
import { ThreeDSecureData } from './threeDSecureData';
|
||||
import { ApplicationInfo } from "../applicationInfo";
|
||||
|
||||
|
||||
export interface PaymentRequest {
|
||||
applicationInfo?: ApplicationInfo;
|
||||
accountInfo?: AccountInfo;
|
||||
/**
|
||||
* This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/api-reference/payments-api#paymentrequestadditionaldata).
|
||||
*/
|
||||
additionalData?: any;
|
||||
amount: Amount;
|
||||
billingAddress?: Address;
|
||||
browserInfo?: BrowserInfo;
|
||||
/**
|
||||
* The delay between the authorisation and scheduled auto-capture, specified in hours.
|
||||
*/
|
||||
captureDelayHours?: number;
|
||||
/**
|
||||
* The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web
|
||||
*/
|
||||
channel?: PaymentRequest.ChannelEnum;
|
||||
company?: Company;
|
||||
/**
|
||||
* The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE
|
||||
*/
|
||||
countryCode?: string;
|
||||
/**
|
||||
* The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD
|
||||
*/
|
||||
dateOfBirth?: Date;
|
||||
dccQuote?: ForexQuote;
|
||||
deliveryAddress?: Address;
|
||||
/**
|
||||
* The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00
|
||||
*/
|
||||
deliveryDate?: Date;
|
||||
/**
|
||||
* A string containing the shopper's device fingerprint. For more information, refer to [Device fingerprinting](https://docs.adyen.com/risk-management/device-fingerprinting).
|
||||
*/
|
||||
deviceFingerprint?: string;
|
||||
/**
|
||||
* When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments.
|
||||
*/
|
||||
enableOneClick?: boolean;
|
||||
/**
|
||||
* When true and `shopperReference` is provided, the payment details will be tokenized for payouts.
|
||||
*/
|
||||
enablePayOut?: boolean;
|
||||
/**
|
||||
* When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments.
|
||||
*/
|
||||
enableRecurring?: boolean;
|
||||
/**
|
||||
* The type of the entity the payment is processed for.
|
||||
*/
|
||||
entityType?: PaymentRequest.EntityTypeEnum;
|
||||
/**
|
||||
* An integer value that is added to the normal fraud score. The value can be either positive or negative.
|
||||
*/
|
||||
fraudOffset?: number;
|
||||
installments?: Installments;
|
||||
/**
|
||||
* Line items regarding the payment.
|
||||
*/
|
||||
lineItems?: Array<LineItem>;
|
||||
/**
|
||||
* The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.
|
||||
*/
|
||||
mcc?: string;
|
||||
/**
|
||||
* The merchant account identifier, with which you want to process the transaction.
|
||||
*/
|
||||
merchantAccount: string;
|
||||
/**
|
||||
* This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.
|
||||
*/
|
||||
merchantOrderReference?: string;
|
||||
merchantRiskIndicator?: MerchantRiskIndicator;
|
||||
/**
|
||||
* Metadata consists of entries, each of which includes a key and a value. Limitations: Error \"177\", \"Metadata size exceeds limit\"
|
||||
*/
|
||||
metadata?: any;
|
||||
mpiData?: ThreeDSecureData;
|
||||
/**
|
||||
* When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead.
|
||||
*/
|
||||
orderReference?: string;
|
||||
/**
|
||||
* Required for the 3D Secure 2 `channel` **Web** integration. Set this parameter to the origin URL of the page that you are loading the 3D Secure Component from.
|
||||
*/
|
||||
origin?: string;
|
||||
/**
|
||||
* The collection that contains the type of the payment method and its specific information (e.g. `idealIssuer`).
|
||||
*/
|
||||
paymentMethod: any;
|
||||
/**
|
||||
* Defines a recurring payment type. Allowed values: * `Subscription` – A transaction for a fixed or variable amount, which follows a fixed schedule. * `CardOnFile` – Card details are stored to enable one-click or omnichannel journeys, or simply to streamline the checkout process. Any subscription not following a fixed schedule is also considered a card-on-file transaction. * `UnscheduledCardOnFile` – A transaction that occurs on a non-fixed schedule and/or have variable amounts. For example, automatic top-ups when a cardholder's balance drops below a certain amount.
|
||||
*/
|
||||
recurringProcessingModel?: PaymentRequest.RecurringProcessingModelEnum;
|
||||
/**
|
||||
* Specifies the redirect method (GET or POST) when redirecting back from the issuer.
|
||||
*/
|
||||
redirectFromIssuerMethod?: string;
|
||||
/**
|
||||
* Specifies the redirect method (GET or POST) when redirecting to the issuer.
|
||||
*/
|
||||
redirectToIssuerMethod?: string;
|
||||
/**
|
||||
* The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.
|
||||
*/
|
||||
reference: string;
|
||||
/**
|
||||
* The URL to return to.
|
||||
*/
|
||||
returnUrl: string;
|
||||
/**
|
||||
* The maximum validity of the session.
|
||||
*/
|
||||
sessionValidity?: string;
|
||||
/**
|
||||
* The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require the `shopperEmail` for both `deviceChannel` **browser** and **app**.
|
||||
*/
|
||||
shopperEmail?: string;
|
||||
/**
|
||||
* The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > This field is mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new).
|
||||
*/
|
||||
shopperIP?: string;
|
||||
/**
|
||||
* Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.
|
||||
*/
|
||||
shopperInteraction?: PaymentRequest.ShopperInteractionEnum;
|
||||
/**
|
||||
* The combination of a language code and a country code to specify the language to be used in the payment.
|
||||
*/
|
||||
shopperLocale?: string;
|
||||
shopperName?: Name;
|
||||
/**
|
||||
* The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments.
|
||||
*/
|
||||
shopperReference?: string;
|
||||
/**
|
||||
* The text to appear on the shopper's bank statement.
|
||||
*/
|
||||
shopperStatement?: string;
|
||||
/**
|
||||
* The shopper's social security number.
|
||||
*/
|
||||
socialSecurityNumber?: string;
|
||||
/**
|
||||
* The details of how the payment should be split when distributing a payment to a MarketPay Marketplace and its Accounts.
|
||||
*/
|
||||
splits?: Array<Split>;
|
||||
/**
|
||||
* The shopper's telephone number.
|
||||
*/
|
||||
telephoneNumber?: string;
|
||||
threeDS2RequestData?: ThreeDS2RequestData;
|
||||
/**
|
||||
* Set to true if the payment should be routed to a trusted MID.
|
||||
*/
|
||||
trustedShopper?: boolean;
|
||||
}
|
||||
|
||||
export namespace PaymentRequest {
|
||||
export type ChannelEnum = 'iOS' | 'Android' | 'Web';
|
||||
export const ChannelEnum = {
|
||||
IOS: 'iOS' as ChannelEnum,
|
||||
Android: 'Android' as ChannelEnum,
|
||||
Web: 'Web' as ChannelEnum
|
||||
};
|
||||
export type EntityTypeEnum = 'NaturalPerson' | 'CompanyName';
|
||||
export const EntityTypeEnum = {
|
||||
NaturalPerson: 'NaturalPerson' as EntityTypeEnum,
|
||||
CompanyName: 'CompanyName' as EntityTypeEnum
|
||||
};
|
||||
export type RecurringProcessingModelEnum = 'CardOnFile' | 'Subscription' | 'UnscheduledCardOnFile';
|
||||
export const RecurringProcessingModelEnum = {
|
||||
CardOnFile: 'CardOnFile' as RecurringProcessingModelEnum,
|
||||
Subscription: 'Subscription' as RecurringProcessingModelEnum,
|
||||
UnscheduledCardOnFile: 'UnscheduledCardOnFile' as RecurringProcessingModelEnum
|
||||
};
|
||||
export type ShopperInteractionEnum = 'Ecommerce' | 'ContAuth' | 'Moto' | 'POS';
|
||||
export const ShopperInteractionEnum = {
|
||||
Ecommerce: 'Ecommerce' as ShopperInteractionEnum,
|
||||
ContAuth: 'ContAuth' as ShopperInteractionEnum,
|
||||
Moto: 'Moto' as ShopperInteractionEnum,
|
||||
POS: 'POS' as ShopperInteractionEnum
|
||||
};
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { FraudResult } from './fraudResult';
|
||||
import { InputDetail } from './inputDetail';
|
||||
import { Redirect } from './redirect';
|
||||
|
||||
|
||||
export interface PaymentResponse {
|
||||
/**
|
||||
* This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs**.
|
||||
*/
|
||||
additionalData?: any;
|
||||
/**
|
||||
* When non-empty, contains all the fields that you must submit to the `/payments/details` endpoint.
|
||||
*/
|
||||
details?: Array<InputDetail>;
|
||||
fraudResult?: FraudResult;
|
||||
/**
|
||||
* Contains the details that will be presented to the shopper.
|
||||
*/
|
||||
outputDetails?: any;
|
||||
/**
|
||||
* When non-empty, contains a value that you must submit to the `/payments/details` endpoint.
|
||||
*/
|
||||
paymentData?: string;
|
||||
/**
|
||||
* Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > `pspReference` is returned only for non-redirect payment methods.
|
||||
*/
|
||||
pspReference?: string;
|
||||
redirect?: Redirect;
|
||||
/**
|
||||
* If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values.
|
||||
*/
|
||||
refusalReason?: string;
|
||||
/**
|
||||
* Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).
|
||||
*/
|
||||
refusalReasonCode?: string;
|
||||
/**
|
||||
* The result of the payment. Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/development-resources/payments-with-pending-status). * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation.
|
||||
*/
|
||||
resultCode?: PaymentResponse.ResultCodeEnum;
|
||||
}
|
||||
export namespace PaymentResponse {
|
||||
export type ResultCodeEnum = 'AuthenticationFinished' | 'Authorised' | 'Cancelled' | 'ChallengeShopper' | 'Error' | 'IdentifyShopper' | 'Pending' | 'Received' | 'RedirectShopper' | 'Refused';
|
||||
export const ResultCodeEnum = {
|
||||
AuthenticationFinished: 'AuthenticationFinished' as ResultCodeEnum,
|
||||
Authorised: 'Authorised' as ResultCodeEnum,
|
||||
Cancelled: 'Cancelled' as ResultCodeEnum,
|
||||
ChallengeShopper: 'ChallengeShopper' as ResultCodeEnum,
|
||||
Error: 'Error' as ResultCodeEnum,
|
||||
IdentifyShopper: 'IdentifyShopper' as ResultCodeEnum,
|
||||
Pending: 'Pending' as ResultCodeEnum,
|
||||
Received: 'Received' as ResultCodeEnum,
|
||||
RedirectShopper: 'RedirectShopper' as ResultCodeEnum,
|
||||
Refused: 'Refused' as ResultCodeEnum
|
||||
};
|
||||
}
|
||||
@@ -1,193 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { Address } from './address';
|
||||
import { Amount } from './amount';
|
||||
import { Company } from './company';
|
||||
import { Configuration } from './configuration';
|
||||
import { ForexQuote } from './forexQuote';
|
||||
import { Installments } from './installments';
|
||||
import { LineItem } from './lineItem';
|
||||
import { Name } from './name';
|
||||
import { Split } from './split';
|
||||
|
||||
|
||||
export interface PaymentSetupRequest {
|
||||
/**
|
||||
* This field contains additional data, which may be required for a particular payment request. The `additionalData` object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to the [additionalData section](https://docs.adyen.com/api-reference/payments-api#paymentrequestadditionaldata).
|
||||
*/
|
||||
additionalData?: any;
|
||||
/**
|
||||
* List of payments methods to be presented to the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods/payment-methods-overview).
|
||||
*/
|
||||
allowedPaymentMethods?: Array<string>;
|
||||
amount: Amount;
|
||||
billingAddress?: Address;
|
||||
/**
|
||||
* List of payments methods to be hidden from the shopper. To refer to payment methods, use their `brandCode` from [Payment methods overview](https://docs.adyen.com/payment-methods/payment-methods-overview).
|
||||
*/
|
||||
blockedPaymentMethods?: Array<string>;
|
||||
/**
|
||||
* The delay between the authorisation and scheduled auto-capture, specified in hours.
|
||||
*/
|
||||
captureDelayHours?: number;
|
||||
/**
|
||||
* The platform where a payment transaction takes place. This field is optional for filtering out payment methods that are only available on specific platforms. If this value is not set, then we will try to infer it from the `sdkVersion` or `token`. Possible values: * iOS * Android * Web
|
||||
*/
|
||||
channel?: PaymentSetupRequest.ChannelEnum;
|
||||
company?: Company;
|
||||
configuration?: Configuration;
|
||||
/**
|
||||
* The shopper country. Format: [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) Example: NL or DE
|
||||
*/
|
||||
countryCode: string;
|
||||
/**
|
||||
* The shopper's date of birth. Format [ISO-8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DD
|
||||
*/
|
||||
dateOfBirth?: Date;
|
||||
dccQuote?: ForexQuote;
|
||||
deliveryAddress?: Address;
|
||||
/**
|
||||
* The date and time the purchased goods should be delivered. Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): YYYY-MM-DDThh:mm:ss.sssTZD Example: 2017-07-17T13:42:40.428+01:00
|
||||
*/
|
||||
deliveryDate?: Date;
|
||||
/**
|
||||
* When true and `shopperReference` is provided, the shopper will be asked if the payment details should be stored for future one-click payments.
|
||||
*/
|
||||
enableOneClick?: boolean;
|
||||
/**
|
||||
* When true and `shopperReference` is provided, the payment details will be tokenized for payouts.
|
||||
*/
|
||||
enablePayOut?: boolean;
|
||||
/**
|
||||
* When true and `shopperReference` is provided, the payment details will be tokenized for recurring payments.
|
||||
*/
|
||||
enableRecurring?: boolean;
|
||||
/**
|
||||
* The type of the entity the payment is processed for.
|
||||
*/
|
||||
entityType?: PaymentSetupRequest.EntityTypeEnum;
|
||||
/**
|
||||
* An integer value that is added to the normal fraud score. The value can be either positive or negative.
|
||||
*/
|
||||
fraudOffset?: number;
|
||||
installments?: Installments;
|
||||
/**
|
||||
* Line items regarding the payment.
|
||||
*/
|
||||
lineItems?: Array<LineItem>;
|
||||
/**
|
||||
* The [merchant category code](https://en.wikipedia.org/wiki/Merchant_category_code) (MCC) is a four-digit number, which relates to a particular market segment. This code reflects the predominant activity that is conducted by the merchant.
|
||||
*/
|
||||
mcc?: string;
|
||||
/**
|
||||
* The merchant account identifier, with which you want to process the transaction.
|
||||
*/
|
||||
merchantAccount: string;
|
||||
/**
|
||||
* This reference allows linking multiple transactions to each other for reporting purposes (i.e. order auth-rate). The reference should be unique per billing cycle. The same merchant order reference should never be reused after the first authorised attempt. If used, this field should be supplied for all incoming authorisations. > We strongly recommend you send the `merchantOrderReference` value to benefit from linking payment requests when authorisation retries take place. In addition, we recommend you provide `retry.orderAttemptNumber`, `retry.chainAttemptNumber`, and `retry.skipRetry` values in `PaymentRequest.additionalData`.
|
||||
*/
|
||||
merchantOrderReference?: string;
|
||||
/**
|
||||
* Metadata consists of entries, each of which includes a key and a value. Limitations: Error \"177\", \"Metadata size exceeds limit\"
|
||||
*/
|
||||
metadata?: any;
|
||||
/**
|
||||
* When you are doing multiple partial (gift card) payments, this is the `pspReference` of the first payment. We use this to link the multiple payments to each other. As your own reference for linking multiple payments, use the `merchantOrderReference`instead.
|
||||
*/
|
||||
orderReference?: string;
|
||||
/**
|
||||
* Required for the Web integration. Set this parameter to the origin URL of the page that you are loading the SDK from.
|
||||
*/
|
||||
origin?: string;
|
||||
/**
|
||||
* The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status. We recommend using a unique value per payment; however, it is not a requirement. If you need to provide multiple references for a transaction, separate them with hyphens (\"-\"). Maximum length: 80 characters.
|
||||
*/
|
||||
reference: string;
|
||||
/**
|
||||
* The URL to return to.
|
||||
*/
|
||||
returnUrl: string;
|
||||
/**
|
||||
* The version of the SDK you are using (for Web SDK integrations only).
|
||||
*/
|
||||
sdkVersion?: string;
|
||||
/**
|
||||
* The maximum validity of the session.
|
||||
*/
|
||||
sessionValidity?: string;
|
||||
/**
|
||||
* The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. > For 3D Secure 2 transactions, schemes require the `shopperEmail` for both `deviceChannel` **browser** and **app**.
|
||||
*/
|
||||
shopperEmail?: string;
|
||||
/**
|
||||
* The shopper's IP address. We recommend that you provide this data, as it is used in a number of risk checks (for instance, number of payment attempts or location-based checks). > This field is mandatory for some merchants depending on your business model. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new).
|
||||
*/
|
||||
shopperIP?: string;
|
||||
/**
|
||||
* Specifies the sales channel, through which the shopper gives their card details, and whether the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper interaction by default. This field has the following possible values: * `Ecommerce` - Online transactions where the cardholder is present (online). For better authorisation rates, we recommend sending the card security code (CSC) along with the request. * `ContAuth` - Card on file and/or subscription transactions, where the cardholder is known to the merchant (returning customer). If the shopper is present (online), you can supply also the CSC to improve authorisation (one-click payment). * `Moto` - Mail-order and telephone-order transactions where the shopper is in contact with the merchant via email or telephone. * `POS` - Point-of-sale transactions where the shopper is physically present to make a payment using a secure payment terminal.
|
||||
*/
|
||||
shopperInteraction?: PaymentSetupRequest.ShopperInteractionEnum;
|
||||
/**
|
||||
* The combination of a language code and a country code to specify the language to be used in the payment.
|
||||
*/
|
||||
shopperLocale?: string;
|
||||
shopperName?: Name;
|
||||
/**
|
||||
* The shopper's reference to uniquely identify this shopper (e.g. user ID or account ID). > This field is required for recurring payments.
|
||||
*/
|
||||
shopperReference?: string;
|
||||
/**
|
||||
* The text to appear on the shopper's bank statement.
|
||||
*/
|
||||
shopperStatement?: string;
|
||||
/**
|
||||
* The shopper's social security number.
|
||||
*/
|
||||
socialSecurityNumber?: string;
|
||||
/**
|
||||
* The details of how the payment should be split when distributing a payment to a MarketPay Marketplace and its Accounts.
|
||||
*/
|
||||
splits?: Array<Split>;
|
||||
/**
|
||||
* The shopper's telephone number.
|
||||
*/
|
||||
telephoneNumber?: string;
|
||||
/**
|
||||
* The token obtained when initializing the SDK. > This parameter is required for iOS and Android; not required for Web.
|
||||
*/
|
||||
token?: string;
|
||||
/**
|
||||
* Set to true if the payment should be routed to a trusted MID.
|
||||
*/
|
||||
trustedShopper?: boolean;
|
||||
}
|
||||
export namespace PaymentSetupRequest {
|
||||
export type ChannelEnum = 'iOS' | 'Android' | 'Web';
|
||||
export const ChannelEnum = {
|
||||
IOS: 'iOS' as ChannelEnum,
|
||||
Android: 'Android' as ChannelEnum,
|
||||
Web: 'Web' as ChannelEnum
|
||||
};
|
||||
export type EntityTypeEnum = 'NaturalPerson' | 'CompanyName';
|
||||
export const EntityTypeEnum = {
|
||||
NaturalPerson: 'NaturalPerson' as EntityTypeEnum,
|
||||
CompanyName: 'CompanyName' as EntityTypeEnum
|
||||
};
|
||||
export type ShopperInteractionEnum = 'Ecommerce' | 'ContAuth' | 'Moto' | 'POS';
|
||||
export const ShopperInteractionEnum = {
|
||||
Ecommerce: 'Ecommerce' as ShopperInteractionEnum,
|
||||
ContAuth: 'ContAuth' as ShopperInteractionEnum,
|
||||
Moto: 'Moto' as ShopperInteractionEnum,
|
||||
POS: 'POS' as ShopperInteractionEnum
|
||||
};
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface PaymentSetupResponse {
|
||||
/**
|
||||
* The encoded payment session that you need to pass to the SDK.
|
||||
*/
|
||||
paymentSession?: string;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface PaymentVerificationRequest {
|
||||
/**
|
||||
* Encrypted and signed payment result data. You should receive this value from the Checkout SDK after the shopper completes the payment.
|
||||
*/
|
||||
payload: string;
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { FraudResult } from './fraudResult';
|
||||
import { ServiceError } from './serviceError';
|
||||
|
||||
|
||||
export interface PaymentVerificationResponse {
|
||||
/**
|
||||
* This field contains additional data, which may be required to return in a particular payment response. To choose data fields to be returned, go to **Customer Area** > **Account** > **API URLs**.
|
||||
*/
|
||||
additionalData?: any;
|
||||
fraudResult?: FraudResult;
|
||||
/**
|
||||
* A unique value that you provided in the initial `/paymentSession` request as a `reference` field.
|
||||
*/
|
||||
merchantReference: string;
|
||||
/**
|
||||
* The payment method used in the transaction.
|
||||
*/
|
||||
paymentMethod: string;
|
||||
/**
|
||||
* Adyen's 16-character string reference associated with the transaction/request. This value is globally unique; quote it when communicating with us about this request. > `pspReference` is returned only for non-redirect payment methods.
|
||||
*/
|
||||
pspReference?: string;
|
||||
/**
|
||||
* If the payment's authorisation is refused or an error occurs during authorisation, this field holds Adyen's mapped reason for the refusal or a description of the error. When a transaction fails, the authorisation response includes `resultCode` and `refusalReason` values.
|
||||
*/
|
||||
refusalReason?: string;
|
||||
/**
|
||||
* Code that specifies the refusal reason. For more information, see [Authorisation refusal reasons](https://docs.adyen.com/development-resources/refusal-reasons).
|
||||
*/
|
||||
refusalReasonCode?: string;
|
||||
/**
|
||||
* The result of the payment. Possible values: * **AuthenticationFinished** – The payment has been successfully authenticated with 3D Secure 2. Returned for 3D Secure 2 authentication-only transactions. * **Authorised** – The payment was successfully authorised. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. This is a final state. * **ChallengeShopper** – The issuer requires further shopper interaction before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Error** – There was an error when the payment was being processed. The reason is given in the `refusalReason` field. This is a final state. * **IdentifyShopper** – The issuer requires the shopper's device fingerprint before the payment can be authenticated. Returned for 3D Secure 2 transactions. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **Pending** – Indicates that it is not possible to obtain the final status of the payment. This can happen if the systems providing final status information for the payment are unavailable, or if the shopper needs to take further action to complete the payment. For more information on handling a pending payment, refer to [Payments with pending status](https://docs.adyen.com/development-resources/payments-with-pending-status). * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation.
|
||||
*/
|
||||
resultCode?: PaymentVerificationResponse.ResultCodeEnum;
|
||||
serviceError?: ServiceError;
|
||||
/**
|
||||
* The shopperLocale value provided in the payment request.
|
||||
*/
|
||||
shopperLocale: string;
|
||||
}
|
||||
export namespace PaymentVerificationResponse {
|
||||
export type ResultCodeEnum = 'AuthenticationFinished' | 'Authorised' | 'Cancelled' | 'ChallengeShopper' | 'Error' | 'IdentifyShopper' | 'Pending' | 'Received' | 'RedirectShopper' | 'Refused';
|
||||
export const ResultCodeEnum = {
|
||||
AuthenticationFinished: 'AuthenticationFinished' as ResultCodeEnum,
|
||||
Authorised: 'Authorised' as ResultCodeEnum,
|
||||
Cancelled: 'Cancelled' as ResultCodeEnum,
|
||||
ChallengeShopper: 'ChallengeShopper' as ResultCodeEnum,
|
||||
Error: 'Error' as ResultCodeEnum,
|
||||
IdentifyShopper: 'IdentifyShopper' as ResultCodeEnum,
|
||||
Pending: 'Pending' as ResultCodeEnum,
|
||||
Received: 'Received' as ResultCodeEnum,
|
||||
RedirectShopper: 'RedirectShopper' as ResultCodeEnum,
|
||||
Refused: 'Refused' as ResultCodeEnum
|
||||
};
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface Recurring {
|
||||
/**
|
||||
* The type of recurring contract to be used. Possible values: * `ONECLICK` – Payment details can be used to initiate a one-click payment, where the shopper enters the [card security code (CVC/CVV)](https://docs.adyen.com/payments-essentials/payment-glossary#card_security_code_cvc_cvv_cid_). * `RECURRING` – Payment details can be used without the card security code to initiate [card-not-present transactions](https://docs.adyen.com/payment-glossary#cardnotpresentcnp). * `ONECLICK,RECURRING` – Payment details can be used regardless of whether the shopper is on your site or not. * `PAYOUT` – Payment details can be used to [make a payout](https://docs.adyen.com/features/third-party-payouts).
|
||||
*/
|
||||
contract?: Recurring.ContractEnum;
|
||||
/**
|
||||
* A descriptive name for this detail.
|
||||
*/
|
||||
recurringDetailName?: string;
|
||||
/**
|
||||
* Date after which no further authorisations shall be performed. Only for 3D Secure 2.
|
||||
*/
|
||||
recurringExpiry?: Date;
|
||||
/**
|
||||
* Minimum number of days between authorisations. Only for 3D Secure 2.
|
||||
*/
|
||||
recurringFrequency?: string;
|
||||
/**
|
||||
* The name of the token service.
|
||||
*/
|
||||
tokenService?: Recurring.TokenServiceEnum;
|
||||
}
|
||||
export namespace Recurring {
|
||||
export type ContractEnum = 'ONECLICK' | 'RECURRING' | 'PAYOUT';
|
||||
export const ContractEnum = {
|
||||
ONECLICK: 'ONECLICK' as ContractEnum,
|
||||
RECURRING: 'RECURRING' as ContractEnum,
|
||||
PAYOUT: 'PAYOUT' as ContractEnum
|
||||
};
|
||||
export type TokenServiceEnum = 'VISATOKENSERVICE' | 'MCTOKENSERVICE';
|
||||
export const TokenServiceEnum = {
|
||||
VISATOKENSERVICE: 'VISATOKENSERVICE' as TokenServiceEnum,
|
||||
MCTOKENSERVICE: 'MCTOKENSERVICE' as TokenServiceEnum
|
||||
};
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/import { InputDetail } from './inputDetail';
|
||||
import { PaymentMethodGroup } from './paymentMethodGroup';
|
||||
import { StoredDetails } from './storedDetails';
|
||||
|
||||
|
||||
export interface RecurringDetail {
|
||||
/**
|
||||
* The configuration of the payment method.
|
||||
*/
|
||||
configuration?: any;
|
||||
/**
|
||||
* All input details to be provided to complete the payment with this payment method.
|
||||
*/
|
||||
details?: Array<InputDetail>;
|
||||
group?: PaymentMethodGroup;
|
||||
/**
|
||||
* The displayable name of this payment method.
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Echo data required to send in next calls.
|
||||
*/
|
||||
paymentMethodData?: string;
|
||||
/**
|
||||
* The reference that uniquely identifies the recurring detail.
|
||||
*/
|
||||
recurringDetailReference?: string;
|
||||
storedDetails?: StoredDetails;
|
||||
/**
|
||||
* Indicates whether this payment method supports tokenization or not.
|
||||
*/
|
||||
supportsRecurring?: boolean;
|
||||
/**
|
||||
* The unique payment method code.
|
||||
*/
|
||||
type?: string;
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface Redirect {
|
||||
/**
|
||||
* When the redirect URL must be accessed via POST, use this data to post to the redirect URL.
|
||||
*/
|
||||
data?: any;
|
||||
/**
|
||||
* The web method that you must use to access the redirect URL. Possible values: GET, POST.
|
||||
*/
|
||||
method?: Redirect.MethodEnum;
|
||||
/**
|
||||
* The URL, to which you must redirect a shopper to complete a payment.
|
||||
*/
|
||||
url?: string;
|
||||
}
|
||||
export namespace Redirect {
|
||||
export type MethodEnum = 'GET' | 'POST';
|
||||
export const MethodEnum = {
|
||||
GET: 'GET' as MethodEnum,
|
||||
POST: 'POST' as MethodEnum
|
||||
};
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface SDKEphemPubKey {
|
||||
/**
|
||||
* The `crv` value as received from the 3D Secure 2 SDK.
|
||||
*/
|
||||
crv?: string;
|
||||
/**
|
||||
* The `kty` value as received from the 3D Secure 2 SDK.
|
||||
*/
|
||||
kty?: string;
|
||||
/**
|
||||
* The `x` value as received from the 3D Secure 2 SDK.
|
||||
*/
|
||||
x?: string;
|
||||
/**
|
||||
* The `y` value as received from the 3D Secure 2 SDK.
|
||||
*/
|
||||
y?: string;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface ServiceError {
|
||||
errorCode?: string;
|
||||
errorType?: string;
|
||||
message?: string;
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
|
||||
|
||||
/**
|
||||
* 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 ```
|
||||
*
|
||||
* OpenAPI spec version: 46
|
||||
* Contact: support@adyen.com
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface ShopperInput {
|
||||
/**
|
||||
* Specifies visibility of billing address fields. Permitted values: * editable * hidden * readOnly
|
||||
*/
|
||||
billingAddress?: ShopperInput.BillingAddressEnum;
|
||||
/**
|
||||
* Specifies visibility of delivery address fields. Permitted values: * editable * hidden * readOnly
|
||||
*/
|
||||
deliveryAddress?: ShopperInput.DeliveryAddressEnum;
|
||||
/**
|
||||
* Specifies visibility of personal details. Permitted values: * editable * hidden * readOnly
|
||||
*/
|
||||
personalDetails?: ShopperInput.PersonalDetailsEnum;
|
||||
}
|
||||
export namespace ShopperInput {
|
||||
export type BillingAddressEnum = 'editable' | 'hidden' | 'readOnly';
|
||||
export const BillingAddressEnum = {
|
||||
Editable: 'editable' as BillingAddressEnum,
|
||||
Hidden: 'hidden' as BillingAddressEnum,
|
||||
ReadOnly: 'readOnly' as BillingAddressEnum
|
||||
};
|
||||
export type DeliveryAddressEnum = 'editable' | 'hidden' | 'readOnly';
|
||||
export const DeliveryAddressEnum = {
|
||||
Editable: 'editable' as DeliveryAddressEnum,
|
||||
Hidden: 'hidden' as DeliveryAddressEnum,
|
||||
ReadOnly: 'readOnly' as DeliveryAddressEnum
|
||||
};
|
||||
export type PersonalDetailsEnum = 'editable' | 'hidden' | 'readOnly';
|
||||
export const PersonalDetailsEnum = {
|
||||
Editable: 'editable' as PersonalDetailsEnum,
|
||||
Hidden: 'hidden' as PersonalDetailsEnum,
|
||||
ReadOnly: 'readOnly' as PersonalDetailsEnum
|
||||
};
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user