commit d1d331d90d3cd06b49c7d3e63b74434857053cb3 Author: Rik ter Beek Date: Thu Jul 4 14:24:23 2019 +0200 Initial commit diff --git a/.babelrc b/.babelrc new file mode 100755 index 0000000..845c7e1 --- /dev/null +++ b/.babelrc @@ -0,0 +1,22 @@ +{ + "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"] + } + } +} \ No newline at end of file diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..311d35e --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +/src/typings/**/*.ts +/examples \ No newline at end of file diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..fb438bf --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,29 @@ +{ + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint"], + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + "ecmaFeatures": { + "modules": true + }, + "project": "./tsconfig.json" + }, + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + "quotes": ["error", "double"], + "semi": ["error", "always"] + }, + "overrides": [ + { + "files": ["*.ts"], + "rules": { + "no-dupe-class-members": "off" + } + } + ] +} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..873d5ce --- /dev/null +++ b/.gitignore @@ -0,0 +1,17 @@ +.src/main/test +.vagrant +Vagrantfile +build +node_modules +.idea +dist +.DS_Store +.bash_history +.config/ +.docker/ +.npm/ +.ssh/ +.viminfo +local/ +coverage/ +package-lock.json \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..f038eb0 --- /dev/null +++ b/.npmignore @@ -0,0 +1,10 @@ +src/ +.babelrc +.eslintignore +.eslintrc.json +.gitignore +.travis.yml +tsconfig.json +jest.config.js +tslint.json +webpack.config.js \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..ec0a19e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - stable +before_install: + - rm -rf package-lock.json node_modules +cache: + directories: + - "node_modules" +script: + - npm run lint:fix + - npm run lint + - npm run test \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6601273 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Adyen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2c2a2d7 --- /dev/null +++ b/README.md @@ -0,0 +1,94 @@ +# Adyen Node.js API Library +[![Build Status](https://travis-ci.com/Adyen/adyen-node-api-library.svg?token=DH2YULmDqk5ustZBswwf&branch=develop)](https://travis-ci.com/Adyen/adyen-node-api-library) + +The Adyen API Library for NodeJS enables you to work with Adyen APIs and Hosted Payment Pages. + +## Integration +The Library supports all APIs under the following services: + +* [x] checkout +* [x] checkout utility +* [x] payments +* [x] modifications +* [x] payouts +* [x] recurring +* [x] notifications +* [x] BIN lookup + +## Requirements + +* Node 8.1.1 or higher + +## Installation + +You can use NPM to add our library to your project + +### NPM + +```bash +npm install --save adyen-node-api-library +``` + +## Documentation +* https://docs.adyen.com/developers/development-resources/libraries +* https://docs.adyen.com/developers/checkout/api-integration + +## HTTP Client Configuration + +By default, NodeJS [https](https://nodejs.org/api/https.html) will be used to submit requests to the API. But you can change that by injecting your own HttpClient on your client instance. In the example below, we use `axios`: + +```javascript +const {Client, Config} = require('adyen-node-api-library'); +const axios = require("axios"); +... +const config = new Config(); +const client = new Client({ + config, + httpClient: { + async request(endpoint, json, config, isApiKeyRequired, requestOptions) { + const response = await axios({ + method: 'POST', + url: endpoint, + data: JSON.parse(json), + headers: { + "X-API-Key": config.apiKey, + "Content-type": "application/json" + }, + }); + + return response.data; + } + } +}); +... +``` + +## Proxy configuration + +You can configure a proxy connection by injecting your own HttpURLConnectionClient on your client instance and changing the `proxy` setter value. + +Example: +```javascript +const {HttpURLConnectionClient, Client, Config} = require('adyen-node-api-library'); +... +const config = new Config(); +const client = new Client({ config }); +const httpClient = new HttpURLConnectionClient(); +httpClient.proxy = { host: "http://google.com", port: 8888, }; + +client.setEnvironment('TEST'); +client.httpClient = httpClient; +... +``` + +## Support + +If you have any problems, questions or suggestions, create an issue here or send your inquiry to support@adyen.com. + +## Licence + +MIT license. For more information, see the LICENSE file. + +## Other + +You can find examples inside the `examples` folder in this repo. diff --git a/examples/payments/async.js b/examples/payments/async.js new file mode 100644 index 0000000..886b9b3 --- /dev/null +++ b/examples/payments/async.js @@ -0,0 +1,24 @@ +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); +} + diff --git a/examples/payments/local.js b/examples/payments/local.js new file mode 100644 index 0000000..71d6ced --- /dev/null +++ b/examples/payments/local.js @@ -0,0 +1,12 @@ +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 + ); +}; + diff --git a/examples/payments/sync.js b/examples/payments/sync.js new file mode 100644 index 0000000..97ace52 --- /dev/null +++ b/examples/payments/sync.js @@ -0,0 +1,13 @@ +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 + ); +}; + diff --git a/examples/payments/terminalApi.js b/examples/payments/terminalApi.js new file mode 100644 index 0000000..89a8c54 --- /dev/null +++ b/examples/payments/terminalApi.js @@ -0,0 +1,135 @@ +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; diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..8890d71 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,36 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * Adyen Node 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. + */ + +module.exports = { + moduleFileExtensions: [ + "ts", + "js" + ], + coveragePathIgnorePatterns: [ + "/src/typings" + ], + unmockedModulePathPatterns: [ + "/dist" + ], + testMatch: [ + "**/__tests__/*.ts" + ] +}; diff --git a/package.json b/package.json new file mode 100644 index 0000000..27008fe --- /dev/null +++ b/package.json @@ -0,0 +1,53 @@ +{ + "name": "adyen-node-api-library", + "version": "1.0.0", + "description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs and Hosted Payment Pages.", + "main": "dist/lib/index.js", + "types": "dist/lib/index.d.ts", + "module": "dist/lib-esm/index.js", + "engines": { + "node": ">=8.1.1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/Adyen/adyen-node-api-library.git" + }, + "keywords": [ + "adyen", + "api", + "nodejs" + ], + "bugs": { + "url": "https://github.com/Adyen/adyen-node-api-library/issues" + }, + "homepage": "https://github.com/Adyen/adyen-node-api-library#readme", + "scripts": { + "clean": "rm -rf ./dist", + "build": "npm run clean && tsc && tsc -m es6 --outDir dist/lib-esm && webpack", + "lint": "eslint 'src/**/*.ts'", + "lint:fix": "eslint --fix 'src/**/*.ts'", + "test": "jest" + }, + "author": "Ricardo Ambrogi", + "license": "MIT", + "devDependencies": { + "@babel/core": "^7.1.6", + "@babel/plugin-proposal-class-properties": "^7.3.4", + "@babel/plugin-proposal-object-rest-spread": "^7.3.2", + "@babel/plugin-transform-runtime": "^7.3.4", + "@babel/preset-env": "^7.1.6", + "@babel/preset-typescript": "^7.1.0", + "@babel/runtime": "^7.3.4", + "@types/jest": "^23.3.5", + "@types/node": "^11.13.7", + "@typescript-eslint/eslint-plugin": "^1.9.0", + "@typescript-eslint/parser": "^1.9.0", + "babel-loader": "^8.0.4", + "eslint": "^5.12.1", + "jest": "^24.0.0", + "ts-loader": "^5.4.5", + "typescript": "^3.4.5", + "webpack": "^4.28.4", + "webpack-cli": "^3.2.3" + } +} diff --git a/src/__mocks__/base.ts b/src/__mocks__/base.ts new file mode 100644 index 0000000..0d3fefa --- /dev/null +++ b/src/__mocks__/base.ts @@ -0,0 +1,120 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Config from "../config"; +import HttpURLConnectionClient from "../httpClient/httpURLConnectionClient"; +import { + AmountsReq, + MessageCategoryType, + MessageClassType, + MessageHeader, + MessageType, + PaymentRequest, + PaymentTransaction, + SaleData, + SaleToPoiRequest, + TerminalApiRequest, + TransactionIdentification, +} from "../typings/terminal"; +import HttpClientException from "../httpClient/httpClientException"; + +jest.mock("../httpClient/httpURLConnectionClient"); + +interface Options { code: number } +export const createMockClientFromResponse = (response: string, { code }: Options = {code: 200}): Client => { + const httpURLConnectionClient: HttpURLConnectionClient = new HttpURLConnectionClient(); + // @ts-ignore + httpURLConnectionClient.request.mockImplementation( + (endpoint: string, json: string, config: Config, isApiRequired: boolean): Promise => { + if ( + typeof endpoint === "string" && + typeof json === "string" && + config instanceof Config && + (isApiRequired ? typeof isApiRequired === "boolean" : true) && + code >= 200 && code < 300 + ) { + return Promise.resolve(response); + } else { + return Promise.reject(new HttpClientException(response, code)); + } + } + ); + + const config: Config = new Config(); + config.terminalApiCloudEndpoint = Client.TERMINAL_API_ENDPOINT_TEST; + config.hmacKey = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00"; + config.endpoint = Client.ENDPOINT_TEST; + config.checkoutEndpoint = Client.CHECKOUT_ENDPOINT_TEST; + + const client: Client = new Client({ config }); + client.httpClient = httpURLConnectionClient; + + return client; +}; + +export const createTerminalAPIPaymentRequest = (): TerminalApiRequest => { + + const messageHeader: MessageHeader = { + messageCategory: MessageCategoryType.Payment, + messageClass: MessageClassType.Service, + messageType: MessageType.Request, + poiid: "P400Plus-123456789", + protocolVersion: "3.0", + saleId: "001", + serviceId: "001", + }; + + const timestamp = new Date().toISOString(); + const transactionIdentification: TransactionIdentification = { + timeStamp: timestamp, + transactionId: "001", + }; + + const saleData: SaleData = { + saleTransactionId: transactionIdentification, + }; + + const amountsReq: AmountsReq = { + currency: "EUR", + requestedAmount: 1, + }; + + const paymentTransaction: PaymentTransaction = { + amountsReq: amountsReq, + }; + + const paymentRequest: PaymentRequest = { + paymentTransaction: paymentTransaction, + saleData: saleData, + }; + + const saleToPOIRequest: SaleToPoiRequest = { + messageHeader: messageHeader, + paymentRequest: paymentRequest, + }; + + const terminalApiRequest: TerminalApiRequest = { + saleToPoiRequest: saleToPOIRequest, + }; + + return terminalApiRequest; +}; diff --git a/src/__mocks__/checkout/paymentMethodsSuccess.ts b/src/__mocks__/checkout/paymentMethodsSuccess.ts new file mode 100644 index 0000000..4b5be63 --- /dev/null +++ b/src/__mocks__/checkout/paymentMethodsSuccess.ts @@ -0,0 +1,986 @@ +/* tslint:disable */ +export const paymentMethodsSuccess = JSON.stringify({ + paymentMethods: [ + { + name: "AliPay", + type: "alipay", + }, + { + name: "AliPay", + type: "alipay_wap", + }, + { + details: [ + { + key: "additionalData.card.encrypted.json", + type: "cardToken", + }, + ], + name: "Credit Card", + type: "scheme", + }, + { + name: "Credit Card via AsiaPay", + type: "asiapay", + }, + { + name: "BancNet", + type: "bancnet", + }, + { + name: "Bank Transfer (BE)", + type: "bankTransfer_BE", + }, + { + name: "Bank Transfer (DE)", + type: "bankTransfer_DE", + }, + { + name: "Bank Transfer (DK)", + type: "bankTransfer_DK", + }, + { + name: "Bank Transfer (GB)", + type: "bankTransfer_GB", + }, + { + name: "SEPA Bank Transfer", + type: "bankTransfer_IBAN", + }, + { + name: "Bank Transfer (NL)", + type: "bankTransfer_NL", + }, + { + name: "Bank Transfer (NO)", + type: "bankTransfer_NO", + }, + { + name: "Bank Transfer (PL)", + type: "bankTransfer_PL", + }, + { + name: "Bank Transfer (SE)", + type: "bankTransfer_SE", + }, + { + name: "Russian Bank Transfer", + type: "bank_ru", + }, + { + details: [ + { + key: "additionalData.card.encrypted.json", + type: "cardToken", + }, + ], + name: "Bancontact card", + type: "bcmc", + }, + { + name: "Boleto Bancario via HSBC", + type: "boletobancario_hsbc", + }, + { + name: "Boleto Bancario via Itau", + type: "boletobancario_itau", + }, + { + name: "Boleto Bancario via Santander", + type: "boletobancario_santander", + }, + { + name: "c_cash", + type: "c_cash", + }, + { + name: "CashU", + type: "cashu", + }, + { + name: "Paiement en 3 fois par Cartes Bancaires", + type: "cofinoga_3xcb", + }, + { + name: "DineroMail", + type: "dineromail", + }, + { + name: "Online bank transfer.", + type: "directEbanking", + }, + { + name: "Direct Debit Brazil - Banco do Brazil", + type: "directdebit_BR_bancodobrasil", + }, + { + name: "Direct Debit Brazil - Bradesco", + type: "directdebit_BR_bradesco", + }, + { + name: "Direct Debit Brazil - Caixa Economica Federal", + type: "directdebit_BR_caixa", + }, + { + name: "Direct Debit Brazil - HSBC", + type: "directdebit_BR_hsbc", + }, + { + name: "Direct Debit Brazil - Itau", + type: "directdebit_BR_itau", + }, + { + name: "Direct Debit Brazil - Santander", + type: "directdebit_BR_santander", + }, + { + name: "Eenmalige machtiging", + type: "directdebit_NL", + }, + { + details: [ + { + items: [ + { + id: "11", + name: "Bank transfer / postal", + }, + { + id: "74", + name: "Banki Spółdzielcze", + }, + { + id: "73", + name: "BLIK", + }, + { + id: "32", + name: "BNP Paribas", + }, + { + id: "16", + name: "Credit Agricole", + }, + { + id: "83", + name: "EnveloBank", + }, + { + id: "55", + name: "erata - dotpay installment", + }, + { + id: "93", + name: "eSKOK", + }, + { + id: "56", + name: "eurobank płatności online", + }, + { + id: "76", + name: "Getin Bank PBL", + }, + { + id: "81", + name: "Idea Cloud", + }, + { + id: "7", + name: "ING Corporate customers", + }, + { + id: "35", + name: "Kantor Polski", + }, + { + id: "44", + name: "Millennium - Płatności Internetowe", + }, + { + id: "10", + name: "Millennium Corporate customers", + }, + { + id: "68", + name: "mRaty", + }, + { + id: "1", + name: "mTransfer", + }, + { + id: "80", + name: "Noble Pay", + }, + { + id: "50", + name: "Pay Way Toyota Bank", + }, + { + id: "45", + name: "Pay with Alior Bank", + }, + { + id: "65", + name: "Paylink Idea Bank", + }, + { + id: "36", + name: "Pekao24Przelew", + }, + { + id: "70", + name: "Pocztowy24", + }, + { + id: "6", + name: "Przelew24", + }, + { + id: "46", + name: "Płacę z Citi Handlowy", + }, + { + id: "38", + name: "Płacę z ING", + }, + { + id: "2", + name: "Płacę z Inteligo", + }, + { + id: "4", + name: "Płacę z iPKO", + }, + { + id: "72", + name: "Płacę z Orange", + }, + { + id: "66", + name: "Płacę z PBS", + }, + { + id: "75", + name: "Płacę z Plus Bank", + }, + { + id: "51", + name: "Płać z BOŚ", + }, + { + id: "48", + name: "R-Przelew", + }, + { + id: "88", + name: "Raiffeisen", + }, + { + id: "52", + name: "SkyCash", + }, + { + id: "58", + name: "Szybkie Platnosci Internetowe z Deutsche Bank PBC", + }, + { + id: "60", + name: "T-Mobile usługi bankowe", + }, + { + id: "21", + name: "VIA - Moje Rachunki", + }, + { + id: "84", + name: "Volkswagen Bank direct", + }, + { + id: "31", + name: "Zaplac w Zabce i we Freshmarket", + }, + { + id: "24", + name: "mPay", + }, + ], + key: "issuer", + type: "select", + }, + ], + name: "Local Polish Payment Methods", + type: "dotpay", + }, + { + name: "Finnish E-Banking", + type: "ebanking_FI", + }, + { + name: "Lastschrift (ELV)", + type: "elv", + }, + { + details: [ + { + items: [ + { + id: "550", + name: "?eská spo?itelna", + }, + { + id: "231", + name: "POP Pankki", + }, + { + id: "551", + name: "Kb", + }, + { + id: "232", + name: "Aktia", + }, + { + id: "552", + name: "Raiffeisen", + }, + { + id: "750", + name: "Swedbank", + }, + { + id: "211", + name: "Nordea", + }, + { + id: "233", + name: "Säästöpankki", + }, + { + id: "553", + name: "Csob", + }, + { + id: "751", + name: "SEB", + }, + { + id: "234", + name: "S-Pankki", + }, + { + id: "554", + name: "Moneta", + }, + { + id: "752", + name: "Nordea", + }, + { + id: "235", + name: "OmaSP", + }, + { + id: "213", + name: "Op-Pohjola", + }, + { + id: "555", + name: "UniCredit", + }, + { + id: "753", + name: "LHV", + }, + { + id: "556", + name: "Fio", + }, + { + id: "557", + name: "mBank", + }, + { + id: "216", + name: "Handelsbanken", + }, + { + id: "260", + name: "Länsförsäkringar", + }, + { + id: "240", + name: "BankDeposit", + }, + { + id: "265", + name: "Sparbanken", + }, + { + id: "640", + name: "BankDeposit", + }, + { + id: "200", + name: "Ålandsbanken", + }, + { + id: "720", + name: "Swedbank", + }, + { + id: "940", + name: "Swedbank", + }, + { + id: "204", + name: "Danske Bank", + }, + { + id: "721", + name: "SEB", + }, + { + id: "941", + name: "SEB", + }, + { + id: "722", + name: "DNB", + }, + { + id: "942", + name: "Citadele", + }, + { + id: "205", + name: "Handelsbanken", + }, + { + id: "723", + name: "Šiaulių Bankas", + }, + { + id: "943", + name: "DNB", + }, + { + id: "206", + name: "Nordea", + }, + { + id: "724", + name: "Nordea", + }, + { + id: "207", + name: "SEB", + }, + { + id: "208", + name: "Skandiabanken", + }, + { + id: "209", + name: "Swedbank", + }, + ], + key: "issuer", + type: "select", + }, + ], + name: "Bank Payment", + type: "entercash", + }, + { + name: "Nationale Entertainment Card", + type: "entertainmentcard", + }, + { + name: "Gall & Gall", + type: "gallgall", + }, + { + name: "Generic GiftCard", + type: "genericgiftcard", + }, + { + details: [ + { + key: "bic", + type: "text", + }, + ], + name: "GiroPay", + type: "giropay", + }, + { + name: "Globe GCash", + type: "globegcash", + }, + { + name: "Hunkemoller Lingerie Card", + type: "hmlingerie", + }, + { + details: [ + { + items: [ + { + id: "1121", + name: "Test Issuer", + }, + { + id: "1154", + name: "Test Issuer 5", + }, + { + id: "1153", + name: "Test Issuer 4", + }, + { + id: "1152", + name: "Test Issuer 3", + }, + { + id: "1151", + name: "Test Issuer 2", + }, + { + id: "1162", + name: "Test Issuer Cancelled", + }, + { + id: "1161", + name: "Test Issuer Pending", + }, + { + id: "1160", + name: "Test Issuer Refused", + }, + { + id: "1159", + name: "Test Issuer 10", + }, + { + id: "1158", + name: "Test Issuer 9", + }, + { + id: "1157", + name: "Test Issuer 8", + }, + { + id: "1156", + name: "Test Issuer 7", + }, + { + id: "1155", + name: "Test Issuer 6", + }, + ], + key: "idealIssuer", + type: "select", + }, + ], + name: "iDEAL", + type: "ideal", + }, + { + name: "Phone Payment", + type: "ivr", + }, + { + name: "Landline phone", + type: "ivrLandline", + }, + { + name: "Mobile phone", + type: "ivrMobile", + }, + { + details: [ + { + details: [ + { + key: "firstName", + type: "text", + }, + { + key: "infix", + optional: "true", + type: "text", + }, + { + key: "lastName", + type: "text", + }, + { + items: [ + { + id: "M", + name: "MALE", + }, + { + id: "F", + name: "FEMALE", + }, + ], + key: "gender", + type: "radio", + }, + { + key: "dateOfBirth", + type: "date", + }, + { + key: "telephoneNumber", + type: "tel", + }, + { + key: "socialSecurityNumber", + optional: "true", + type: "text", + }, + { + key: "shopperEmail", + type: "emailAddress", + }, + ], + key: "personalDetails", + type: "fieldSet", + }, + { + details: [ + { + key: "street", + type: "text", + }, + { + key: "houseNumberOrName", + type: "text", + }, + { + key: "city", + type: "text", + }, + { + key: "postalCode", + type: "text", + }, + { + key: "stateOrProvince", + optional: "true", + type: "text", + }, + { + items: [ + { + id: "SE", + name: "SWEDEN", + }, + { + id: "NO", + name: "NORWAY", + }, + { + id: "FI", + name: "FINLAND", + }, + { + id: "DK", + name: "DENMARK", + }, + { + id: "AT", + name: "AUSTRIA", + }, + { + id: "DE", + name: "GERMANY", + }, + { + id: "NL", + name: "NETHERLANDS", + }, + ], + key: "country", + type: "select", + }, + ], + key: "billingAddress", + type: "address", + }, + { + key: "separateDeliveryAddress", + optional: "true", + type: "boolean", + value: "false", + }, + { + details: [ + { + key: "street", + type: "text", + }, + { + key: "houseNumberOrName", + type: "text", + }, + { + key: "city", + type: "text", + }, + { + key: "postalCode", + type: "text", + }, + { + key: "stateOrProvince", + optional: "true", + type: "text", + }, + { + items: [ + { + id: "SE", + name: "SWEDEN", + }, + { + id: "NO", + name: "NORWAY", + }, + { + id: "FI", + name: "FINLAND", + }, + { + id: "DK", + name: "DENMARK", + }, + { + id: "AT", + name: "AUSTRIA", + }, + { + id: "DE", + name: "GERMANY", + }, + { + id: "NL", + name: "NETHERLANDS", + }, + ], + key: "country", + type: "select", + }, + ], + key: "deliveryAddress", + optional: "true", + type: "address", + }, + ], + name: "Pay later with Klarna.", + type: "klarna", + }, + { + name: "Multibanco", + type: "multibanco", + }, + { + name: "Russian Online Payments", + type: "online_RU", + }, + { + name: "Invoice", + type: "openinvoice", + }, + { + name: "PayPal", + type: "paypal", + }, + { + name: "Paysafecard", + type: "paysafecard", + }, + { + name: "POLi", + type: "poli", + }, + { + details: [ + { + items: [ + { + id: "+7", + name: "RU", + }, + { + id: "+9955", + name: "GE", + }, + { + id: "+507", + name: "PA", + }, + { + id: "+44", + name: "GB", + }, + { + id: "+992", + name: "TJ", + }, + { + id: "+370", + name: "LT", + }, + { + id: "+972", + name: "IL", + }, + { + id: "+996", + name: "KG", + }, + { + id: "+380", + name: "UA", + }, + { + id: "+84", + name: "VN", + }, + { + id: "+90", + name: "TR", + }, + { + id: "+994", + name: "AZ", + }, + { + id: "+374", + name: "AM", + }, + { + id: "+371", + name: "LV", + }, + { + id: "+91", + name: "IN", + }, + { + id: "+66", + name: "TH", + }, + { + id: "+373", + name: "MD", + }, + { + id: "+1", + name: "US", + }, + { + id: "+81", + name: "JP", + }, + { + id: "+998", + name: "UZ", + }, + { + id: "+77", + name: "KZ", + }, + { + id: "+375", + name: "BY", + }, + { + id: "+372", + name: "EE", + }, + { + id: "+40", + name: "RO", + }, + { + id: "+82", + name: "KR", + }, + ], + key: "qiwiwallet.telephoneNumberPrefix", + type: "select", + }, + { + key: "qiwiwallet.telephoneNumber", + type: "text", + }, + ], + name: "Qiwi Wallet", + type: "qiwiwallet", + }, + { + name: "RatePay Invoice", + type: "ratepay", + }, + { + name: "SafetyPay", + type: "safetypay", + }, + { + details: [ + { + key: "sepa.ownerName", + type: "text", + }, + { + key: "sepa.ibanNumber", + type: "text", + }, + ], + name: "SEPA Direct Debit", + type: "sepadirectdebit", + }, + { + name: "Premium SMS", + type: "sms", + }, + { + name: "TenPay", + type: "tenpay", + }, + { + name: "Russian Cash Terminal Payments", + type: "terminal_RU", + }, + { + name: "Trustly Direct bank e-Payments", + type: "trustly", + }, + { + name: "Online Banking by Trustpay", + type: "trustpay", + }, + { + name: "UnionPay", + type: "unionpay", + }, + { + name: "Russian Wallet Payments", + type: "wallet_RU", + }, + { + name: "Webshop Giftcard", + type: "webshopgiftcard", + }, + { + name: "Your Gift", + type: "yourgift", + }, + ], +}); \ No newline at end of file diff --git a/src/__mocks__/checkout/paymentSessionErrorInvalidData422.ts b/src/__mocks__/checkout/paymentSessionErrorInvalidData422.ts new file mode 100644 index 0000000..a698a17 --- /dev/null +++ b/src/__mocks__/checkout/paymentSessionErrorInvalidData422.ts @@ -0,0 +1,7 @@ +/* tslint:disable */ +export const paymentSessionError = JSON.stringify({ + status: 422, + errorCode: "14_012", + message: "The provided SDK token could not be parsed.", + errorType: "validation", +}); \ No newline at end of file diff --git a/src/__mocks__/checkout/paymentSessionSucess.ts b/src/__mocks__/checkout/paymentSessionSucess.ts new file mode 100644 index 0000000..6546006 --- /dev/null +++ b/src/__mocks__/checkout/paymentSessionSucess.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +export const paymentSessionSuccess = JSON.stringify({ + paymentSession: "eyJjaGVja291dHNob3BwZXJCYXNlVXJsIjoiaHR0cHM6XC9cL2NoZWNrb3V0c2asdHBlci10ZXN0LmFkeWVuLmNvbVwvY2hlY2tvdXRzaG9wcGVyXC8iLCJkaXNhYmxlUmVjdXJyaW5nRGV0YWlsVXJsIjoiaHR0cHM6XC9cL2NoZWNrb3V0c2hvcHBlci10ZXN0LmFkeWVuLmNvbVwvY2hlY2tvdXRzaG9wcGVyXC9zZXJ2aWNlc1wvUGF5bWVudEluaXRpYXRpb25cL3YxXC9kaXNhYmxlUmVjdXJyaW5nRGV0YWlsIiwiZ2VuZXJhdGlvbnRpbWUiOiIyMDE4LTA2LTIyVDE0OjMxOjI1WiIsImluaXRpYXRpb25VcmwiOiJodHRwczpcL1wvY2hlY2tvdXRzaG9wcGVyLXRlc3QuYWR5ZW4uY29tXC9jaGVja291dHNob3BwZXJcL3NlcnZpY2VzXC9QYXltZW50SW5pdGlhdGlvblwvdjFcL2luaXRpYXRlIiwib3JpZ2luIjoiIiwicGF5bWVudCI6eyJhbW91bnQiOnsiY3VycmVuY3kiOiJFVVIiLCJ2YWx1ZSI6MTAwMH0sImNvdW50cnlDb2RlIjoiTkwiLCJyZWZlcmVuY2UiOiJZb3VyIG9yZGVyIG51bWJlciIsInJldHVyblVybCI6Imh0dHBzOlwvXC95b3VyLWNvbXBhbnkuY29tXC8iLCJzZXNzaW9uVmFsaWRpdHkiOiIyMDE4LTA2LTIyVDE1OjMxOjI1WiJ9LCJwYXltZW50RGF0YSI6IkFiMDJiNGMwIUJRQUJBZ0FJemlidUZ2Z3hsMGVTOTFQZWtjbDB3VHJhRG1xTU1BWFdZUGdxOXI1NXJjKzJ5N2l5bWV2ZWswR0VWdU9sZDhPSkwyeTBzWnl3UVlYWFhHUDkwa0pZU21SVzIzS1dHYXp3VEhyMDV0cGpGMGZOMHJrZ2lPNTFBdkxrVnhQSWI4RE1iQUtmeVlyRVErdjlpZWIyUjI0emdiTXhYWGJJMWtjZGJWeEdKbENMRWVaXC9kNDUzclVGZ0NnRktWczNXUk1JRHVTTlBoQ1hCclwvMlhqMXJ4dDRFTkFFZEN3czVwb1VnTEdWdnBQK0RSSU9FNlU1bHB1djVJV1k0N256azBIeHdGdWZnNVZmUWhWOGZHd2RCQzZrdW4wTWI2dlZcL1JqWDc5Tm9FVHBKcUlXcDNseEFpQW5HZjl5Mlp0Q3UzNEROUlNOZUR4eUQ1UFFhaTlwWHRNTFo2YnBlMkZEMG1BRkpHNXAyUk9kNUc2RkM0UXRDMzA3YTRcL2d3ZVh5TklpeFN2MHBXdVZzV2RsUzlUM1RDN2dXZEZVSEVLb1ozU041MzZqeVdTZGRMTVNoMlRJZWwxN25ISnZsMnBxTmltQTlBRWpmUG05NG53U0M1SGJkd1NuSDlpQmdmY3NqaSsxVXYrVmlzVnVHbUk5V2lDYjRIR2pPZlFoQUxXbmxWZWZXVlhPWGs0NmkwOExRemZPN1krUXNRMjVRNmVkdEduM1ZCeHlUdDEwajlWMTZnMlwvaTl1Y3pcL2owZ0piODRoUGw3NFZ3bTlWYTNPZEl2bk1MdjdXNE14bG9MWlhcL2paakF3NGZ5V0ZtNHhQclp5ZUpWK2ZLbkV4UHdsY2FzbjVLQkp4SHpcLzJXNk9MOWQ1cE02T003WnprOE9RNVIwOWhcL1pKOHNSMTBGT29kOU1nQkJTNW1YeUMrWXU2Q1JSaGR6N2I4ZlRBRXA3SW10bGVTSTZJa0ZHTUVGQlFURXdNME5CTlRNM1JVRkZSRGczUXpJMFJFUTFNemt3T1VJNE1FRTNPRUU1TWpORk16Z3lNMFEyT0VSQlEwTTVORUk1UmtZNE16QTFSRU1pZlFkd01idGdFczlUZGRXeU96NGQrdlYyQVQxVUEwV3h3XC9NR05Pa0owdWxoaGhPYXVCQVpLK0RIdU5xXC9vQnQzRVQ0S3N2MDd2VnZRWFBZNkc2MzQ4Q2pzWWYyQURHQjV3NzlpeDc3ZERtZzZhWGRhSG95T3RxdHdDcyt2VUUxbXJhVytFOVhpZlh6Qm1UK2Roc2t4WlQ0NHllTzh1VGpjMTRKQnNpVWpmXC9ESEl5YUtzOHV3UFk2UnNxK3JUNjFtR3BseTBMQ25VNWlObjNDM2lPMHRcL3Y1WDY3eGRqWXhnYW5QcHEzTFVpZ29FNDZaOUpNdnp4NEFIdTZJNWJaUDJ6S3UwQzNWcXMyWjUwSENpQjh2MlhKY3dlY0lOcWFUWEZaQmwyclhNRmdBbDlDSjY2dkMwRnJJSWp1d3B4M1ZGelQxTHJmc3psOWdkYUY1aUp4VDlRemgraGNqNk9KaEhmcTNnQ0RGUFZsUnZIWkRcL1VHa3ltUmlvTGNPeDFBVEw3azhRclwvREpZQ3NjY3g5aXlEcnhhQ2hPa1FrV054VjZqcjBYSHRnaHdGSE5GeTFJc3kyeWxPcFJYMUVyY2Y0XC92bHJVU0N3WHQ2R0Z0dHhmR0xHbExlN0dBKzVaU3R3UGR4aGxUb2haeTdwMWg2a0U5ZnJxbU1tZk1YV2N1Rkt4NnZMWjVtMEtsbzZydllROWZ1Q0pUYkdKMDRENkI2RnR5WXYrOHlEWTJaeVBvRzhjbHJJZ3Z6dEtLaVlibG10RnRHakd3OVNaWkVxXC80ODBDOEZOdlVuZmtnXC9IT2FScnlKaXhvSjFicFBEK1YwRVlrYTVIbjBnWlwvRXVQTDFcL1B5eUp5Q0d5SVh2SlBFMHhZUWdDWllqcDJiNUhGZjZpMDdtUDFNdHNkYVBZd280VkQwRUNrckpDeE5DcnBIVmJqMWt3dmtcL0JxNE5QRXlFVFd2N25FamswUG1WalFySHpxZ2lpb2RIM1YrYXZodGxpSjcwNUx1RWFIdmNRTHU1aE5OSlVVRFNlTnMwR2hldVkxcGRuK3l6R1Y5ZG1OaklMSFI0N1B3UlQzRlwvMUJMNGU4elZLdFFOSWpYVnN1ZHd2UHN2RUNzamhmTGpaOEhmY3JGM1JTTW9pNnR0UlwvNkJlTVlSb1BHTlZ5bG9ybnBSQ3lqTXVsZmJlSzkzNWdaOVwvWkd6alFtZzRTRzlTWkUxSGdpaGhldFZ4bnh1YmRmMjhEcUxVNHBTZ2ZHWlFuMk83ZnYwNCt6RjQ0eHQ2VnJ6NFwvNHNzbTdaZUpKYW5HQStSVlFUZTlNTVNEYXU5Z1YyXC93Y0N4bGN6YmdkaUllYWQzb3RVK296V1FpS2VoODY2RVBrWjUxQmJraHRMNUxlT1lUYjAwYU5GRGk2QnVWZ2s2SG5sTnpJcDZIRDFcLytSaXVvc3llYTNmcVg0b1hwYVR0RE5WMEF1TlVLVnFvZUJkaktoTVVpb005UTVqbW94Q2hpcStWRndGbUlNUGFLMWpSRkpxTzRIUElsYWYwXC9MWk5cL3hzQU96WHQrVW5BQTFFZzZUU2FLYWN5amwxUXFmT21CNFV6TFwvcmx2WXRqRW5IdlwvdzZ4eUROMnp1IiwicGF5bWVudE1ldGhvZHMiOlt7ImNvbmZpZ3VyYXRpb24iOnsiY2FuSWdub3JlQ29va2llcyI6InRydWUifSwiZGV0YWlscyI6W3siaXRlbXMiOlt7ImlkIjoiMTEyMSIsIm5hbWUiOiJUZXN0IElzc3VlciJ9LHsiaWQiOiIxMTU0IiwibmFtZSI6IlRlc3QgSXNzdWVyIDUifSx7ImlkIjoiMTE1MyIsIm5hbWUiOiJUZXN0IElzc3VlciA0In0seyJpZCI6IjExNTIiLCJuYW1lIjoiVGVzdCBJc3N1ZXIgMyJ9LHsiaWQiOiIxMTUxIiwibmFtZSI6IlRlc3QgSXNzdWVyIDIifSx7ImlkIjoiMTE2MiIsIm5hbWUiOiJUZXN0IElzc3VlciBDYW5jZWxsZWQifSx7ImlkIjoiMTE2MSIsIm5hbWUiOiJUZXN0IElzc3VlciBQZW5kaW5nIn0seyJpZCI6IjExNjAiLCJuYW1lIjoiVGVzdCBJc3N1ZXIgUmVmdXNlZCJ9LHsiaWQiOiIxMTU5IiwibmFtZSI6IlRlc3QgSXNzdWVyIDEwIn0seyJpZCI6IjExNTgiLCJuYW1lIjoiVGVzdCBJc3N1ZXIgOSJ9LHsiaWQiOiIxMTU3IiwibmFtZSI6IlRlc3QgSXNzdWVyIDgifSx7ImlkIjoiMTE1NiIsIm5hbWUiOiJUZXN0IElzc3VlciA3In0seyJpZCI6IjExNTUiLCJuYW1lIjoiVGVzdCBJc3N1ZXIgNiJ9XSwia2V5IjoiaWRlYWxJc3N1ZXIiLCJ0eXBlIjoic2VsZWN0In1dLCJuYW1lIjoiaURFQUwiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBXbGtaV0ZzIiwidHlwZSI6ImlkZWFsIn0seyJkZXRhaWxzIjpbeyJrZXkiOiJlbmNyeXB0ZWRDYXJkTnVtYmVyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkU2VjdXJpdHlDb2RlIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5TW9udGgiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJlbmNyeXB0ZWRFeHBpcnlZZWFyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiaG9sZGVyTmFtZSIsIm9wdGlvbmFsIjoidHJ1ZSIsInR5cGUiOiJ0ZXh0In1dLCJncm91cCI6eyJuYW1lIjoiQ3JlZGl0IENhcmQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYTmphR1Z0WlE9PSIsInR5cGUiOiJjYXJkIn0sIm5hbWUiOiJNYXN0ZXJDYXJkIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQVzFqIiwidHlwZSI6Im1jIn0seyJuYW1lIjoiUGF5UGFsIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQWEJoZVhCaGJBPT0iLCJ0eXBlIjoicGF5cGFsIn0seyJkZXRhaWxzIjpbeyJrZXkiOiJlbmNyeXB0ZWRDYXJkTnVtYmVyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkU2VjdXJpdHlDb2RlIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5TW9udGgiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJlbmNyeXB0ZWRFeHBpcnlZZWFyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiaG9sZGVyTmFtZSIsIm9wdGlvbmFsIjoidHJ1ZSIsInR5cGUiOiJ0ZXh0In1dLCJncm91cCI6eyJuYW1lIjoiQ3JlZGl0IENhcmQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYTmphR1Z0WlE9PSIsInR5cGUiOiJjYXJkIn0sIm5hbWUiOiJWSVNBIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQWFpwYzJFPSIsInR5cGUiOiJ2aXNhIn0seyJkZXRhaWxzIjpbeyJrZXkiOiJlbmNyeXB0ZWRDYXJkTnVtYmVyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkU2VjdXJpdHlDb2RlIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5TW9udGgiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJlbmNyeXB0ZWRFeHBpcnlZZWFyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiaG9sZGVyTmFtZSIsIm9wdGlvbmFsIjoidHJ1ZSIsInR5cGUiOiJ0ZXh0In1dLCJncm91cCI6eyJuYW1lIjoiQ3JlZGl0IENhcmQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYTmphR1Z0WlE9PSIsInR5cGUiOiJjYXJkIn0sIm5hbWUiOiJBbWVyaWNhbiBFeHByZXNzIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQV0Z0WlhnPSIsInR5cGUiOiJhbWV4In0seyJuYW1lIjoiU0VQQSBEaXJlY3QgRGViaXQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYTmxjR0ZrYVhKbFkzUmtaV0pwZEE9PSIsInR5cGUiOiJzZXBhZGlyZWN0ZGViaXQifSx7Im5hbWUiOiJQYXlzYWZlY2FyZCIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFhCaGVYTmhabVZqWVhKayIsInR5cGUiOiJwYXlzYWZlY2FyZCJ9LHsibmFtZSI6IkJhbmsgVHJhbnNmZXIgKE5MKSIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdKaGJtdFVjbUZ1YzJabGNsOU9UQT09IiwidHlwZSI6ImJhbmtUcmFuc2Zlcl9OTCJ9LHsiZGV0YWlscyI6W3sia2V5IjoiZW5jcnlwdGVkQ2FyZE51bWJlciIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZFNlY3VyaXR5Q29kZSIsIm9wdGlvbmFsIjoidHJ1ZSIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZEV4cGlyeU1vbnRoIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5WWVhciIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImhvbGRlck5hbWUiLCJvcHRpb25hbCI6InRydWUiLCJ0eXBlIjoidGV4dCJ9XSwiZ3JvdXAiOnsibmFtZSI6IkNyZWRpdCBDYXJkIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQWE5qYUdWdFpRPT0iLCJ0eXBlIjoiY2FyZCJ9LCJuYW1lIjoiTWFlc3RybyIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFcxaFpYTjBjbTg9IiwidHlwZSI6Im1hZXN0cm8ifSx7Im5hbWUiOiJIdW5rZW1vbGxlciBMaW5nZXJpZSBDYXJkIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQV2h0YkdsdVoyVnlhV1U9IiwidHlwZSI6ImhtbGluZ2VyaWUifSx7Im5hbWUiOiJFZW5tYWxpZ2UgbWFjaHRpZ2luZyIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdScGNtVmpkR1JsWW1sMFgwNU0iLCJ0eXBlIjoiZGlyZWN0ZGViaXRfTkwifSx7Im5hbWUiOiJTRVBBIEJhbmsgVHJhbnNmZXIiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBXSmhibXRVY21GdWMyWmxjbDlKUWtGTyIsInR5cGUiOiJiYW5rVHJhbnNmZXJfSUJBTiJ9LHsibmFtZSI6ImNfY2FzaCIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdOZlkyRnphQT09IiwidHlwZSI6ImNfY2FzaCJ9LHsiZGV0YWlscyI6W3sia2V5IjoiZW5jcnlwdGVkQ2FyZE51bWJlciIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZFNlY3VyaXR5Q29kZSIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZEV4cGlyeU1vbnRoIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5WWVhciIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImhvbGRlck5hbWUiLCJvcHRpb25hbCI6InRydWUiLCJ0eXBlIjoidGV4dCJ9XSwiZ3JvdXAiOnsibmFtZSI6IkNyZWRpdCBDYXJkIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQWE5qYUdWdFpRPT0iLCJ0eXBlIjoiY2FyZCJ9LCJuYW1lIjoiRXhwcmVzc1BheSIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdOMWNBPT0iLCJ0eXBlIjoiY3VwIn0seyJkZXRhaWxzIjpbeyJrZXkiOiJlbmNyeXB0ZWRDYXJkTnVtYmVyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkU2VjdXJpdHlDb2RlIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5TW9udGgiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJlbmNyeXB0ZWRFeHBpcnlZZWFyIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiaG9sZGVyTmFtZSIsIm9wdGlvbmFsIjoidHJ1ZSIsInR5cGUiOiJ0ZXh0In1dLCJncm91cCI6eyJuYW1lIjoiQ3JlZGl0IENhcmQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYTmphR1Z0WlE9PSIsInR5cGUiOiJjYXJkIn0sIm5hbWUiOiJEaW5lcnMgQ2x1YiIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdScGJtVnljdz09IiwidHlwZSI6ImRpbmVycyJ9LHsiZGV0YWlscyI6W3sia2V5IjoiZW5jcnlwdGVkQ2FyZE51bWJlciIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZFNlY3VyaXR5Q29kZSIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZEV4cGlyeU1vbnRoIiwidHlwZSI6ImNhcmRUb2tlbiJ9LHsia2V5IjoiZW5jcnlwdGVkRXhwaXJ5WWVhciIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImhvbGRlck5hbWUiLCJvcHRpb25hbCI6InRydWUiLCJ0eXBlIjoidGV4dCJ9XSwiZ3JvdXAiOnsibmFtZSI6IkNyZWRpdCBDYXJkIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQWE5qYUdWdFpRPT0iLCJ0eXBlIjoiY2FyZCJ9LCJuYW1lIjoiRGlzY292ZXIiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBXUnBjMk52ZG1WeSIsInR5cGUiOiJkaXNjb3ZlciJ9LHsibmFtZSI6Ik5hdGlvbmFsZSBFbnRlcnRhaW5tZW50IENhcmQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBXVnVkR1Z5ZEdGcGJtMWxiblJqWVhKayIsInR5cGUiOiJlbnRlcnRhaW5tZW50Y2FyZCJ9LHsibmFtZSI6IkdhbGwgJiBHYWxsIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQV2RoYkd4bllXeHMiLCJ0eXBlIjoiZ2FsbGdhbGwifSx7Im5hbWUiOiJQaG9uZSBQYXltZW50IiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQV2wyY2c9PSIsInR5cGUiOiJpdnIifSx7Im5hbWUiOiJMYW5kbGluZSBwaG9uZSIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdsMmNreGhibVJzYVc1bCIsInR5cGUiOiJpdnJMYW5kbGluZSJ9LHsibmFtZSI6Ik1vYmlsZSBwaG9uZSIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdsMmNrMXZZbWxzWlE9PSIsInR5cGUiOiJpdnJNb2JpbGUifSx7ImRldGFpbHMiOlt7ImtleSI6ImVuY3J5cHRlZENhcmROdW1iZXIiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJlbmNyeXB0ZWRTZWN1cml0eUNvZGUiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJlbmNyeXB0ZWRFeHBpcnlNb250aCIsInR5cGUiOiJjYXJkVG9rZW4ifSx7ImtleSI6ImVuY3J5cHRlZEV4cGlyeVllYXIiLCJ0eXBlIjoiY2FyZFRva2VuIn0seyJrZXkiOiJob2xkZXJOYW1lIiwib3B0aW9uYWwiOiJ0cnVlIiwidHlwZSI6InRleHQifV0sImdyb3VwIjp7Im5hbWUiOiJDcmVkaXQgQ2FyZCIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFhOamFHVnRaUT09IiwidHlwZSI6ImNhcmQifSwibmFtZSI6IkpDQiIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFdwallnPT0iLCJ0eXBlIjoiamNiIn0seyJuYW1lIjoiTW9uZXlib29rZXJzIiwicGF5bWVudE1ldGhvZERhdGEiOiJDZjYyZjFlMyFZbkpoYm1SRGIyUmxQVzF2Ym1WNVltOXZhMlZ5Y3c9PSIsInR5cGUiOiJtb25leWJvb2tlcnMifSx7Im5hbWUiOiJPbmViaXAiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBXOXVaV0pwY0E9PSIsInR5cGUiOiJvbmViaXAifSx7Im5hbWUiOiJQcmVtaXVtIFNNUyIsInBheW1lbnRNZXRob2REYXRhIjoiQ2Y2MmYxZTMhWW5KaGJtUkRiMlJsUFhOdGN3PT0iLCJ0eXBlIjoic21zIn0seyJuYW1lIjoiVW5pb25QYXkiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYVnVhVzl1Y0dGNSIsInR5cGUiOiJ1bmlvbnBheSJ9LHsibmFtZSI6IldlYnNob3AgR2lmdGNhcmQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYZGxZbk5vYjNCbmFXWjBZMkZ5WkE9PSIsInR5cGUiOiJ3ZWJzaG9wZ2lmdGNhcmQifSx7Im5hbWUiOiJZb3VyIEdpZnQiLCJwYXltZW50TWV0aG9kRGF0YSI6IkNmNjJmMWUzIVluSmhibVJEYjJSbFBYbHZkWEpuYVdaMCIsInR5cGUiOiJ5b3VyZ2lmdCJ9XSwicHVibGljS2V5IjoiMTAwMDF8QkNBREY4MjU3RTE4QTFBODlBQ0M0MTQ5RDBGQzMyNEU5ODMxNUMyNDA1RDc1NUU1MDRENjY0QjJDMUM3MUE2MzhCOUQxMkZEMjkwRTEyQTA0QkIxRTZCMkRBM0YzN0M1NTJEMDExQ0ZCQUJCQ0M4NDgwNkFCQjc4RUQxNjU3OERFRDk2NDQ4Q0I4QjU0MTM5RkQ3QzcyRjkwQzA4NkMzNkFFNzdFNjlFOTE3MUEzQTBENTIwRDAyMTM2MzcyNjNFMEM1REY5NjREQUQ4RDc5N0VCMURENkU1NEFENjY5RDYwQUFDMjU1NUUwQzhCRTIyNzNGODk4NDQ3M0U3NkVFNzM4N0ZFQzBFNzFCODM2ODQ0Qjg0MDZBQzkwNTk0OUZCODhGQzY4RThGMDE4NjYzMkYxRURCNEM5QjVCODg4RUY1QzU3RERFMTEzN0JCRjM2RjY1NEU0N0U1NzFGQkM4ODgyOENCRTk0MzhENzQyRjNDMDkyQUQ1RkYzRTYyQUNBRDI1MjQ2RUE0M0QyMkNGQzhBRTE0NDE5NzY3ODY3RDJDNjBEQ0JBNkFDOTIwMDhEMEQ4ODM0QkVBMTExN0FFMzQ3RjMxMkQ2QzAxQzU3Q0I0MkFERDNENEQ2MkUzNzI3QTNDRThBQTFGMDlCRjZCNzk2QTBBMzc0MUJDNDgxMTEifQ==", +}, +); \ No newline at end of file diff --git a/src/__mocks__/checkout/paymentmethodsErrorForbidden403.ts b/src/__mocks__/checkout/paymentmethodsErrorForbidden403.ts new file mode 100644 index 0000000..c7204e6 --- /dev/null +++ b/src/__mocks__/checkout/paymentmethodsErrorForbidden403.ts @@ -0,0 +1,6 @@ +export const paymentMethodsError = JSON.stringify({ + errorCode: "901", + errorType: "security", + message: "Invalid Merchant Account", + status: 403, +}); diff --git a/src/__mocks__/checkout/paymentsDetailsErrorInvalidData422.ts b/src/__mocks__/checkout/paymentsDetailsErrorInvalidData422.ts new file mode 100644 index 0000000..6a0cae5 --- /dev/null +++ b/src/__mocks__/checkout/paymentsDetailsErrorInvalidData422.ts @@ -0,0 +1,7 @@ +/* tslint:disable */ +export const paymentDetailsError = JSON.stringify({ + status: 422, + errorCode: "101", + message: "Invalid card number", + errorType: "validation", +}); \ No newline at end of file diff --git a/src/__mocks__/checkout/paymentsDetailsSuccess.ts b/src/__mocks__/checkout/paymentsDetailsSuccess.ts new file mode 100644 index 0000000..07e264c --- /dev/null +++ b/src/__mocks__/checkout/paymentsDetailsSuccess.ts @@ -0,0 +1,9 @@ +/* tslint:disable */ +export const paymentDetailsSuccess = JSON.stringify({ + pspReference: "8515232733321252", + resultCode: "Authorised", + additionalData: { + liabilityShift: "true", + refusalReasonRaw: "AUTHORISED", + }, +}); \ No newline at end of file diff --git a/src/__mocks__/checkout/paymentsErrorInvalidData422.ts b/src/__mocks__/checkout/paymentsErrorInvalidData422.ts new file mode 100644 index 0000000..b34df87 --- /dev/null +++ b/src/__mocks__/checkout/paymentsErrorInvalidData422.ts @@ -0,0 +1,7 @@ +/* tslint:disable */ +export const paymentsError = JSON.stringify({ + status: 422, + errorCode: "130", + message: "Reference Missing", + errorType: "validation", +}); \ No newline at end of file diff --git a/src/__mocks__/checkout/paymentsResultErrorInvalidDataPayload422.ts b/src/__mocks__/checkout/paymentsResultErrorInvalidDataPayload422.ts new file mode 100644 index 0000000..de39a5e --- /dev/null +++ b/src/__mocks__/checkout/paymentsResultErrorInvalidDataPayload422.ts @@ -0,0 +1,7 @@ +/* tslint:disable */ +export const paymentsResultError = JSON.stringify({ + status: 422, + errorCode: "14_018", + message: "Invalid payload provided", + errorType: "validation", +}); \ No newline at end of file diff --git a/src/__mocks__/checkout/paymentsResultMultibancoSuccess.ts b/src/__mocks__/checkout/paymentsResultMultibancoSuccess.ts new file mode 100644 index 0000000..3fd598c --- /dev/null +++ b/src/__mocks__/checkout/paymentsResultMultibancoSuccess.ts @@ -0,0 +1,15 @@ +/* tslint:disable */ +export const paymentsResultMultibancoSuccess = JSON.stringify({ + additionalData: { + "cvcResult": "0", + "avsResult": "0", + "comprafacil.deadline": "3", + "comprafacil.reference": "123 123 123", + "paymentMethod": "multibanco", + "paymentMethodVariant": "multibanco", + "comprafacil.entity": "12345", + "comprafacil.amount": "101.01", + }, + pspReference: "8111111111111111", + resultCode: "Received", +}); \ No newline at end of file diff --git a/src/__mocks__/checkout/paymentsResultSucess.ts b/src/__mocks__/checkout/paymentsResultSucess.ts new file mode 100644 index 0000000..2a0c454 --- /dev/null +++ b/src/__mocks__/checkout/paymentsResultSucess.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +export const paymentsResultSuccess = JSON.stringify({ + pspReference: "8535253563623704", + resultCode: "Authorised", +}); \ No newline at end of file diff --git a/src/__mocks__/checkout/paymentsSuccess.ts b/src/__mocks__/checkout/paymentsSuccess.ts new file mode 100644 index 0000000..87fdaa1 --- /dev/null +++ b/src/__mocks__/checkout/paymentsSuccess.ts @@ -0,0 +1,98 @@ +/* tslint:disable */ +export const paymentsSuccess = JSON.stringify({ + additionalData: { + expiryDate: "8/2018", + fraudResultType: "GREEN", + cardBin: "411111", + cardSummary: "1111", + fraudManualReview: "false", + aliasType: "Default", + alias: "H167852639363479", + cardPaymentMethod: "visa", + cardIssuingCountry: "NL", + }, + fraudResult: { + accountScore: 0, + results: [ + { + FraudCheckResult: { + accountScore: 0, + checkId: 2, + name: "CardChunkUsage", + }, + }, + { + FraudCheckResult: { + accountScore: 0, + checkId: 3, + name: "PaymentDetailUsage", + }, + }, + { + FraudCheckResult: { + accountScore: 0, + checkId: 4, + name: "HolderNameUsage", + }, + }, + { + FraudCheckResult: { + accountScore: 0, + checkId: 1, + name: "PaymentDetailRefCheck", + }, + }, + { + FraudCheckResult: { + accountScore: 0, + checkId: 13, + name: "IssuerRefCheck", + }, + }, + { + FraudCheckResult: { + accountScore: 0, + checkId: 15, + name: "IssuingCountryReferral", + }, + }, + { + FraudCheckResult: { + accountScore: 0, + checkId: 27, + name: "PmOwnerRefCheck", + }, + }, + { + FraudCheckResult: { + accountScore: 0, + checkId: 10, + name: "HolderNameContainsNumber", + }, + }, + { + FraudCheckResult: { + accountScore: 0, + checkId: 11, + name: "HolderNameIsOneWord", + }, + }, + { + FraudCheckResult: { + accountScore: 0, + checkId: 82, + name: "CustomFieldCheck", + }, + }, + { + FraudCheckResult: { + accountScore: 0, + checkId: 25, + name: "CVCAuthResultCheck", + }, + }, + ], + }, + pspReference: "8535296650153317", + resultCode: "Authorised", +}); \ No newline at end of file diff --git a/src/__mocks__/checkoutUtility/originkeysSuccess.ts b/src/__mocks__/checkoutUtility/originkeysSuccess.ts new file mode 100644 index 0000000..f1a69e0 --- /dev/null +++ b/src/__mocks__/checkoutUtility/originkeysSuccess.ts @@ -0,0 +1,7 @@ +export const originKeysSuccess = JSON.stringify({ + originKeys: { + "https://www.your-domain1.com": "pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4xLmNvbQ.UEwIBmW9-c_uXo5wSEr2w8Hz8hVIpujXPHjpcEse3xI", + "https://www.your-domain2.com": "pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4yLmNvbQ.EP6eXBJKk0t7-QIUl6e_b1qMuMHGepxG_SlUqxAYrfY", + "https://www.your-domain3.com": "pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4zLmNvbQ.fUvflu-YIdZSsLEH8Qqmr7ksE4ag_NYiiMXK0s6aq_4", + }, +}); diff --git a/src/__mocks__/notification/authorisationTrue.json b/src/__mocks__/notification/authorisationTrue.json new file mode 100644 index 0000000..0dcc867 --- /dev/null +++ b/src/__mocks__/notification/authorisationTrue.json @@ -0,0 +1,36 @@ +{ + "live": "false", + "notificationItems": [ + { + "NotificationRequestItem": { + "additionalData": { + "expiryDate": "12\/2012", + " NAME1 ": "VALUE1", + "authCode": "1234", + "cardSummary": "7777", + "totalFraudScore": "10", + "hmacSignature": "OzDjCMZIsdtDqrZ+cl\/FWC+WdESrorctXTzAzW33dXI=", + "NAME2": " VALUE2 ", + "fraudCheck-6-ShopperIpUsage": "10" + }, + "amount": { + "currency": "EUR", + "value": 10100 + }, + "eventCode": "AUTHORISATION", + "eventDate": "2017-01-19T16:42:03+01:00", + "merchantAccountCode": "MagentoMerchantTest2", + "merchantReference": "8313842560770001", + "operations": [ + "CANCEL", + "CAPTURE", + "REFUND" + ], + "paymentMethod": "visa", + "pspReference": "123456789", + "reason": "1234:7777:12\/2012", + "success": "true" + } + } + ] +} \ No newline at end of file diff --git a/src/__mocks__/notification/captureFalse.json b/src/__mocks__/notification/captureFalse.json new file mode 100644 index 0000000..fb2a6fd --- /dev/null +++ b/src/__mocks__/notification/captureFalse.json @@ -0,0 +1,25 @@ +{ + "live": "false", + "notificationItems": [ + { + "NotificationRequestItem": { + "additionalData": { + "hmacSignature": "KujHNqpyCAMdGefj7lfQ8AeD0Jke9Zs2bVAqScQDWi4=" + }, + "amount": { + "currency": "USD", + "value": 23623 + }, + "eventCode": "CAPTURE", + "eventDate": "2017-01-25T18:08:19+01:00", + "merchantAccountCode": "MagentoMerchantTest2", + "merchantReference": "00000001", + "originalReference": "ORIGINAL_PSP", + "paymentMethod": "visa", + "pspReference": "PSP_REFERENCE", + "reason": "Insufficient balance on payment", + "success": "false" + } + } + ] +} \ No newline at end of file diff --git a/src/__mocks__/notification/captureTrue.json b/src/__mocks__/notification/captureTrue.json new file mode 100644 index 0000000..c081ab5 --- /dev/null +++ b/src/__mocks__/notification/captureTrue.json @@ -0,0 +1,25 @@ +{ + "live": "false", + "notificationItems": [ + { + "NotificationRequestItem": { + "additionalData": { + "hmacSignature": "qvS6I3Gdi1jx+jSh7IopAgcHtMoxvXlNL7DYQ+j1hd0=" + }, + "amount": { + "currency": "USD", + "value": 23623 + }, + "eventCode": "CAPTURE", + "eventDate": "2017-01-25T18:08:19+01:00", + "merchantAccountCode": "MagentoMerchantTest2", + "merchantReference": "00000001", + "originalReference": "ORIGINAL_PSP", + "paymentMethod": "visa", + "pspReference": "PSP_REFERENCE", + "reason": "", + "success": "true" + } + } + ] +} \ No newline at end of file diff --git a/src/__mocks__/notification/refundFalse.json b/src/__mocks__/notification/refundFalse.json new file mode 100644 index 0000000..49a834a --- /dev/null +++ b/src/__mocks__/notification/refundFalse.json @@ -0,0 +1,25 @@ +{ + "live": "false", + "notificationItems": [ + { + "NotificationRequestItem": { + "additionalData": { + "hmacSignature": "HZXziBYopfDIzDhk49iC\/\/yCfxmy\/z0xWuvvTxFNUSA=" + }, + "amount": { + "currency": "EUR", + "value": 1500 + }, + "eventCode": "REFUND", + "eventDate": "2017-02-17T11:04:07+01:00", + "merchantAccountCode": "MagentoMerchantTest2", + "merchantReference": "payment-2017-1-17-11-refund", + "originalReference": "ORIGINAL_PSP", + "paymentMethod": "visa", + "pspReference": "PSP_REFERENCE", + "reason": "Insufficient balance on payment", + "success": "false" + } + } + ] +} \ No newline at end of file diff --git a/src/__mocks__/notification/refundTrue.json b/src/__mocks__/notification/refundTrue.json new file mode 100644 index 0000000..b58e1f6 --- /dev/null +++ b/src/__mocks__/notification/refundTrue.json @@ -0,0 +1,25 @@ +{ + "live": "false", + "notificationItems": [ + { + "NotificationRequestItem": { + "additionalData": { + "hmacSignature": "KJFhURWP8Pv9m8k+7NGHNJAupBj6X6J\/VWAikFxeWhA=" + }, + "amount": { + "currency": "EUR", + "value": 1500 + }, + "eventCode": "REFUND", + "eventDate": "2017-02-17T11:11:44+01:00", + "merchantAccountCode": "MagentoMerchantTest2", + "merchantReference": "payment-2017-1-17-11-refund", + "originalReference": "ORIGINAL_PSP", + "paymentMethod": "visa", + "pspReference": "PSP_REFERENCE", + "reason": "", + "success": "true" + } + } + ] +} \ No newline at end of file diff --git a/src/__mocks__/recurring/disableSuccess.ts b/src/__mocks__/recurring/disableSuccess.ts new file mode 100644 index 0000000..87201fb --- /dev/null +++ b/src/__mocks__/recurring/disableSuccess.ts @@ -0,0 +1,3 @@ +export const disableSuccess = JSON.stringify({ + response: "[detail-successfully-disabled]", +}); diff --git a/src/__mocks__/recurring/listRecurringDetailsSuccess.ts b/src/__mocks__/recurring/listRecurringDetailsSuccess.ts new file mode 100644 index 0000000..5b577cc --- /dev/null +++ b/src/__mocks__/recurring/listRecurringDetailsSuccess.ts @@ -0,0 +1,52 @@ +export const listRecurringDetailsSuccess = JSON.stringify({ + creationDate: new Date("2017-03-01T11:53:11+01:00"), + details: [ + { + additionalData: { + cardBin: "411111", + }, + alias: "cardAlias", + aliasType: "Default", + card: { + expiryMonth: "8", + expiryYear: "2018", + holderName: "Holder", + number: "1111", + }, + contractTypes: [ + "ONECLICK", + ], + creationDate: new Date("2017-03-07T09:43:33+01:00"), + firstPspReference: "8524888762135795", + paymentMethodVariant: "visa", + recurringDetailReference: "recurringReference", + variant: "visa", + }, + { + billingAddress: { + city: "City", + country: "NL", + houseNumberOrName: "1", + postalCode: "2312aa", + stateOrProvince: "NA", + street: "Street", + }, + contractTypes: [ + "RECURRING", + ], + creationDate: new Date("2017-10-10T08:50:02+02:00"), + firstPspReference: "8515076181707110", + paymentMethodVariant: "paypal", + recurringDetailReference: "8315076181982020", + tokenDetails: { + tokenData: { + "BillingAgreementId": "B-7MA42752FE774625C", + "EmailId": "tedtest@test.nl", + "PayPal.PayerId": "H95EPL8B2KFE6", + }, + tokenDataType: "PayPal", + }, + variant: "paypal", + }, + ], +}); diff --git a/src/__mocks__/terminalApi/async.ts b/src/__mocks__/terminalApi/async.ts new file mode 100644 index 0000000..7dd7f71 --- /dev/null +++ b/src/__mocks__/terminalApi/async.ts @@ -0,0 +1 @@ +export const asyncRes = "ok"; diff --git a/src/__mocks__/terminalApi/local.ts b/src/__mocks__/terminalApi/local.ts new file mode 100644 index 0000000..d18a7d0 --- /dev/null +++ b/src/__mocks__/terminalApi/local.ts @@ -0,0 +1,107 @@ +export const localRes = JSON.stringify({ + SaleToPOIResponse: { + MessageHeader: { + MessageCategory: "Payment", + MessageClass: "Service", + MessageType: "Response", + POIID: "P400Plus-275039202", + ProtocolVersion: "3.0", + SaleID: "325488592", + ServiceID: "325488592", + }, + NexoBlob: `ei2mTwLeXBRLw6yBzfG7gxinRqVqJB8RKvGRKK+vFmSwSzMtbb3ziiRBVAjgcdTHMoDUewrr56wIqVa1YWw/WexEm3XHbFxxE5in + jBl+aXGbgGPEoByEbIYqY3gLOswp+VaDjqH6cocDNc482s+v1VvJOCCaOKqmKS28fqmKdq42NfdIS5vVqZ5ydUTnOMhiPWXkCYoDjbhaooLpeq/ + NDb7ZG9eu2KRfjLBWY0ohVUR7Mm8vD2CjVR4nFX7oyjKMvlkx7o3+ofo/EZJDLzuyxFvSi5sXznt5FMQC3YrtjF0kgU3XSNMfh4xm7rFVr8W0gE + LPVnufSjbty3XlZw5w7nrp8FlHT79vnoo835cH2CQvfKteyxo1TMV2CIcalQx4304UKb485qHUh6jcD/vHemAhCnemufJNcQzkDHMAFh8jHkzsr + 9AweaRHjICxIWo+6neEzZpBvkztVKZcdIVV6YOb9cNklaHvxzfHPTfVA6GtHkvHd2a+SQRJFQJPxuCBX0J/wR6s+yDWZUjISPXwsgTp1xbq8egT + tHZFniNduBuzB785UoR06Q66gv22nCetjrAz9gQehyU0jxeyb9D9+MmUCMPt7dMIseoacCWCk1C8naj1v4hdIjRimsgp4G9cs6csiqOwFcxYV0T + Y0zKyDaUGoDd6nOajHQP9UkYrAMhYGPd6CwGTA9D/ERyAayt/SRT8Toq2NsJ1WX7O7JVcOVk1p40VPhk8f4IbL24TV0MyKu3Ms+dpjqbC4jecGK + 6RtShn6oDWfsmsg9AjLa1N8WYcyeiy9fCS6WVpC8aTGSlChcwQLsFc0SurFiyGYVOA/kterCUqrmguE4bVEX0qYHzTVWDsTzR2Kp6qO/Bf1NGwX + silXNGkl645Ofn1RcpBfJybA14xoRtb3NUHTSiFd0iO1OTO0ntPd7S+9JoZvdgvYuHPhsSV2+w+yb80s/iquDkXkfLhCl06c/jthJEzOtxHbU93 + 2cVQe/ZTIiqpZFVwl1iuWG14/MPBzZ/f45tSO8iSxGG7MBouWs2k5OlhaSysSA1i2rHiwglth9UIDngzOvaGX7HsfPExyKpDJmNxPdGiCaAfwbd + ZBmVmBVf2gtaJw4Qqqwqsg6DjjkdrEzKnS3XsFRtW27c18QkKv+ZK5NDm8HbPeCDLhpFeo95BGI5isXRR/Ypv8DBwXWGRZlDY3dXFx0gnBfg9gY + h22TQhsNg4FJPGFie/OkjKX0uwX74Ejg4ewbYRzx67iIFlz5trxeIVLhfh7cZxUkoFJ5rObKUpsw350L5ovH0GMqg8IKeo78X5JtwnTGX9Py900 + UlFNHdurXq3NuF1iU1O0NHqarQaWW9FS/BVR766OxChhKSQnbp28l36rWIkjwFh1PRskxx7OEIaJM28MbZ39eE8Ll8qrn+boH7vXLi0pP4eLJoO + Cwo5PyRZs/lqAfGTNXlVpfYn4TBWtNxwSn/XV3xc3E7B80EUN+tDHKPtM3hmTwVSgIv5l+tyWhVaRqedOnthGjNJyIDPMk+g5A2LN/HBlUAEBoB + 5IS3TMtLJOsX86BSAQXyPTlFxVKsoed6MZkJAAofuKjdYWHyto2YwRwFGTifXThysohUOymxjBB4BFbRdjmw4eTKKCNobZc85LIutt7cD96CORz + PjNnCy80GGO0a0QCZugi/q5nlFL4dpMzAgIFsmgOWL2dV6kZICm7N9hzKwI1q/72PfQNNsV5ERgIm1eSOKajV+en5mRtCHcpDxPUMSsXxGaHS4I + VUwu6tj4sxzmSzgD0/hsRh+0kVprQBE7Lkxa5ylAOQ1TlG9fgKIDXTAmiB/23rsbvW9wHvjKRJcjhX8diaoOX22liYIIk6HNflDLCGJX09Ac52x + j32VWT1niPTUMIcieo5fN4SfcD7DcZhShmAnToZxxEnRGq+sy7sxn5mh64o6ZGD++FFUryAp4QkbIs8oAU8/mDTc2YG18OuCE6+b70E5+lZwMLh + U6iMhCndxAjHWexJZzO2DwRlJ9QBwOcLtOn+PL1Siruej761vrK6Et1ruhn0ddH8N/tH6CrKAL8o6d8Y/QNBLRTKJLWbka3MORTdNUniKJ8TFrr + AcGP0NOsnTNMzU3sQDLHj7epwBFw/STVSu0f6YH/CDMZ7dhPkHM4WPfyzA5rBLfLw3EJ4wZh7l/KSA5xqS3rqKM/pJqp1tY8lQBCpv/C3Lc7arV + 0Qc+eb2vX4jVmjDzg+jtXQPwdsNqLbd41qnCSIdc4x8A3X84Li58byHDX4C5T/wRotZtC5HNWOeI47QONm4Yz/KuGBC5SseLQC+SwYACHPejyL2 + I465VyxbIZg6s7sK93mndc4u5QoSGbCeHGpmeWn/z6wX+PZV2eglnMNqPOoT9t/TvQrN5kiiPztZp/qTltmNK6eZZdubPFMxD92zFip2moLevdd + arzV3rHsre5HRS3Fn/vqVxjdrtjEOfd+KXbNYhlZ2UidmsVilS1DX035HeoftQAP8+MGlGAEHcDERgdHWhHM83trDndRsF/mtx5gsH+VBHz6R2N + UnXdzOVGf++6R/qli7D8N/KE1u7O6wV3U9O9wQAtn7Lw7Eg2hf634VcBftALmeyP0mAPoEGeo6264YZdeJbLcbs+Wqik8iyWsF7y5jrCah6vHNi + 2d9EFCATFFSJI24e/08n/nw8k7nh+6K/rgdg/ja0cLXQ4gUs8ewY3g48RjgaiLDKSMV1tzSJdxxvdgGbsSvdgbxkG3CXc2T9kJwWoSeGs8hdBNm + B/nhqeCAB2obk/qp+ndMDVsg/1914khS6DIu/lqinnuJ8Rdemxrd7P/qXIZUN8acoJeCrqhCfxPQQlp7HW71JHdqaFRym0W3VYepoayRz85XtuL + vAS8/jqxFIUpCRp3q5KSUY5LFMo75a/uvirhVH/h0bAYxOm42Y8er0dxhR7s/sZASIW3MGxHgYCQHneVqHBavSld9PkJvtgQa7mbMKHm9FAw0dg + Le0ZXFOby3CWkzWOcHwOIVFvXuFLf3fjGZlbuFQ4aly/Xu0bnhfXFT0c3fcLb5yeTJWUtsLLLQVAqe/fkykYI4XCktkjmrfODfpXl5RTOUdRSYA + CMNn/Wc6LGQk2yPT4b+GJvaIpzAo7tgXrK8EwGAH/xNeShDzZ/dxZsP2yfisccT2n/VxkpL4Usrrogwg1LoSLZljvADaLotIToFXxvSU2ySVVx8 + ctbXU8R2wd6s3N/wHQv/DRuGc7CWC7YUCVLL2xDgPyjkskc0vRSCB9KZBd7QFlt+wO621mM+YcrahNlggiuAsFnWQMzezQJJKkUfs1b/zT5dbtc + npvUpA9ZK9chHMUfgVHu8OzH4xKiCxzX6WqnKNMJDbKeW7IDK6O5so5irlyFnoakT5JsafyxQINtvVViA/3xo7w8Xc3KUoiidF7xLQSj8ZG3PhF + TyNi545ab5X4FuiAZoP6EDS9+fnB7c1HQlR8b5nw90tcvq2Jkc/j3QTRmUWqtaW/O6+rEQGmuGVLYdXPvVQpyyoex6p9ePo8o9tmTp8w9KXCaRv + AR9GcRvQQgeJ04LFp8tEEkkSMcJtDd1ha8V+X0YhM1VBK69qGbRZh+ulXKxVUr8hy3A7w5+ia3IaIwLt3EABrsurgkxicJsma43u0A8bBKMDdaI + y9MFHIv6Jx7s48eKafmxORCjVWLQzWDPiNy+Feqbbk2C4FJqnMkfpbTmE/t2Af1LcyhP0xEpbPVqcmkWJiXvyxiNQf0ozpjTXNYlHGopORbqolG + WU+hVEeiyneuNI0LFyMveaPB7/fuXuo3kUYwjH5sEklU6kNzirF8ZJzXSVdvZ3ZWLywpJoQScLRgcXV/PKMCuwbkuTE8SuHggtBLuLTN+c+lmLZ + pqXVn8dS3faATyug8itRdDmRhCFHYOM+907K+P9G4kcLbYeaZbOhW75Uzn1gwL3cMphc50OFk7E/pRRjB9IuouX3aLSrIjz18ZTf+2oiu1VW/Ah + lMhdfcLrlDROT6Einsx3sHRipHNGa+LnwBYnF268t7klkljMFuS0iUCMZL1d+5tCy1PVrJqb9598l10Dyxcnnol2Vo+iQ6MIAt1v/HLslmUyhoH + mPaXUZe7m5aHLM8XOd7CjVSTl6zly+ZvA7Fhvtv1ymU9gZfay5W7DiQTqFnoSa+O8hlHzpPn7Kw4WGXF+KpSZgvElt1B4FCUBmAuGq6D6QPrn6d + EjponWYmV7h0DIApyRRpfbIFN9m662L/x6vOKgwe1Fj1zkEgQQtuxmfBzW/hbogHCuH3gkkfviAT9XNR9qhw38nTV9F/yaCn6X2t0QIRjRSVc6N + 4cy4V2uN+SYBSkgcX0P5J0eXsWuZgPDrF8fom/oKG7xWxLTvFpsOLvWNG9pySJxqMKJYVwrPM59gwrhvaSR40p4JfSYwvd1UVGZPzh5icuhNWj+ + W2M3vsXbhiy3B7cxzX8vcF45v2CqTRYz6WPw4U9rXgnXkFPZJo3f4g9WDf0LnlrZ0/hu/2RyBnKDkgdDdwUdzeEGToOnU8SOL/f/T9eBGnm7RWJ + DvI0N7Bl7q2ovocqfr9+DHZHSOnoVHVwSIhJFwvTGn1pRPgMb8lVWu1rwIKNObQmYGPuKpv3WvPsQfFvwZGbK1uCIoXjId4OSvIOcC7tknKBUsx + hI/eARn5m57WBR/O114F41CI7mRepeSvm/2NGx8u0V7VOdkMC92lEoi+cKNY+oKamFG9LMAiE9Y6niJ9XECRAzNG2lVnbvlcHrb9jAU1WtPWL05 + 8I235LmfyhK/Qwp2ZE3EG4cie40AMO3LYhdEzGTuKlPkCAvrpaKs5skZ6b6Vn08Y01+XFGR6Ie9lOmvFF2VjWNdM4hIz/AQz0C6jUNDqPAkySr1 + OkCTznd+Eo2ol8G1HUb9JNYQs1GOE1OWO7+Cwy1oSvVlremvAAX1FGv8+n/1TMQKXfeH809gejMyzBio/9WOL4X5TBN0WILU2w4B1cU3ERLtzxC + 2zVEWPttb6HfxiMPw5kTd6rW4WjC1epwbUqz25P2RxBe0jQ37PSMpaUN/ZmEIYJ0yU6sqgl+xPBkfFTYEL6Vy2zlw/MgxogKzevgjiTh418v4F+ + ips65TdyKlOlo63h07kPlcpQw9wy+75xYlIRs2sTjvpdsvREzh2elMIP1qh2ezBxH3EIJyMQqTnptNqLKwGQCFs0Y06Fj6EQJrPyNfUW3kgfNB9 + T8nGJrQ2vly3MKvnods26WUdOSdtHNVd8P+7R+jj3QU/YmUig1C+oddspbd7oW526TCAE4qet60dqzMnGjBgdssMOHYz32WDdQ5yZwpkEYdSbAX + 6JKAN21n4NlbJKrfdb8qQCWYVvJ4ddGvPoVRgoMHBiIJymAwi4NyFiB6DsuFZZPVoJJxHhSNUHV+qoZzKifA8QxXKngv+RBrw2aGSBxpbVDWpo/ + nEOq4SHOly/OfxfW/z2FavkuCJahtrdwRyBYuOnJUwzbvsRICiZsJ8VvUnqy05b0CB8a3W3bSeR8uL4WFBuE4VS2vn1RxTR9I9fn/dpfzJpkNyg + 1irLrqyhWSuX4RzqS7pJnGUNj3bgZSGB9Ev7pxuvGKPPLK3Yb1Yt5IHZafqQxlPwStGmh7x5rMFe8q6cLVuq2ALwloVg0FFmST/uXkWSUJF3LRa + olrhooxRGBUbQF0yOy8l1JFD5REfIoWzNTdM1d/lIm5m3b64aVEcU0Boq0wQ1DUxmGkaA/1ih874rhv5G954zSwS5RDYSYzPGRVNbtVcO7C8VnE + U8vtbtEQv9ucM/RBBeCgaAGW9VuOlNk2A7KoBWSTYITmfH6WURrKv74U5wfX03frx9RKJBFf3gVU7uofnbKD8zfqCYrFvQj+vauHF4/3nWJa1ZL + 1RGAXML5gq1265S06CjvsM5dwFgGl0kw3Y2gIiulGPTZhh+zKvMPXUCjcdfCyDbd5QpRBikJEaIMlwvlyH7zCcGsbzViVTU5DBiOL9F8p5lvNI8 + disdEgDeL58n0YhLPd/vcndRcTmEwutK71ynu9fyRJrbAKGdFWbgGpOoOVsBeecn+/QtqD4Psk10R+9SMyj6hiQSYm/FkObmL5YrqZJSqjYEP59 + Lzc8Ms+5wv2U84JduUC0Is1HP2JsVNH8gn4wsj5zpSfxOHHIQZYcX/0FNXi1BOoF0UBo7avQgOCskvvyDLAwZRp9HGo71hASzxki0KgUj8r2Rpb + e7svdD5dThLdzTQ5eTfLihUAuPSz2xaScYdtmd/vzJZS/AdeCXB+xD3xO+iZum4HkfQQF71auHLeBxjwU6qSqoJlB21yuzuM7nx1wk9/1hAu8W2 + RjdHrlKF3ycaG7QxZxbe+psb1lqb28QqAni/fc9RXWRVYitW6v4WPTUrNDswrOeVv0op8SKJaOPPYMERS/ujEWN+r6sAtZ5m5VB7VhdREkEF2HB + AqIW8kocsBajpEZb3kdiR2vwasFRmoMV6oUYgIEhxQkXqNatcjdJuR3JcrkjN0ZdpZw5cMVaBYFCFq0B9bawas48Jag7WdbuiHc7PPqh76ZenGp + yD3HCY8wsTq1kX81fEImZUXH25dYPQYKoLS6eGtNXWZKj4vOuig88zJF/gaZQv72Sv1Aimk0ZyRDVtOFsbzcjGdjER2UNlMd4jCLoT+qG0f6z6E + ufS111BJhGlL+HPyEMtnx2ingFUVjixOo5ynGrbNuKXOTLFVbF8vzQKrjyVQLkshaYEP/wla6bVBp/jLFC5+k5FioyvJbSxDsV2LxpMSpqCJUUl + BORwMoQezSjSObmy2g5U92U2p5eGALCvpw9Jyp7+qKOVeOUYDV4FNltdslsv9XpQj1uR3OUSG27ZSVZRIjG4gXjkA/xetsFCqP5fGbH4nsSb3/u + tQO8FAw5jBm8qwFPArI15NlCrerAXs3ASwMzyFQGQR0njQQJkWMdqNJ/Jt2gRftnawu65WhuUQZfUY6EdTHpOWdB1LgEEctrpmA6PI+eXofWIrD + GqInurgMx1yAcfzhI93kgMlhluKrGmhvHiiGWL79d1NhgAGLlxhAEC8ukZZc8BBspPVjoQC76ApiQeKJWJ+tIJgTn0M3IG0kRD8tAldVtuecJpR + OTnyT/7zGSga3oPYD89PkeUYt5Hn9i6+jyd28d3c0tNcrMVR7bk0p0WMeAqMnCAQpiKB6Witpp1WioQMUH5n/idtigb6rlTSlBPnaonPDigdlqM + k/FamqbacblZjDqylf717Ba+Cqg0ijCKC3QghfnxnZMic7bm1mEP8gKpfLvPj/K4GOC1cYRUGyi+sRIxziI+2gAEfjoZ8ACHm09tMdS2VOB2ps/ + HN5dVt2OHRmArhlbRl+eCyakF/AiP+DkSs+tXDNJQrjKCNpumkbKodi51AWP8MXww6gQulxwBgE4V6L1TAadzCAUOPlJEPcVssf9m2cn5htMnIX + vnWN8FKh3mrbOQdLHX0QRxT64qQdcOpNtdDS5DXFG5QtFvCnDSPTQPa38t39mUzEAAtPkZnTJp1eF4fGOILgsceW084SNMUjuVrU6yCe9LjT6GJ + V3BGFl1ByDV5Rs2vuq/g7oIdf7E/stskOS//6ypWAQ2Yutyw5aHoNYeRf4eWf+dE0hVbzmCcTOO8rZmkvpYxiHf3YplEPuAe86ZSrCBMiAF2gMO + ffWvEEELhFU4BlSNIkLbBZz6s9rHT9X/MtuQb9UVqGoawWPgaSgCuskgTQwioBr3p2p8shGDSEOdkkdfnmPvkM/bvXv5/yxQDKcY4dBDZHnwNNB + 7iaQlBShqRKTntjF5hCP9m0SsbCThV8JCRveLvgKffC2KeW5RAJgRD8aMso9BkewEvBj9tdss9thUj/lGG+b/rY6rzQvO6dHdeUrCOlURa4vCiJ + CZIBEJPrC7zs/+vm/lH14WKe7vl1I7c6bygDdjpVXe0cLYkrjuMl2EqAKId16MeznAodNwAVWiCq5J0AYJ6GNWTVNnqOl1ftUFWeMkcS8w/787O + nNaIVk5xrHbZz6J7GfqnmKW28ZuLammVGERWePxc7aIYE6Wd0bnZK3NVuFkbZHMxRrTHnhHT28dunqjfBuGPPDaBsWDD+xqq5OD1Hlg3SHOcIfK + x2UWJ9lB8/xi+0JUYHJ6Q3HNIB/jLIOHR+TNhnjF8FPCsxxzEOU8QYGWPCpl5P+mvCYOR5M/mf0sCLoIEX1n+CymLqMFP9XqYmtGlKtZlW/kQc6 + 8c/GKLOXPZtxF2VngIxHmE8uytuOVL4z8Y1EtXNHuvaCJHoK6UW12/Emu0L1GBo3ASv1xIi2PR1+ZFcco3oZRcL48h7/32tm9FPSf+6yFrXjoGz + jTIUakuk+Id02wwbpYZN1zNkf8nXI3ACnVJfoaNseYXheGwPOcwIjJl+eYbQ8V0QJqzKFnBAbbctx0Vw8RBRFQMTH22b6n0UAJ7YqknnTzPxiEW + /h3VjcD74Khb5Hie2+C42MWcADzuUlg5jWTjsWfgqWkU1P+GtT9iJwfL346E9CU6u6FQNXSi7G1z88nTbYxN+hfyOA3iJE/hc9swDVCUYL8ZyQe + 4jL3NwgAgrwVyY7bYkpaNDxCa+qpow5+uAZdoub5skT4fKrVc6affNBRIKWGQunPYam4kNUwwV7P9FQPn3YgZ7DYF/EGo6hMea8pOW/ac0Fb3nG + +tvIqdFosDuD2NNgQGL8Qu5cnJzPLC/h2xS0JSdilWIkhZ3O5ec9A3ijeTmmzUHKYUA4j3ERISQCmD04Diyge1W19Olrsl4Z/V7/rq5jkQiG0ZK + wa0lgLsJYZwIuG82xMzJjebzc6KrjrmyC1449zeBBWDxd4GumU5NuUzuN6jsAFdefTU2TAz5DOS0lotOOCRdqW45yFYwMLDyFWXmYgXbvHNrH6p + KZsqE7EfwMP1ErmZOlncL4PzuT521F1Ui+2dEob9RK0g1mCuYSjHf0RMgjLSmVCiqwFoS882xvvlCqKlbnaDHlIdFBztwCr+pFj3r59b7p+1BmL + k1BRWBbIqlqCEVJm0oqkL5y4H28FWWwZxlFN9zbl73gQbPVHX3dhoPnjoxwYxgCaHR3OrS4uri6DLPykGNJePHWdKOn9is8ueMJmocH35eIYCUO + IAFEey5GfFAFfbvzV0m6BUmL1IBDngs5uIUrcpZ6FTAYgpYcIfvjJcEv7lMERQgyCXM3/RCOJE61oaDssneYU18TJYsHI8b7zopMLyTDb/RfuxM + A1L5CVRKZ4niiU07GGjnSDy/W6n9nmmXNC129ZsP+M7+W+kJzp+laHq/OHWeDUhJ9OiIqhG8TjMVgeM1j00X8Ve0ASHwC/Rb0RlOAqOPpT7rqhn + FS4QDeLgLYVLtlxlLoTu2VXkpTchHxbg55oKFaAyg7ULzovZ7b8YfEEnvNLbObf9KYqKGwNZGVzT7ZXT/GCUsD62iiL9ey/J1bVevmz2QRQ3cpG + NtMy602cc73PVofnvhRkX3HBJrrx24KKAJdf8Jh/KlvpiFrwmfsiFFIBV/HpJnXpfO78iO6DvxOYopU2O6zFpok6UiDUF5j2x/p3e0A/hO/jmpJ + wfTX9+q35vzFfexggzH0KA7aG8i5DaE+E2qrgras6dpwRWmpzVyX1hNbV8ZENNnTz`, + SecurityTrailer: { + AdyenCryptoVersion: 1, + Hmac: "l+5/pYiAbC0V9Xx78ELNDcLMaqTlqx2OyGha37i/g5g=", + KeyIdentifier: "CryptoKeyIdentifier12345", + KeyVersion: 1, + Nonce: "9iiJMpzKfYs3106ozIKNFQ==", + }, + }, +}); diff --git a/src/__mocks__/terminalApi/sync.ts b/src/__mocks__/terminalApi/sync.ts new file mode 100644 index 0000000..e983a26 --- /dev/null +++ b/src/__mocks__/terminalApi/sync.ts @@ -0,0 +1,329 @@ +export const syncRes = JSON.stringify({ + SaleToPOIResponse: { + MessageHeader: { + MessageCategory: "Payment", + MessageClass: "Service", + MessageType: "Response", + POIID: "P400Plus-123456789", + ProtocolVersion: "3.0", + SaleID: "001", + ServiceID: "1234567890", + }, + PaymentResponse: { + POIData: { + POIReconciliationID: "1000", + POITransactionID: { + TimeStamp: "2019-04-29T00:00:00.000Z", + TransactionID: "4r7i001556529591000.8515565295894301", + }, + }, + + PaymentReceipt: [ + { + DocumentQualifier: "CashierReceipt", + OutputContent: { + OutputFormat: "Text", + OutputText: [ + { + CharacterStyle: "Bold", + EndOfLineFlag: true, + Text: "key=header1", + }, + { + CharacterStyle: "Bold", + EndOfLineFlag: true, + Text: "key=header2", + }, + { + CharacterStyle: "Bold", + EndOfLineFlag: true, + Text: "name=MERCHANT%20COPY&key=merchantTitle", + }, + { + EndOfLineFlag: true, + Text: "key=filler", + }, + { + EndOfLineFlag: true, + Text: "name=Date&value=29%2f04%2f19&key=txdate", + }, + { + EndOfLineFlag: true, + Text: "name=Time&value=10%3a19%3a51&key=txtime", + }, + { + EndOfLineFlag: true, + Text: "key=filler", + }, + { + EndOfLineFlag: true, + Text: "name=Card&value=%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a3511&key=pan", + }, + { + EndOfLineFlag: true, + Text: "name=Pref.%20name&value=MCC%20351%20v1%202&key=preferredName", + }, + { + EndOfLineFlag: true, + Text: "name=Card%20type&value=mc&key=cardType", + }, + { + EndOfLineFlag: true, + Text: "name=Payment%20method&value=mc&key=paymentMethod", + }, + { + EndOfLineFlag: true, + Text: "name=Payment%20variant&value=mc&key=paymentMethodVariant", + }, + { + EndOfLineFlag: true, + Text: "name=Entry%20mode&value=Contactless%20swipe&key=posEntryMode", + }, + { + EndOfLineFlag: true, + Text: "key=filler", + }, + { + EndOfLineFlag: true, + Text: "name=AID&value=A0000000041010&key=aid", + }, + { + EndOfLineFlag: true, + Text: "name=MID&value=1000&key=mid", + }, + { + EndOfLineFlag: true, + Text: "name=TID&value=P400Plus-275039202&key=tid", + }, + { + EndOfLineFlag: true, + Text: "name=PTID&value=75039202&key=ptid", + }, + { + EndOfLineFlag: true, + Text: "key=filler", + }, + { + EndOfLineFlag: true, + Text: "name=Auth.%20code&value=123456&key=authCode", + }, + { + EndOfLineFlag: true, + Text: "name=Tender&value=4r7i001556529591000&key=txRef", + }, + { + EndOfLineFlag: true, + Text: "name=Reference&value=003&key=mref", + }, + { + EndOfLineFlag: true, + Text: "key=filler", + }, + { + EndOfLineFlag: true, + Text: "name=Type&value=GOODS_SERVICES&key=txtype", + }, + { + CharacterStyle: "Bold", + EndOfLineFlag: true, + Text: "name=TOTAL&value=%e2%82%ac%c2%a01.00&key=totalAmount", + }, + { + EndOfLineFlag: true, + Text: "key=filler", + }, + { + CharacterStyle: "Bold", + EndOfLineFlag: true, + Text: "name=APPROVED&key=approved", + }, + ], + }, + RequiredSignatureFlag: false, + }, + { + DocumentQualifier: "CustomerReceipt", + OutputContent: { + OutputFormat: "Text", + OutputText: [ + { + CharacterStyle: "Bold", + EndOfLineFlag: true, + Text: "key=header1", + }, + { + CharacterStyle: "Bold", + EndOfLineFlag: true, + Text: "key=header2", + }, + { + CharacterStyle: "Bold", + EndOfLineFlag: true, + Text: "name=CARDHOLDER%20COPY&key=cardholderHeader", + }, + { + EndOfLineFlag: true, + Text: "key=filler", + }, + { + EndOfLineFlag: true, + Text: "name=Date&value=29%2f04%2f19&key=txdate", + }, + { + EndOfLineFlag: true, + Text: "name=Time&value=10%3a19%3a51&key=txtime", + }, + { + EndOfLineFlag: true, + Text: "key=filler", + }, + { + EndOfLineFlag: true, + Text: "name=Card&value=%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a3511&key=pan", + }, + { + EndOfLineFlag: true, + Text: "name=Pref.%20name&value=MCC%20351%20v1%202&key=preferredName", + }, + { + EndOfLineFlag: true, + Text: "name=Card%20type&value=mc&key=cardType", + }, + { + EndOfLineFlag: true, + Text: "name=Payment%20method&value=mc&key=paymentMethod", + }, + { + EndOfLineFlag: true, + Text: "name=Payment%20variant&value=mc&key=paymentMethodVariant", + }, + { + EndOfLineFlag: true, + Text: "name=Entry%20mode&value=Contactless%20swipe&key=posEntryMode", + }, + { + EndOfLineFlag: true, + Text: "key=filler", + }, + { + EndOfLineFlag: true, + Text: "name=AID&value=A0000000041010&key=aid", + }, + { + EndOfLineFlag: true, + Text: "name=MID&value=1000&key=mid", + }, + { + EndOfLineFlag: true, + Text: "name=TID&value=P400Plus-275039202&key=tid", + }, + { + EndOfLineFlag: true, + Text: "name=PTID&value=75039202&key=ptid", + }, + { + EndOfLineFlag: true, + Text: "key=filler", + }, + { + EndOfLineFlag: true, + Text: "name=Auth.%20code&value=123456&key=authCode", + }, + { + EndOfLineFlag: true, + Text: "name=Tender&value=4r7i001556529591000&key=txRef", + }, + { + EndOfLineFlag: true, + Text: "name=Reference&value=003&key=mref", + }, + { + EndOfLineFlag: true, + Text: "key=filler", + }, + { + EndOfLineFlag: true, + Text: "name=Type&value=GOODS_SERVICES&key=txtype", + }, + { + CharacterStyle: "Bold", + EndOfLineFlag: true, + Text: "name=TOTAL&value=%e2%82%ac%c2%a01.00&key=totalAmount", + }, + { + EndOfLineFlag: true, + Text: "key=filler", + }, + { + CharacterStyle: "Bold", + EndOfLineFlag: true, + Text: "name=APPROVED&key=approved", + }, + { + EndOfLineFlag: true, + Text: "key=filler", + }, + { + EndOfLineFlag: true, + Text: "name=Please%20retain%20for%20your%20records&key=retain", + }, + { + EndOfLineFlag: true, + Text: "name=Thank%20you&key=thanks", + }, + ], + }, + RequiredSignatureFlag: false, + }, + ], + PaymentResult: { + AmountsResp: { + AuthorizedAmount: 1, + Currency: "EUR", + }, + OnlineFlag: true, + PaymentAcquirerData: { + AcquirerPOIID: "P400Plus-123456789", + AcquirerTransactionID: { + TimeStamp: "2019-04-29T09:19:51.000Z", + TransactionID: "8515565295894301", + }, + ApprovalCode: "123456", + MerchantID: "TestMerchant", + }, + PaymentInstrumentData: { + CardData: { + EntryMode: [ + "Tapped", + ], + MaskedPan: "411111 **** 1111", + PaymentBrand: "mc", + SensitiveCardData: { + ExpiryDate: "1225", + }, + }, + PaymentInstrumentType: "Card", + }, + }, + Response: { + AdditionalResponse: `tid=75039202&AID=A0000000041010&transactionType=GOODS_SERVICES&backendGiftcardIndi + cator=false&expiryYear=2025&acquirerAccountCode=TestPmmAcquirerAccount&alias=M900978995070104&posOrigin + alAmountCurrency=EUR&giftcardIndicator=false&authorisedAmountValue=100&pspReference=8515565295894301&pa + ymentMethodVariant=mc&cardHolderName=N%2fA&refusalReasonRaw=APPROVED&authorisationMid=1000&expiryDate=1 + 2%2f2025&applicationPreferredName=MCC%20351%20v1%202&acquirerCode=TestPmmAcquirer&txtime=10%3a19%3a51&i + so8601TxDate=2019-04-29T09%3a19%3a51.0000000%2b0000&cardType=mc&posOriginalAmountValue=100&offline=fals + e&aliasType=Default&txdate=29-04-2019&paymentMethod=mc&cvcResult=0%20Unknown&avsResult=0%20Unknown&mid= + 1000&merchantReference=003&transactionReferenceNumber=8515565295894301&expiryMonth=12&cardSummary=3511& + posTotalAmountValue=100&posAuthAmountCurrency=EUR&cardHolderVerificationMethodResults=3F0300&authCode=1 + 23456&shopperCountry=NL&posEntryMode=CLESS_SWIPE&cardScheme=mc&cardBin=541333&posAuthAmountValue=100`, + Result: "Success", + }, + SaleData: { + SaleTransactionID: { + TimeStamp: "2019-04-29T00:00:00.000Z", + TransactionID: "001", + }, + }, + }, + }, +}); diff --git a/src/__tests__/binLookup.spec.ts b/src/__tests__/binLookup.spec.ts new file mode 100644 index 0000000..f664875 --- /dev/null +++ b/src/__tests__/binLookup.spec.ts @@ -0,0 +1,116 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 { createMockClientFromResponse } from "../__mocks__/base"; +import BinLookup from "../service/binLookup"; +import {CostEstimateRequest, ThreeDSAvailabilityRequest, ThreeDSAvailabilityResponse} from "../typings/binLookup"; + +const threeDSAvailabilitySuccess = { + dsPublicKeys: [{ + brand: "visa", + directoryServerId: "F013371337", + publicKey: "eyJrdHkiOiJSU0EiLCJlIjoiQVFBQiIsIm4iOiI4VFBxZkFOWk4xSUEzcHFuMkdhUVZjZ1g4LUpWZ1Y0M2diWURtYmdTY0N5SkVSN3lPWEJqQmQyaTBEcVFBQWpVUVBXVUxZU1FsRFRKYm91bVB1aXVoeVMxUHN2NTM4UHBRRnEySkNaSERkaV85WThVZG9hbmlrU095c2NHQWtBVmJJWHA5cnVOSm1wTTBwZ0s5VGxJSWVHYlE3ZEJaR01OQVJLQXRKeTY3dVlvbVpXV0ZBbWpwM2d4SDVzNzdCR2xkaE9RUVlQTFdybDdyS0pLQlUwNm1tZlktUDNpazk5MmtPUTNEak02bHR2WmNvLThET2RCR0RKYmdWRGFmb29LUnVNd2NUTXhDdTRWYWpyNmQyZkppVXlqNUYzcVBrYng4WDl6a1c3UmlxVno2SU1qdE54NzZicmg3aU9Vd2JiWmoxYWF6VG1GQ2xEb0dyY2JxOV80Nnc9PSJ9" + }], + threeDS1Supported: true, + threeDS2CardRangeDetails: [{ + brandCode: "visa", + endRange: "411111111111", + startRange: "411111111111", + threeDS2Version: "2.1.0", + threeDSMethodURL: "https://pal-test.adyen.com/threeds2simulator/acs/startMethod.shtml" + }], + threeDS2supported: true +}; + +describe("Bin Lookup", function (): void { + it("should succeed on get 3ds availability", async function (): Promise { + const client = createMockClientFromResponse(JSON.stringify(threeDSAvailabilitySuccess)); + const binLookup = new BinLookup(client); + + const threeDSAvailabilityRequest: ThreeDSAvailabilityRequest = { + merchantAccount: client.config.merchantAccount, + brands: ["randomBrand"], + cardNumber: "4111111111111111" + }; + + const { + dsPublicKeys, + threeDS2CardRangeDetails, + threeDS1Supported + }: ThreeDSAvailabilityResponse = await binLookup.get3dsAvailability(threeDSAvailabilityRequest); + expect(dsPublicKeys[0].brand).toEqual("visa"); + expect(threeDS2CardRangeDetails[0].brandCode).toEqual("visa"); + expect(threeDS1Supported).toEqual(true); + }); + + it("should have invalid merchant", async function (): Promise { + const client = createMockClientFromResponse(JSON.stringify({ + status: 403, + errorCode: "901", + message: "Invalid Merchant Account", + errorType: "security" + }), {code: 403}); + const binLookup = new BinLookup(client); + + const threeDSAvailabilityRequest: ThreeDSAvailabilityRequest = { + merchantAccount: undefined, + cardNumber: "4111111111111", + brands: [] + }; + + try { + await binLookup.get3dsAvailability(threeDSAvailabilityRequest); + fail("Expected request to fail"); + } catch (e) { + expect(e.statusCode).toEqual(403); + expect(JSON.parse(e.message).errorCode).toEqual("901"); + } + }); + + it("should succeed on get cost estimate", async function (): Promise { + const client = createMockClientFromResponse(JSON.stringify({ + cardBin: {summary: "1111"}, + resultCode: "Unsupported", + surchargeType: "ZERO" + })); + const binLookup = new BinLookup(client); + const costEstimateRequest: CostEstimateRequest = { + amount: { currency: "EUR", value: 1000 }, + assumptions: { + assumeLevel3Data: true, + assume3DSecureAuthenticated: true + }, + cardNumber: "411111111111", + merchantAccount: client.config.merchantAccount, + merchantDetails: { + countryCode: "NL", + mcc: "7411", + enrolledIn3DSecure: true + }, + shopperInteraction: "Ecommerce" + }; + + const {cardBin, resultCode, surchargeType} = await binLookup.getCostEstimate(costEstimateRequest); + + expect(cardBin.summary).toEqual("1111"); + expect(resultCode).toEqual("Unsupported"); + expect(surchargeType).toEqual("ZERO"); + }); +}); \ No newline at end of file diff --git a/src/__tests__/checkout.spec.ts b/src/__tests__/checkout.spec.ts new file mode 100644 index 0000000..68e45e5 --- /dev/null +++ b/src/__tests__/checkout.spec.ts @@ -0,0 +1,267 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 { createMockClientFromResponse } from "../__mocks__/base"; +import {paymentMethodsError} from "../__mocks__/checkout/paymentmethodsErrorForbidden403"; +import {paymentMethodsSuccess} from "../__mocks__/checkout/paymentMethodsSuccess"; +import {paymentsError} from "../__mocks__/checkout/paymentsErrorInvalidData422"; +import {paymentsSuccess} from "../__mocks__/checkout/paymentsSuccess"; +import {paymentDetailsError} from "../__mocks__/checkout/paymentsDetailsErrorInvalidData422"; +import {paymentDetailsSuccess} from "../__mocks__/checkout/paymentsDetailsSuccess"; +import {paymentSessionError} from "../__mocks__/checkout/paymentSessionErrorInvalidData422"; +import {paymentSessionSuccess} from "../__mocks__/checkout/paymentSessionSucess"; +import {paymentsResultError} from "../__mocks__/checkout/paymentsResultErrorInvalidDataPayload422"; +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 "../service/checkout"; +import { + Amount, + DetailsRequest, + PaymentMethodsRequest, + PaymentRequest, + PaymentResponse, + PaymentSetupRequest, PaymentVerificationRequest +} from "../typings/checkout"; + +function createAmountObject(currency: string, value: number): Amount { + return { + currency, + value, + }; +} + +function createPaymentsDetailsRequest(): DetailsRequest { + return { + details: { + MD: "mdValue", + PaRes: "paResValue", + }, + paymentData: "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...", + }; +} + +function createPaymentsCheckoutRequest(): PaymentRequest { + const paymentMethodDetails = { + cvc: "737", + expiryMonth: "10", + expiryYear: "2018", + holderName: "John Smith", + number: "4111111111111111", + type: TYPE_SCHEME, + }; + + return { + amount: createAmountObject("USD", 1000), + merchantAccount: "MagentoMerchantTest", + paymentMethod: paymentMethodDetails, + reference: "Your order number", + returnUrl: "https://your-company.com/...", + }; +} + +function createPaymentSessionRequest(): PaymentSetupRequest { + return { + amount: createAmountObject("USD", 1000), + countryCode: "NL", + merchantAccount: "MagentoMerchantTest", + reference: "Your order number", + returnUrl: "https://your-company.com/...", + }; +} + +describe("Checkout", (): void => { + it("should make a payment", async (): Promise => { + const client: Client = createMockClientFromResponse(paymentsSuccess); + const checkout: Checkout = new Checkout(client); + const paymentsRequest: PaymentRequest = createPaymentsCheckoutRequest(); + const paymentsResponse: PaymentResponse = await checkout.payments(paymentsRequest); + expect(paymentsResponse.pspReference).toEqual("8535296650153317"); + }); + + it("should not make a payment", async (): Promise => { + const client: Client = createMockClientFromResponse(paymentsError); + const checkout: Checkout = new Checkout(client); + const paymentsRequest: PaymentRequest = createPaymentsCheckoutRequest(); + const paymentsResponse: PaymentResponse = await checkout.payments(paymentsRequest); + expect(paymentsResponse.pspReference).toBeUndefined(); + }); + + it("should have valid payment methods", async (): Promise => { + const client = createMockClientFromResponse(paymentMethodsSuccess); + const checkout: Checkout = new Checkout(client); + const paymentMethodsRequest: PaymentMethodsRequest = { + merchantAccount: "MagentoMerchantTest", + }; + const paymentMethodsResponse = await checkout.paymentMethods(paymentMethodsRequest); + expect(paymentMethodsResponse.paymentMethods.length).toEqual(65); + expect(paymentMethodsResponse.paymentMethods[0].name).toEqual("AliPay"); + }); + + it("should not have valid payment methods", async (): Promise => { + const client = createMockClientFromResponse(paymentMethodsError); + const checkout: Checkout = new Checkout(client); + const paymentMethodsRequest: PaymentMethodsRequest = { + merchantAccount: "MagentoMerchantTest", + }; + const paymentMethodsResponse = await checkout.paymentMethods(paymentMethodsRequest); + expect(paymentMethodsResponse.paymentMethods).toBeUndefined(); + }); + + it("should have payment details", async (): Promise => { + const client: Client = createMockClientFromResponse(paymentDetailsSuccess); + const checkout: Checkout = new Checkout(client); + const paymentsResponse = await checkout.paymentsDetails(createPaymentsDetailsRequest()); + expect(paymentsResponse.resultCode).toEqual("Authorised"); + }); + + it("should not have payment details", async (): Promise => { + const client: Client = createMockClientFromResponse(paymentDetailsError); + const checkout: Checkout = new Checkout(client); + const paymentsResponse = await checkout.paymentsDetails(createPaymentsDetailsRequest()); + expect(paymentsResponse.resultCode).toBeUndefined(); + }); + + it("should have payment session success", async (): Promise => { + const client: Client = createMockClientFromResponse(paymentSessionSuccess); + const checkout: Checkout = new Checkout(client); + const paymentSessionRequest: PaymentSetupRequest = createPaymentSessionRequest(); + const paymentSessionResponse = await checkout.paymentSession(paymentSessionRequest); + expect(paymentSessionResponse.paymentSession).not.toBeUndefined(); + }); + + it("should not have payment session success", async (): Promise => { + const client: Client = createMockClientFromResponse(paymentSessionError); + const checkout: Checkout = new Checkout(client); + const paymentSessionRequest: PaymentSetupRequest = createPaymentSessionRequest(); + const paymentSessionResponse = await checkout.paymentSession(paymentSessionRequest); + expect(paymentSessionResponse.paymentSession).toBeUndefined(); + }); + + it("should have payments result", async (): Promise => { + const client = createMockClientFromResponse(paymentsResultSuccess); + const checkout = new Checkout(client); + const paymentResultRequest: PaymentVerificationRequest = { + payload: "This is a test payload", + }; + const paymentResultResponse = await checkout.paymentResult(paymentResultRequest); + expect(paymentResultResponse.resultCode).toEqual("Authorised"); + }); + + it("should not have payments result", async (): Promise => { + const client = createMockClientFromResponse(paymentsResultError); + const checkout = new Checkout(client); + const paymentResultRequest: PaymentVerificationRequest = { + payload: "This is a test payload", + }; + const paymentResultResponse = await checkout.paymentResult(paymentResultRequest); + expect(paymentResultResponse.resultCode).toBeUndefined(); + }); + + it("should have missing identifier on live", async (): Promise => { + const client = createMockClientFromResponse(paymentsResultError); + client.setEnvironment("TEST"); + try { + new Checkout(client); + } 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."); + } + }); + + it("should have custom payment details", async (): Promise => { + const paymentsRequest = createPaymentsCheckoutRequest(); + expect(JSON.parse("{\n" + + " \"amount\": {\n" + + " \"value\": 1000,\n" + + " \"currency\": \"USD\"\n" + + " },\n" + + " \"merchantAccount\": \"MagentoMerchantTest\",\n" + + " \"paymentMethod\": {\n" + + " \"type\": \"scheme\",\n" + + " \"number\": \"4111111111111111\",\n" + + " \"expiryMonth\": \"10\",\n" + + " \"expiryYear\": \"2018\",\n" + + " \"holderName\": \"John Smith\",\n" + + " \"cvc\": \"737\"\n" + + " },\n" + + " \"reference\": \"Your order number\",\n" + + " \"returnUrl\": \"https://your-company.com/...\"\n" + + "}")).toEqual(paymentsRequest); + + paymentsRequest.paymentMethod = { + testKey: "testValue", + type: "testType", + }; + + expect(JSON.parse("{\n" + + " \"amount\": {\n" + + " \"value\": 1000,\n" + + " \"currency\": \"USD\"\n" + + " },\n" + + " \"merchantAccount\": \"MagentoMerchantTest\",\n" + + " \"paymentMethod\": {\n" + + " \"testKey\": \"testValue\",\n" + + " \"type\": \"testType\"\n" + + " },\n" + + " \"reference\": \"Your order number\",\n" + + " \"returnUrl\": \"https://your-company.com/...\"\n" + + "}")).toEqual(JSON.parse(JSON.stringify(paymentsRequest))); + }); + + it("should succeed on multibanco payment", async (): Promise => { + const client: Client = createMockClientFromResponse(paymentsResultMultibancoSuccess); + const checkout: Checkout = new Checkout(client); + const paymentsRequest: PaymentRequest = createPaymentsCheckoutRequest(); + const paymentsResponse: 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"); + }); + + it("should return sepa payment method details", async (): Promise => { + const defaultPaymentMethods = { + sepaIbanNumber: "DE87123456781234567890", + sepaOwnerName: "A. Schneider", + type: "sepadirectdebit", + }; + + const paymentsRequest = createPaymentsCheckoutRequest(); + paymentsRequest.paymentMethod = defaultPaymentMethods; + + expect(JSON.parse("{\n" + + " \"amount\": {\n" + + " \"value\": 1000,\n" + + " \"currency\": \"USD\"\n" + + " },\n" + + " \"merchantAccount\": \"MagentoMerchantTest\",\n" + + " \"paymentMethod\": {\n" + + " \"type\": \"sepadirectdebit\",\n" + + " \"sepaOwnerName\": \"A. Schneider\",\n" + + " \"sepaIbanNumber\": \"DE87123456781234567890\"\n" + + " },\n" + + " \"reference\": \"Your order number\",\n" + + " \"returnUrl\": \"https://your-company.com/...\"\n" + + "}")).toEqual(JSON.parse(JSON.stringify(paymentsRequest))); + }); +}); + diff --git a/src/__tests__/checkoutUtility.spec.ts b/src/__tests__/checkoutUtility.spec.ts new file mode 100644 index 0000000..e5f0236 --- /dev/null +++ b/src/__tests__/checkoutUtility.spec.ts @@ -0,0 +1,17 @@ +import { createMockClientFromResponse } from "../__mocks__/base"; +import {originKeysSuccess} from "../__mocks__/checkoutUtility/originkeysSuccess"; +import CheckoutUtility from "../service/checkoutUtility"; +import {CheckoutUtilityRequest} from "../typings/checkoutUtility"; + +describe("Checkout Utility", (): void => { + it("should get origin keys", async (): Promise => { + const client = createMockClientFromResponse(originKeysSuccess); + const checkoutUtility = new CheckoutUtility(client); + const originKeysRequest: CheckoutUtilityRequest = { + originDomains: ["www.test.com", "https://www.your-domain2.com"], + }; + const originKeysResponse = await checkoutUtility.originKeys(originKeysRequest); + expect(originKeysResponse.originKeys["https://www.your-domain1.com"]) + .toEqual("pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4xLmNvbQ.UEwIBmW9-c_uXo5wSEr2w8Hz8hVIpujXPHjpcEse3xI"); + }); +}); diff --git a/src/__tests__/notification.spec.ts b/src/__tests__/notification.spec.ts new file mode 100644 index 0000000..4711896 --- /dev/null +++ b/src/__tests__/notification.spec.ts @@ -0,0 +1,65 @@ +import authorisationTrue from "../__mocks__/notification/authorisationTrue.json"; +import captureTrue from "../__mocks__/notification/captureTrue.json"; +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"; + +describe("Notification Test", function (): void { + it("should return authorisation success", function (): void { + const notificationRequest = new NotificationRequest(authorisationTrue); + 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"); + }); + + it("should return capture success", function (): void { + const notificationRequest = new NotificationRequest(captureTrue); + 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"); + }); + + it("should return capture fail", function (): void { + const notificationRequest = new NotificationRequest(captureFalse); + 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"); + }); + + it("should return refund success", function (): void { + const notificationRequest = new NotificationRequest(refundTrue); + 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(); + }); + + it("should return refund fail", function (): void { + const notificationRequest = new NotificationRequest(refundFalse); + 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(); + }); +}); \ No newline at end of file diff --git a/src/__tests__/payout.spec.ts b/src/__tests__/payout.spec.ts new file mode 100644 index 0000000..3d2cb43 --- /dev/null +++ b/src/__tests__/payout.spec.ts @@ -0,0 +1,139 @@ +import { createMockClientFromResponse } from "../__mocks__/base"; +import Payout from "../service/payout"; +import { + ModifyRequest, + StoreDetailAndSubmitRequest, + StoreDetailRequest, SubmitRequest +} from "../typings/payout"; +import { FRAUD_MANUAL_REVIEW, FRAUD_RESULT_TYPE } from "../typings/constants/apiConstants"; + +const storeDetailAndSubmitThirdParty = JSON.stringify({ + additionalData: { + fraudResultType: "GREEN", + fraudManualReview: "false", + + }, + pspReference: "8515131751004933", + resultCode: "[payout-submit-received]" +}); + +const storeDetail = JSON.stringify({ + pspReference: "8515136787207087", + recurringDetailReference: "8415088571022720", + resultCode: "Success" +}); + + +const amountAndReference = { + amount: { + value: 1000, + currency: "USD" + }, + reference: "randomReference", +}; + +const defaultData = { + dateOfBirth: new Date(), + nationality: "NL", + shopperEmail: "johndoe@email.com", + shopperReference: "shopperReference", +}; + +const mockStoreDetailRequest = (merchantAccount: string): StoreDetailRequest => ({ + ...defaultData, + entityType: "NaturalPerson", + recurring: { + contract: "ONECLICK" + }, + merchantAccount, +}); + +const mockSubmitRequest = (merchantAccount: string): SubmitRequest => ({ + selectedRecurringDetailReference: "LATEST", + recurring: { + contract: "ONECLICK" + }, + ...defaultData, + ...amountAndReference, + merchantAccount, +}); + +const mockStoreDetailAndSubmitRequest = (merchantAccount: string): StoreDetailAndSubmitRequest => ({ + ...amountAndReference, + ...(mockStoreDetailRequest(merchantAccount)), +}); + + +describe("PayoutTest", function (): void { + it("should succeed on store detail and submit third party", async function (): Promise { + const client = createMockClientFromResponse(storeDetailAndSubmitThirdParty); + const payout = new Payout(client); + + const request: StoreDetailAndSubmitRequest = mockStoreDetailAndSubmitRequest(client.config.merchantAccount); + + 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"); + }); + + it("should succeed on store detail", async function (): Promise { + const client = createMockClientFromResponse(storeDetail); + const payout = new Payout(client); + + const request: StoreDetailRequest = mockStoreDetailRequest(client.config.merchantAccount); + const result = await payout.storeDetail(request); + + expect("Success").toEqual(result.resultCode); + expect("8515136787207087").toEqual(result.pspReference); + expect("8415088571022720").toEqual(result.recurringDetailReference); + }); + + it("should succeed on confirm third party", async function (): Promise { + const client = createMockClientFromResponse(JSON.stringify({ + pspReference: "8815131762537886", + response: "[payout-confirm-received]" + })); + const payout = new Payout(client); + + const request: ModifyRequest = { + merchantAccount: client.config.merchantAccount, + originalReference: "reference" + }; + const result = await payout.confirmThirdParty(request); + + expect(result.response).toEqual("[payout-confirm-received]"); + expect(result.pspReference).toEqual("8815131762537886"); + }); + + it("should succeed on submit third party", async function (): Promise { + const client = createMockClientFromResponse(storeDetailAndSubmitThirdParty); + const payout = new Payout(client); + + const request: SubmitRequest = mockSubmitRequest(client.config.merchantAccount); + 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"); + }); + + it("should succeed on decline third party", async function (): Promise { + const client = createMockClientFromResponse(JSON.stringify({ + pspReference: "8815131762537886", + response: "[payout-confirm-received]" + })); + const payout = new Payout(client); + + const request: ModifyRequest = { + merchantAccount: client.config.merchantAccount, + originalReference: "reference" + }; + const result = await payout.declineThirdParty(request); + + expect(result.response).toEqual("[payout-confirm-received]"); + expect(result.pspReference).toEqual("8815131762537886"); + }); +}); \ No newline at end of file diff --git a/src/__tests__/recurring.spec.ts b/src/__tests__/recurring.spec.ts new file mode 100644 index 0000000..04136d8 --- /dev/null +++ b/src/__tests__/recurring.spec.ts @@ -0,0 +1,40 @@ +import { createMockClientFromResponse } from "../__mocks__/base"; +import { disableSuccess } from "../__mocks__/recurring/disableSuccess"; +import { listRecurringDetailsSuccess } from "../__mocks__/recurring/listRecurringDetailsSuccess"; +import Recurring from "../service/recurring"; +import { DisableRequest, RecurringDetailsRequest } from "../typings/recurring"; + +const createRecurringDetailsRequest = (): RecurringDetailsRequest => { + return { + merchantAccount: "MerchantAccount", + recurring: {contract: "ONECLICK"}, + shopperReference: "test-123", + }; +}; + +describe("Recurring", (): void => { + it("should test have recurring details list", async (): Promise => { + const client = createMockClientFromResponse(listRecurringDetailsSuccess); + const recurring = new Recurring(client); + const request = createRecurringDetailsRequest(); + const result = await recurring.listRecurringDetails(request); + expect(result.details).toHaveLength(2); + + const [recurringDetail] = result.details; + expect(recurringDetail.recurringDetailReference).toEqual("recurringReference"); + expect(recurringDetail.alias).toEqual("cardAlias"); + expect(recurringDetail.card.number).toEqual("1111"); + }); + + it("should disable", async (): Promise => { + const client = createMockClientFromResponse(disableSuccess); + const recurring = new Recurring(client); + const request: DisableRequest = { + merchantAccount: "MerchantAccount", + recurringDetailReference: "reference", + shopperReference: "test-123", + }; + const result = await recurring.disable(request); + expect(result.response).toEqual("[detail-successfully-disabled]"); + }); +}); diff --git a/src/__tests__/terminalCloudAPI.spec.ts b/src/__tests__/terminalCloudAPI.spec.ts new file mode 100644 index 0000000..1f33ad4 --- /dev/null +++ b/src/__tests__/terminalCloudAPI.spec.ts @@ -0,0 +1,69 @@ +import {createMockClientFromResponse, createTerminalAPIPaymentRequest} from "../__mocks__/base"; +import {asyncRes} from "../__mocks__/terminalApi/async"; +import {syncRes} from "../__mocks__/terminalApi/sync"; +import Client from "../client"; +import TerminalCloudAPI from "../service/terminalCloudAPI"; +import {MessageHeader, SaleToPoiResponse, TerminalApiRequest, TerminalApiResponse} from "../typings/terminal"; + +describe("Terminal Cloud API", (): void => { + it("should make an async payment request", async (): Promise => { + const client: Client = createMockClientFromResponse(asyncRes); + const terminalCloudAPI: TerminalCloudAPI = new TerminalCloudAPI(client); + + const terminalAPIPaymentRequest: TerminalApiRequest = createTerminalAPIPaymentRequest() as TerminalApiRequest; + + const requestResponse: string = await terminalCloudAPI.async(terminalAPIPaymentRequest); + + expect(requestResponse).toEqual("ok"); + }); + + it("should make a sync payment request", async (): Promise => { + const client: Client = createMockClientFromResponse(syncRes); + const terminalCloudAPI: TerminalCloudAPI = new TerminalCloudAPI(client); + const terminalAPIPaymentRequest: TerminalApiRequest = createTerminalAPIPaymentRequest() as TerminalApiRequest; + const terminalAPIResponse: TerminalApiResponse = await terminalCloudAPI.sync(terminalAPIPaymentRequest); + + const saleToPoiResponse: SaleToPoiResponse = terminalAPIResponse.saleToPoiResponse; + + const messageHeader: MessageHeader = saleToPoiResponse.messageHeader; + expect(messageHeader.messageType).toEqual("Response"); + expect(messageHeader.messageClass).toEqual("Service"); + expect(messageHeader.messageCategory).toEqual("Payment"); + expect(messageHeader.protocolVersion).toEqual("3.0"); + expect(messageHeader.saleId).toEqual("001"); + expect(messageHeader.serviceId).toEqual("1234567890"); + expect(messageHeader.poiid).toEqual("P400Plus-123456789"); + + const response = saleToPoiResponse.paymentResponse.response; + expect(response.result).toEqual("Success"); + expect(response.additionalResponse).toBeTruthy(); + + const poiData = saleToPoiResponse.paymentResponse.poiData; + expect(poiData.poiReconciliationId).toEqual("1000"); + expect(poiData.poiTransactionId.transactionId).toEqual("4r7i001556529591000.8515565295894301"); + expect(poiData.poiTransactionId.timeStamp).toEqual("2019-04-29T00:00:00.000Z"); + + const saleData = saleToPoiResponse.paymentResponse.saleData; + expect(saleData.saleTransactionId.transactionId).toEqual("001"); + expect(saleData.saleTransactionId.timeStamp).toEqual("2019-04-29T00:00:00.000Z"); + + expect(saleToPoiResponse.paymentResponse.paymentReceipt.length).toBeGreaterThan(0); + saleToPoiResponse.paymentResponse.paymentReceipt.forEach((receipt): void => { + expect(receipt.outputContent.outputFormat).toEqual("Text"); + expect(receipt.outputContent.outputText.length).toBeGreaterThan(0); + receipt.outputContent.outputText.forEach((outputText): void => { + expect(outputText.text).toBeTruthy(); + }); + }); + const {paymentResult} = saleToPoiResponse.paymentResponse; + expect(paymentResult.onlineFlag).toBeTruthy(); + expect(paymentResult.paymentAcquirerData.acquirerPoiid).toEqual("P400Plus-123456789"); + expect(paymentResult.paymentAcquirerData.approvalCode).toEqual("123456"); + expect(paymentResult.paymentAcquirerData.merchantId).toEqual("TestMerchant"); + expect(paymentResult.paymentInstrumentData.cardData.paymentBrand).toEqual("mc"); + expect(paymentResult.paymentInstrumentData.cardData.maskedPan).toEqual("411111 **** 1111"); + expect(paymentResult.paymentInstrumentData.paymentInstrumentType).toEqual("Card"); + expect(paymentResult.amountsResp.currency).toEqual("EUR"); + expect(paymentResult.amountsResp.authorizedAmount).toEqual(1); + }); +}); diff --git a/src/__tests__/terminalLocalAPI.spec.ts b/src/__tests__/terminalLocalAPI.spec.ts new file mode 100644 index 0000000..c606853 --- /dev/null +++ b/src/__tests__/terminalLocalAPI.spec.ts @@ -0,0 +1,67 @@ +import {createMockClientFromResponse, createTerminalAPIPaymentRequest} from "../__mocks__/base"; +import {localRes} from "../__mocks__/terminalApi/local"; +import Client from "../client"; +import TerminalLocalAPI from "../service/terminalLocalAPI"; +import {SecurityKey, TerminalApiRequest, TerminalApiResponse} from "../typings/terminal"; + +describe("Terminal Local API", (): void => { + it("should make a local payment", async (): Promise => { + const client: Client = createMockClientFromResponse(localRes); + const terminalLocalAPI: TerminalLocalAPI = new TerminalLocalAPI(client); + + const terminalAPIPaymentRequest = createTerminalAPIPaymentRequest() as TerminalApiRequest; + + const securityKey: SecurityKey = { + adyenCryptoVersion: 1, + keyIdentifier: "CryptoKeyIdentifier12345", + keyVersion: 1, + passphrase: "p@ssw0rd123456", + }; + + const terminalApiResponse: TerminalApiResponse = + await terminalLocalAPI.request(terminalAPIPaymentRequest, securityKey); + const saleToPoiResponse = terminalApiResponse.saleToPoiResponse; + const messageHeader = saleToPoiResponse.messageHeader; + + expect(messageHeader.messageType).toEqual("Response"); + expect(messageHeader.messageClass).toEqual("Service"); + expect(messageHeader.messageCategory).toEqual("Payment"); + expect(messageHeader.protocolVersion).toEqual("3.0"); + expect(messageHeader.saleId).toEqual("325488592"); + expect(messageHeader.serviceId).toEqual("325488592"); + expect(messageHeader.poiid).toEqual("P400Plus-275039202"); + + const response = saleToPoiResponse.paymentResponse.response; + expect(response.result).toEqual("Success"); + expect(response.additionalResponse).toBeTruthy(); + + const poiData = saleToPoiResponse.paymentResponse.poiData; + expect(poiData.poiReconciliationId).toEqual("1000"); + expect(poiData.poiTransactionId.transactionId).toEqual("4r7i001557325515012.8815573255107661"); + expect(poiData.poiTransactionId.timeStamp).toEqual("2019-05-08T14:25:15.000Z"); + + const saleData = saleToPoiResponse.paymentResponse.saleData; + expect(saleData.saleTransactionId.transactionId).toEqual("999"); + expect(saleData.saleTransactionId.timeStamp).toEqual("2019-05-08T14:24:48.598Z"); + + expect(saleToPoiResponse.paymentResponse.paymentReceipt.length).toBeGreaterThan(0); + saleToPoiResponse.paymentResponse.paymentReceipt.forEach((receipt): void => { + expect(receipt.outputContent.outputFormat).toEqual("Text"); + expect(receipt.outputContent.outputText.length).toBeGreaterThan(0); + receipt.outputContent.outputText.forEach((outputText): void => { + expect(outputText.text).toBeTruthy(); + }); + }); + + const paymentResult = saleToPoiResponse.paymentResponse.paymentResult; + expect(paymentResult.onlineFlag).toBeTruthy(); + expect(paymentResult.paymentAcquirerData.acquirerPoiid).toEqual("P400Plus-275039202"); + expect(paymentResult.paymentAcquirerData.approvalCode).toEqual("123456"); + expect(paymentResult.paymentAcquirerData.merchantId).toEqual("TestMerchantRenatoTest"); + expect(paymentResult.paymentInstrumentData.cardData.paymentBrand).toEqual("mc"); + expect(paymentResult.paymentInstrumentData.cardData.maskedPan).toEqual("541333 **** 0010"); + expect(paymentResult.paymentInstrumentData.paymentInstrumentType).toEqual("Card"); + expect(paymentResult.amountsResp.currency).toEqual("EUR"); + expect(paymentResult.amountsResp.authorizedAmount).toEqual(1); + }); +}); diff --git a/src/apiKeyAuthenticatedService.ts b/src/apiKeyAuthenticatedService.ts new file mode 100644 index 0000000..a4504fa --- /dev/null +++ b/src/apiKeyAuthenticatedService.ts @@ -0,0 +1,31 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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"; + +class ApiKeyAuthenticatedService extends Service { + protected constructor(client: Client) { + super(client); + this.apiKeyRequired = true; + } +} + +export default ApiKeyAuthenticatedService; diff --git a/src/client.ts b/src/client.ts new file mode 100644 index 0000000..e24f92d --- /dev/null +++ b/src/client.ts @@ -0,0 +1,157 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Config from "./config"; +import ClientInterface from "./httpClient/clientInterface"; +import HttpURLConnectionClient from "./httpClient/httpURLConnectionClient"; +import { Environment } from "./typings/enums/environment"; + +type ClientParametersOverload = +| { config: Config } +| { config: Config; httpClient: ClientInterface } +| { username: string; password: string; environment: Environment; applicationName: string } +| { username: string; password: string; environment: Environment; applicationName: string; httpClient: ClientInterface } +| { username: string; password: string; environment: Environment; applicationName: string; liveEndpointUrlPrefix: string } +| { username: string; password: string; environment: Environment; applicationName: string; liveEndpointUrlPrefix: string; httpClient: ClientInterface } +| { apiKey: string; environment: Environment } +| { apiKey: string; environment: Environment; httpClient: ClientInterface } +| { apiKey: string; environment: Environment; liveEndpointUrlPrefix: string; httpClient: ClientInterface }; + +interface ClientParameters { + config?: Config; + username?: string; + password?: string; + environment?: Environment; + applicationName?: string; + liveEndpointUrlPrefix?: string; + apiKey?: string; + httpClient?: ClientInterface; +} + +class Client { + public static ENDPOINT_TEST: string = "https://pal-test.adyen.com"; + public static ENDPOINT_LIVE: string = "https://pal-live.adyen.com"; + public static ENDPOINT_LIVE_SUFFIX: string = "-pal-live.adyenpayments.com"; + public static HPP_TEST: string = "https://test.adyen.com/hpp"; + public static HPP_LIVE: string = "https://live.adyen.com/hpp"; + public static MARKETPAY_ENDPOINT_TEST: string = "https://cal-test.adyen.com/cal/services"; + public static MARKETPAY_ENDPOINT_LIVE: string = "https://cal-live.adyen.com/cal/services"; + public static API_VERSION: string = "v49"; + public static RECURRING_API_VERSION: string = "v30"; + public static MARKETPAY_ACCOUNT_API_VERSION: string = "v4"; + public static MARKETPAY_FUND_API_VERSION: string = "v3"; + public static MARKETPAY_NOTIFICATION_API_VERSION: string = "v1"; + public static LIB_NAME: string = "adyen-node-api-library"; + public static LIB_VERSION: string = "1.0.0"; + public static CHECKOUT_ENDPOINT_TEST: string = "https://checkout-test.adyen.com/checkout"; + public static CHECKOUT_ENDPOINT_LIVE_SUFFIX: string = "-checkout-live.adyenpayments.com/checkout"; + public static CHECKOUT_API_VERSION: string = "v49"; + public static BIN_LOOKUP_PAL_SUFFIX = "/pal/servlet/BinLookup/"; + public static BIN_LOOKUP_API_VERSION = "v40"; + public static CHECKOUT_UTILITY_API_VERSION: string = "v1"; + public static TERMINAL_API_ENDPOINT_TEST: string = "https://terminal-api-test.adyen.com"; + public static TERMINAL_API_ENDPOINT_LIVE: string = "https://terminal-api-live.adyen.com"; + public static ENDPOINT_PROTOCOL: string = "https://"; + + private _httpClient: ClientInterface; + private _config: Config; + + public constructor(clientParameters: ClientParametersOverload); + public constructor(options: ClientParameters) { + if (options.config) { + this._config = options.config; + } else { + this._config = new Config(); + } + + if (options.environment) { + this.setEnvironment(options.environment, options.liveEndpointUrlPrefix); + if (options.username && options.password && options.applicationName) { + this._config.username = options.username; + this._config.password = options.password; + this._config.applicationName = options.applicationName; + } + + if (options.apiKey) { + this._config.apiKey = options.apiKey; + } + } + + if (options.httpClient) { + this._httpClient = options.httpClient; + } + } + + public setEnvironment(environment: Environment, liveEndpointUrlPrefix?: string): void { + this._config.environment = environment; + if (environment === "TEST") { + this._config.endpoint = Client.ENDPOINT_TEST; + this._config.marketPayEndpoint = Client.MARKETPAY_ENDPOINT_TEST; + this._config.hppEndpoint = Client.HPP_TEST; + this._config.checkoutEndpoint = Client.CHECKOUT_ENDPOINT_TEST; + this._config.terminalApiCloudEndpoint = Client.TERMINAL_API_ENDPOINT_TEST; + } else if (environment === "LIVE") { + this._config.endpoint = Client.ENDPOINT_LIVE; + this._config.marketPayEndpoint = Client.MARKETPAY_ENDPOINT_LIVE; + this._config.hppEndpoint = Client.HPP_LIVE; + if (liveEndpointUrlPrefix) { + this._config.endpoint = + `${Client.ENDPOINT_PROTOCOL}${liveEndpointUrlPrefix}${Client.ENDPOINT_LIVE_SUFFIX}`; + this._config.checkoutEndpoint = + `${Client.ENDPOINT_PROTOCOL}${liveEndpointUrlPrefix}${Client.CHECKOUT_ENDPOINT_LIVE_SUFFIX}`; + } else { + this._config.endpoint = Client.ENDPOINT_LIVE; + this._config.checkoutEndpoint = undefined; + } + } + } + + public get httpClient(): ClientInterface { + if (!this._httpClient) { + this._httpClient = new HttpURLConnectionClient(); + } + + return this._httpClient; + } + + public set httpClient(httpClient: ClientInterface) { + this._httpClient = httpClient; + } + + public get config(): Config { + return this._config; + } + + public set config(config: Config) { + this._config = config; + } + + public setApplicationName(applicationName: string): void { + this.config.applicationName = applicationName; + } + + public setTimeouts(connectionTimeoutMillis: number, readTimeoutMillis: number): void { + this.config.connectionTimeoutMillis = connectionTimeoutMillis; + this.config.readTimeoutMillis = readTimeoutMillis; + } +} + +export default Client; diff --git a/src/config.ts b/src/config.ts new file mode 100644 index 0000000..8100b16 --- /dev/null +++ b/src/config.ts @@ -0,0 +1,226 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 { Environment } from "./typings/enums/environment"; + +interface ConfigConstructor { + username?: string; + password?: string; + merchantAccount?: string; + environment?: Environment; + endpoint?: string; + marketPayEndpoint?: string; + applicationName?: string; + apiKey?: string; + connectionTimeoutMillis?: number; + readTimeoutMillis?: number; + certificatePath?: string; + hppEndpoint?: string; + skinCode?: string; + hmacKey?: string; + checkoutEndpoint?: string; + terminalApiCloudEndpoint?: string; + terminalApiLocalEndpoint?: string; +} + +class Config { + protected _username: string; + protected _password: string; + protected _merchantAccount: string; + protected _environment: Environment; + protected _endpoint: string; + protected _marketPayEndpoint: string; + protected _applicationName: string; + protected _apiKey: string; + protected _connectionTimeoutMillis: number; + protected _readTimeoutMillis: number; + protected _certificatePath: string; + + protected _hppEndpoint: string; + protected _skinCode: string; + protected _hmacKey: string; + + protected _checkoutEndpoint: string; + + protected _terminalApiCloudEndpoint: string; + protected _terminalApiLocalEndpoint: string; + + public constructor(options: ConfigConstructor = {}) { + this._username = options.username; + this._password = options.password; + this._merchantAccount = options.merchantAccount; + this._environment = options.environment; + this._endpoint = options.endpoint; + this._marketPayEndpoint = options.marketPayEndpoint; + this._applicationName = options.applicationName; + this._apiKey = options.apiKey; + this._connectionTimeoutMillis = options.connectionTimeoutMillis || 30000; + this._readTimeoutMillis = options.readTimeoutMillis || 3000; + this._certificatePath = options.certificatePath; + this._hppEndpoint = options.hppEndpoint; + this._skinCode = options.skinCode; + this._hmacKey = options.hmacKey; + this._checkoutEndpoint = options.checkoutEndpoint; + this._terminalApiCloudEndpoint = options.terminalApiCloudEndpoint; + this._terminalApiLocalEndpoint = options.terminalApiLocalEndpoint; + } + + public get username(): string { + return this._username; + } + + public set username(username: string) { + this._username = username; + } + + public get password(): string { + return this._password; + } + + public set password(password: string) { + this._password = password; + } + + public get merchantAccount(): string { + return this._merchantAccount; + } + + public set merchantAccount(merchantAccount: string) { + this._merchantAccount = merchantAccount; + } + + public get environment(): Environment { + return this._environment; + } + + public set environment(environment: Environment) { + this._environment = environment; + } + + public get endpoint(): string { + return this._endpoint; + } + + public set endpoint(endpoint: string) { + this._endpoint = endpoint; + } + + public get marketPayEndpoint(): string { + return this._marketPayEndpoint; + } + + public set marketPayEndpoint(marketPayEndpoint: string) { + this._marketPayEndpoint = marketPayEndpoint; + } + + public get applicationName(): string { + return this._applicationName; + } + + public set applicationName(applicationName: string) { + this._applicationName = applicationName; + } + + public get apiKey(): string { + return this._apiKey; + } + + public set apiKey(apiKey: string) { + this._apiKey = apiKey; + } + + public get hppEndpoint(): string { + return this._hppEndpoint; + } + + public set hppEndpoint(hppEndpoint: string) { + this._hppEndpoint = hppEndpoint; + } + + public get skinCode(): string { + return this._skinCode; + } + + public set skinCode(skinCode: string) { + this._skinCode = skinCode; + } + + public get hmacKey(): string { + return this._hmacKey; + } + + public set hmacKey(hmacKey: string) { + this._hmacKey = hmacKey; + } + + public get checkoutEndpoint(): string { + if (!this._checkoutEndpoint) { + const message = "Please provide your unique live url prefix on the setEnvironment() call on the Client or provide checkoutEndpoint in your config object."; + throw new Error(message); + } + return this._checkoutEndpoint; + } + + public set checkoutEndpoint(checkoutEndpoint: string) { + this._checkoutEndpoint = checkoutEndpoint; + } + + public get terminalApiCloudEndpoint(): string { + return this._terminalApiCloudEndpoint; + } + + public set terminalApiCloudEndpoint(terminalApiCloudEndpoint: string) { + this._terminalApiCloudEndpoint = terminalApiCloudEndpoint; + } + + public get terminalApiLocalEndpoint(): string { + return this._terminalApiLocalEndpoint; + } + + public set terminalApiLocalEndpoint(terminalApiLocalEndpoint: string) { + this._terminalApiLocalEndpoint = terminalApiLocalEndpoint; + } + + public get connectionTimeoutMillis(): number { + return this._connectionTimeoutMillis; + } + + public set connectionTimeoutMillis(connectionTimeoutMillis: number) { + this._connectionTimeoutMillis = connectionTimeoutMillis; + } + + public get readTimeoutMillis(): number { + return this._readTimeoutMillis; + } + + public set readTimeoutMillis(readTimeoutMillis: number) { + this._readTimeoutMillis = readTimeoutMillis; + } + + public set certificatePath(certificatePath: string) { + this._certificatePath = certificatePath; + } + + public get certificatePath(): string { + return this._certificatePath; + } +} + +export default Config; diff --git a/src/helpers/getJsonResponse.ts b/src/helpers/getJsonResponse.ts new file mode 100644 index 0000000..a79cb0e --- /dev/null +++ b/src/helpers/getJsonResponse.ts @@ -0,0 +1,42 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Resource from "../service/resource"; +import { RequestOptions } from "../typings/requestOptions"; + +async function getJsonResponse(resource: Resource, jsonRequest: T | string, requestOptions?: RequestOptions): Promise; +async function getJsonResponse(resource: Resource, jsonRequest: T | string, requestOptions?: RequestOptions): Promise; + +async function getJsonResponse( + resource: Resource, + jsonRequest: T | string, + requestOptions: RequestOptions = {}, +): Promise { + const response = await resource.request( + typeof jsonRequest === "string" ? jsonRequest : JSON.stringify(jsonRequest), + requestOptions); + try { + return JSON.parse(response); + } catch (e) { + return response; + } +} +export default getJsonResponse; diff --git a/src/httpClient/clientInterface.ts b/src/httpClient/clientInterface.ts new file mode 100644 index 0000000..3eaa248 --- /dev/null +++ b/src/httpClient/clientInterface.ts @@ -0,0 +1,33 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Config from "../config"; +import { RequestOptions } from "../typings/requestOptions"; +import { AgentOptions } from "https"; + +interface ClientInterface { + request( + endpoint: string, json: string, config: Config, isApiKeyRequired: boolean, requestOptions?: RequestOptions, + ): Promise; + post(endpoint: string, postParameters: [string, string][], config: Config): Promise; + proxy?: AgentOptions; +} + +export default ClientInterface; diff --git a/src/httpClient/httpClientException.ts b/src/httpClient/httpClientException.ts new file mode 100644 index 0000000..e9697f7 --- /dev/null +++ b/src/httpClient/httpClientException.ts @@ -0,0 +1,72 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 {IncomingHttpHeaders, IncomingMessage} from "http"; + +class HttpClientException implements Error { + private _code: number = 0; + private _responseHeaders: IncomingHttpHeaders; + private readonly _message: string; + private readonly _name: string; + private _responseBody: IncomingMessage; + + public constructor(message: string, code?: number, responseHeaders?: IncomingHttpHeaders, responseBody?: IncomingMessage) { + this._name = "HttpClientException"; + this._message = message; + this._code = code; + this._responseHeaders = responseHeaders; + this._responseBody = responseBody; + } + + public get message(): string { + return this._message; + } + + public get name(): string { + return this._name; + } + + public get code(): number { + return this._code; + } + + public set code(value: number) { + this._code = value; + } + + public get responseHeaders(): IncomingHttpHeaders { + return this._responseHeaders; + } + + public set responseHeaders(value: IncomingHttpHeaders) { + this._responseHeaders = value; + } + + public get responseBody(): IncomingMessage { + return this._responseBody; + } + + public set responseBody(value: IncomingMessage) { + this._responseBody = value; + } +} + +export default HttpClientException; diff --git a/src/httpClient/httpURLConnectionClient.ts b/src/httpClient/httpURLConnectionClient.ts new file mode 100644 index 0000000..b190255 --- /dev/null +++ b/src/httpClient/httpURLConnectionClient.ts @@ -0,0 +1,181 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 {ClientRequest, IncomingMessage} from "http"; +import { Agent, AgentOptions, request as httpRequest } from "https"; + +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 "./clientInterface"; +import HttpClientException from "./httpClientException"; + +class HttpURLConnectionClient implements ClientInterface { + private static CHARSET: string = "utf-8"; + private _proxy: AgentOptions; + private agentOptions: AgentOptions; + + public request( + endpoint: string, json: string, config: Config, isApiRequired: boolean, + requestOptions: RequestOptions = {}, + ): Promise { + requestOptions.headers = {}; + requestOptions.timeout = config.connectionTimeoutMillis; + + if (config.certificatePath) { + this.installCertificateVerifier(config.certificatePath); + } + + const apiKey = config.apiKey; + + if (isApiRequired || apiKey) { + requestOptions.headers[API_KEY] = apiKey; + } else { + const authString = `${config.username}:${config.password}`; + const authEncBytes = new Buffer(authString); + const authStringEnc = authEncBytes.toString(); + + requestOptions.headers.Authorization = `Basic ${authStringEnc}`; + } + + requestOptions.headers[CONTENT_TYPE] = APPLICATION_JSON_TYPE; + const httpConnection: ClientRequest = this.createRequest(endpoint, config.applicationName, requestOptions); + + return this.doPostRequest(httpConnection, json); + } + + public post(endpoint: string, postParameters: [string, string][], config: Config): Promise { + const postQuery: string = this.getQuery(postParameters); + const httpConnection: ClientRequest = this.createRequest(endpoint, config.applicationName, {}); + return this.doPostRequest(httpConnection, postQuery); + } + + public set proxy(agentOptions: AgentOptions) { + this._proxy = agentOptions; + } + + private createRequest(endpoint: string, applicationName: string, requestOptions: RequestOptions): ClientRequest { + const url = new URL(endpoint); + requestOptions.hostname = url.hostname; + requestOptions.protocol = url.protocol; + requestOptions.port = url.port; + requestOptions.path = url.pathname; + + if (this._proxy) { + this.agentOptions = {...this._proxy, ...this.agentOptions}; + } + + if (requestOptions && requestOptions.idempotencyKey) { + requestOptions.headers[IDEMPOTENCY_KEY] = requestOptions.idempotencyKey; + delete requestOptions.idempotencyKey; + } + + 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}`; + + return httpRequest(requestOptions); + } + + private getQuery(params: [string, string][]): string { + return params.map(([key, value]): string => `${key}=${value}`).join("&"); + } + + private doPostRequest(httpConnection: ClientRequest, json: string): Promise { + return new Promise((resolve, reject): void => { + httpConnection.flushHeaders(); + + httpConnection.on("response", (res: IncomingMessage): void => { + let resData = ""; + if (res.statusCode && res.statusCode !== 200) { + const exception = new HttpClientException( + `HTTP Exception: ${res.statusCode}. ${res.statusMessage}`, + res.statusCode, + res.headers, + res, + ); + reject(exception); + } + res.on("data", (data): void => { + resData += data; + }); + + res.on("end", (): void => { + if (!res.complete) { + reject(new Error("The connection was terminated while the message was still being sent")); + } + resolve(resData); + }); + + res.on("error", reject); + }); + + httpConnection.on("timeout", (): void => { + httpConnection.abort(); + }); + httpConnection.on("error", reject); + httpConnection.write(Buffer.from(json)); + httpConnection.end(); + }); + } + + private static setBasicAuthentication(httpConnection: ClientRequest, username: string, password: string): ClientRequest { + const authString = `${username}:${password}`; + const authEncBytes = new Buffer(authString); + const authStringEnc = authEncBytes.toString(); + + httpConnection.setHeader("Authorization", `Basic ${authStringEnc}`); + return httpConnection; + } + + private installCertificateVerifier(terminalCertificatePath: string): void { + try { + const certificateInput = fs.readFileSync(terminalCertificatePath); + + this.agentOptions = { + ca: certificateInput, + checkServerIdentity: (): undefined => { + return undefined; + }, + }; + + } catch (e) { + throw new HttpClientException(`Error loading certificate from path: ${e.message}`); + } + + } + +} + +export default HttpURLConnectionClient; diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..1e4fe3e --- /dev/null +++ b/src/index.ts @@ -0,0 +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 { default as Client } from "./client"; +export { default as Config } from "./config"; +export * from "./service/"; +export { default as HttpURLConnectionClient } from "./httpClient/httpURLConnectionClient"; diff --git a/src/notification/notificationRequest.ts b/src/notification/notificationRequest.ts new file mode 100644 index 0000000..63610f4 --- /dev/null +++ b/src/notification/notificationRequest.ts @@ -0,0 +1,58 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 {Convert, Notification, NotificationItem, NotificationRequestItem} from "../typings/notification"; + +class NotificationRequest { + public constructor(json: Notification) { + const notification = Convert.toNotification(JSON.stringify(json)); + this._notificationItemContainers = notification.notificationItems; + this._live = notification.live; + } + + public get notificationItemContainers(): NotificationItem[] { + return this._notificationItemContainers; + } + + public set notificationItemContainers(value: NotificationItem[]) { + this._notificationItemContainers = value; + } + + public get live(): string { + return this._live; + } + + public set live(value: string) { + this._live = value; + } + + public get notificationItems(): NotificationRequestItem[] { + if (!this._notificationItemContainers) { + return null; + } + + return this._notificationItemContainers.map((container): NotificationRequestItem => container.notificationRequestItem); + } + + private _live: string; + private _notificationItemContainers: NotificationItem[]; +} + +export default NotificationRequest; \ No newline at end of file diff --git a/src/security/exception/invalidSecurityKeyException.ts b/src/security/exception/invalidSecurityKeyException.ts new file mode 100644 index 0000000..5c08323 --- /dev/null +++ b/src/security/exception/invalidSecurityKeyException.ts @@ -0,0 +1,40 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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. + */ + +class InvalidSecurityKeyException implements Error { + private readonly _message: string; + private readonly _name: string; + + public constructor(message: string) { + this._message = message; + this._name = "InvalidSecurityKeyException"; + } + + public get message(): string { + return this._message; + } + + public get name(): string { + return this._name; + } +} + +export default InvalidSecurityKeyException; diff --git a/src/security/nexoCrypto.ts b/src/security/nexoCrypto.ts new file mode 100644 index 0000000..f80dba7 --- /dev/null +++ b/src/security/nexoCrypto.ts @@ -0,0 +1,128 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 {Cipher, createCipheriv, createDecipheriv, createHmac, randomBytes} from "crypto"; +import NexoCryptoException from "../service/exception/nexoCryptoException"; +import {NEXO_IV_LENGTH} from "../typings/constants/nexoConstants"; +import { + MessageHeader, + NexoDerivedKey, + SaleToPoiSecuredMessage, + SecurityKey, + SecurityTrailer, +} from "../typings/terminal"; +import InvalidSecurityKeyException from "./exception/invalidSecurityKeyException"; +import NexoDerivedKeyGenerator from "./nexoDerivedKeyGenerator"; + +enum Modes { + ENCRYPT, + DECRYPT, +} + +class NexoCrypto { + public static encrypt( + messageHeader: MessageHeader, + saleToPoiMessageJson: string, + securityKey: SecurityKey, + ): SaleToPoiSecuredMessage { + const derivedKey: NexoDerivedKey = NexoDerivedKeyGenerator.deriveKeyMaterial(securityKey.passphrase); + const saleToPoiMessageByteArray = Buffer.from(saleToPoiMessageJson, "ascii"); + const ivNonce = NexoCrypto.generateRandomIvNonce(); + const encryptedSaleToPoiMessage = NexoCrypto.crypt(saleToPoiMessageByteArray, derivedKey, ivNonce, Modes.ENCRYPT); + const encryptedSaleToPoiMessageHmac = NexoCrypto.hmac(saleToPoiMessageByteArray, derivedKey); + + const securityTrailer: SecurityTrailer = { + adyenCryptoVersion: securityKey.adyenCryptoVersion, + hmac: encryptedSaleToPoiMessageHmac.toString("base64"), + keyIdentifier: securityKey.keyIdentifier, + keyVersion: securityKey.keyVersion, + nonce: ivNonce.toString("base64"), + }; + + return { + messageHeader, + nexoBlob: encryptedSaleToPoiMessage.toString("base64"), + securityTrailer: securityTrailer, + }; + } + + public decrypt(saleToPoiSecureMessage: SaleToPoiSecuredMessage, securityKey: SecurityKey): string { + NexoCrypto.validateSecurityKey(securityKey); + + const encryptedSaleToPoiMessageByteArray = Buffer.from(saleToPoiSecureMessage.nexoBlob, "base64"); + const derivedKey = NexoDerivedKeyGenerator.deriveKeyMaterial(securityKey.passphrase); + const ivNonce = Buffer.from(saleToPoiSecureMessage.securityTrailer.nonce, "base64"); + const decryptedSaleToPoiMessageByteArray = + NexoCrypto.crypt(encryptedSaleToPoiMessageByteArray, derivedKey, ivNonce, Modes.DECRYPT); + + const receivedHmac = Buffer.from(saleToPoiSecureMessage.securityTrailer.hmac, "base64"); + this.validateHmac(receivedHmac, decryptedSaleToPoiMessageByteArray, derivedKey); + + return decryptedSaleToPoiMessageByteArray.toString("ascii"); + } + + private static validateSecurityKey(securityKey: SecurityKey): void { + const isValid = securityKey + && securityKey.passphrase + && securityKey.keyIdentifier + && securityKey.keyVersion + && securityKey.adyenCryptoVersion; + if (!isValid) { + throw new InvalidSecurityKeyException("Invalid Security Key"); + } + } + + 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++) { + actualIV[i] = dk.iv[i] ^ ivNonce[i]; + } + + const cipher = mode === Modes.ENCRYPT + ? createCipheriv("aes-256-cbc", dk.cipherKey, actualIV) + : createDecipheriv("aes-256-cbc", dk.cipherKey, actualIV); + + let encrypted = (cipher as Cipher).update(bytes); + encrypted = Buffer.concat([encrypted, cipher.final()]); + return encrypted; + } + + private static hmac(bytes: Buffer, derivedKey: NexoDerivedKey): Buffer { + const mac = createHmac("sha256", derivedKey.hmacKey); + return mac.update(bytes).digest(); + } + + private static generateRandomIvNonce(): Buffer { + return randomBytes(NEXO_IV_LENGTH); + } + + private validateHmac(receivedHmac: Buffer, decryptedMessage: Buffer, derivedKey: NexoDerivedKey): void { + const hmac = NexoCrypto.hmac(decryptedMessage, derivedKey); + + const isValid = hmac.every((item, index): boolean => item === receivedHmac[index]); + + if (!isValid) { + throw new NexoCryptoException("Hmac validation failed"); + } + } +} + +export default NexoCrypto; diff --git a/src/security/nexoDerivedKeyGenerator.ts b/src/security/nexoDerivedKeyGenerator.ts new file mode 100644 index 0000000..5b4464c --- /dev/null +++ b/src/security/nexoDerivedKeyGenerator.ts @@ -0,0 +1,48 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 {pbkdf2Sync} from "crypto"; +import {NEXO_CIPHER_KEY_LENGTH, NEXO_HMAC_KEY_LENGTH, NEXO_IV_LENGTH} from "../typings/constants/nexoConstants"; +import { NexoDerivedKey } from "../typings/terminal"; + +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 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), + iv: key.slice( + NEXO_HMAC_KEY_LENGTH + NEXO_CIPHER_KEY_LENGTH, + NEXO_CIPHER_KEY_LENGTH + NEXO_HMAC_KEY_LENGTH + NEXO_IV_LENGTH, + ), + }; + } +} + +export default NexoDerivedKeyGenerator; diff --git a/src/service.ts b/src/service.ts new file mode 100644 index 0000000..9fd20fe --- /dev/null +++ b/src/service.ts @@ -0,0 +1,49 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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"; + +class Service { + protected _apiKeyRequired: boolean = false; + private _client: Client; + + protected constructor(client: Client) { + this._client = client; + } + + public get client(): Client { + return this._client; + } + + public set client(client: Client) { + this._client = client; + } + + public get apiKeyRequired(): boolean { + return this._apiKeyRequired; + } + + public set apiKeyRequired(apiKeyRequired: boolean) { + this._apiKeyRequired = apiKeyRequired; + } +} + +export default Service; diff --git a/src/service/binLookup.ts b/src/service/binLookup.ts new file mode 100644 index 0000000..4c3d82c --- /dev/null +++ b/src/service/binLookup.ts @@ -0,0 +1,58 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 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 { + private readonly _get3dsAvailability: Get3dsAvailability; + private readonly _getCostEstimate: GetCostEstimate; + + public constructor(client: Client) { + super(client); + this._get3dsAvailability = new Get3dsAvailability(this); + this._getCostEstimate = new GetCostEstimate(this); + } + + public async get3dsAvailability(request: ThreeDSAvailabilityRequest): Promise { + return await getJsonResponse( + this._get3dsAvailability, + request + ); + } + + public async getCostEstimate(request: CostEstimateRequest): Promise { + return await getJsonResponse( + this._getCostEstimate, + request + ); + } +} + +export default BinLookup; diff --git a/src/service/checkout.ts b/src/service/checkout.ts new file mode 100644 index 0000000..1f80730 --- /dev/null +++ b/src/service/checkout.ts @@ -0,0 +1,96 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 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"; + +class Checkout extends ApiKeyAuthenticatedService { + private readonly _payments: Payments; + private readonly _paymentMethods: PaymentMethods; + private readonly _paymentsDetails: PaymentsDetails; + private readonly _paymentSession: PaymentSession; + private readonly _paymentsResult: PaymentsResult; + + public constructor(client: Client) { + super(client); + this._payments = new Payments(this); + this._paymentMethods = new PaymentMethods(this); + this._paymentsDetails = new PaymentsDetails(this); + this._paymentSession = new PaymentSession(this); + this._paymentsResult = new PaymentsResult(this); + } + + public async payments( + paymentsRequest: PaymentRequest, + requestOptions?: RequestOptions, + ): Promise { + return getJsonResponse( + this._payments, + paymentsRequest, + requestOptions, + ); + } + + public async paymentMethods(paymentMethodsRequest: PaymentMethodsRequest): Promise { + return getJsonResponse( + this._paymentMethods, + paymentMethodsRequest, + ); + } + + public async paymentsDetails(paymentsDetailsRequest: DetailsRequest): Promise { + return getJsonResponse( + this._paymentsDetails, + paymentsDetailsRequest, + ); + } + + public async paymentSession( + paymentSessionRequest: PaymentSetupRequest, + requestOptions?: RequestOptions, + ): Promise { + return getJsonResponse( + this._paymentSession, + paymentSessionRequest, + requestOptions, + ); + } + + public async paymentResult(paymentResultRequest: PaymentVerificationRequest): Promise { + return getJsonResponse( + this._paymentsResult, + paymentResultRequest, + ); + } +} + +export default Checkout; diff --git a/src/service/checkoutUtility.ts b/src/service/checkoutUtility.ts new file mode 100644 index 0000000..35ed6eb --- /dev/null +++ b/src/service/checkoutUtility.ts @@ -0,0 +1,44 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 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 { + private readonly _originKeys: OriginKeys; + + public constructor(client: Client) { + super(client); + this._originKeys = new OriginKeys(this); + } + + public async originKeys(originKeysRequest: CheckoutUtilityRequest): Promise { + return getJsonResponse( + this._originKeys, + originKeysRequest, + ); + } +} + +export default CheckoutUtility; diff --git a/src/service/exception/apiException.ts b/src/service/exception/apiException.ts new file mode 100644 index 0000000..1c8543b --- /dev/null +++ b/src/service/exception/apiException.ts @@ -0,0 +1,61 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 { ApiError } from "../../typings/apiError"; + +class ApiException implements Error { + private _error: ApiError; + private _statusCode: number; + private readonly _message: string; + private readonly _name: string; + + public constructor(message: string, statusCode: number) { + this._name = "ApiException"; + this._message = message; + this._statusCode = statusCode; + } + + public get error(): ApiError { + return this._error; + } + + public set error(error: ApiError) { + this._error = error; + } + + public get statusCode(): number { + return this._statusCode; + } + + public set statusCode(statusCode: number) { + this._statusCode = statusCode; + } + + public get message(): string { + return this._message; + } + + public get name(): string { + return this._name; + } +} + +export default ApiException; diff --git a/src/service/exception/nexoCryptoException.ts b/src/service/exception/nexoCryptoException.ts new file mode 100644 index 0000000..5b3de81 --- /dev/null +++ b/src/service/exception/nexoCryptoException.ts @@ -0,0 +1,40 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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. + */ + +class NexoCryptoException implements Error { + private readonly _message: string; + private readonly _name: string; + + public constructor(message: string) { + this._name = "NexoCryptoException"; + this._message = message; + } + + public get message(): string { + return this._message; + } + + public get name(): string { + return this._name; + } +} + +export default NexoCryptoException; diff --git a/src/service/index.ts b/src/service/index.ts new file mode 100644 index 0000000..571992a --- /dev/null +++ b/src/service/index.ts @@ -0,0 +1,29 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 { default as TerminalLocalAPI } from "./terminalLocalAPI"; +export { default as TerminalCloudAPI } from "./terminalCloudAPI"; +export { default as CheckoutAPI } from "./checkout"; +export { default as CheckoutUtility } from "./checkoutUtility"; +export { default as Recurring } from "./recurring"; +export { default as Modification } from "./modification"; +export { default as BinLookup } from "./binLookup"; +export { default as Payout } from "./payout"; diff --git a/src/service/modification.ts b/src/service/modification.ts new file mode 100644 index 0000000..b797629 --- /dev/null +++ b/src/service/modification.ts @@ -0,0 +1,118 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 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"; +import Capture from "./resource/modification/capture"; +import Refund from "./resource/modification/refund"; +import TechnicalCancel from "./resource/modification/technicalCancel"; + +class Modification extends Service { + private readonly _cancelOrRefund: CancelOrRefund; + private readonly _cancel: Cancel; + private readonly _capture: Capture; + private readonly _refund: Refund; + private readonly _adjustAuthorisation: AdjustAuthorisation; + private readonly _technicalCancel: TechnicalCancel; + + public constructor(client: Client) { + super(client); + this._capture = new Capture(this); + this._cancelOrRefund = new CancelOrRefund(this); + this._cancel = new Cancel(this); + this._refund = new Refund(this); + this._adjustAuthorisation = new AdjustAuthorisation(this); + this._technicalCancel = new TechnicalCancel(this); + } + + public async capture( + captureRequest: ModificationRequest, + requestOptions?: RequestOptions, + ): Promise { + return await getJsonResponse( + this._capture, + captureRequest, + requestOptions, + ); + } + + public async cancelOrRefund( + cancelOrRefundRequest: ModificationRequest, + requestOptions?: RequestOptions, + ): Promise { + return await getJsonResponse( + this._cancelOrRefund, + cancelOrRefundRequest, + requestOptions, + ); + } + + public async refund( + refundRequest: ModificationRequest, + requestOptions?: RequestOptions, + ): Promise { + return await getJsonResponse( + this._refund, + refundRequest, + requestOptions, + ); + } + + public async cancel( + cancelRequest: ModificationRequest, + requestOptions?: RequestOptions, + ): Promise { + return await getJsonResponse( + this._cancel, + cancelRequest, + requestOptions, + ); + } + + public async technicalCancel( + technicalCancelRequest: ModificationRequest, + requestOptions?: RequestOptions, + ): Promise { + return await getJsonResponse( + this._technicalCancel, + technicalCancelRequest, + requestOptions, + ); + } + + public async adjustAuthorisation( + adjustAuthorisationRequest: ModificationRequest, + requestOptions?: RequestOptions, + ): Promise { + return await getJsonResponse( + this._adjustAuthorisation, + adjustAuthorisationRequest, + requestOptions, + ); + } +} + +export default Modification; diff --git a/src/service/payout.ts b/src/service/payout.ts new file mode 100644 index 0000000..04f8cf3 --- /dev/null +++ b/src/service/payout.ts @@ -0,0 +1,89 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 DeclineThirdParty from "./resource/payout/declineThirdParty"; +import StoreDetail from "./resource/payout/storeDetail"; +import SubmitThirdParty from "./resource/payout/submitThirdParty"; +import ConfirmThirdParty from "./resource/payout/confirmThirdParty"; +import StoreDetailAndSubmitThirdParty from "./resource/payout/storeDetailAndSubmitThirdParty"; +import { + ModifyRequest, + ModifyResponse, + StoreDetailAndSubmitRequest, + StoreDetailAndSubmitResponse, StoreDetailRequest, StoreDetailResponse, SubmitRequest, SubmitResponse +} from "../typings/payout"; +import getJsonResponse from "../helpers/getJsonResponse"; + +class Payout extends Service { + private readonly _storeDetailAndSubmitThirdParty: StoreDetailAndSubmitThirdParty; + private readonly _confirmThirdParty: ConfirmThirdParty; + private readonly _declineThirdParty: DeclineThirdParty; + private readonly _storeDetail: StoreDetail; + private readonly _submitThirdParty: SubmitThirdParty; + + public constructor(client: Client) { + super(client); + + this._storeDetailAndSubmitThirdParty = new StoreDetailAndSubmitThirdParty(this); + this._confirmThirdParty = new ConfirmThirdParty(this); + this._declineThirdParty = new DeclineThirdParty(this); + this._storeDetail = new StoreDetail(this); + this._submitThirdParty = new SubmitThirdParty(this); + } + + public async storeDetailAndSubmitThirdParty(request: StoreDetailAndSubmitRequest): Promise { + return await getJsonResponse( + this._storeDetailAndSubmitThirdParty, + request + ); + } + + public async confirmThirdParty(request: ModifyRequest): Promise { + return await getJsonResponse( + this._confirmThirdParty, + request + ); + } + + public async declineThirdParty(request: ModifyRequest): Promise { + return await getJsonResponse( + this._declineThirdParty, + request + ); + } + + public async storeDetail(request: StoreDetailRequest): Promise { + return await getJsonResponse( + this._storeDetail, + request + ); + } + + public async submitThirdparty(request: SubmitRequest): Promise { + return await getJsonResponse( + this._submitThirdParty, + request + ); + } +} + +export default Payout; \ No newline at end of file diff --git a/src/service/recurring.ts b/src/service/recurring.ts new file mode 100644 index 0000000..ffae964 --- /dev/null +++ b/src/service/recurring.ts @@ -0,0 +1,54 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 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"; + +class Recurring extends Service { + private readonly _listRecurringDetails: ListRecurringDetails; + private readonly _disable: Disable; + + public constructor(client: Client) { + super(client); + this._listRecurringDetails = new ListRecurringDetails(this); + this._disable = new Disable(this); + } + + public async listRecurringDetails(request: RecurringDetailsRequest): Promise { + return await getJsonResponse( + this._listRecurringDetails, + request, + ); + } + + public async disable(request: DisableRequest): Promise { + return await getJsonResponse( + this._disable, + request, + ); + } +} + +export default Recurring; diff --git a/src/service/resource.ts b/src/service/resource.ts new file mode 100644 index 0000000..3cc454d --- /dev/null +++ b/src/service/resource.ts @@ -0,0 +1,65 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Config from "../config"; +import ClientInterface from "../httpClient/clientInterface"; +import Service from "../service"; +import { RequestOptions } from "../typings/requestOptions"; +import ApiException from "./exception/apiException"; + +class Resource { + protected endpoint: string; + private service: Service; + + public constructor(service: Service, endpoint: string) { + this.service = service; + this.endpoint = endpoint; + } + + public async request(json: string, requestOptions?: RequestOptions): Promise { + const clientInterface: ClientInterface = this.service.client.httpClient; + const config: Config = this.service.client.config; + let responseBody; + let apiException: ApiException; + + try { + return await clientInterface.request( + this.endpoint, + json, config, + this.service.apiKeyRequired, + requestOptions, + ); + } catch (e) { + responseBody = e.responseBody; + apiException = new ApiException(e.message, e.code); + } + + try { + apiException.error = responseBody; + } catch (e) { + throw new ApiException("Invalid response or an invalid X-API-Key key was used", e.statusCode); + } + + throw apiException; + } +} + +export default Resource; diff --git a/src/service/resource/binLookup/get3dsAvailability.ts b/src/service/resource/binLookup/get3dsAvailability.ts new file mode 100644 index 0000000..51b90c2 --- /dev/null +++ b/src/service/resource/binLookup/get3dsAvailability.ts @@ -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 Resource from "../../resource"; +import Service from "../../../service"; +import Client from "../../../client"; + +class Get3dsAvailability extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}${Client.BIN_LOOKUP_PAL_SUFFIX}${Client.BIN_LOOKUP_API_VERSION}/get3dsAvailability` + ); + } +} + +export default Get3dsAvailability; diff --git a/src/service/resource/binLookup/getCostEstimate.ts b/src/service/resource/binLookup/getCostEstimate.ts new file mode 100644 index 0000000..59b8346 --- /dev/null +++ b/src/service/resource/binLookup/getCostEstimate.ts @@ -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 Resource from "../../resource"; +import Service from "../../../service"; +import Client from "../../../client"; + +class GetCostEstimate extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}${Client.BIN_LOOKUP_PAL_SUFFIX}${Client.BIN_LOOKUP_API_VERSION}/getCostEstimate` + ); + } +} + +export default GetCostEstimate; diff --git a/src/service/resource/checkout/paymentMethods.ts b/src/service/resource/checkout/paymentMethods.ts new file mode 100644 index 0000000..847b090 --- /dev/null +++ b/src/service/resource/checkout/paymentMethods.ts @@ -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 PaymentMethods extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.checkoutEndpoint}/${Client.CHECKOUT_API_VERSION}/paymentMethods`, + ); + } +} + +export default PaymentMethods; diff --git a/src/service/resource/checkout/paymentSession.ts b/src/service/resource/checkout/paymentSession.ts new file mode 100644 index 0000000..42f82ce --- /dev/null +++ b/src/service/resource/checkout/paymentSession.ts @@ -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 PaymentSession extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.checkoutEndpoint}/${Client.CHECKOUT_API_VERSION}/paymentSession`, + ); + } +} + +export default PaymentSession; diff --git a/src/service/resource/checkout/payments.ts b/src/service/resource/checkout/payments.ts new file mode 100644 index 0000000..93acf42 --- /dev/null +++ b/src/service/resource/checkout/payments.ts @@ -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 Payments extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.checkoutEndpoint}/${Client.CHECKOUT_API_VERSION}/payments`, + ); + } +} + +export default Payments; diff --git a/src/service/resource/checkout/paymentsDetails.ts b/src/service/resource/checkout/paymentsDetails.ts new file mode 100644 index 0000000..317c464 --- /dev/null +++ b/src/service/resource/checkout/paymentsDetails.ts @@ -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 PaymentsDetails extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.checkoutEndpoint}/${Client.CHECKOUT_API_VERSION}/payments/details`, + ); + } +} + +export default PaymentsDetails; diff --git a/src/service/resource/checkout/paymentsResult.ts b/src/service/resource/checkout/paymentsResult.ts new file mode 100644 index 0000000..949a207 --- /dev/null +++ b/src/service/resource/checkout/paymentsResult.ts @@ -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 PaymentsResult extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.checkoutEndpoint}/${Client.CHECKOUT_API_VERSION}/payments/result`, + ); + } +} + +export default PaymentsResult; diff --git a/src/service/resource/checkoutUtility/originKeys.ts b/src/service/resource/checkoutUtility/originKeys.ts new file mode 100644 index 0000000..6f623c4 --- /dev/null +++ b/src/service/resource/checkoutUtility/originKeys.ts @@ -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 OriginKeys extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.checkoutEndpoint}/${Client.CHECKOUT_UTILITY_API_VERSION}/originKeys`, + ); + } +} + +export default OriginKeys; diff --git a/src/service/resource/modification/adjustAuthorisation.ts b/src/service/resource/modification/adjustAuthorisation.ts new file mode 100644 index 0000000..3cdb3d6 --- /dev/null +++ b/src/service/resource/modification/adjustAuthorisation.ts @@ -0,0 +1,34 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 AdjustAuthorisation extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}/pal/servlet/Payment/${Client.API_VERSION}/adjustAuthorisation`, + ); + } +} + +export default AdjustAuthorisation; diff --git a/src/service/resource/modification/cancel.ts b/src/service/resource/modification/cancel.ts new file mode 100644 index 0000000..e7f4398 --- /dev/null +++ b/src/service/resource/modification/cancel.ts @@ -0,0 +1,34 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Cancel extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}/pal/servlet/Payment/${Client.API_VERSION}/cancel`, + ); + } +} + +export default Cancel; diff --git a/src/service/resource/modification/cancelOrRefund.ts b/src/service/resource/modification/cancelOrRefund.ts new file mode 100644 index 0000000..e3e4d9e --- /dev/null +++ b/src/service/resource/modification/cancelOrRefund.ts @@ -0,0 +1,34 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 CancelOrRefund extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}/pal/servlet/Payment/${Client.API_VERSION}/cancelOrRefund`, + ); + } +} + +export default CancelOrRefund; diff --git a/src/service/resource/modification/capture.ts b/src/service/resource/modification/capture.ts new file mode 100644 index 0000000..246fee1 --- /dev/null +++ b/src/service/resource/modification/capture.ts @@ -0,0 +1,34 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Capture extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}/pal/servlet/Payment/${Client.API_VERSION}/capture`, + ); + } +} + +export default Capture; diff --git a/src/service/resource/modification/refund.ts b/src/service/resource/modification/refund.ts new file mode 100644 index 0000000..0a937b7 --- /dev/null +++ b/src/service/resource/modification/refund.ts @@ -0,0 +1,34 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Refund extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}/pal/servlet/Payment/${Client.API_VERSION}/refund`, + ); + } +} + +export default Refund; diff --git a/src/service/resource/modification/technicalCancel.ts b/src/service/resource/modification/technicalCancel.ts new file mode 100644 index 0000000..7f5d7f7 --- /dev/null +++ b/src/service/resource/modification/technicalCancel.ts @@ -0,0 +1,34 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Resource from "../../resource"; +import Client from "../../../client"; +import Service from "../../../service"; + +class TechnicalCancel extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}/pal/servlet/Payment/${Client.API_VERSION}/technicalCancel`, + ); + } +} + +export default TechnicalCancel; diff --git a/src/service/resource/payout/confirmThirdParty.ts b/src/service/resource/payout/confirmThirdParty.ts new file mode 100644 index 0000000..73369b7 --- /dev/null +++ b/src/service/resource/payout/confirmThirdParty.ts @@ -0,0 +1,34 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Resource from "../../resource"; +import Service from "../../../service"; +import Client from "../../../client"; + +class ConfirmThirdParty extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}/pal/servlet/Payout/${Client.API_VERSION}/declineThirdParty` + ); + } +} + +export default ConfirmThirdParty; diff --git a/src/service/resource/payout/declineThirdParty.ts b/src/service/resource/payout/declineThirdParty.ts new file mode 100644 index 0000000..802d823 --- /dev/null +++ b/src/service/resource/payout/declineThirdParty.ts @@ -0,0 +1,34 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Resource from "../../resource"; +import Service from "../../../service"; +import Client from "../../../client"; + +class DeclineThirdParty extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}/pal/servlet/Payout/${Client.API_VERSION}/storeDetailAndSubmitThirdParty` + ); + } +} + +export default DeclineThirdParty; diff --git a/src/service/resource/payout/storeDetail.ts b/src/service/resource/payout/storeDetail.ts new file mode 100644 index 0000000..9bb101e --- /dev/null +++ b/src/service/resource/payout/storeDetail.ts @@ -0,0 +1,34 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Resource from "../../resource"; +import Service from "../../../service"; +import Client from "../../../client"; + +class StoreDetail extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}/pal/servlet/Payout/${Client.API_VERSION}/storeDetail` + ); + } +} + +export default StoreDetail; diff --git a/src/service/resource/payout/storeDetailAndSubmitThirdParty.ts b/src/service/resource/payout/storeDetailAndSubmitThirdParty.ts new file mode 100644 index 0000000..fc0f312 --- /dev/null +++ b/src/service/resource/payout/storeDetailAndSubmitThirdParty.ts @@ -0,0 +1,34 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Resource from "../../resource"; +import Service from "../../../service"; +import Client from "../../../client"; + +class StoreDetailAndSubmitThirdParty extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}/pal/servlet/Payout/${Client.API_VERSION}/storeDetailAndSubmitThirdParty` + ); + } +} + +export default StoreDetailAndSubmitThirdParty; diff --git a/src/service/resource/payout/submitThirdParty.ts b/src/service/resource/payout/submitThirdParty.ts new file mode 100644 index 0000000..8fd74a6 --- /dev/null +++ b/src/service/resource/payout/submitThirdParty.ts @@ -0,0 +1,34 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Resource from "../../resource"; +import Service from "../../../service"; +import Client from "../../../client"; + +class SubmitThirdParty extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}/pal/servlet/Payout/${Client.API_VERSION}/submitThirdParty` + ); + } +} + +export default SubmitThirdParty; diff --git a/src/service/resource/recurring/disable.ts b/src/service/resource/recurring/disable.ts new file mode 100644 index 0000000..178439f --- /dev/null +++ b/src/service/resource/recurring/disable.ts @@ -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 Disable extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}/pal/servlet/Recurring/${Client.RECURRING_API_VERSION}/disable`, + ); + } +} + +export default Disable; diff --git a/src/service/resource/recurring/listRecurringDetails.ts b/src/service/resource/recurring/listRecurringDetails.ts new file mode 100644 index 0000000..ad70c55 --- /dev/null +++ b/src/service/resource/recurring/listRecurringDetails.ts @@ -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 ListRecurringDetails extends Resource { + public constructor(service: Service) { + super( + service, + `${service.client.config.endpoint}/pal/servlet/Recurring/${Client.RECURRING_API_VERSION}/listRecurringDetails`, + ); + } +} + +export default ListRecurringDetails; diff --git a/src/service/resource/terminal/cloud/async.ts b/src/service/resource/terminal/cloud/async.ts new file mode 100644 index 0000000..7c35187 --- /dev/null +++ b/src/service/resource/terminal/cloud/async.ts @@ -0,0 +1,32 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Service from "../../../../service"; +import Resource from "../../../resource"; + +class Async extends Resource { + public constructor(service: Service) { + super(service, service.client.config.terminalApiCloudEndpoint + "/async"); + } + +} + +export default Async; diff --git a/src/service/resource/terminal/cloud/sync.ts b/src/service/resource/terminal/cloud/sync.ts new file mode 100644 index 0000000..b86073f --- /dev/null +++ b/src/service/resource/terminal/cloud/sync.ts @@ -0,0 +1,32 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Service from "../../../../service"; +import Resource from "../../../resource"; + +class Sync extends Resource { + public constructor(service: Service) { + super(service, service.client.config.terminalApiCloudEndpoint + "/sync"); + } + +} + +export default Sync; diff --git a/src/service/resource/terminal/local/localRequest.ts b/src/service/resource/terminal/local/localRequest.ts new file mode 100644 index 0000000..7283fdd --- /dev/null +++ b/src/service/resource/terminal/local/localRequest.ts @@ -0,0 +1,31 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 Service from "../../../../service"; +import Resource from "../../../resource"; + +class LocalRequest extends Resource { + public constructor(service: Service) { + super(service, service.client.config.terminalApiLocalEndpoint + ":8443/nexo/"); + } +} + +export default LocalRequest; diff --git a/src/service/terminalCloudAPI.ts b/src/service/terminalCloudAPI.ts new file mode 100644 index 0000000..d28defc --- /dev/null +++ b/src/service/terminalCloudAPI.ts @@ -0,0 +1,56 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 ApiKeyAuthenticatedService from "../apiKeyAuthenticatedService"; +import Client from "../client"; +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"; + +class TerminalCloudAPI extends ApiKeyAuthenticatedService { + private readonly terminalApiAsync: Async; + private readonly terminalApiSync: Sync; + + public constructor(client: Client) { + super(client); + this.terminalApiAsync = new Async(this); + this.terminalApiSync = new Sync(this); + } + + public async(terminalApiRequest: TerminalApiRequest): Promise { + return getJsonResponse( + this.terminalApiAsync, + Convert.terminalApiRequestToJson(terminalApiRequest), + ); + } + + public async sync(terminalApiRequest: TerminalApiRequest): Promise { + const response = await getJsonResponse( + this.terminalApiSync, + Convert.terminalApiRequestToJson(terminalApiRequest), + ); + + return Convert.toTerminalApiResponse(JSON.stringify(response)); + } +} + +export default TerminalCloudAPI; diff --git a/src/service/terminalLocalAPI.ts b/src/service/terminalLocalAPI.ts new file mode 100644 index 0000000..171b42a --- /dev/null +++ b/src/service/terminalLocalAPI.ts @@ -0,0 +1,75 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 ApiKeyAuthenticatedService from "../apiKeyAuthenticatedService"; +import Client from "../client"; +import getJsonResponse from "../helpers/getJsonResponse"; +import NexoCrypto from "../security/nexoCrypto"; +import { + Convert, + SaleToPoiSecuredMessage, + SecurityKey, + TerminalApiRequest, TerminalApiResponse, + TerminalApiSecuredRequest, +} from "../typings/terminal"; +import LocalRequest from "./resource/terminal/local/localRequest"; + +class TerminalLocalAPI extends ApiKeyAuthenticatedService { + private readonly localRequest: LocalRequest; + private nexoCrypto: NexoCrypto; + + public constructor(client: Client) { + super(client); + this.localRequest = new LocalRequest(this); + this.nexoCrypto = new NexoCrypto(); + } + + public async request( + terminalApiRequest: TerminalApiRequest, + securityKey: SecurityKey, + ): Promise { + const saleToPoiSecuredMessage: SaleToPoiSecuredMessage = NexoCrypto.encrypt( + terminalApiRequest.saleToPoiRequest.messageHeader, + Convert.terminalApiRequestToJson(terminalApiRequest), + securityKey, + ); + + const securedPaymentRequest: TerminalApiSecuredRequest = { + saleToPoiRequest: saleToPoiSecuredMessage, + }; + + const jsonResponse = await getJsonResponse( + this.localRequest, + Convert.terminalApiSecuredRequestToJson(securedPaymentRequest), + ); + + const terminalApiSecuredResponse = Convert.toTerminalApiSecuredResponse(JSON.stringify(jsonResponse)); + + const response = this.nexoCrypto.decrypt( + terminalApiSecuredResponse.saleToPoiResponse, + securityKey, + ); + + return Convert.toTerminalApiResponse(response); + } +} + +export default TerminalLocalAPI; diff --git a/src/typings/amount.ts b/src/typings/amount.ts new file mode 100644 index 0000000..2a5a301 --- /dev/null +++ b/src/typings/amount.ts @@ -0,0 +1,4 @@ +export interface Amount { + currency: string; + value: number; +} \ No newline at end of file diff --git a/src/typings/apiError.ts b/src/typings/apiError.ts new file mode 100644 index 0000000..7011721 --- /dev/null +++ b/src/typings/apiError.ts @@ -0,0 +1,9 @@ +// Generated using typescript-generator version 2.14.505 on 2019-06-04 08:51:10. + +export interface ApiError { + status?: number; + errorCode?: string; + message?: string; + errorType?: string; + pspReference?: string; +} diff --git a/src/typings/applicationInfo.ts b/src/typings/applicationInfo.ts new file mode 100644 index 0000000..f74dd47 --- /dev/null +++ b/src/typings/applicationInfo.ts @@ -0,0 +1,41 @@ +// Generated using typescript-generator version 2.14.505 on 2019-06-11 10:28:22. + +import Client from "../client"; + +export class ApplicationInfo { + adyenLibrary?: CommonField; + adyenPaymentSource?: CommonField; + externalPlatform?: ExternalPlatform; + merchantApplication?: CommonField; + merchantDevice?: MerchantDevice; + paymentDetailsSource?: CommonField; + shopperInteractionDevice?: ShopperInteractionDevice; + + constructor() { + this.adyenLibrary = { + name: Client.LIB_NAME, + version: Client.LIB_VERSION, + } + } +} + +export interface CommonField { + name?: string; + version?: string; +} + +export interface ExternalPlatform extends CommonField { + integrator?: string; +} + +export interface MerchantDevice { + os?: string; + osVersion?: string; + reference?: string; +} + +export interface ShopperInteractionDevice { + os?: string; + osVersion?: string; + locale?: string; +} diff --git a/src/typings/binLookup/amount.ts b/src/typings/binLookup/amount.ts new file mode 100755 index 0000000..8d7aa23 --- /dev/null +++ b/src/typings/binLookup/amount.ts @@ -0,0 +1,22 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/binLookup/cardBin.ts b/src/typings/binLookup/cardBin.ts new file mode 100755 index 0000000..c927964 --- /dev/null +++ b/src/typings/binLookup/cardBin.ts @@ -0,0 +1,54 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/binLookup/costEstimateAssumptions.ts b/src/typings/binLookup/costEstimateAssumptions.ts new file mode 100755 index 0000000..9857312 --- /dev/null +++ b/src/typings/binLookup/costEstimateAssumptions.ts @@ -0,0 +1,26 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/binLookup/costEstimateRequest.ts b/src/typings/binLookup/costEstimateRequest.ts new file mode 100755 index 0000000..b501b33 --- /dev/null +++ b/src/typings/binLookup/costEstimateRequest.ts @@ -0,0 +1,55 @@ +/** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/binLookup/costEstimateResponse.ts b/src/typings/binLookup/costEstimateResponse.ts new file mode 100755 index 0000000..27a7936 --- /dev/null +++ b/src/typings/binLookup/costEstimateResponse.ts @@ -0,0 +1,26 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/binLookup/dSPublicKeyDetail.ts b/src/typings/binLookup/dSPublicKeyDetail.ts new file mode 100755 index 0000000..83901cd --- /dev/null +++ b/src/typings/binLookup/dSPublicKeyDetail.ts @@ -0,0 +1,26 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/binLookup/index.ts b/src/typings/binLookup/index.ts new file mode 100755 index 0000000..2a15be9 --- /dev/null +++ b/src/typings/binLookup/index.ts @@ -0,0 +1,11 @@ +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'; diff --git a/src/typings/binLookup/merchantDetails.ts b/src/typings/binLookup/merchantDetails.ts new file mode 100755 index 0000000..41c76ca --- /dev/null +++ b/src/typings/binLookup/merchantDetails.ts @@ -0,0 +1,26 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/binLookup/recurring.ts b/src/typings/binLookup/recurring.ts new file mode 100755 index 0000000..c4218b2 --- /dev/null +++ b/src/typings/binLookup/recurring.ts @@ -0,0 +1,47 @@ +/** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/binLookup/threeDS2CardRangeDetail.ts b/src/typings/binLookup/threeDS2CardRangeDetail.ts new file mode 100755 index 0000000..7e97057 --- /dev/null +++ b/src/typings/binLookup/threeDS2CardRangeDetail.ts @@ -0,0 +1,34 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/binLookup/threeDSAvailabilityRequest.ts b/src/typings/binLookup/threeDSAvailabilityRequest.ts new file mode 100755 index 0000000..4dae741 --- /dev/null +++ b/src/typings/binLookup/threeDSAvailabilityRequest.ts @@ -0,0 +1,38 @@ +/** + * 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; + /** + * 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; +} \ No newline at end of file diff --git a/src/typings/binLookup/threeDSAvailabilityResponse.ts b/src/typings/binLookup/threeDSAvailabilityResponse.ts new file mode 100755 index 0000000..27c9331 --- /dev/null +++ b/src/typings/binLookup/threeDSAvailabilityResponse.ts @@ -0,0 +1,32 @@ +/** + * 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; + /** + * Indicator if 3D Secure 1 is supported. + */ + threeDS1Supported?: boolean; + /** + * List of brand and card range pairs. + */ + threeDS2CardRangeDetails?: Array; + /** + * Indicator if 3D Secure 2 is supported. + */ + threeDS2supported?: boolean; +} \ No newline at end of file diff --git a/src/typings/checkout/accountInfo.ts b/src/typings/checkout/accountInfo.ts new file mode 100755 index 0000000..9c7339c --- /dev/null +++ b/src/typings/checkout/accountInfo.ts @@ -0,0 +1,126 @@ +/** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/address.ts b/src/typings/checkout/address.ts new file mode 100755 index 0000000..6e17a06 --- /dev/null +++ b/src/typings/checkout/address.ts @@ -0,0 +1,38 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/amount.ts b/src/typings/checkout/amount.ts new file mode 100755 index 0000000..11c3d31 --- /dev/null +++ b/src/typings/checkout/amount.ts @@ -0,0 +1,22 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/avs.ts b/src/typings/checkout/avs.ts new file mode 100755 index 0000000..1a6c44c --- /dev/null +++ b/src/typings/checkout/avs.ts @@ -0,0 +1,30 @@ +/** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/bankAccount.ts b/src/typings/checkout/bankAccount.ts new file mode 100755 index 0000000..e6dfb70 --- /dev/null +++ b/src/typings/checkout/bankAccount.ts @@ -0,0 +1,50 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/browserInfo.ts b/src/typings/checkout/browserInfo.ts new file mode 100755 index 0000000..f97e9ca --- /dev/null +++ b/src/typings/checkout/browserInfo.ts @@ -0,0 +1,50 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/card.ts b/src/typings/checkout/card.ts new file mode 100755 index 0000000..2946abb --- /dev/null +++ b/src/typings/checkout/card.ts @@ -0,0 +1,46 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/company.ts b/src/typings/checkout/company.ts new file mode 100755 index 0000000..95df436 --- /dev/null +++ b/src/typings/checkout/company.ts @@ -0,0 +1,38 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/configuration.ts b/src/typings/checkout/configuration.ts new file mode 100755 index 0000000..4c53b63 --- /dev/null +++ b/src/typings/checkout/configuration.ts @@ -0,0 +1,32 @@ +/** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/detailsRequest.ts b/src/typings/checkout/detailsRequest.ts new file mode 100755 index 0000000..c906b7b --- /dev/null +++ b/src/typings/checkout/detailsRequest.ts @@ -0,0 +1,26 @@ +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/deviceRenderOptions.ts b/src/typings/checkout/deviceRenderOptions.ts new file mode 100755 index 0000000..7c6aed5 --- /dev/null +++ b/src/typings/checkout/deviceRenderOptions.ts @@ -0,0 +1,40 @@ + + +/** + * 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; +} +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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/forexQuote.ts b/src/typings/checkout/forexQuote.ts new file mode 100755 index 0000000..a87b024 --- /dev/null +++ b/src/typings/checkout/forexQuote.ts @@ -0,0 +1,53 @@ + + +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/fraudCheckResult.ts b/src/typings/checkout/fraudCheckResult.ts new file mode 100755 index 0000000..3fc31a0 --- /dev/null +++ b/src/typings/checkout/fraudCheckResult.ts @@ -0,0 +1,28 @@ + + +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/fraudResult.ts b/src/typings/checkout/fraudResult.ts new file mode 100755 index 0000000..4058633 --- /dev/null +++ b/src/typings/checkout/fraudResult.ts @@ -0,0 +1,25 @@ + + +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/index.ts b/src/typings/checkout/index.ts new file mode 100755 index 0000000..52dbf6b --- /dev/null +++ b/src/typings/checkout/index.ts @@ -0,0 +1,45 @@ + + +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'; diff --git a/src/typings/checkout/inputDetail.ts b/src/typings/checkout/inputDetail.ts new file mode 100755 index 0000000..beff987 --- /dev/null +++ b/src/typings/checkout/inputDetail.ts @@ -0,0 +1,50 @@ + + +/** + * 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; + /** + * 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; + /** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/installments.ts b/src/typings/checkout/installments.ts new file mode 100755 index 0000000..253ae8d --- /dev/null +++ b/src/typings/checkout/installments.ts @@ -0,0 +1,20 @@ + + +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/item.ts b/src/typings/checkout/item.ts new file mode 100755 index 0000000..c77c1a7 --- /dev/null +++ b/src/typings/checkout/item.ts @@ -0,0 +1,24 @@ + + +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/lineItem.ts b/src/typings/checkout/lineItem.ts new file mode 100755 index 0000000..e5f9c8f --- /dev/null +++ b/src/typings/checkout/lineItem.ts @@ -0,0 +1,57 @@ + + +/** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/merchantRiskIndicator.ts b/src/typings/checkout/merchantRiskIndicator.ts new file mode 100755 index 0000000..89fafc0 --- /dev/null +++ b/src/typings/checkout/merchantRiskIndicator.ts @@ -0,0 +1,69 @@ + + +/** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/name.ts b/src/typings/checkout/name.ts new file mode 100755 index 0000000..5647471 --- /dev/null +++ b/src/typings/checkout/name.ts @@ -0,0 +1,40 @@ + + +/** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/paymentMethod.ts b/src/typings/checkout/paymentMethod.ts new file mode 100755 index 0000000..3dcd046 --- /dev/null +++ b/src/typings/checkout/paymentMethod.ts @@ -0,0 +1,43 @@ + + +/** + * 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; + 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; +} \ No newline at end of file diff --git a/src/typings/checkout/paymentMethodGroup.ts b/src/typings/checkout/paymentMethodGroup.ts new file mode 100755 index 0000000..4e2c224 --- /dev/null +++ b/src/typings/checkout/paymentMethodGroup.ts @@ -0,0 +1,28 @@ + + +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/paymentMethodsGroup.ts b/src/typings/checkout/paymentMethodsGroup.ts new file mode 100755 index 0000000..5ba2d67 --- /dev/null +++ b/src/typings/checkout/paymentMethodsGroup.ts @@ -0,0 +1,28 @@ + + +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/paymentMethodsRequest.ts b/src/typings/checkout/paymentMethodsRequest.ts new file mode 100755 index 0000000..958fdce --- /dev/null +++ b/src/typings/checkout/paymentMethodsRequest.ts @@ -0,0 +1,58 @@ + + +/** + * 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; + 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; + /** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/paymentMethodsResponse.ts b/src/typings/checkout/paymentMethodsResponse.ts new file mode 100755 index 0000000..ad67219 --- /dev/null +++ b/src/typings/checkout/paymentMethodsResponse.ts @@ -0,0 +1,31 @@ + + +/** + * 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; + /** + * Detailed list of one-click payment methods. + */ + oneClickPaymentMethods?: Array; + /** + * Detailed list of payment methods required to generate payment forms. + */ + paymentMethods?: Array; +} \ No newline at end of file diff --git a/src/typings/checkout/paymentRequest.ts b/src/typings/checkout/paymentRequest.ts new file mode 100755 index 0000000..be84a62 --- /dev/null +++ b/src/typings/checkout/paymentRequest.ts @@ -0,0 +1,219 @@ + + +/** + * 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 class 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; + /** + * 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; + /** + * The shopper's telephone number. + */ + telephoneNumber?: string; + threeDS2RequestData?: ThreeDS2RequestData; + /** + * Set to true if the payment should be routed to a trusted MID. + */ + trustedShopper?: boolean; + + constructor() { + if (!this.applicationInfo) { + this.applicationInfo = new ApplicationInfo(); + } + } +} +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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/paymentResponse.ts b/src/typings/checkout/paymentResponse.ts new file mode 100755 index 0000000..a47a829 --- /dev/null +++ b/src/typings/checkout/paymentResponse.ts @@ -0,0 +1,68 @@ + + +/** + * 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; + 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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/paymentSetupRequest.ts b/src/typings/checkout/paymentSetupRequest.ts new file mode 100755 index 0000000..50a2544 --- /dev/null +++ b/src/typings/checkout/paymentSetupRequest.ts @@ -0,0 +1,193 @@ + + +/** + * 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; + 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; + /** + * 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; + /** + * 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; + /** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/paymentSetupResponse.ts b/src/typings/checkout/paymentSetupResponse.ts new file mode 100755 index 0000000..8f61456 --- /dev/null +++ b/src/typings/checkout/paymentSetupResponse.ts @@ -0,0 +1,20 @@ + + +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/paymentVerificationRequest.ts b/src/typings/checkout/paymentVerificationRequest.ts new file mode 100755 index 0000000..8e71b98 --- /dev/null +++ b/src/typings/checkout/paymentVerificationRequest.ts @@ -0,0 +1,20 @@ + + +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/paymentVerificationResponse.ts b/src/typings/checkout/paymentVerificationResponse.ts new file mode 100755 index 0000000..1415f18 --- /dev/null +++ b/src/typings/checkout/paymentVerificationResponse.ts @@ -0,0 +1,67 @@ + + +/** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/recurring.ts b/src/typings/checkout/recurring.ts new file mode 100755 index 0000000..3acaf02 --- /dev/null +++ b/src/typings/checkout/recurring.ts @@ -0,0 +1,49 @@ + + +/** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/recurringDetail.ts b/src/typings/checkout/recurringDetail.ts new file mode 100755 index 0000000..d8333b5 --- /dev/null +++ b/src/typings/checkout/recurringDetail.ts @@ -0,0 +1,49 @@ + + +/** + * 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; + 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; +} \ No newline at end of file diff --git a/src/typings/checkout/redirect.ts b/src/typings/checkout/redirect.ts new file mode 100755 index 0000000..434b2da --- /dev/null +++ b/src/typings/checkout/redirect.ts @@ -0,0 +1,35 @@ + + +/** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/sDKEphemPubKey.ts b/src/typings/checkout/sDKEphemPubKey.ts new file mode 100755 index 0000000..ded509e --- /dev/null +++ b/src/typings/checkout/sDKEphemPubKey.ts @@ -0,0 +1,32 @@ + + +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/serviceError.ts b/src/typings/checkout/serviceError.ts new file mode 100755 index 0000000..c539526 --- /dev/null +++ b/src/typings/checkout/serviceError.ts @@ -0,0 +1,19 @@ + + +/** + * 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; +} \ No newline at end of file diff --git a/src/typings/checkout/shopperInput.ts b/src/typings/checkout/shopperInput.ts new file mode 100755 index 0000000..eae2161 --- /dev/null +++ b/src/typings/checkout/shopperInput.ts @@ -0,0 +1,48 @@ + + +/** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/checkout/split.ts b/src/typings/checkout/split.ts new file mode 100755 index 0000000..0dd190c --- /dev/null +++ b/src/typings/checkout/split.ts @@ -0,0 +1,45 @@ + + +/** + * 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 { SplitAmount } from './splitAmount'; + + +export interface Split { + /** + * The account to which this split applies. >Required if the type is `MarketPlace`. + */ + account?: string; + amount: SplitAmount; + /** + * A description of this split. + */ + description?: string; + /** + * The reference of this split. Used to link other operations (e.g. captures and refunds) to this split. >Required if the type is `MarketPlace`. + */ + reference?: string; + /** + * The type of this split. >Permitted values: `Default`, `PaymentFee`, `VAT`, `Commission`, `MarketPlace`, `Verification`. + */ + type: Split.TypeEnum; +} +export namespace Split { + export type TypeEnum = 'Commission' | 'Default' | 'MarketPlace' | 'PaymentFee' | 'VAT' | 'Verification'; + export const TypeEnum = { + Commission: 'Commission' as TypeEnum, + Default: 'Default' as TypeEnum, + MarketPlace: 'MarketPlace' as TypeEnum, + PaymentFee: 'PaymentFee' as TypeEnum, + VAT: 'VAT' as TypeEnum, + Verification: 'Verification' as TypeEnum + }; +} \ No newline at end of file diff --git a/src/typings/checkout/splitAmount.ts b/src/typings/checkout/splitAmount.ts new file mode 100755 index 0000000..8af4166 --- /dev/null +++ b/src/typings/checkout/splitAmount.ts @@ -0,0 +1,24 @@ + + +/** + * 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 SplitAmount { + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used. + */ + 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; +} \ No newline at end of file diff --git a/src/typings/checkout/storedDetails.ts b/src/typings/checkout/storedDetails.ts new file mode 100755 index 0000000..13904d7 --- /dev/null +++ b/src/typings/checkout/storedDetails.ts @@ -0,0 +1,24 @@ + + +/** + * 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 { BankAccount } from './bankAccount'; +import { Card } from './card'; + + +export interface StoredDetails { + bank?: BankAccount; + card?: Card; + /** + * The email associated with stored payment details. + */ + emailAddress?: string; +} \ No newline at end of file diff --git a/src/typings/checkout/subInputDetail.ts b/src/typings/checkout/subInputDetail.ts new file mode 100755 index 0000000..0f21dff --- /dev/null +++ b/src/typings/checkout/subInputDetail.ts @@ -0,0 +1,41 @@ + + +/** + * 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'; + + +export interface SubInputDetail { + /** + * Configuration parameters for the required input. + */ + configuration?: any; + /** + * In case of a select, the items to choose from. + */ + items?: Array; + /** + * The value to provide in the result. + */ + key?: string; + /** + * True if this input is optional to provide. + */ + optional?: boolean; + /** + * The type of the required input. + */ + type?: string; + /** + * The value can be pre-filled, if available. + */ + value?: string; +} \ No newline at end of file diff --git a/src/typings/checkout/threeDS2RequestData.ts b/src/typings/checkout/threeDS2RequestData.ts new file mode 100755 index 0000000..e7d25d9 --- /dev/null +++ b/src/typings/checkout/threeDS2RequestData.ts @@ -0,0 +1,84 @@ + + +/** + * 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 { DeviceRenderOptions } from './deviceRenderOptions'; +import { SDKEphemPubKey } from './sDKEphemPubKey'; + + +export interface ThreeDS2RequestData { + /** + * If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration), and not the payment authorisation. + */ + authenticationOnly?: boolean; + /** + * Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` + */ + challengeIndicator?: ThreeDS2RequestData.ChallengeIndicatorEnum; + /** + * The environment of the shopper. Allowed values: * `app` * `browser` + */ + deviceChannel: string; + deviceRenderOptions?: DeviceRenderOptions; + /** + * The `messageVersion` value indicating the 3D Secure 2 protocol version. + */ + messageVersion?: string; + /** + * URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. + */ + notificationURL?: string; + /** + * The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. + */ + sdkAppID?: string; + /** + * The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. + */ + sdkEncData?: string; + sdkEphemPubKey?: SDKEphemPubKey; + /** + * The maximum amount of time in minutes for the 3D Secure 2 authentication process. Only for `deviceChannel` set to **app**. + */ + sdkMaxTimeout?: number; + /** + * The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. + */ + sdkReferenceNumber?: string; + /** + * The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. + */ + sdkTransID?: string; + /** + * Completion indicator for the device fingerprinting. + */ + threeDSCompInd?: string; + /** + * Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. + */ + threeDSRequestorID?: string; + /** + * Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. + */ + threeDSRequestorName?: string; + /** + * URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. + */ + threeDSRequestorURL?: string; +} +export namespace ThreeDS2RequestData { + export type ChallengeIndicatorEnum = 'noPreference' | 'requestNoChallenge' | 'requestChallenge'; + export const ChallengeIndicatorEnum = { + NoPreference: 'noPreference' as ChallengeIndicatorEnum, + RequestNoChallenge: 'requestNoChallenge' as ChallengeIndicatorEnum, + RequestChallenge: 'requestChallenge' as ChallengeIndicatorEnum + }; +} \ No newline at end of file diff --git a/src/typings/checkout/threeDSecureData.ts b/src/typings/checkout/threeDSecureData.ts new file mode 100755 index 0000000..9b9383e --- /dev/null +++ b/src/typings/checkout/threeDSecureData.ts @@ -0,0 +1,65 @@ + + +/** + * 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 ThreeDSecureData { + /** + * In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from challenge flow. If the transaction was frictionless, set this value to **Y**. + */ + authenticationResponse?: ThreeDSecureData.AuthenticationResponseEnum; + /** + * The cardholder authentication value (base64 encoded, 20 bytes in a decoded form). + */ + cavv?: string; + /** + * The CAVV algorithm used. Include this only for 3D Secure 1. + */ + cavvAlgorithm?: string; + /** + * In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from 3D Secure device fingerprinting result. + */ + directoryResponse?: ThreeDSecureData.DirectoryResponseEnum; + /** + * Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction. + */ + dsTransID?: string; + /** + * The electronic commerce indicator. + */ + eci?: string; + /** + * The version of the 3D Secure protocol. + */ + threeDSVersion?: string; + /** + * Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form). + */ + xid?: string; +} +export namespace ThreeDSecureData { + export type AuthenticationResponseEnum = 'Y' | 'N' | 'U' | 'A'; + export const AuthenticationResponseEnum = { + Y: 'Y' as AuthenticationResponseEnum, + N: 'N' as AuthenticationResponseEnum, + U: 'U' as AuthenticationResponseEnum, + A: 'A' as AuthenticationResponseEnum + }; + export type DirectoryResponseEnum = 'Y' | 'N' | 'U' | 'E' | 'C'; + export const DirectoryResponseEnum = { + Y: 'Y' as DirectoryResponseEnum, + N: 'N' as DirectoryResponseEnum, + U: 'U' as DirectoryResponseEnum, + E: 'E' as DirectoryResponseEnum, + C: 'C' as DirectoryResponseEnum + }; +} \ No newline at end of file diff --git a/src/typings/checkoutUtility/checkoutUtilityRequest.ts b/src/typings/checkoutUtility/checkoutUtilityRequest.ts new file mode 100755 index 0000000..59d0630 --- /dev/null +++ b/src/typings/checkoutUtility/checkoutUtilityRequest.ts @@ -0,0 +1,18 @@ +/** + * Adyen Checkout Utility Service + * A web service containing utility functions available for merchants integrating with Checkout APIs. ## Authentication Each request to the Checkout Utility 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/v1/originKeys ``` + * + * OpenAPI spec version: 1 + * 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 CheckoutUtilityRequest { + /** + * The list of origin domains, for which origin keys are requested. + */ + originDomains: Array; +} \ No newline at end of file diff --git a/src/typings/checkoutUtility/checkoutUtilityResponse.ts b/src/typings/checkoutUtility/checkoutUtilityResponse.ts new file mode 100755 index 0000000..21a1128 --- /dev/null +++ b/src/typings/checkoutUtility/checkoutUtilityResponse.ts @@ -0,0 +1,20 @@ + + +/** + * Adyen Checkout Utility Service + * A web service containing utility functions available for merchants integrating with Checkout APIs. ## Authentication Each request to the Checkout Utility 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/v1/originKeys ``` + * + * OpenAPI spec version: 1 + * 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 CheckoutUtilityResponse { + /** + * The list of origin keys for all requested domains. For each list item, the key is the domain and the value is the origin key. + */ + originKeys?: any; +} \ No newline at end of file diff --git a/src/typings/checkoutUtility/index.ts b/src/typings/checkoutUtility/index.ts new file mode 100755 index 0000000..87f19de --- /dev/null +++ b/src/typings/checkoutUtility/index.ts @@ -0,0 +1,4 @@ + + +export * from './checkoutUtilityRequest'; +export * from './checkoutUtilityResponse'; diff --git a/src/typings/constants/apiConstants.ts b/src/typings/constants/apiConstants.ts new file mode 100644 index 0000000..63ec681 --- /dev/null +++ b/src/typings/constants/apiConstants.ts @@ -0,0 +1,83 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 const TRANSACTION_NOT_PERMITTED = "Transaction Not Permitted"; +export const CVC_DECLINED = "CVC Declined"; +export const RESTRICTED_CARD = "Restricted Card"; +export const PAYMENT_DETAIL_NOT_FOUND = "803 PaymentDetail not found"; +export const REFUSED = "Refused"; + +export const REFUSAL_REASON_RAW = "refusalReasonRaw"; +export const PAYMENT_METHOD = "paymentMethod"; +export const EXPIRY_DATE = "expiryDate"; +export const CARD_BIN = "cardBin"; +export const CARD_HOLDER_NAME = "cardHolderName"; +export const CARD_SUMMARY = "cardSummary"; +export const THREE_D_OFFERERED = "threeDOffered"; +export const THREE_D_AUTHENTICATED = "threeDAuthenticated"; +export const AVS_RESULT = "avsResult"; +export const PAYMENT_TOKEN = "payment.token"; +export const FRAUD_RESULT_TYPE = "fraudResultType"; +export const FRAUD_MANUAL_REVIEW = "fraudManualReview"; +export const AUTH_CODE = "authCode"; + +export const BOLETO_BARCODE_REFERENCE = "boletobancario.barCodeReference"; +export const BOLETO_DATA = "boletobancario.data"; +export const BOLETO_DUE_DATE = "boletobancario.dueDate"; +export const BOLETO_URL = "boletobancario.url"; +export const BOLETO_EXPIRATION_DATE = "boletobancario.expirationDate"; + +export const MULTIBANCO_ENTITY = "comprafacil.entity"; +export const MULTIBANCO_AMOUNT = "comprafacil.amount"; +export const MULTIBANCO_DEADLINE = "comprafacil.deadline"; +export const MULTIBANCO_REFERENCE = "comprafacil.reference"; + +export const HMAC_SIGNATURE = "hmacSignature"; + +export const JSON = "card.encrypted.json"; + +export const BOLETO_SANTANDER = "boletobancario_santander"; + +export const NUMBER = "number"; +export const EXPIRY_MONTH = "expiryMonth"; +export const EXPIRY_YEAR = "expiryYear"; +export const CVC = "cvc"; +export const ENCRYPTED_CARD_NUMBER = "encryptedCardNumber"; +export const ENCRYPTED_EXPIRY_MONTH = "encryptedExpiryMonth"; +export const ENCRYPTED_EXPIRY_YEAR = "encryptedExpiryYear"; +export const ENCRYPTED_SECURITY_CODE = "encryptedSecurityCode"; +export const METHOD_TYPE = "type"; +export const HOLDER_NAME = "holderName"; +export const RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; +export const STORE_DETAILS = "storeDetails"; + +export const MD = "MD"; +export const PAREQ = "PaReq"; + +export const TYPE_SCHEME = "scheme"; + +export const IDEMPOTENCY_KEY = "Idempotency-Key"; +export const ACCEPT_CHARSET = "Accept-Charset"; +export const USER_AGENT = "User-Agent"; +export const METHOD_POST = "POST"; +export const CONTENT_TYPE = "Content-Type"; +export const API_KEY = "X-API-Key"; +export const APPLICATION_JSON_TYPE = "application/json"; diff --git a/src/typings/constants/nexoConstants.ts b/src/typings/constants/nexoConstants.ts new file mode 100644 index 0000000..751f074 --- /dev/null +++ b/src/typings/constants/nexoConstants.ts @@ -0,0 +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. + */ + +export const NEXO_HMAC_KEY_LENGTH = 32; +export const NEXO_CIPHER_KEY_LENGTH = 32; +export const NEXO_IV_LENGTH = 16; diff --git a/src/typings/enums/environment.ts b/src/typings/enums/environment.ts new file mode 100644 index 0000000..6d1fa7f --- /dev/null +++ b/src/typings/enums/environment.ts @@ -0,0 +1,22 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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 type Environment = "LIVE" | "TEST"; diff --git a/src/typings/enums/vatCategory.ts b/src/typings/enums/vatCategory.ts new file mode 100644 index 0000000..25bb15e --- /dev/null +++ b/src/typings/enums/vatCategory.ts @@ -0,0 +1,27 @@ +/* + * ###### + * ###### + * ############ ####( ###### #####. ###### ############ ############ + * ############# #####( ###### #####. ###### ############# ############# + * ###### #####( ###### #####. ###### ##### ###### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ##### ###### + * ###### ###### #####( ###### #####. ###### ##### ##### ###### + * ############# ############# ############# ############# ##### ###### + * ############ ############ ############# ############ ##### ###### + * ###### + * ############# + * ############ + * + * 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. + */ +enum VatCategory { + HIGH = "High", + LOW = "Low", + NONE = "None", +} + +export default VatCategory; diff --git a/src/typings/nexo.ts b/src/typings/nexo.ts new file mode 100644 index 0000000..666fcb8 --- /dev/null +++ b/src/typings/nexo.ts @@ -0,0 +1,1348 @@ +// Generated using typescript-generator version 2.14.505 on 2019-06-06 08:35:05. + +export interface AbortRequest { + MessageReference: MessageReference; + AbortReason: string; + DisplayOutput?: DisplayOutput; +} + +export interface AdminRequest { + ServiceIdentification?: string; +} + +export interface AdminResponse { + Response: Response; +} + +export interface AlgorithmIdentifier { + Parameter?: Parameter; + Algorithm: AlgorithmType; +} + +export interface AllowedProduct { + ProductLabel?: string; + AdditionalProductInfo?: string; + ProductCode: string; + EanUpc?: string; +} + +export interface Amount { + value?: number; + Currency?: string; +} + +export interface AmountsReq { + Currency: string; + RequestedAmount?: number; + CashBackAmount?: number; + TipAmount?: number; + PaidAmount?: number; + MinimumAmountToDeliver?: number; + MaximumCashBackAmount?: number; + MinimumSplitAmount?: number; +} + +export interface AmountsResp { + Currency?: string; + AuthorizedAmount: number; + TotalRebatesAmount?: number; + TotalFeesAmount?: number; + CashBackAmount?: number; + TipAmount?: number; +} + +export interface AreaSize { + X: string; + Y: string; +} + +export interface AuthenticatedData { + keyTransportOrKEK?: any[]; + MACAlgorithm: AlgorithmIdentifier; + EncapsulatedContent: EncapsulatedContent; + Version?: VersionType; + MAC: any; +} + +export interface BalanceInquiryRequest { + PaymentAccountReq?: PaymentAccountReq; + LoyaltyAccountReq?: LoyaltyAccountReq; +} + +export interface BalanceInquiryResponse { + Response: Response; + PaymentAccountStatus?: PaymentAccountStatus; + LoyaltyAccountStatus?: LoyaltyAccountStatus; +} + +export interface BatchRequest { + TransactionToPerform?: TransactionToPerform[]; + RemoveAllFlag?: boolean; +} + +export interface BatchResponse { + Response: Response; + PerformedTransaction?: PerformedTransaction[]; +} + +export interface CapturedSignature { + AreaSize?: AreaSize; + SignaturePoint: SignaturePoint[]; +} + +export interface CardAcquisitionRequest { + SaleData: SaleData; + CardAcquisitionTransaction: CardAcquisitionTransaction; +} + +export interface CardAcquisitionResponse { + Response: Response; + SaleData: SaleData; + POIData: POIData; + PaymentBrand?: string[]; + PaymentInstrumentData?: PaymentInstrumentData; + LoyaltyAccount?: LoyaltyAccount[]; + CustomerOrder?: CustomerOrder[]; +} + +export interface CardAcquisitionTransaction { + AllowedPaymentBrand?: string[]; + AllowedLoyaltyBrand?: string[]; + ForceEntryMode?: ForceEntryModeType[][]; + LoyaltyHandling?: LoyaltyHandlingType; + CustomerLanguage?: string; + ForceCustomerSelectionFlag?: boolean; + TotalAmount?: number; + PaymentType?: PaymentType; + CashBackFlag?: boolean; +} + +export interface CardData { + ProtectedCardData?: ContentInformation; + SensitiveCardData?: SensitiveCardData; + AllowedProductCode?: string[]; + AllowedProduct?: AllowedProduct[]; + PaymentToken?: PaymentToken; + CustomerOrder?: CustomerOrder[]; + PaymentBrand?: string; + MaskedPan?: string; + PaymentAccountRef?: string; + EntryMode?: EntryModeType[]; + CardCountryCode?: string; +} + +export interface CardReaderAPDURequest { + APDUData?: any; + APDUClass: any; + APDUInstruction: any; + APDUPar1: any; + APDUPar2: any; + APDUExpectedLength?: any; +} + +export interface CardReaderAPDUResponse { + Response: Response; + APDUData?: any; + CardStatusWords: any; +} + +export interface CardReaderInitRequest { + ForceEntryMode?: ForceEntryModeType[][]; + DisplayOutput?: DisplayOutput; + WarmResetFlag?: boolean; + LeaveCardFlag?: boolean; + MaxWaitingTime?: number; +} + +export interface CardReaderInitResponse { + Response: Response; + TrackData?: TrackData[]; + ICCResetData?: ICCResetData; + EntryMode?: EntryModeType[]; +} + +export interface CardReaderPowerOffRequest { + DisplayOutput?: DisplayOutput; + MaxWaitingTime?: number; +} + +export interface CardReaderPowerOffResponse { + Response: Response; +} + +export interface CardholderPIN { + EncrPINBlock: ContentInformation; + PINFormat: PINFormatType; + AdditionalInput?: string; +} + +export interface CashHandlingDevice { + CoinsOrBills: CoinsOrBills[]; + CashHandlingOKFlag: boolean; + Currency: string; +} + +export interface CheckData { + BankID?: string; + AccountNumber?: string; + CheckNumber?: string; + TrackData?: TrackData; + CheckCardNumber?: string; + Type?: CheckTypeCodeType; + Country?: string; +} + +export interface CoinsOrBills { + UnitValue: number; + Number: number; +} + +export interface ContentInformation { + EnvelopedData?: EnvelopedData; + AuthenticatedData?: AuthenticatedData; + SignedData?: SignedData; + DigestedData?: DigestedData; + NamedKeyEncryptedData?: NamedKeyEncryptedData; + ContentType: ContentType; +} + +export interface CurrencyConversion { + ConvertedAmount: Amount; + Commission?: number; + Declaration?: string; + CustomerApprovedFlag?: boolean; + Rate?: number; + Markup?: number; +} + +export interface CustomerOrder { + AdditionalInformation?: string; + CustomerOrderID: string; + OpenOrderState?: boolean; + StartDate: XMLGregorianCalendar; + EndDate?: XMLGregorianCalendar; + ForecastedAmount: number; + CurrentAmount: number; + Currency?: string; + AccessedBy?: string; +} + +export interface DiagnosisRequest { + AcquirerID?: string[]; + POIID?: string; + HostDiagnosisFlag?: boolean; +} + +export interface DiagnosisResponse { + Response: Response; + LoggedSaleID?: string[]; + POIStatus?: POIStatus; + HostStatus?: HostStatus[]; +} + +export interface DigestedData { + DigestAlgorithm: AlgorithmIdentifier; + EncapsulatedContent: EncapsulatedContent; + Digest: any; + Version?: VersionType; +} + +export interface DisplayOutput { + OutputContent: OutputContent; + MenuEntry?: MenuEntry[]; + OutputSignature?: any; + ResponseRequiredFlag?: boolean; + MinimumDisplayTime?: number; + Device: DeviceType; + InfoQualify: InfoQualifyType; +} + +export interface DisplayRequest { + DisplayOutput: DisplayOutput[]; +} + +export interface DisplayResponse { + OutputResult: OutputResult[]; +} + +export interface EnableServiceRequest { + ServicesEnabled?: ServicesEnabledType[]; + DisplayOutput?: DisplayOutput; + TransactionAction: TransactionActionType; +} + +export interface EnableServiceResponse { + Response: Response; +} + +export interface EncapsulatedContent { + Content?: any; + ContentType: ContentType; +} + +export interface EncryptedContent { + ContentEncryptionAlgorithm: AlgorithmIdentifier; + EncryptedData: any; + ContentType: ContentType; +} + +export interface EnvelopedData { + keyTransportOrKEK?: any[]; + EncryptedContent: EncryptedContent; + Version?: VersionType; +} + +export interface EventNotification { + EventDetails?: string; + RejectedMessage?: any; + DisplayOutput?: DisplayOutput; + TimeStamp: XMLGregorianCalendar; + EventToNotify: EventToNotifyType; + MaintenanceRequiredFlag?: boolean; + CustomerLanguage?: string; +} + +export interface GeographicCoordinates { + Latitude: string; + Longitude: string; +} + +export interface Geolocation { + GeographicCoordinates?: GeographicCoordinates; + UTMCoordinates?: UTMCoordinates; +} + +export interface GetTotalsRequest { + TotalDetails?: TotalDetailsType[]; + TotalFilter?: TotalFilter; +} + +export interface GetTotalsResponse { + Response: Response; + TransactionTotals?: TransactionTotals[]; + POIReconciliationID: string; +} + +export interface HostStatus { + AcquirerID: string; + IsReachableFlag?: boolean; +} + +export interface ICCResetData { + ATRValue?: any; + CardStatusWords?: any; +} + +export interface Input { + ConfirmedFlag?: boolean; + FunctionKey?: string; + TextInput?: string; + DigitInput?: string; + Password?: ContentInformation; + MenuEntryNumber?: number; + InputCommand: InputCommandType; +} + +export interface InputData { + DefaultInputString?: string; + StringMask?: string; + Device: DeviceType; + InfoQualify: InfoQualifyType; + InputCommand: InputCommandType; + NotifyCardInputFlag?: boolean; + MaxInputTime?: number; + ImmediateResponseFlag?: boolean; + MinLength?: number; + MaxLength?: number; + MaxDecimalLength?: number; + WaitUserValidationFlag?: boolean; + FromRightToLeftFlag?: boolean; + MaskCharactersFlag?: boolean; + BeepKeyFlag?: boolean; + GlobalCorrectionFlag?: boolean; + DisableCancelFlag?: boolean; + DisableCorrectFlag?: boolean; + DisableValidFlag?: boolean; + MenuBackFlag?: boolean; +} + +export interface InputRequest { + DisplayOutput?: DisplayOutput; + InputData: InputData; +} + +export interface InputResponse { + OutputResult?: OutputResult; + InputResult: InputResult; +} + +export interface InputResult { + Response: Response; + Input?: Input; + Device: DeviceType; + InfoQualify: InfoQualifyType; +} + +export interface InputUpdate { + MessageReference: MessageReference; + OutputContent: OutputContent; + MenuEntry?: MenuEntry[]; + OutputSignature?: any; + MinLength?: number; + MaxLength?: number; + MaxDecimalLength?: number; +} + +export interface Instalment { + Instalment?: InstalmentType[]; + SequenceNumber?: number; + PlanID?: string; + Period?: number; + PeriodUnit?: PeriodUnitType; + FirstPaymentDate?: string; + TotalNbOfPayments?: number; + CumulativeAmount?: number; + FirstAmount?: number; + Charges?: number; +} + +export interface Issuer { + RelativeDistinguishedName: RelativeDistinguishedName[]; +} + +export interface IssuerAndSerialNumber { + Issuer: Issuer; + SerialNumber: number; +} + +export interface KEK { + KEKIdentifier: KEKIdentifier; + KeyEncryptionAlgorithm: AlgorithmIdentifier; + Version?: VersionType; + EncryptedKey: any; +} + +export interface KEKIdentifier { + KeyIdentifier: string; + KeyVersion: string; + DerivationIdentifier?: any; +} + +export interface KeyTransport { + RecipientIdentifier: RecipientIdentifier; + KeyEncryptionAlgorithm: AlgorithmIdentifier; + Version?: VersionType; + EncryptedKey: any; +} + +export interface LoginRequest { + DateTime: XMLGregorianCalendar; + SaleSoftware: SaleSoftware; + SaleTerminalData?: SaleTerminalData; + TrainingModeFlag?: boolean; + OperatorLanguage: string; + OperatorID?: string; + ShiftNumber?: string; + TokenRequestedType?: TokenRequestedType; + CustomerOrderReq?: CustomerOrderReqType[]; + POISerialNumber?: string; +} + +export interface LoginResponse { + Response: Response; + POISystemData?: POISystemData; +} + +export interface LogoutRequest { + MaintenanceAllowed?: boolean; +} + +export interface LogoutResponse { + Response: Response; +} + +export interface LoyaltyAccount { + LoyaltyAccountID: LoyaltyAccountID; + LoyaltyBrand?: string; +} + +export interface LoyaltyAccountID { + value?: string; + EntryMode: EntryModeType[]; + IdentificationType: IdentificationType; + IdentificationSupport?: IdentificationSupportType; +} + +export interface LoyaltyAccountReq { + CardAcquisitionReference?: TransactionIdentification; + LoyaltyAccountID?: LoyaltyAccountID; +} + +export interface LoyaltyAccountStatus { + LoyaltyAccount: LoyaltyAccount; + CurrentBalance?: number; + LoyaltyUnit?: LoyaltyUnitType; + Currency?: string; +} + +export interface LoyaltyAcquirerData { + ApprovalCode?: string; + LoyaltyTransactionID?: TransactionIdentification; + LoyaltyAcquirerID?: string; + HostReconciliationID?: string; +} + +export interface LoyaltyAmount { + value?: number; + LoyaltyUnit?: LoyaltyUnitType; + Currency?: string; +} + +export interface LoyaltyData { + CardAcquisitionReference?: TransactionIdentification; + LoyaltyAccountID?: LoyaltyAccountID; + LoyaltyAmount?: LoyaltyAmount; +} + +export interface LoyaltyRequest { + SaleData: SaleData; + LoyaltyTransaction: LoyaltyTransaction; + LoyaltyData?: LoyaltyData[]; +} + +export interface LoyaltyResponse { + Response: Response; + SaleData: SaleData; + POIData: POIData; + LoyaltyResult?: LoyaltyResult[]; + PaymentReceipt?: PaymentReceipt[]; +} + +export interface LoyaltyResult { + LoyaltyAccount: LoyaltyAccount; + LoyaltyAmount?: LoyaltyAmount; + LoyaltyAcquirerData?: LoyaltyAcquirerData; + Rebates?: Rebates; + CurrentBalance?: number; +} + +export interface LoyaltyTotals { + TransactionType: TransactionType; + TransactionCount: number; + TransactionAmount: number; +} + +export interface LoyaltyTransaction { + OriginalPOITransaction?: OriginalPOITransaction; + TransactionConditions?: TransactionConditions; + SaleItem?: SaleItem[]; + LoyaltyTransactionType: LoyaltyTransactionType; + Currency?: string; + TotalAmount?: number; +} + +export interface MenuEntry { + PredefinedContent?: PredefinedContent; + OutputText?: OutputText[]; + OutputXHTML?: any; + MenuEntryTag?: MenuEntryTagType; + OutputFormat: OutputFormatType; + DefaultSelectedFlag?: boolean; +} + +export interface MessageHeader { + ProtocolVersion?: string; + MessageClass: MessageClassType; + MessageCategory: MessageCategoryType; + MessageType: MessageType; + ServiceID?: string; + DeviceID?: string; + SaleID: string; + POIID: string; +} + +export interface MessageReference { + MessageCategory?: MessageCategoryType; + ServiceID?: string; + DeviceID?: string; + SaleID?: string; + POIID?: string; +} + +export interface MobileData { + MobileCountryCode?: string; + Geolocation?: Geolocation; + ProtectedMobileData?: ContentInformation; + SensitiveMobileData?: SensitiveMobileData; + MobileNetworkCode?: string; + MaskedMSISDN?: string; +} + +export interface NamedKeyEncryptedData { + KeyName?: string; + EncryptedContent: EncryptedContent; + Version?: VersionType; +} + +export interface ObjectFactory { +} + +export interface OriginalPOITransaction { + POITransactionID?: TransactionIdentification; + ApprovalCode?: string; + HostTransactionID?: TransactionIdentification; + SaleID?: string; + POIID?: string; + ReuseCardDataFlag?: boolean; + CustomerLanguage?: string; + AcquirerID?: string; +} + +export interface OutputBarcode { + value?: string; + BarcodeType?: BarcodeType; +} + +export interface OutputContent { + PredefinedContent?: PredefinedContent; + OutputText?: OutputText[]; + OutputXHTML?: any; + OutputBarcode?: OutputBarcode; + OutputFormat: OutputFormatType; +} + +export interface OutputResult { + Response: Response; + Device: DeviceType; + InfoQualify: InfoQualifyType; +} + +export interface OutputText { + Text?: string; + CharacterSet?: number; + Font?: string; + StartRow?: number; + StartColumn?: number; + Color?: ColorType; + CharacterWidth?: CharacterWidthType; + CharacterHeight?: CharacterHeightType; + CharacterStyle?: CharacterStyleType; + Alignment?: AlignmentType; + EndOfLineFlag?: boolean; +} + +export interface PINRequest { + CardholderPIN?: CardholderPIN; + PINRequestType: PINRequestType; + PINVerifMethod?: string; + AdditionalInput?: string; + PINEncAlgorithm?: string; + PINFormat?: PINFormatType; + KeyReference?: string; + MaxWaitingTime?: number; +} + +export interface PINResponse { + Response: Response; + CardholderPIN?: CardholderPIN; +} + +export interface POIData { + POITransactionID: TransactionIdentification; + POIReconciliationID?: string; +} + +export interface POIProfile { + ServiceProfiles?: ServiceProfilesType[]; + GenericProfile?: GenericProfileType; +} + +export interface POISoftware { + ManufacturerID: string; + ApplicationName: string; + SoftwareVersion: string; + CertificationCode: string; +} + +export interface POIStatus { + CashHandlingDevice?: CashHandlingDevice[]; + GlobalStatus: GlobalStatusType; + SecurityOKFlag?: boolean; + PEDOKFlag?: boolean; + CardReaderOKFlag?: boolean; + PrinterStatus?: PrinterStatusType; + CommunicationOKFlag?: boolean; + FraudPreventionFlag?: boolean; +} + +export interface POISystemData { + DateTime: XMLGregorianCalendar; + POISoftware: POISoftware; + POITerminalData?: POITerminalData; + POIStatus?: POIStatus; +} + +export interface POITerminalData { + POICapabilities: POICapabilitiesType[]; + POIProfile?: POIProfile; + TerminalEnvironment: TerminalEnvironmentType; + POISerialNumber: string; +} + +export interface Parameter { + InitialisationVector?: any; +} + +export interface PaymentAccountReq { + CardAcquisitionReference?: TransactionIdentification; + PaymentInstrumentData?: PaymentInstrumentData; + AccountType?: AccountType; +} + +export interface PaymentAccountStatus { + PaymentInstrumentData?: PaymentInstrumentData; + PaymentAcquirerData?: PaymentAcquirerData; + LoyaltyAccountStatus?: LoyaltyAccountStatus; + Currency?: string; + CurrentBalance?: number; +} + +export interface PaymentAcquirerData { + AcquirerTransactionID?: TransactionIdentification; + ApprovalCode?: string; + AcquirerID?: string; + MerchantID: string; + AcquirerPOIID: string; +} + +export interface PaymentData { + CardAcquisitionReference?: TransactionIdentification; + RequestedValidityDate?: string; + Instalment?: Instalment; + CustomerOrder?: CustomerOrder; + PaymentInstrumentData?: PaymentInstrumentData; + PaymentType?: PaymentType; + SplitPaymentFlag?: boolean; +} + +export interface PaymentInstrumentData { + CardData?: CardData; + CheckData?: CheckData; + MobileData?: MobileData; + PaymentInstrumentType: PaymentInstrumentType; + StoredValueAccountID: StoredValueAccountID; + ProtectedCardData: ContentInformation; +} + +export interface PaymentReceipt { + OutputContent: OutputContent; + DocumentQualifier: DocumentQualifierType; + IntegratedPrintFlag?: boolean; + RequiredSignatureFlag?: boolean; +} + +export interface PaymentRequest { + SaleData: SaleData; + PaymentTransaction: PaymentTransaction; + PaymentData?: PaymentData; + LoyaltyData?: LoyaltyData[]; +} + +export interface PaymentResponse { + Response: Response; + SaleData: SaleData; + POIData: POIData; + PaymentResult?: PaymentResult; + LoyaltyResult?: LoyaltyResult[]; + PaymentReceipt?: PaymentReceipt[]; + CustomerOrder?: CustomerOrder[]; +} + +export interface PaymentResult { + PaymentInstrumentData?: PaymentInstrumentData; + AmountsResp?: AmountsResp; + Instalment?: Instalment; + CurrencyConversion?: CurrencyConversion[]; + CapturedSignature?: CapturedSignature; + ProtectedSignature?: ContentInformation; + PaymentAcquirerData?: PaymentAcquirerData; + PaymentType?: PaymentType; + MerchantOverrideFlag?: boolean; + CustomerLanguage?: string; + OnlineFlag?: boolean; + AuthenticationMethod?: AuthenticationMethodType[]; + ValidityDate?: string; +} + +export interface PaymentToken { + TokenRequestedType: TokenRequestedType; + TokenValue: string; + ExpiryDateTime?: XMLGregorianCalendar; +} + +export interface PaymentTotals { + TransactionType: TransactionType; + TransactionCount: number; + TransactionAmount: number; +} + +export interface PaymentTransaction { + AmountsReq: AmountsReq; + OriginalPOITransaction?: OriginalPOITransaction; + TransactionConditions?: TransactionConditions; + SaleItem?: SaleItem[]; +} + +export interface PerformedTransaction { + Response: Response; + SaleData?: SaleData; + POIData: POIData; + PaymentResult?: PaymentResult; + LoyaltyResult?: LoyaltyResult[]; + ReversedAmount?: number; +} + +export interface PredefinedContent { + ReferenceID: string; + Language?: string; +} + +export interface PrintOutput { + OutputContent: OutputContent; + OutputSignature?: any; + DocumentQualifier: DocumentQualifierType; + ResponseMode: ResponseModeType; + IntegratedPrintFlag?: boolean; + RequiredSignatureFlag?: boolean; +} + +export interface PrintRequest { + PrintOutput: PrintOutput; +} + +export interface PrintResponse { + Response: Response; + DocumentQualifier: DocumentQualifierType; +} + +export interface Rebates { + TotalRebate?: number; + RebateLabel?: string; + SaleItemRebate?: SaleItemRebate[]; +} + +export interface RecipientIdentifier { + IssuerAndSerialNumber: IssuerAndSerialNumber; +} + +export interface ReconciliationRequest { + AcquirerID?: string[]; + ReconciliationType: ReconciliationType; + POIReconciliationID?: string; +} + +export interface ReconciliationResponse { + Response: Response; + TransactionTotals?: TransactionTotals[]; + ReconciliationType: ReconciliationType; + POIReconciliationID?: string; +} + +export interface RelativeDistinguishedName { + Attribute: string; + AttributeValue: string; +} + +export interface RepeatedMessageResponse { + RepeatedResponseMessageBody: RepeatedResponseMessageBody; + MessageHeader: MessageHeader; +} + +export interface RepeatedMessageResponseBody { + LoyaltyResponse?: LoyaltyResponse; + PaymentResponse?: PaymentResponse; + ReversalResponse?: ReversalResponse; + StoredValueResponse?: StoredValueResponse; + CardAcquisitionResponse?: CardAcquisitionResponse; + CardReaderAPDUResponse?: CardReaderAPDUResponse; +} + +export interface RepeatedResponseMessageBody { + LoyaltyResponse?: LoyaltyResponse; + PaymentResponse?: PaymentResponse; + ReversalResponse?: ReversalResponse; + StoredValueResponse?: StoredValueResponse; + CardAcquisitionResponse?: CardAcquisitionResponse; + CardReaderAPDUResponse?: CardReaderAPDUResponse; +} + +export interface Response { + AdditionalResponse?: string; + Result: ResultType; + ErrorCondition?: ErrorConditionType; +} + +export interface ReversalRequest { + OriginalPOITransaction: OriginalPOITransaction; + CustomerOrderID?: CustomerOrder; + SaleReferenceID?: string; + ReversalReason: ReversalReasonType; + ReversedAmount?: number; +} + +export interface ReversalResponse { + Response: Response; + POIData?: POIData; + OriginalPOITransaction?: OriginalPOITransaction; + PaymentReceipt?: PaymentReceipt[]; + ReversedAmount?: number; + CustomerOrderID?: string; +} + +export interface SaleData { + SaleTransactionID: TransactionIdentification; + SaleTerminalData?: SaleTerminalData; + SponsoredMerchant?: SponsoredMerchant[]; + SaleToPOIData?: string; + SaleToAcquirerData?: string; + SaleToIssuerData?: SaleToIssuerData; + OperatorID?: string; + OperatorLanguage?: string; + ShiftNumber?: string; + SaleReferenceID?: string; + TokenRequestedType?: TokenRequestedType; + CustomerOrderID?: string; + CustomerOrderReq?: CustomerOrderReqType[]; +} + +export interface SaleItem { + UnitOfMeasure?: UnitOfMeasureType; + Quantity?: number; + UnitPrice?: number; + TaxCode?: string; + SaleChannel?: string; + ProductLabel?: string; + AdditionalProductInfo?: string; + ItemID: number; + ProductCode: string; + EanUpc?: string; + ItemAmount: number; +} + +export interface SaleItemRebate { + UnitOfMeasure?: UnitOfMeasureType; + Quantity?: number; + RebateLabel?: string; + ItemID: number; + ProductCode: string; + EanUpc?: string; + ItemAmount?: number; +} + +export interface SaleProfile { + ServiceProfiles?: ServiceProfilesType[]; + GenericProfile?: GenericProfileType; +} + +export interface SaleSoftware { + ManufacturerID: string; + ApplicationName: string; + SoftwareVersion: string; + CertificationCode: string; +} + +export interface SaleTerminalData { + SaleCapabilities?: SaleCapabilitiesType[]; + SaleProfile?: SaleProfile; + TerminalEnvironment?: TerminalEnvironmentType; + TotalsGroupID?: string; +} + +export interface SaleToIssuerData { + StatementReference?: string; +} + +export interface SaleToPOIRequest { + MessageHeader: MessageHeader; + AbortRequest?: AbortRequest; + BalanceInquiryRequest?: BalanceInquiryRequest; + BatchRequest?: BatchRequest; + CardAcquisitionRequest?: CardAcquisitionRequest; + AdminRequest?: AdminRequest; + DiagnosisRequest?: DiagnosisRequest; + DisplayRequest?: DisplayRequest; + EnableServiceRequest?: EnableServiceRequest; + EventNotification?: EventNotification; + GetTotalsRequest?: GetTotalsRequest; + InputRequest?: InputRequest; + InputUpdate?: InputUpdate; + LoginRequest?: LoginRequest; + LogoutRequest?: LogoutRequest; + LoyaltyRequest?: LoyaltyRequest; + PaymentRequest?: PaymentRequest; + PINRequest?: PINRequest; + PrintRequest?: PrintRequest; + CardReaderInitRequest?: CardReaderInitRequest; + CardReaderAPDURequest?: CardReaderAPDURequest; + CardReaderPowerOffRequest?: CardReaderPowerOffRequest; + ReconciliationRequest?: ReconciliationRequest; + ReversalRequest?: ReversalRequest; + SoundRequest?: SoundRequest; + StoredValueRequest?: StoredValueRequest; + TransactionStatusRequest?: TransactionStatusRequest; + TransmitRequest?: TransmitRequest; + SecurityTrailer?: ContentInformation; +} + +export interface SaleToPOIResponse { + MessageHeader: MessageHeader; + BalanceInquiryResponse?: BalanceInquiryResponse; + BatchResponse?: BatchResponse; + CardAcquisitionResponse?: CardAcquisitionResponse; + AdminResponse?: AdminResponse; + DiagnosisResponse?: DiagnosisResponse; + DisplayResponse?: DisplayResponse; + EnableServiceResponse?: EnableServiceResponse; + GetTotalsResponse?: GetTotalsResponse; + InputResponse?: InputResponse; + LoginResponse?: LoginResponse; + LogoutResponse?: LogoutResponse; + LoyaltyResponse?: LoyaltyResponse; + PaymentResponse?: PaymentResponse; + PINResponse?: PINResponse; + PrintResponse?: PrintResponse; + CardReaderInitResponse?: CardReaderInitResponse; + CardReaderAPDUResponse?: CardReaderAPDUResponse; + CardReaderPowerOffResponse?: CardReaderPowerOffResponse; + ReconciliationResponse?: ReconciliationResponse; + ReversalResponse?: ReversalResponse; + SoundResponse?: SoundResponse; + StoredValueResponse?: StoredValueResponse; + TransactionStatusResponse?: TransactionStatusResponse; + TransmitResponse?: TransmitResponse; + SecurityTrailer?: ContentInformation; +} + +export interface SensitiveCardData { + TrackData?: TrackData[]; + PAN?: string; + CardSeqNumb?: string; + ExpiryDate?: string; +} + +export interface SensitiveMobileData { + MSISDN: string; + IMSI?: string; + IMEI?: string; +} + +export interface SignaturePoint { + X: string; + Y: string; +} + +export interface SignedData { + DigestAlgorithm: AlgorithmIdentifier[]; + EncapsulatedContent: EncapsulatedContent; + Certificate?: any[]; + Signer: Signer[]; + Version?: VersionType; +} + +export interface Signer { + SignerIdentifier: SignerIdentifier; + DigestAlgorithm: AlgorithmIdentifier; + SignatureAlgorithm: AlgorithmIdentifier; + Signature: any; + Version?: VersionType; +} + +export interface SignerIdentifier { + IssuerAndSerialNumber: IssuerAndSerialNumber; +} + +export interface SoundContent { + value?: string; + SoundFormat?: SoundFormatType; + Language?: string; + ReferenceID?: string; +} + +export interface SoundRequest { + SoundContent: SoundContent; + ResponseMode?: ResponseModeType; + SoundAction: SoundActionType; + SoundVolume?: number; +} + +export interface SoundResponse { + Response: Response; +} + +export interface SponsoredMerchant { + MerchantName: string; + MerchantAddress?: string; + MerchantCountry: string; + MerchantCategoryCode: string; + RegistrationID: string; +} + +export interface StoredValueAccountID { + value?: string; + StoredValueAccountType: StoredValueAccountType; + StoredValueProvider?: string; + OwnerName?: string; + ExpiryDate?: string; + EntryMode: EntryModeType[]; + IdentificationType: IdentificationType; +} + +export interface StoredValueAccountStatus { + StoredValueAccountID: StoredValueAccountID; + CurrentBalance?: number; +} + +export interface StoredValueData { + StoredValueAccountID?: StoredValueAccountID; + OriginalPOITransaction?: OriginalPOITransaction; + StoredValueProvider?: string; + StoredValueTransactionType: StoredValueTransactionType; + ProductCode?: string; + EanUpc?: string; + ItemAmount: number; + Currency: string; +} + +export interface StoredValueRequest { + SaleData: SaleData; + StoredValueData: StoredValueData[]; + CustomerLanguage?: string; +} + +export interface StoredValueResponse { + Response: Response; + SaleData: SaleData; + POIData: POIData; + StoredValueResult?: StoredValueResult[]; +} + +export interface StoredValueResult { + StoredValueAccountStatus: StoredValueAccountStatus; + HostTransactionID?: TransactionIdentification; + StoredValueTransactionType: StoredValueTransactionType; + ProductCode: string; + EanUpc?: string; + ItemAmount: number; + Currency: string; +} + +export interface TotalFilter { + POIID?: string; + SaleID?: string; + OperatorID?: string; + ShiftNumber?: string; + TotalsGroupID?: string; +} + +export interface TrackData { + value?: string; + TrackNumb?: number; + TrackFormat?: TrackFormatType; +} + +export interface TransactionConditions { + AllowedPaymentBrand?: string[]; + AcquirerID?: string[]; + AllowedLoyaltyBrand?: string[]; + ForceEntryMode?: ForceEntryModeType[][]; + DebitPreferredFlag?: boolean; + LoyaltyHandling?: LoyaltyHandlingType; + CustomerLanguage?: string; + ForceOnlineFlag?: boolean; + MerchantCategoryCode?: string; +} + +export interface TransactionIdentification { + TransactionID: string; + TimeStamp: XMLGregorianCalendar; +} + +export interface TransactionStatusRequest { + MessageReference?: MessageReference; + DocumentQualifier?: DocumentQualifierType[]; + ReceiptReprintFlag?: boolean; +} + +export interface TransactionStatusResponse { + Response: Response; + MessageReference?: MessageReference; + RepeatedMessageResponse?: RepeatedMessageResponse; +} + +export interface TransactionToPerform { + PaymentRequest?: PaymentRequest; + LoyaltyRequest?: LoyaltyRequest; + ReversalRequest?: ReversalRequest; +} + +export interface TransactionTotals { + PaymentTotals?: PaymentTotals[]; + LoyaltyTotals?: LoyaltyTotals[]; + PaymentInstrumentType: PaymentInstrumentType; + AcquirerID?: string; + ErrorCondition?: ErrorConditionType; + HostReconciliationID?: string; + CardBrand?: string; + POIID?: string; + SaleID?: string; + OperatorID?: string; + ShiftNumber?: string; + TotalsGroupID?: string; + PaymentCurrency?: string; + LoyaltyUnit?: LoyaltyUnitType; + LoyaltyCurrency?: string; +} + +export interface TransmitRequest { + Message: any; + WaitResponseFlag?: boolean; + MaximumTransmitTime: number; + DestinationAddress: string; +} + +export interface TransmitResponse { + Response: Response; + Message?: any; +} + +export interface UTMCoordinates { + UTMZone: string; + UTMEastward: string; + UTMNorthward: string; +} + +export interface XMLGregorianCalendar extends Cloneable { +} + +export interface Cloneable { +} + +export type AccountType = "Default" | "Savings" | "Checking" | "CreditCard" | "Universal" | "Investment" | "CardTotals" | "EpurseCard"; + +export type AlgorithmType = "id-retail-cbc-mac" | "id-retail-cbc-mac-sha-256" | "id-ukpt-wrap " | "id-dukpt-wrap" | "des-ede3-ecb" | "des-ede3-cbc" | "id-sha256" | "sha256WithRSAEncryption" | "rsaEncryption"; + +export type AlignmentType = "Left" | "Right" | "Centred" | "Justified"; + +export type AttributeType = "id-at-commonName" | "id-at-localityName" | "id-at-organizationName" | "id-at-organizationalUnitName" | "id-at-countryName"; + +export type AuthenticationMethodType = "Bypass" | "ManualVerification" | "MerchantAuthentication" | "OfflinePIN" | "OnLinePIN" | "PaperSignature" | "SecuredChannel" | "SecureCertificate" | "SecureNoCertificate" | "SignatureCapture" | "UnknownMethod"; + +export type BarcodeType = "EAN8" | "EAN13" | "UPCA" | "Code25" | "Code128" | "PDF417" | "QRCODE"; + +export type CharacterHeightType = "SingleHeight" | "DoubleHeight" | "HalfHeight"; + +export type CharacterStyleType = "Normal" | "Bold" | "Italic" | "Underlined"; + +export type CharacterWidthType = "SingleWidth" | "DoubleWidth"; + +export type CheckTypeCodeType = "Personal" | "Company"; + +export type ColorType = "White" | "Black" | "Red" | "Green" | "Blue" | "Yellow" | "Magenta" | "Cyan"; + +export type ContentType = "id-data" | "id-signedData" | "id-envelopedData" | "id-digestedData" | "id-encryptedData" | "id-ct-authData"; + +export type CustomerOrderReqType = "Open" | "Closed" | "Both"; + +export type DeviceType = "CashierDisplay" | "CustomerDisplay" | "CashierInput" | "CustomerInput"; + +export type DocumentQualifierType = "SaleReceipt" | "CashierReceipt" | "CustomerReceipt" | "Document" | "Voucher" | "Journal"; + +export type EntryModeType = "RFID" | "Keyed" | "Manual" | "File" | "Scanned" | "MagStripe" | "ICC" | "SynchronousICC" | "Tapped" | "Contactless" | "Mobile"; + +export type ErrorConditionType = "Aborted" | "Busy" | "Cancel" | "DeviceOut" | "InsertedCard" | "InProgress" | "LoggedOut" | "MessageFormat" | "NotAllowed" | "NotFound" | "PaymentRestriction" | "Refusal" | "UnavailableDevice" | "UnavailableService" | "InvalidCard" | "UnreachableHost" | "WrongPIN"; + +export type EventToNotifyType = "BeginMaintenance" | "EndMaintenance" | "Shutdown" | "Initialised" | "OutOfOrder" | "Completed" | "Abort" | "SaleWakeUp" | "SaleAdmin" | "CustomerLanguage" | "KeyPressed" | "SecurityAlarm" | "StopAssistance" | "CardInserted" | "CardRemoved" | "Reject"; + +export type ForceEntryModeType = "RFID" | "Keyed" | "Manual" | "File" | "Scanned" | "MagStripe" | "ICC" | "SynchronousICC" | "Tapped" | "Contactless" | "CheckReader"; + +export type GenericProfileType = "Basic" | "Standard" | "Extended"; + +export type GlobalStatusType = "OK" | "Busy" | "Maintenance" | "Unreachable"; + +export type IdentificationSupportType = "NoCard" | "LoyaltyCard" | "HybridCard" | "LinkedCard"; + +export type IdentificationType = "PAN" | "ISOTrack2" | "BarCode" | "AccountNumber" | "PhoneNumber"; + +export type InfoQualifyType = "Status" | "Error" | "Display" | "Sound" | "Input" | "POIReplication" | "CustomerAssistance" | "Receipt" | "Document" | "Voucher"; + +export type InputCommandType = "GetAnyKey" | "GetConfirmation" | "SiteManager" | "TextString" | "DigitString" | "DecimalString" | "GetFunctionKey" | "GetMenuEntry" | "Password"; + +export type InstalmentType = "DeferredInstalments" | "EqualInstalments" | "InequalInstalments"; + +export type LoyaltyHandlingType = "Forbidden" | "Processed" | "Allowed" | "Proposed" | "Required"; + +export type LoyaltyTransactionType = "Award" | "Rebate" | "Redemption" | "AwardRefund" | "RebateRefund" | "RedemptionRefund"; + +export type LoyaltyUnitType = "Point" | "Monetary"; + +export type MenuEntryTagType = "Selectable" | "NonSelectable" | "SubMenu" | "NonSelectableSubMenu"; + +export type MessageCategoryType = "Abort" | "Admin" | "BalanceInquiry" | "Batch" | "CardAcquisition" | "CardReaderAPDU" | "CardReaderInit" | "CardReaderPowerOff" | "Diagnosis" | "Display" | "EnableService" | "Event" | "GetTotals" | "Input" | "InputUpdate" | "Login" | "Logout" | "Loyalty" | "Payment" | "PIN" | "Print" | "Reconciliation" | "Reversal" | "Sound" | "StoredValue" | "TransactionStatus" | "Transmit"; + +export type MessageClassType = "Service" | "Device" | "Event"; + +export type MessageType = "Request" | "Response" | "Notification"; + +export type OutputFormatType = "MessageRef" | "Text" | "XHTML" | "BarCode"; + +export type PINFormatType = "ISO0" | "ISO1" | "ISO2" | "ISO3"; + +export type PINRequestType = "PINVerify" | "PINVerifyOnly" | "PINEnter"; + +export type POICapabilitiesType = "CashierDisplay" | "CashierError" | "CashierInput" | "CustomerDisplay" | "CustomerError" | "CustomerInput" | "PrinterReceipt" | "PrinterDocument" | "PrinterVoucher" | "MagStripe" | "ICC" | "EMVContactless" | "CashHandling"; + +export type PaymentInstrumentType = "Card" | "Check" | "Mobile" | "StoredValue" | "Cash"; + +export type PaymentType = "Normal" | "Refund" | "OneTimeReservation" | "FirstReservation" | "UpdateReservation" | "Completion" | "CashAdvance" | "CashDeposit" | "Recurring" | "Instalment" | "IssuerInstalment" | "PaidOut"; + +export type PeriodUnitType = "Daily" | "Weekly" | "Monthly" | "Annual"; + +export type PrinterStatusType = "OK" | "PaperLow" | "NoPaper" | "PaperJam" | "OutOfOrder"; + +export type ReconciliationType = "SaleReconciliation" | "AcquirerSynchronisation" | "AcquirerReconciliation" | "PreviousReconciliation"; + +export type ResponseModeType = "NotRequired" | "Immediate" | "PrintEnd" | "SoundEnd"; + +export type ResultType = "Success" | "Failure" | "Partial"; + +export type ReversalReasonType = "CustCancel" | "MerchantCancel" | "Malfunction" | "Unable2Compl"; + +export type SaleCapabilitiesType = "CashierStatus" | "CashierError" | "CashierDisplay" | "POIReplication" | "CashierInput" | "CustomerAssistance" | "CustomerDisplay" | "CustomerError" | "CustomerInput" | "PrinterReceipt" | "PrinterDocument" | "PrinterVoucher" | "MagStripe" | "ICC" | "EMVContactless"; + +export type ServiceProfilesType = "Synchro" | "Batch" | "OneTimeRes" | "Reservation" | "Loyalty" | "StoredValue" | "PIN" | "CardReader" | "Sound" | "Communication"; + +export type ServicesEnabledType = "CardAcquisition" | "Payment" | "Loyalty"; + +export type SoundActionType = "StartSound" | "StopSound" | "SetDefaultVolume"; + +export type SoundFormatType = "SoundRef" | "MessageRef" | "Text"; + +export type StoredValueAccountType = "GiftCard" | "PhoneCard" | "Other"; + +export type StoredValueTransactionType = "Reserve" | "Activate" | "Load" | "Unload" | "Reverse" | "Duplicate"; + +export type TerminalEnvironmentType = "Attended" | "SemiAttended" | "Unattended"; + +export type TokenRequestedType = "Transaction" | "Customer"; + +export type TotalDetailsType = "POIID" | "SaleID" | "OperatorID" | "ShiftNumber" | "TotalsGroupID"; + +export type TrackFormatType = "ISO" | "JIS-I" | "JIS-II" | "AAMVA" | "CMC-7" | "E-13B"; + +export type TransactionActionType = "StartTransaction" | "AbortTransaction"; + +export type TransactionType = "Debit" | "Credit" | "ReverseDebit" | "ReverseCredit" | "OneTimeReservation" | "CompletedDeffered" | "FirstReservation" | "UpdateReservation" | "CompletedReservation" | "CashAdvance" | "IssuerInstalment" | "Declined" | "Failed" | "Award" | "ReverseAward" | "Redemption" | "ReverseRedemption" | "Rebate" | "ReverseRebate"; + +export type UnitOfMeasureType = "Case" | "Foot" | "UKGallon" | "USGallon" | "Gram" | "Inch" | "Kilogram" | "Pound" | "Meter" | "Centimetre" | "Litre" | "Centilitre" | "Ounce" | "Quart" | "Pint" | "Mile" | "Kilometre" | "Yard" | "Other"; + +export type VersionType = "v0" | "v1" | "v2" | "v3" | "v4" | "v5"; diff --git a/src/typings/notification.ts b/src/typings/notification.ts new file mode 100644 index 0000000..640bc90 --- /dev/null +++ b/src/typings/notification.ts @@ -0,0 +1,229 @@ +// To parse this data: +// +// import { Convert, Notification } from "./file"; +// +// const notification = Convert.toNotification(json); +// +// These functions will throw an error if the JSON doesn't +// match the expected interface, even if the JSON is valid. + +export interface Notification { + live: string; + notificationItems: NotificationItem[]; +} + +export interface NotificationItem { + notificationRequestItem: NotificationRequestItem; +} + +export interface NotificationRequestItem { + additionalData: AdditionalData; + amount: Amount; + eventCode: string; + eventDate: Date; + merchantAccountCode: string; + merchantReference: string; + operations?: string[]; + originalReference?: string; + paymentMethod: string; + pspReference: string; + reason: string; + success: string; +} + +export interface AdditionalData { + [key: string]: string; +} + +export interface Amount { + currency: string; + value: number; +} + +export enum NotificationEnum { + EVENT_CODE_AUTHORISATION = "AUTHORISATION", + + //Event codes + EVENT_CODE_CANCELLATION = "CANCELLATION", + EVENT_CODE_REFUND = "REFUND", + EVENT_CODE_CANCEL_OR_REFUND = "CANCEL_OR_REFUND", + EVENT_CODE_CAPTURE = "CAPTURE", + EVENT_CODE_CAPTURE_FAILED = "CAPTURE_FAILED", + EVENT_CODE_REFUND_FAILED = "REFUND_FAILED", + EVENT_CODE_REFUNDED_REVERSED = "REFUNDED_REVERSED", + EVENT_CODE_PAIDOUT_REVERSED = "PAIDOUT_REVERSED", + + //Additional Data + ADDITIONAL_DATA_TOTAL_FRAUD_SCORE = "totalFraudScore", + ADDITIONAL_DATA_FRAUD_CHECK_PATTERN = "fraudCheck-(\\d+)-([A-Za-z0-9]+)", +} + +// Converts JSON strings to/from your types +// and asserts the results of JSON.parse at runtime +export class Convert { + public static toNotification(json: string): Notification { + return cast(JSON.parse(json), r("Notification")); + } + + public static notificationToJson(value: Notification): string { + return JSON.stringify(uncast(value, r("Notification")), null, 2); + } +} + +function invalidValue(typ: any, val: any): never { + throw Error(`Invalid value ${JSON.stringify(val)} for type ${JSON.stringify(typ)}`); +} + +function jsonToJSProps(typ: any): any { + if (typ.jsonToJS === undefined) { + var map: any = {}; + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); + typ.jsonToJS = map; + } + return typ.jsonToJS; +} + +function jsToJSONProps(typ: any): any { + if (typ.jsToJSON === undefined) { + var map: any = {}; + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); + typ.jsToJSON = map; + } + return typ.jsToJSON; +} + +function transform(val: any, typ: any, getProps: any): any { + function transformPrimitive(typ: string, val: any): any { + if (typeof typ === typeof val) return val; + return invalidValue(typ, val); + } + + function transformUnion(typs: any[], val: any): any { + // val must validate against one typ in typs + var l = typs.length; + for (var i = 0; i < l; i++) { + var typ = typs[i]; + try { + return transform(val, typ, getProps); + } catch (_) {} + } + return invalidValue(typs, val); + } + + function transformEnum(cases: string[], val: any): any { + if (cases.indexOf(val) !== -1) return val; + return invalidValue(cases, val); + } + + function transformArray(typ: any, val: any): any { + // val must be an array with no invalid elements + if (!Array.isArray(val)) return invalidValue("array", val); + return val.map(el => transform(el, typ, getProps)); + } + + function transformDate(typ: any, val: any): any { + if (val === null) { + return null; + } + const d = new Date(val); + if (isNaN(d.valueOf())) { + return invalidValue("Date", val); + } + return d; + } + + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { + if (val === null || typeof val !== "object" || Array.isArray(val)) { + return invalidValue("object", val); + } + var result: any = {}; + Object.getOwnPropertyNames(props).forEach(key => { + const prop = props[key]; + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; + result[prop.key] = transform(v, prop.typ, getProps); + }); + Object.getOwnPropertyNames(val).forEach(key => { + if (!Object.prototype.hasOwnProperty.call(props, key)) { + result[key] = transform(val[key], additional, getProps); + } + }); + return result; + } + + if (typ === "any") return val; + if (typ === null) { + if (val === null) return val; + return invalidValue(typ, val); + } + if (typ === false) return invalidValue(typ, val); + while (typeof typ === "object" && typ.ref !== undefined) { + typ = typeMap[typ.ref]; + } + if (Array.isArray(typ)) return transformEnum(typ, val); + if (typeof typ === "object") { + return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) + : invalidValue(typ, val); + } + // Numbers can be parsed by Date but shouldn't be. + if (typ === Date && typeof val !== "number") return transformDate(typ, val); + return transformPrimitive(typ, val); +} + +function cast(val: any, typ: any): T { + return transform(val, typ, jsonToJSProps); +} + +function uncast(val: T, typ: any): any { + return transform(val, typ, jsToJSONProps); +} + +function a(typ: any) { + return { arrayItems: typ }; +} + +function u(...typs: any[]) { + return { unionMembers: typs }; +} + +function o(props: any[], additional: any) { + return { props, additional }; +} + +function m(additional: any) { + // @ts-ignore + return { props: [], additional }; +} + +function r(name: string) { + return { ref: name }; +} + +const typeMap: any = { + "Notification": o([ + { json: "live", js: "live", typ: "" }, + { json: "notificationItems", js: "notificationItems", typ: a(r("NotificationItem")) }, + ], false), + "NotificationItem": o([ + { json: "NotificationRequestItem", js: "notificationRequestItem", typ: r("NotificationRequestItem") }, + ], false), + "NotificationRequestItem": o([ + { json: "additionalData", js: "additionalData", typ: u(undefined, m("any")) }, + { json: "amount", js: "amount", typ: r("Amount") }, + { json: "eventCode", js: "eventCode", typ: "" }, + { json: "eventDate", js: "eventDate", typ: Date }, + { json: "merchantAccountCode", js: "merchantAccountCode", typ: "" }, + { json: "merchantReference", js: "merchantReference", typ: "" }, + { json: "operations", js: "operations", typ: u(undefined, a("")) }, + { json: "originalReference", js: "originalReference", typ: u(undefined, "") }, + { json: "paymentMethod", js: "paymentMethod", typ: "" }, + { json: "pspReference", js: "pspReference", typ: "" }, + { json: "reason", js: "reason", typ: "" }, + { json: "success", js: "success", typ: "" }, + ], false), + "Amount": o([ + { json: "currency", js: "currency", typ: "" }, + { json: "value", js: "value", typ: 0 }, + ], false), +}; diff --git a/src/typings/payments/accountInfo.ts b/src/typings/payments/accountInfo.ts new file mode 100755 index 0000000..55a2c92 --- /dev/null +++ b/src/typings/payments/accountInfo.ts @@ -0,0 +1,126 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/payments/address.ts b/src/typings/payments/address.ts new file mode 100755 index 0000000..8ea527b --- /dev/null +++ b/src/typings/payments/address.ts @@ -0,0 +1,38 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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'). > If you don't know the country or are not collecting the country from the shopper, provide `countryCode` as `ZZ`. + */ + 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; +} \ No newline at end of file diff --git a/src/typings/payments/amount.ts b/src/typings/payments/amount.ts new file mode 100755 index 0000000..c3e0246 --- /dev/null +++ b/src/typings/payments/amount.ts @@ -0,0 +1,22 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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; +} \ No newline at end of file diff --git a/src/typings/payments/bankAccount.ts b/src/typings/payments/bankAccount.ts new file mode 100755 index 0000000..af5c2d4 --- /dev/null +++ b/src/typings/payments/bankAccount.ts @@ -0,0 +1,50 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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; +} \ No newline at end of file diff --git a/src/typings/payments/browserInfo.ts b/src/typings/payments/browserInfo.ts new file mode 100755 index 0000000..f917413 --- /dev/null +++ b/src/typings/payments/browserInfo.ts @@ -0,0 +1,50 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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; +} \ No newline at end of file diff --git a/src/typings/payments/card.ts b/src/typings/payments/card.ts new file mode 100755 index 0000000..da42dc6 --- /dev/null +++ b/src/typings/payments/card.ts @@ -0,0 +1,46 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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; +} \ No newline at end of file diff --git a/src/typings/payments/deviceRenderOptions.ts b/src/typings/payments/deviceRenderOptions.ts new file mode 100755 index 0000000..138ea9d --- /dev/null +++ b/src/typings/payments/deviceRenderOptions.ts @@ -0,0 +1,38 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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?: 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 + }; +} \ No newline at end of file diff --git a/src/typings/payments/forexQuote.ts b/src/typings/payments/forexQuote.ts new file mode 100755 index 0000000..e0730b0 --- /dev/null +++ b/src/typings/payments/forexQuote.ts @@ -0,0 +1,51 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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; +} \ No newline at end of file diff --git a/src/typings/payments/fraudCheckResult.ts b/src/typings/payments/fraudCheckResult.ts new file mode 100755 index 0000000..6f09c6f --- /dev/null +++ b/src/typings/payments/fraudCheckResult.ts @@ -0,0 +1,26 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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; +} \ No newline at end of file diff --git a/src/typings/payments/fraudResult.ts b/src/typings/payments/fraudResult.ts new file mode 100755 index 0000000..f05689d --- /dev/null +++ b/src/typings/payments/fraudResult.ts @@ -0,0 +1,23 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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?: FraudCheckResult[]; +} \ No newline at end of file diff --git a/src/typings/payments/index.ts b/src/typings/payments/index.ts new file mode 100755 index 0000000..c5fb220 --- /dev/null +++ b/src/typings/payments/index.ts @@ -0,0 +1,28 @@ +export * from './accountInfo'; +export * from './address'; +export * from './amount'; +export * from './bankAccount'; +export * from './browserInfo'; +export * from './card'; +export * from './deviceRenderOptions'; +export * from './forexQuote'; +export * from './fraudCheckResult'; +export * from './fraudResult'; +export * from './installments'; +export * from './merchantRiskIndicator'; +export * from './modificationRequest'; +export * from './modificationResult'; +export * from './name'; +export * from './paymentRequest'; +export * from './paymentRequest3d'; +export * from './paymentRequest3ds2'; +export * from './paymentResult'; +export * from './recurring'; +export * from './sDKEphemPubKey'; +export * from './split'; +export * from './splitAmount'; +export * from './threeDS2RequestData'; +export * from './threeDS2Result'; +export * from './threeDS2ResultRequest'; +export * from './threeDS2ResultResponse'; +export * from './threeDSecureData'; diff --git a/src/typings/payments/installments.ts b/src/typings/payments/installments.ts new file mode 100755 index 0000000..2020d4c --- /dev/null +++ b/src/typings/payments/installments.ts @@ -0,0 +1,18 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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; +} \ No newline at end of file diff --git a/src/typings/payments/merchantRiskIndicator.ts b/src/typings/payments/merchantRiskIndicator.ts new file mode 100755 index 0000000..eb96c6e --- /dev/null +++ b/src/typings/payments/merchantRiskIndicator.ts @@ -0,0 +1,67 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/payments/modificationRequest.ts b/src/typings/payments/modificationRequest.ts new file mode 100755 index 0000000..4f52609 --- /dev/null +++ b/src/typings/payments/modificationRequest.ts @@ -0,0 +1,51 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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'; +import { Split } from './split'; +import { ThreeDSecureData } from './threeDSecureData'; + + +export interface ModificationRequest { + /** + * This field contains additional data, which may be required for a particular modification 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 [ModificationRequest.additionalData](https://docs.adyen.com/api-reference/payments-api/modificationrequest/modificationrequest-additionaldata) section. + */ + additionalData?: any; + /** + * The merchant account that is used to process the payment. + */ + merchantAccount: string; + modificationAmount?: Amount; + mpiData?: ThreeDSecureData; + /** + * The original merchant reference to cancel. + */ + originalMerchantReference?: string; + /** + * The original pspReference of the payment to modify. This reference is returned in: * authorisation response * authorisation notification + */ + originalReference: string; + /** + * Optionally, you can specify your reference for the payment modification. This reference is visible in Customer Area and in reports. Maximum length: 80 characters. + */ + reference?: string; + /** + * The details of how the payment should be split when distributing a payment to a Marketpay Marketplace and its Accounts. + */ + splits?: Split[]; + /** + * The transaction reference provided by the PED. For point-of-sale integrations only. + */ + tenderReference?: string; + /** + * Unique terminal ID for the PED that originally processed the request. For point-of-sale integrations only. + */ + uniqueTerminalId?: string; +} \ No newline at end of file diff --git a/src/typings/payments/modificationResult.ts b/src/typings/payments/modificationResult.ts new file mode 100755 index 0000000..ae92076 --- /dev/null +++ b/src/typings/payments/modificationResult.ts @@ -0,0 +1,35 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 ModificationResult { + /** + * This field contains additional data, which may be returned in a particular modification response. + */ + additionalData?: any; + /** + * 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?: string; + /** + * Indicates if the modification request has been received for processing. + */ + response?: ModificationResult.ResponseEnum; +} +export namespace ModificationResult { + export type ResponseEnum = '[capture-received]' | '[cancel-received]' | '[refund-received]' | '[cancelOrRefund-received]'; + export const ResponseEnum = { + CaptureReceived: '[capture-received]' as ResponseEnum, + CancelReceived: '[cancel-received]' as ResponseEnum, + RefundReceived: '[refund-received]' as ResponseEnum, + CancelOrRefundReceived: '[cancelOrRefund-received]' as ResponseEnum + }; +} \ No newline at end of file diff --git a/src/typings/payments/name.ts b/src/typings/payments/name.ts new file mode 100755 index 0000000..1aece76 --- /dev/null +++ b/src/typings/payments/name.ts @@ -0,0 +1,38 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/payments/paymentRequest.ts b/src/typings/payments/paymentRequest.ts new file mode 100755 index 0000000..10cb322 --- /dev/null +++ b/src/typings/payments/paymentRequest.ts @@ -0,0 +1,183 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 { BankAccount } from './bankAccount'; +import { BrowserInfo } from './browserInfo'; +import { Card } from './card'; +import { ForexQuote } from './forexQuote'; +import { Installments } from './installments'; +import { MerchantRiskIndicator } from './merchantRiskIndicator'; +import { Name } from './name'; +import { Recurring } from './recurring'; +import { Split } from './split'; +import { ThreeDS2RequestData } from './threeDS2RequestData'; +import { ThreeDSecureData } from './threeDSecureData'; + + +export interface PaymentRequest { + accountInfo?: AccountInfo; + additionalAmount?: Amount; + /** + * This field contains additional data, which may be required for a particular payment request. + */ + additionalData?: any; + amount: Amount; + bankAccount?: BankAccount; + billingAddress?: Address; + browserInfo?: BrowserInfo; + /** + * The delay between the authorisation and scheduled auto-capture, specified in hours. + */ + captureDelayHours?: number; + card?: Card; + /** + * 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; + /** + * 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; + /** + * 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; + /** + * The two-character country code of the shopper's nationality. + */ + nationality?: string; + /** + * 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; + recurring?: Recurring; + /** + * 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; + /** + * 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; + /** + * Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + */ + selectedBrand?: string; + /** + * The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + */ + selectedRecurringDetailReference?: string; + /** + * A session ID used to identify a payment session. + */ + sessionId?: 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?: Split[]; + /** + * The physical store, for which this payment is processed. + */ + store?: string; + /** + * The shopper's telephone number. + */ + telephoneNumber?: string; + threeDS2RequestData?: ThreeDS2RequestData; + /** + * The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + */ + totalsGroup?: string; + /** + * Set to true if the payment should be routed to a trusted MID. + */ + trustedShopper?: boolean; +} +export namespace PaymentRequest { + 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 + }; +} \ No newline at end of file diff --git a/src/typings/payments/paymentRequest3d.ts b/src/typings/payments/paymentRequest3d.ts new file mode 100755 index 0000000..a75568d --- /dev/null +++ b/src/typings/payments/paymentRequest3d.ts @@ -0,0 +1,172 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 { ForexQuote } from './forexQuote'; +import { Installments } from './installments'; +import { MerchantRiskIndicator } from './merchantRiskIndicator'; +import { Name } from './name'; +import { Recurring } from './recurring'; +import { Split } from './split'; +import { ThreeDS2RequestData } from './threeDS2RequestData'; + + +export interface PaymentRequest3d { + accountInfo?: AccountInfo; + additionalAmount?: Amount; + /** + * 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 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; + /** + * An integer value that is added to the normal fraud score. The value can be either positive or negative. + */ + fraudOffset?: number; + installments?: Installments; + /** + * 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 payment session identifier returned by the card issuer. + */ + md: 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; + /** + * 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; + /** + * Payment authorisation response returned by the card issuer. The `paResponse` field holds the PaRes value received from the card issuer. + */ + paResponse: string; + recurring?: Recurring; + /** + * 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?: PaymentRequest3d.RecurringProcessingModelEnum; + /** + * 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; + /** + * Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + */ + selectedBrand?: string; + /** + * The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + */ + selectedRecurringDetailReference?: string; + /** + * A session ID used to identify a payment session. + */ + sessionId?: 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?: PaymentRequest3d.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?: Split[]; + /** + * The physical store, for which this payment is processed. + */ + store?: string; + /** + * The shopper's telephone number. + */ + telephoneNumber?: string; + threeDS2RequestData?: ThreeDS2RequestData; + /** + * The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + */ + totalsGroup?: string; + /** + * Set to true if the payment should be routed to a trusted MID. + */ + trustedShopper?: boolean; +} +export namespace PaymentRequest3d { + 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 + }; +} \ No newline at end of file diff --git a/src/typings/payments/paymentRequest3ds2.ts b/src/typings/payments/paymentRequest3ds2.ts new file mode 100755 index 0000000..5f6c6bd --- /dev/null +++ b/src/typings/payments/paymentRequest3ds2.ts @@ -0,0 +1,170 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 { ForexQuote } from './forexQuote'; +import { Installments } from './installments'; +import { MerchantRiskIndicator } from './merchantRiskIndicator'; +import { Name } from './name'; +import { Recurring } from './recurring'; +import { Split } from './split'; +import { ThreeDS2RequestData } from './threeDS2RequestData'; +import { ThreeDS2Result } from './threeDS2Result'; + + +export interface PaymentRequest3ds2 { + accountInfo?: AccountInfo; + additionalAmount?: Amount; + /** + * 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 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; + /** + * An integer value that is added to the normal fraud score. The value can be either positive or negative. + */ + fraudOffset?: number; + installments?: Installments; + /** + * 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; + /** + * 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; + recurring?: Recurring; + /** + * 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?: PaymentRequest3ds2.RecurringProcessingModelEnum; + /** + * 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; + /** + * Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + */ + selectedBrand?: string; + /** + * The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + */ + selectedRecurringDetailReference?: string; + /** + * A session ID used to identify a payment session. + */ + sessionId?: 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?: PaymentRequest3ds2.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?: Split[]; + /** + * The physical store, for which this payment is processed. + */ + store?: string; + /** + * The shopper's telephone number. + */ + telephoneNumber?: string; + threeDS2RequestData?: ThreeDS2RequestData; + threeDS2Result?: ThreeDS2Result; + /** + * The ThreeDS2Token that was returned in the /authorise call. + */ + threeDS2Token?: string; + /** + * The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + */ + totalsGroup?: string; + /** + * Set to true if the payment should be routed to a trusted MID. + */ + trustedShopper?: boolean; +} +export namespace PaymentRequest3ds2 { + 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 + }; +} \ No newline at end of file diff --git a/src/typings/payments/paymentResult.ts b/src/typings/payments/paymentResult.ts new file mode 100755 index 0000000..97b73cf --- /dev/null +++ b/src/typings/payments/paymentResult.ts @@ -0,0 +1,69 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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'; +import { FraudResult } from './fraudResult'; + + +export interface PaymentResult { + /** + * 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; + /** + * Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. + */ + authCode?: string; + dccAmount?: Amount; + /** + * Cryptographic signature used to verify `dccQuote`. > This value only applies if you have implemented Dynamic Currency Conversion. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + */ + dccSignature?: string; + fraudResult?: FraudResult; + /** + * The URL to direct the shopper to. > In case of SecurePlus, do not redirect a shopper to this URL. + */ + issuerUrl?: string; + /** + * The payment session. + */ + md?: string; + /** + * The 3D request data for the issuer. If the value is **CUPSecurePlus-CollectSMSVerificationCode**, collect an SMS code from the shopper and pass it in the `/authorise3D` request. For more information, see [3D Secure](https://docs.adyen.com/classic-integration/3d-secure). + */ + paRequest?: 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; + /** + * 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?: PaymentResult.ResultCodeEnum; +} +export namespace PaymentResult { + 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 + }; +} \ No newline at end of file diff --git a/src/typings/payments/recurring.ts b/src/typings/payments/recurring.ts new file mode 100755 index 0000000..805f336 --- /dev/null +++ b/src/typings/payments/recurring.ts @@ -0,0 +1,47 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/payments/sDKEphemPubKey.ts b/src/typings/payments/sDKEphemPubKey.ts new file mode 100755 index 0000000..e67d95f --- /dev/null +++ b/src/typings/payments/sDKEphemPubKey.ts @@ -0,0 +1,30 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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; +} \ No newline at end of file diff --git a/src/typings/payments/split.ts b/src/typings/payments/split.ts new file mode 100755 index 0000000..fc903dd --- /dev/null +++ b/src/typings/payments/split.ts @@ -0,0 +1,43 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 { SplitAmount } from './splitAmount'; + + +export interface Split { + /** + * The account to which this split applies. >Required if the type is `MarketPlace`. + */ + account?: string; + amount: SplitAmount; + /** + * A description of this split. + */ + description?: string; + /** + * The reference of this split. Used to link other operations (e.g. captures and refunds) to this split. >Required if the type is `MarketPlace`. + */ + reference?: string; + /** + * The type of this split. >Permitted values: `Default`, `PaymentFee`, `VAT`, `Commission`, `MarketPlace`, `Verification`. + */ + type: Split.TypeEnum; +} +export namespace Split { + export type TypeEnum = 'Commission' | 'Default' | 'MarketPlace' | 'PaymentFee' | 'VAT' | 'Verification'; + export const TypeEnum = { + Commission: 'Commission' as TypeEnum, + Default: 'Default' as TypeEnum, + MarketPlace: 'MarketPlace' as TypeEnum, + PaymentFee: 'PaymentFee' as TypeEnum, + VAT: 'VAT' as TypeEnum, + Verification: 'Verification' as TypeEnum + }; +} \ No newline at end of file diff --git a/src/typings/payments/splitAmount.ts b/src/typings/payments/splitAmount.ts new file mode 100755 index 0000000..dcfdeca --- /dev/null +++ b/src/typings/payments/splitAmount.ts @@ -0,0 +1,22 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 SplitAmount { + /** + * The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes). If this value is not provided, the currency in which the payment is made will be used. + */ + 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; +} \ No newline at end of file diff --git a/src/typings/payments/threeDS2RequestData.ts b/src/typings/payments/threeDS2RequestData.ts new file mode 100755 index 0000000..231c7ff --- /dev/null +++ b/src/typings/payments/threeDS2RequestData.ts @@ -0,0 +1,82 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 { DeviceRenderOptions } from './deviceRenderOptions'; +import { SDKEphemPubKey } from './sDKEphemPubKey'; + + +export interface ThreeDS2RequestData { + /** + * If set to true, you will only perform the [3D Secure 2 authentication](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration), and not the payment authorisation. + */ + authenticationOnly?: boolean; + /** + * Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * `noPreference` * `requestNoChallenge` * `requestChallenge` + */ + challengeIndicator?: ThreeDS2RequestData.ChallengeIndicatorEnum; + /** + * The environment of the shopper. Allowed values: * `app` * `browser` + */ + deviceChannel: string; + deviceRenderOptions?: DeviceRenderOptions; + /** + * The `messageVersion` value indicating the 3D Secure 2 protocol version. + */ + messageVersion?: string; + /** + * URL to where the issuer should send the `CRes`. Required if you are not using components for `channel` **Web** or if you are using classic integration `deviceChannel` **browser**. + */ + notificationURL?: string; + /** + * The `sdkAppID` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. + */ + sdkAppID?: string; + /** + * The `sdkEncData` value as received from the 3D Secure 2 SDK. Required for `deviceChannel` set to **app**. + */ + sdkEncData?: string; + sdkEphemPubKey?: SDKEphemPubKey; + /** + * The maximum amount of time in minutes for the 3D Secure 2 authentication process. Only for `deviceChannel` set to **app**. + */ + sdkMaxTimeout?: number; + /** + * The `sdkReferenceNumber` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. + */ + sdkReferenceNumber?: string; + /** + * The `sdkTransID` value as received from the 3D Secure 2 SDK. Only for `deviceChannel` set to **app**. + */ + sdkTransID?: string; + /** + * Completion indicator for the device fingerprinting. + */ + threeDSCompInd?: string; + /** + * Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration) for Visa. Unique 3D Secure requestor identifier assigned by the Directory Server when you enrol for 3D Secure 2. + */ + threeDSRequestorID?: string; + /** + * Required for [authentication-only integration](https://docs.adyen.com/checkout/3d-secure-2/3ds2-checkout-authentication-only-integration) for Visa. Unique 3D Secure requestor name assigned by the Directory Server when you enrol for 3D Secure 2. + */ + threeDSRequestorName?: string; + /** + * URL of the (customer service) website that will be shown to the shopper in case of technical errors during the 3D Secure 2 process. + */ + threeDSRequestorURL?: string; +} +export namespace ThreeDS2RequestData { + export type ChallengeIndicatorEnum = 'noPreference' | 'requestNoChallenge' | 'requestChallenge'; + export const ChallengeIndicatorEnum = { + NoPreference: 'noPreference' as ChallengeIndicatorEnum, + RequestNoChallenge: 'requestNoChallenge' as ChallengeIndicatorEnum, + RequestChallenge: 'requestChallenge' as ChallengeIndicatorEnum + }; +} \ No newline at end of file diff --git a/src/typings/payments/threeDS2Result.ts b/src/typings/payments/threeDS2Result.ts new file mode 100755 index 0000000..c3080da --- /dev/null +++ b/src/typings/payments/threeDS2Result.ts @@ -0,0 +1,42 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 ThreeDS2Result { + /** + * The `authenticationValue` value as defined in the 3D Secure 2 specification. + */ + authenticationValue?: string; + /** + * The `dsTransID` value as defined in the 3D Secure 2 specification. + */ + dsTransID?: string; + /** + * The `eci` value as defined in the 3D Secure 2 specification. + */ + eci?: string; + /** + * The `threeDSServerTransID` value as defined in the 3D Secure 2 specification. + */ + threeDSServerTransID?: string; + /** + * The `timestamp` value of the 3D Secure 2 authentication. + */ + timestamp?: string; + /** + * The `transStatus` value as defined in the 3D Secure 2 specification. + */ + transStatus?: string; + /** + * The `transStatusReason` value as defined in the 3D Secure 2 specification. + */ + transStatusReason?: string; +} \ No newline at end of file diff --git a/src/typings/payments/threeDS2ResultRequest.ts b/src/typings/payments/threeDS2ResultRequest.ts new file mode 100755 index 0000000..85c23b0 --- /dev/null +++ b/src/typings/payments/threeDS2ResultRequest.ts @@ -0,0 +1,22 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 ThreeDS2ResultRequest { + /** + * The merchant account identifier, with which you want to process the transaction. + */ + merchantAccount: string; + /** + * The pspReference returned in the /authorise call. + */ + pspReference: string; +} \ No newline at end of file diff --git a/src/typings/payments/threeDS2ResultResponse.ts b/src/typings/payments/threeDS2ResultResponse.ts new file mode 100755 index 0000000..c0c7ecd --- /dev/null +++ b/src/typings/payments/threeDS2ResultResponse.ts @@ -0,0 +1,16 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 { ThreeDS2Result } from './threeDS2Result'; + + +export interface ThreeDS2ResultResponse { + threeDS2Result?: ThreeDS2Result; +} \ No newline at end of file diff --git a/src/typings/payments/threeDSecureData.ts b/src/typings/payments/threeDSecureData.ts new file mode 100755 index 0000000..552977e --- /dev/null +++ b/src/typings/payments/threeDSecureData.ts @@ -0,0 +1,63 @@ +/** + * Adyen Payment Service + * A set of API endpoints that allow you to initiate, settle, and modify payments on the Adyen payments platform. You can use the API to accept card payments (including One-Click and 3D Secure), bank transfers, ewallets, and many other payment methods. To learn more about the API, visit [Classic integration](https://docs.adyen.com/classic-integration). ## Authentication To connect to the Payments API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Payments API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Payment/v46/authorise ``` + * + * 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 ThreeDSecureData { + /** + * In 3D Secure 1, the authentication response if the shopper was redirected. In 3D Secure 2, this is the `transStatus` from challenge flow. If the transaction was frictionless, set this value to **Y**. + */ + authenticationResponse?: ThreeDSecureData.AuthenticationResponseEnum; + /** + * The cardholder authentication value (base64 encoded, 20 bytes in a decoded form). + */ + cavv?: string; + /** + * The CAVV algorithm used. Include this only for 3D Secure 1. + */ + cavvAlgorithm?: string; + /** + * In 3D Secure 1, this is the enrollment response from the 3D directory server. In 3D Secure 2, this is the `transStatus` from 3D Secure device fingerprinting result. + */ + directoryResponse?: ThreeDSecureData.DirectoryResponseEnum; + /** + * Supported for 3D Secure 2. The unique transaction identifier assigned by the Directory Server (DS) to identify a single transaction. + */ + dsTransID?: string; + /** + * The electronic commerce indicator. + */ + eci?: string; + /** + * The version of the 3D Secure protocol. + */ + threeDSVersion?: string; + /** + * Supported for 3D Secure 1. The transaction identifier (Base64-encoded, 20 bytes in a decoded form). + */ + xid?: string; +} +export namespace ThreeDSecureData { + export type AuthenticationResponseEnum = 'Y' | 'N' | 'U' | 'A'; + export const AuthenticationResponseEnum = { + Y: 'Y' as AuthenticationResponseEnum, + N: 'N' as AuthenticationResponseEnum, + U: 'U' as AuthenticationResponseEnum, + A: 'A' as AuthenticationResponseEnum + }; + export type DirectoryResponseEnum = 'Y' | 'N' | 'U' | 'E' | 'C'; + export const DirectoryResponseEnum = { + Y: 'Y' as DirectoryResponseEnum, + N: 'N' as DirectoryResponseEnum, + U: 'U' as DirectoryResponseEnum, + E: 'E' as DirectoryResponseEnum, + C: 'C' as DirectoryResponseEnum + }; +} \ No newline at end of file diff --git a/src/typings/payout/address.ts b/src/typings/payout/address.ts new file mode 100755 index 0000000..0ed7fa3 --- /dev/null +++ b/src/typings/payout/address.ts @@ -0,0 +1,38 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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. >Required if either houseNumberOrName, street, city, or stateOrProvince are provided. + */ + 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; +} \ No newline at end of file diff --git a/src/typings/payout/amount.ts b/src/typings/payout/amount.ts new file mode 100755 index 0000000..7f9bfa1 --- /dev/null +++ b/src/typings/payout/amount.ts @@ -0,0 +1,22 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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; +} \ No newline at end of file diff --git a/src/typings/payout/bankAccount.ts b/src/typings/payout/bankAccount.ts new file mode 100755 index 0000000..c03a767 --- /dev/null +++ b/src/typings/payout/bankAccount.ts @@ -0,0 +1,50 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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; +} \ No newline at end of file diff --git a/src/typings/payout/browserInfo.ts b/src/typings/payout/browserInfo.ts new file mode 100755 index 0000000..b440a78 --- /dev/null +++ b/src/typings/payout/browserInfo.ts @@ -0,0 +1,22 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 user agent value of the shopper's browser. + */ + userAgent: string; +} \ No newline at end of file diff --git a/src/typings/payout/card.ts b/src/typings/payout/card.ts new file mode 100755 index 0000000..87eb73e --- /dev/null +++ b/src/typings/payout/card.ts @@ -0,0 +1,46 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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/payment-glossary#cardsecuritycodecvccvvcid) (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/features/client-side-encryption), 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; +} \ No newline at end of file diff --git a/src/typings/payout/forexQuote.ts b/src/typings/payout/forexQuote.ts new file mode 100755 index 0000000..c597a38 --- /dev/null +++ b/src/typings/payout/forexQuote.ts @@ -0,0 +1,51 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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; +} \ No newline at end of file diff --git a/src/typings/payout/fraudCheckResult.ts b/src/typings/payout/fraudCheckResult.ts new file mode 100755 index 0000000..2d07b37 --- /dev/null +++ b/src/typings/payout/fraudCheckResult.ts @@ -0,0 +1,26 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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; +} \ No newline at end of file diff --git a/src/typings/payout/fraudResult.ts b/src/typings/payout/fraudResult.ts new file mode 100755 index 0000000..502e4db --- /dev/null +++ b/src/typings/payout/fraudResult.ts @@ -0,0 +1,23 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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; +} \ No newline at end of file diff --git a/src/typings/payout/fundSource.ts b/src/typings/payout/fundSource.ts new file mode 100755 index 0000000..7c27103 --- /dev/null +++ b/src/typings/payout/fundSource.ts @@ -0,0 +1,32 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 { Card } from './card'; +import { Name } from './name'; + + +export interface FundSource { + /** + * a map of name/value pairs for passing in additional/industry-specific data + */ + additionalData?: any; + billingAddress?: Address; + card?: Card; + /** + * the email address of the person + */ + shopperEmail?: string; + shopperName?: Name; + /** + * the telephone number of the person + */ + telephoneNumber?: string; +} \ No newline at end of file diff --git a/src/typings/payout/index.ts b/src/typings/payout/index.ts new file mode 100755 index 0000000..b76c54b --- /dev/null +++ b/src/typings/payout/index.ts @@ -0,0 +1,23 @@ +export * from './address'; +export * from './amount'; +export * from './bankAccount'; +export * from './browserInfo'; +export * from './card'; +export * from './forexQuote'; +export * from './fraudCheckResult'; +export * from './fraudResult'; +export * from './fundSource'; +export * from './installments'; +export * from './modifyRequest'; +export * from './modifyResponse'; +export * from './name'; +export * from './payoutRequest'; +export * from './payoutResponse'; +export * from './recurring'; +export * from './storeDetailAndSubmitRequest'; +export * from './storeDetailAndSubmitResponse'; +export * from './storeDetailRequest'; +export * from './storeDetailResponse'; +export * from './submitRequest'; +export * from './submitResponse'; +export * from './threeDSecureData'; diff --git a/src/typings/payout/installments.ts b/src/typings/payout/installments.ts new file mode 100755 index 0000000..9ebbee8 --- /dev/null +++ b/src/typings/payout/installments.ts @@ -0,0 +1,18 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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; +} \ No newline at end of file diff --git a/src/typings/payout/modifyRequest.ts b/src/typings/payout/modifyRequest.ts new file mode 100755 index 0000000..d5c3259 --- /dev/null +++ b/src/typings/payout/modifyRequest.ts @@ -0,0 +1,26 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 ModifyRequest { + /** + * This field contains additional data, which may be required for a particular payout request. + */ + additionalData?: any; + /** + * The merchant account identifier, with which you want to process the transaction. + */ + merchantAccount: string; + /** + * The PSP reference received in the `/submitThirdParty` response. + */ + originalReference: string; +} \ No newline at end of file diff --git a/src/typings/payout/modifyResponse.ts b/src/typings/payout/modifyResponse.ts new file mode 100755 index 0000000..d1975af --- /dev/null +++ b/src/typings/payout/modifyResponse.ts @@ -0,0 +1,26 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 ModifyResponse { + /** + * This field contains additional data, which may be returned in a particular response. + */ + additionalData?: any; + /** + * Adyen's 16-character string reference associated with the transaction. This value is globally unique; quote it when communicating with us about this response. + */ + pspReference: string; + /** + * The response: * In case of success, it is either `payout-confirm-received` or `payout-decline-received`. * In case of an error, an informational message is returned. + */ + response: string; +} \ No newline at end of file diff --git a/src/typings/payout/name.ts b/src/typings/payout/name.ts new file mode 100755 index 0000000..afb046e --- /dev/null +++ b/src/typings/payout/name.ts @@ -0,0 +1,38 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/payout/payoutRequest.ts b/src/typings/payout/payoutRequest.ts new file mode 100755 index 0000000..704208b --- /dev/null +++ b/src/typings/payout/payoutRequest.ts @@ -0,0 +1,169 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 { BankAccount } from './bankAccount'; +import { BrowserInfo } from './browserInfo'; +import { Card } from './card'; +import { ForexQuote } from './forexQuote'; +import { FundSource } from './fundSource'; +import { Installments } from './installments'; +import { Name } from './name'; +import { Recurring } from './recurring'; +import { ThreeDSecureData } from './threeDSecureData'; + + +export interface PayoutRequest { + additionalAmount?: Amount; + /** + * 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; + bankAccount?: BankAccount; + billingAddress?: Address; + browserInfo?: BrowserInfo; + /** + * The delay between the authorisation and scheduled auto-capture, specified in hours. + */ + captureDelayHours?: number; + card?: Card; + /** + * 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; + /** + * The type of the entity the payment is processed for. + */ + entityType?: PayoutRequest.EntityTypeEnum; + /** + * An integer value that is added to the normal fraud score. The value can be either positive or negative. + */ + fraudOffset?: number; + fundSource?: FundSource; + installments?: Installments; + /** + * 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. > 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; + mpiData?: ThreeDSecureData; + /** + * The two-character country code of the shopper's nationality. + */ + nationality?: string; + /** + * The order reference to link multiple partial payments. + */ + orderReference?: string; + recurring?: Recurring; + /** + * 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. + */ + recurringProcessingModel?: PayoutRequest.RecurringProcessingModelEnum; + /** + * 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; + /** + * Some payment methods require defining a value for this field to specify how to process the transaction. For the Bancontact payment method, it can be set to: * `maestro` (default), to be processed like a Maestro card, or * `bcmc`, to be processed like a Bancontact card. + */ + selectedBrand?: string; + /** + * The `recurringDetailReference` you want to use for this payment. The value `LATEST` can be used to select the most recently stored recurring detail. + */ + selectedRecurringDetailReference?: string; + /** + * A session ID used to identify a payment session. + */ + sessionId?: string; + /** + * The shopper's email address. We recommend that you provide this data, as it is used in velocity fraud checks. + */ + 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?: PayoutRequest.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 physical store, for which this payment is processed. + */ + store?: string; + /** + * The shopper's telephone number. + */ + telephoneNumber?: string; + /** + * The reference value to aggregate sales totals in reporting. When not specified, the store field is used (if available). + */ + totalsGroup?: string; +} +export namespace PayoutRequest { + export type EntityTypeEnum = 'NaturalPerson' | 'CompanyName'; + export const EntityTypeEnum = { + NaturalPerson: 'NaturalPerson' as EntityTypeEnum, + CompanyName: 'CompanyName' as EntityTypeEnum + }; + export type RecurringProcessingModelEnum = 'CardOnFile' | 'Subscription'; + export const RecurringProcessingModelEnum = { + CardOnFile: 'CardOnFile' as RecurringProcessingModelEnum, + Subscription: 'Subscription' 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 + }; +} \ No newline at end of file diff --git a/src/typings/payout/payoutResponse.ts b/src/typings/payout/payoutResponse.ts new file mode 100755 index 0000000..e3ddfe1 --- /dev/null +++ b/src/typings/payout/payoutResponse.ts @@ -0,0 +1,66 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 { FraudResult } from './fraudResult'; + + +export interface PayoutResponse { + /** + * 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; + /** + * Authorisation code: * When the payment is authorised successfully, this field holds the authorisation code for the payment. * When the payment is not authorised, this field is empty. + */ + authCode?: string; + dccAmount?: Amount; + /** + * Cryptographic signature used to verify `dccQuote`. > This value only applies if you have implemented Dynamic Currency Conversion. For more information, [contact Support](https://support.adyen.com/hc/en-us/requests/new). + */ + dccSignature?: string; + fraudResult?: FraudResult; + /** + * The URL to direct the shopper to. > In case of SecurePlus, do not redirect a shopper to this URL. + */ + issuerUrl?: string; + /** + * The payment session. + */ + md?: string; + /** + * The 3D request data for the issuer. If the value is **CUPSecurePlus-CollectSMSVerificationCode**, collect an SMS code from the shopper and pass it in the `/authorise3D` request. For more information, see [3D Secure](https://docs.adyen.com/risk-management/3d-secure). + */ + paRequest?: 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; + /** + * The result of the payment. Possible values: * **Authorised** – Indicates the payment authorisation was successfully completed. This state serves as an indicator to proceed with the delivery of goods and services. This is a final state. * **Refused** – Indicates the payment was refused. The reason is given in the `refusalReason` field. This is a final state. * **RedirectShopper** – Indicates the shopper should be redirected to an external web page or app to complete the authorisation. * **Received** – Indicates the payment has successfully been received by Adyen, and will be processed. This is the initial state for all payments. * **Cancelled** – Indicates the payment has been cancelled (either by the shopper or the merchant) before processing was completed. 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). * **Error** – Indicates an error occurred during processing of the payment. The reason is given in the `refusalReason` field. This is a final state. + */ + resultCode?: PayoutResponse.ResultCodeEnum; +} +export namespace PayoutResponse { + export type ResultCodeEnum = 'Authorised' | 'PartiallyAuthorised' | 'Refused' | 'Error' | 'Cancelled' | 'Received' | 'RedirectShopper'; + export const ResultCodeEnum = { + Authorised: 'Authorised' as ResultCodeEnum, + PartiallyAuthorised: 'PartiallyAuthorised' as ResultCodeEnum, + Refused: 'Refused' as ResultCodeEnum, + Error: 'Error' as ResultCodeEnum, + Cancelled: 'Cancelled' as ResultCodeEnum, + Received: 'Received' as ResultCodeEnum, + RedirectShopper: 'RedirectShopper' as ResultCodeEnum + }; +} \ No newline at end of file diff --git a/src/typings/payout/recurring.ts b/src/typings/payout/recurring.ts new file mode 100755 index 0000000..9901677 --- /dev/null +++ b/src/typings/payout/recurring.ts @@ -0,0 +1,39 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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; + /** + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/payout/storeDetailAndSubmitRequest.ts b/src/typings/payout/storeDetailAndSubmitRequest.ts new file mode 100755 index 0000000..bd5f856 --- /dev/null +++ b/src/typings/payout/storeDetailAndSubmitRequest.ts @@ -0,0 +1,81 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 { BankAccount } from './bankAccount'; +import { Card } from './card'; +import { Name } from './name'; +import { Recurring } from './recurring'; + + +export interface StoreDetailAndSubmitRequest { + /** + * This field contains additional data, which may be required for a particular request. + */ + additionalData?: any; + amount: Amount; + bank?: BankAccount; + billingAddress?: Address; + card?: Card; + /** + * The date of birth. Format: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD For Paysafecard it must be the same as used when registering the Paysafecard account. > This field is mandatory for natural persons. + */ + dateOfBirth: Date; + /** + * The type of the entity the payout is processed for. + */ + entityType: StoreDetailAndSubmitRequest.EntityTypeEnum; + /** + * An integer value that is added to the normal fraud score. The value can be either positive or negative. + */ + fraudOffset?: number; + /** + * The merchant account identifier, with which you want to process the transaction. + */ + merchantAccount: string; + /** + * The shopper's nationality. A valid value is an ISO 2-character country code (e.g. 'NL'). + */ + nationality: string; + recurring: Recurring; + /** + * The merchant reference for this payment. This reference will be used in all communication to the merchant about the status of the payout. Although it is a good idea to make sure it is unique, this is not a requirement. + */ + reference: string; + /** + * The name of the brand to make a payout to. For Paysafecard it must be set to `paysafecard`. + */ + selectedBrand?: string; + /** + * The shopper's email address. + */ + shopperEmail: string; + shopperName?: Name; + /** + * The shopper's reference for the payment transaction. + */ + shopperReference: string; + /** + * The description of this payout. This description is shown on the bank statement of the shopper (if this is supported by the chosen payment method). + */ + shopperStatement?: string; + /** + * The shopper's social security number. + */ + socialSecurityNumber?: string; +} +export namespace StoreDetailAndSubmitRequest { + export type EntityTypeEnum = 'NaturalPerson' | 'Company'; + export const EntityTypeEnum = { + NaturalPerson: 'NaturalPerson' as EntityTypeEnum, + Company: 'Company' as EntityTypeEnum + }; +} \ No newline at end of file diff --git a/src/typings/payout/storeDetailAndSubmitResponse.ts b/src/typings/payout/storeDetailAndSubmitResponse.ts new file mode 100755 index 0000000..f47d7ab --- /dev/null +++ b/src/typings/payout/storeDetailAndSubmitResponse.ts @@ -0,0 +1,30 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 StoreDetailAndSubmitResponse { + /** + * This field contains additional data, which may be returned in a particular response. + */ + additionalData?: any; + /** + * A new reference to uniquely identify this request. + */ + pspReference: string; + /** + * In case of refusal, an informational message for the reason. + */ + refusalReason?: string; + /** + * The response: * In case of success is payout-submit-received. * In case of an error, an informational message is returned. + */ + resultCode: string; +} \ No newline at end of file diff --git a/src/typings/payout/storeDetailRequest.ts b/src/typings/payout/storeDetailRequest.ts new file mode 100755 index 0000000..d59f936 --- /dev/null +++ b/src/typings/payout/storeDetailRequest.ts @@ -0,0 +1,71 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 { BankAccount } from './bankAccount'; +import { Card } from './card'; +import { Name } from './name'; +import { Recurring } from './recurring'; + + +export interface StoreDetailRequest { + /** + * This field contains additional data, which may be required for a particular request. + */ + additionalData?: any; + bank?: BankAccount; + billingAddress?: Address; + card?: Card; + /** + * The date of birth. Format: [ISO-8601](https://www.w3.org/TR/NOTE-datetime); example: YYYY-MM-DD For Paysafecard it must be the same as used when registering the Paysafecard account. > This field is mandatory for natural persons. + */ + dateOfBirth: Date; + /** + * The type of the entity the payout is processed for. + */ + entityType: StoreDetailRequest.EntityTypeEnum; + /** + * An integer value that is added to the normal fraud score. The value can be either positive or negative. + */ + fraudOffset?: number; + /** + * The merchant account identifier, with which you want to process the transaction. + */ + merchantAccount: string; + /** + * The shopper's nationality. A valid value is an ISO 2-character country code (e.g. 'NL'). + */ + nationality: string; + recurring: Recurring; + /** + * The name of the brand to make a payout to. For Paysafecard it must be set to `paysafecard`. + */ + selectedBrand?: string; + /** + * The shopper's email address. + */ + shopperEmail: string; + shopperName?: Name; + /** + * The shopper's reference for the payment transaction. + */ + shopperReference: string; + /** + * The shopper's social security number. + */ + socialSecurityNumber?: string; +} +export namespace StoreDetailRequest { + export type EntityTypeEnum = 'NaturalPerson' | 'Company'; + export const EntityTypeEnum = { + NaturalPerson: 'NaturalPerson' as EntityTypeEnum, + Company: 'Company' as EntityTypeEnum + }; +} \ No newline at end of file diff --git a/src/typings/payout/storeDetailResponse.ts b/src/typings/payout/storeDetailResponse.ts new file mode 100755 index 0000000..ce899b9 --- /dev/null +++ b/src/typings/payout/storeDetailResponse.ts @@ -0,0 +1,30 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 StoreDetailResponse { + /** + * This field contains additional data, which may be returned in a particular response. + */ + additionalData?: any; + /** + * A new reference to uniquely identify this request. + */ + pspReference: string; + /** + * The token which you can use later on for submitting the payout. + */ + recurringDetailReference: string; + /** + * The result code of the transaction. `Success` indicates that the details were stored successfully. + */ + resultCode: string; +} \ No newline at end of file diff --git a/src/typings/payout/submitRequest.ts b/src/typings/payout/submitRequest.ts new file mode 100755 index 0000000..af5c965 --- /dev/null +++ b/src/typings/payout/submitRequest.ts @@ -0,0 +1,75 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 { Name } from './name'; +import { Recurring } from './recurring'; + + +export interface SubmitRequest { + /** + * This field contains additional data, which may be required for a particular request. + */ + additionalData?: any; + amount: Amount; + /** + * The date of birth. Format: ISO-8601; example: YYYY-MM-DD For Paysafecard it must be the same as used when registering the Paysafecard account. > This field is mandatory for natural persons. > This field is required to update the existing `dateOfBirth` that is associated with this recurring contract. + */ + dateOfBirth?: Date; + /** + * The type of the entity the payout is processed for. Allowed values: * NaturalPerson * Company > This field is required to update the existing `entityType` that is associated with this recurring contract. + */ + entityType?: SubmitRequest.EntityTypeEnum; + /** + * An integer value that is added to the normal fraud score. The value can be either positive or negative. + */ + fraudOffset?: number; + /** + * The merchant account identifier you want to process the transaction request with. + */ + merchantAccount: string; + /** + * The shopper's nationality. A valid value is an ISO 2-character country code (e.g. 'NL'). > This field is required to update the existing nationality that is associated with this recurring contract. + */ + nationality?: string; + recurring: Recurring; + /** + * The merchant reference for this payout. This reference will be used in all communication to the merchant about the status of the payout. Although it is a good idea to make sure it is unique, this is not a requirement. + */ + reference: string; + /** + * This is the `recurringDetailReference` you want to use for this payout. You can use the value LATEST to select the most recently used recurring detail. + */ + selectedRecurringDetailReference: string; + /** + * The shopper's email address. + */ + shopperEmail: string; + shopperName?: Name; + /** + * The shopper's reference for the payout transaction. + */ + shopperReference: string; + /** + * The description of this payout. This description is shown on the bank statement of the shopper (if this is supported by the chosen payment method). + */ + shopperStatement?: string; + /** + * The shopper's social security number. + */ + socialSecurityNumber?: string; +} +export namespace SubmitRequest { + export type EntityTypeEnum = 'NaturalPerson' | 'Company'; + export const EntityTypeEnum = { + NaturalPerson: 'NaturalPerson' as EntityTypeEnum, + Company: 'Company' as EntityTypeEnum + }; +} \ No newline at end of file diff --git a/src/typings/payout/submitResponse.ts b/src/typings/payout/submitResponse.ts new file mode 100755 index 0000000..be3fd01 --- /dev/null +++ b/src/typings/payout/submitResponse.ts @@ -0,0 +1,30 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 SubmitResponse { + /** + * This field contains additional data, which may be returned in a particular response. + */ + additionalData?: any; + /** + * A new reference to uniquely identify this request. + */ + pspReference: string; + /** + * In case of refusal, an informational message for the reason. + */ + refusalReason?: string; + /** + * The response: * In case of success, it is `payout-submit-received`. * In case of an error, an informational message is returned. + */ + resultCode: string; +} \ No newline at end of file diff --git a/src/typings/payout/threeDSecureData.ts b/src/typings/payout/threeDSecureData.ts new file mode 100755 index 0000000..fc90cc7 --- /dev/null +++ b/src/typings/payout/threeDSecureData.ts @@ -0,0 +1,54 @@ +/** + * Adyen Payout Service + * A set of API endpoints that allow you to store payout details, confirm, or decline a payout. For more information, refer to [Third-party payouts](https://docs.adyen.com/features/third-party-payouts). + * + * OpenAPI spec version: 30 + * 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 ThreeDSecureData { + /** + * The authentication response if the shopper was redirected. + */ + authenticationResponse?: ThreeDSecureData.AuthenticationResponseEnum; + /** + * The cardholder authentication value (base64 encoded, 20 bytes in a decoded form). + */ + cavv?: string; + /** + * The CAVV algorithm used. + */ + cavvAlgorithm?: string; + /** + * The enrollment response from the 3D directory server. + */ + directoryResponse?: ThreeDSecureData.DirectoryResponseEnum; + /** + * The electronic commerce indicator. + */ + eci?: string; + /** + * The transaction identifier (base64 encoded, 20 bytes in a decoded form). + */ + xid?: string; +} +export namespace ThreeDSecureData { + export type AuthenticationResponseEnum = 'Y' | 'N' | 'U' | 'A'; + export const AuthenticationResponseEnum = { + Y: 'Y' as AuthenticationResponseEnum, + N: 'N' as AuthenticationResponseEnum, + U: 'U' as AuthenticationResponseEnum, + A: 'A' as AuthenticationResponseEnum + }; + export type DirectoryResponseEnum = 'Y' | 'N' | 'U' | 'E'; + export const DirectoryResponseEnum = { + Y: 'Y' as DirectoryResponseEnum, + N: 'N' as DirectoryResponseEnum, + U: 'U' as DirectoryResponseEnum, + E: 'E' as DirectoryResponseEnum + }; +} \ No newline at end of file diff --git a/src/typings/recurring/address.ts b/src/typings/recurring/address.ts new file mode 100755 index 0000000..ffbc060 --- /dev/null +++ b/src/typings/recurring/address.ts @@ -0,0 +1,38 @@ +/** + * Adyen Recurring Service + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/features/tokenization). ## Authentication To connect to the Recurring API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Recurring API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v30/disable ``` + * + * OpenAPI spec version: 30 + * 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'). > If you don't know the country or are not collecting the country from the shopper, provide `countryCode` as `ZZ`. + */ + 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; +} \ No newline at end of file diff --git a/src/typings/recurring/bankAccount.ts b/src/typings/recurring/bankAccount.ts new file mode 100755 index 0000000..d9ac076 --- /dev/null +++ b/src/typings/recurring/bankAccount.ts @@ -0,0 +1,50 @@ +/** + * Adyen Recurring Service + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/features/tokenization). ## Authentication To connect to the Recurring API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Recurring API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v30/disable ``` + * + * OpenAPI spec version: 30 + * 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; +} \ No newline at end of file diff --git a/src/typings/recurring/card.ts b/src/typings/recurring/card.ts new file mode 100755 index 0000000..d075a4b --- /dev/null +++ b/src/typings/recurring/card.ts @@ -0,0 +1,46 @@ +/** + * Adyen Recurring Service + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/features/tokenization). ## Authentication To connect to the Recurring API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Recurring API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v30/disable ``` + * + * OpenAPI spec version: 30 + * 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; +} \ No newline at end of file diff --git a/src/typings/recurring/disableRequest.ts b/src/typings/recurring/disableRequest.ts new file mode 100755 index 0000000..d49fbac --- /dev/null +++ b/src/typings/recurring/disableRequest.ts @@ -0,0 +1,30 @@ +/** + * Adyen Recurring Service + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/features/tokenization). ## Authentication To connect to the Recurring API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Recurring API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v30/disable ``` + * + * OpenAPI spec version: 30 + * 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 DisableRequest { + /** + * Specify the contract if you only want to disable a specific use. This field can be set to one of the following values, or to their combination (comma-separated): * ONECLICK * RECURRING * PAYOUT + */ + contract?: string; + /** + * The merchant account identifier with which you want to process the transaction. + */ + merchantAccount: string; + /** + * The ID that uniquely identifies the recurring detail reference. If it is not provided, the whole recurring contract of the `shopperReference` will be disabled, which includes all recurring details. + */ + recurringDetailReference?: string; + /** + * The ID that uniquely identifies the shopper. This `shopperReference` must be the same as the `shopperReference` used in the initial payment. + */ + shopperReference: string; +} \ No newline at end of file diff --git a/src/typings/recurring/disableResult.ts b/src/typings/recurring/disableResult.ts new file mode 100755 index 0000000..24644ec --- /dev/null +++ b/src/typings/recurring/disableResult.ts @@ -0,0 +1,18 @@ +/** + * Adyen Recurring Service + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/features/tokenization). ## Authentication To connect to the Recurring API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Recurring API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v30/disable ``` + * + * OpenAPI spec version: 30 + * 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 DisableResult { + /** + * Depending on whether a specific recurring detail was in the request, result is either [detail-successfully-disabled] or [all-details-successfully-disabled]. + */ + response?: string; +} \ No newline at end of file diff --git a/src/typings/recurring/index.ts b/src/typings/recurring/index.ts new file mode 100755 index 0000000..452cdd4 --- /dev/null +++ b/src/typings/recurring/index.ts @@ -0,0 +1,10 @@ +export * from './address'; +export * from './bankAccount'; +export * from './card'; +export * from './disableRequest'; +export * from './disableResult'; +export * from './name'; +export * from './recurring'; +export * from './recurringDetail'; +export * from './recurringDetailsRequest'; +export * from './recurringDetailsResult'; diff --git a/src/typings/recurring/name.ts b/src/typings/recurring/name.ts new file mode 100755 index 0000000..974f1f6 --- /dev/null +++ b/src/typings/recurring/name.ts @@ -0,0 +1,38 @@ +/** + * Adyen Recurring Service + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/features/tokenization). ## Authentication To connect to the Recurring API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Recurring API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v30/disable ``` + * + * OpenAPI spec version: 30 + * 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 + }; +} \ No newline at end of file diff --git a/src/typings/recurring/recurring.ts b/src/typings/recurring/recurring.ts new file mode 100755 index 0000000..7a50841 --- /dev/null +++ b/src/typings/recurring/recurring.ts @@ -0,0 +1,39 @@ +/** + * Adyen Recurring Service + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/features/tokenization). ## Authentication To connect to the Recurring API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Recurring API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v30/disable ``` + * + * OpenAPI spec version: 30 + * 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/payments-essentials/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/features/third-party-payouts). + */ + contract?: Recurring.ContractEnum; + /** + * A descriptive name for this detail. + */ + recurringDetailName?: 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 + }; +} \ No newline at end of file diff --git a/src/typings/recurring/recurringDetail.ts b/src/typings/recurring/recurringDetail.ts new file mode 100755 index 0000000..77b0461 --- /dev/null +++ b/src/typings/recurring/recurringDetail.ts @@ -0,0 +1,66 @@ +/** + * Adyen Recurring Service + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/features/tokenization). ## Authentication To connect to the Recurring API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Recurring API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v30/disable ``` + * + * OpenAPI spec version: 30 + * 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 { BankAccount } from './bankAccount'; +import { Card } from './card'; +import { Name } from './name'; + + +export interface RecurringDetail { + /** + * This field contains additional data, which may be returned in a particular response. The additionalData object consists of entries, each of which includes the key and value. For more information on possible key-value pairs, refer to [RecurringDetail.additionalData](https://docs.adyen.com/api-reference/recurring-api#recurringdetailadditionaldata). + */ + additionalData?: any; + /** + * The alias of the credit card number. Applies only to recurring contracts storing credit card details + */ + alias?: string; + /** + * The alias type of the credit card number. Applies only to recurring contracts storing credit card details. + */ + aliasType?: string; + bank?: BankAccount; + billingAddress?: Address; + card?: Card; + /** + * Types of recurring contracts. + */ + contractTypes?: string[]; + /** + * The date when the recurring details were created. + */ + creationDate?: Date; + /** + * The `pspReference` of the first recurring payment that created the recurring detail. + */ + firstPspReference?: string; + /** + * An optional descriptive name for this recurring detail. + */ + name?: string; + /** + * The type or sub-brand of a payment method used, e.g. Visa Debit, Visa Corporate, etc. For more information, refer to [PaymentMethodVariant](https://docs.adyen.com/api-reference/common-api/paymentmethodvariant). + */ + paymentMethodVariant?: string; + /** + * The reference that uniquely identifies the recurring detail. + */ + recurringDetailReference: string; + shopperName?: Name; + /** + * A shopper's social security number (only in countries where it is legal to collect). + */ + socialSecurityNumber?: string; + /** + * The payment method, such as “mc\", \"visa\", \"ideal\", \"paypal\". + */ + variant: string; +} \ No newline at end of file diff --git a/src/typings/recurring/recurringDetailsRequest.ts b/src/typings/recurring/recurringDetailsRequest.ts new file mode 100755 index 0000000..a200fd3 --- /dev/null +++ b/src/typings/recurring/recurringDetailsRequest.ts @@ -0,0 +1,24 @@ +/** + * Adyen Recurring Service + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/features/tokenization). ## Authentication To connect to the Recurring API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Recurring API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v30/disable ``` + * + * OpenAPI spec version: 30 + * 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 { Recurring } from './recurring'; + + +export interface RecurringDetailsRequest { + /** + * The merchant account identifier you want to process the (transaction) request with. + */ + merchantAccount: string; + recurring?: Recurring; + /** + * The reference you use to uniquely identify the shopper (e.g. user ID or account ID). + */ + shopperReference: string; +} \ No newline at end of file diff --git a/src/typings/recurring/recurringDetailsResult.ts b/src/typings/recurring/recurringDetailsResult.ts new file mode 100755 index 0000000..f09fb49 --- /dev/null +++ b/src/typings/recurring/recurringDetailsResult.ts @@ -0,0 +1,31 @@ +/** + * Adyen Recurring Service + * The Recurring APIs allow you to manage and remove your tokens or saved payment details. Tokens should be created with validation during a payment request. For more information, refer to our [Tokenization documentation](https://docs.adyen.com/features/tokenization). ## Authentication To connect to the Recurring API, you must use your basic authentication credentials. For this, create your web service user, as described in [How to get the WS user password](https://docs.adyen.com/user-management/how-to-get-the-web-service-ws-user-password). Then use its credentials to authenticate your request, for example: ``` curl -U \"ws@Company.YourCompany\":\"YourWsPassword\" \\ -H \"Content-Type: application/json\" \\ ... ``` Note that when going live, you need to generate new web service user credentials to access the [live endpoints](https://docs.adyen.com/development-resources/live-endpoints). ## Versioning Recurring API supports versioning of its endpoints through a version suffix in the endpoint URL. This suffix has the following format: \"vXX\", where XX is the version number. For example: ``` https://pal-test.adyen.com/pal/servlet/Recurring/v30/disable ``` + * + * OpenAPI spec version: 30 + * 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 { RecurringDetail } from './recurringDetail'; + + +export interface RecurringDetailsResult { + /** + * The date when the recurring details were created. + */ + creationDate?: Date; + /** + * Payment details stored for recurring payments. + */ + details?: RecurringDetail[]; + /** + * The most recent email for this shopper (if available). + */ + lastKnownShopperEmail?: string; + /** + * The reference you use to uniquely identify the shopper (e.g. user ID or account ID). + */ + shopperReference?: string; +} \ No newline at end of file diff --git a/src/typings/requestOptions.ts b/src/typings/requestOptions.ts new file mode 100644 index 0000000..1a42488 --- /dev/null +++ b/src/typings/requestOptions.ts @@ -0,0 +1,8 @@ +// Generated using typescript-generator version 2.14.505 on 2019-06-03 16:13:35. + +import {RequestOptions as HttpsRequestOptions} from "https"; + +export type RequestOptions = HttpsRequestOptions & { + idempotencyKey?: string; +} + diff --git a/src/typings/terminal.ts b/src/typings/terminal.ts new file mode 100644 index 0000000..12e146d --- /dev/null +++ b/src/typings/terminal.ts @@ -0,0 +1,5532 @@ +// To parse this data: +// +// import { Convert, TerminalApiRequest, TerminalApiResponse, TerminalApiSecuredRequest, TerminalApiSecuredResponse, NexoDerivedKey, SaleToPoiSecuredMessage, SecurityKey, SecurityTrailer, SaleToPoiRequest, SaleToPoiResponse, MessageHeader, AbortRequest, BalanceInquiryRequest, BatchRequest, CardAcquisitionRequest, AdminRequest, DiagnosisRequest, DisplayRequest, EnableServiceRequest, EventNotification, GetTotalsRequest, InputRequest, InputUpdate, LoginRequest, LogoutRequest, LoyaltyRequest, PaymentRequest, PinRequest, PrintRequest, CardReaderInitRequest, CardReaderApduRequest, CardReaderPowerOffRequest, ReconciliationRequest, ReversalRequest, SoundRequest, StoredValueRequest, TransactionStatusRequest, TransmitRequest, ContentInformation, BalanceInquiryResponse, BatchResponse, CardAcquisitionResponse, AdminResponse, DiagnosisResponse, DisplayResponse, EnableServiceResponse, GetTotalsResponse, InputResponse, LoginResponse, LogoutResponse, LoyaltyResponse, PaymentResponse, PinResponse, PrintResponse, CardReaderInitResponse, CardReaderApduResponse, CardReaderPowerOffResponse, ReconciliationResponse, ReversalResponse, SoundResponse, StoredValueResponse, TransactionStatusResponse, TransmitResponse, MessageReference, DisplayOutput, PaymentAccountReq, LoyaltyAccountReq, TransactionToPerform, SaleData, CardAcquisitionTransaction, TotalFilter, InputData, OutputContent, MenuEntry, SaleSoftware, SaleTerminalData, LoyaltyTransaction, LoyaltyData, PaymentTransaction, PaymentData, CardholderPin, PrintOutput, OriginalPoiTransaction, CustomerOrder, SoundContent, StoredValueData, EnvelopedData, AuthenticatedData, SignedData, DigestedData, NamedKeyEncryptedData, Response, PaymentAccountStatus, LoyaltyAccountStatus, PerformedTransaction, PoiData, PaymentInstrumentData, LoyaltyAccount, PoiStatus, HostStatus, OutputResult, TransactionTotals, InputResult, PoiSystemData, LoyaltyResult, PaymentReceipt, PaymentResult, TrackData, IccResetData, StoredValueResult, RepeatedMessageResponse, TransactionIdentification, LoyaltyAccountId, SponsoredMerchant, SaleToIssuerData, PredefinedContent, OutputText, OutputBarcode, SaleProfile, TransactionConditions, SaleItem, LoyaltyAmount, AmountsReq, Instalment, StoredValueAccountId, EncryptedContent, AlgorithmIdentifier, EncapsulatedContent, Signer, PaymentAcquirerData, CardData, CheckData, MobileData, CashHandlingDevice, PaymentTotals, LoyaltyTotals, Input, PoiSoftware, PoiTerminalData, LoyaltyAcquirerData, Rebates, AmountsResp, CurrencyConversion, CapturedSignature, StoredValueAccountStatus, RepeatedResponseMessageBody, Parameter, SignerIdentifier, SensitiveCardData, AllowedProduct, PaymentToken, Geolocation, SensitiveMobileData, CoinsOrBills, PoiProfile, SaleItemRebate, Amount, AreaSize, SignaturePoint, IssuerAndSerialNumber, GeographicCoordinates, UtmCoordinates, Issuer, RelativeDistinguishedName, MessageClassType, MessageCategoryType, MessageType, ServicesEnabledType, TransactionActionType, EventToNotifyType, TotalDetailsType, TokenRequestedType, CustomerOrderReqType, PinRequestType, PinFormatType, ForceEntryModeType, ReconciliationType, ReversalReasonType, ResponseModeType, SoundActionType, DocumentQualifierType, ContentType, EntryModeType, DeviceType, InfoQualifyType, AccountType, LoyaltyHandlingType, PaymentType, InputCommandType, OutputFormatType, MenuEntryTagType, SaleCapabilitiesType, TerminalEnvironmentType, LoyaltyTransactionType, SoundFormatType, StoredValueTransactionType, VersionType, ResultType, ErrorConditionType, LoyaltyUnitType, PaymentInstrumentType, GlobalStatusType, PrinterStatusType, AuthenticationMethodType, TrackFormatType, IdentificationType, IdentificationSupportType, ColorType, CharacterWidthType, CharacterHeightType, CharacterStyleType, AlignmentType, BarcodeType, ServiceProfilesType, GenericProfileType, UnitOfMeasureType, InstalmentType, PeriodUnitType, StoredValueAccountType, AlgorithmType, CheckTypeCodeType, TransactionType, PoiCapabilitiesType } from "./file"; +// +// const terminalApiRequest = Convert.toTerminalApiRequest(json); +// const terminalApiResponse = Convert.toTerminalApiResponse(json); +// const terminalApiSecuredRequest = Convert.toTerminalApiSecuredRequest(json); +// const terminalApiSecuredResponse = Convert.toTerminalApiSecuredResponse(json); +// const nexoDerivedKey = Convert.toNexoDerivedKey(json); +// const saleToPoiSecuredMessage = Convert.toSaleToPoiSecuredMessage(json); +// const securityKey = Convert.toSecurityKey(json); +// const securityTrailer = Convert.toSecurityTrailer(json); +// const saleToPoiRequest = Convert.toSaleToPoiRequest(json); +// const saleToPoiResponse = Convert.toSaleToPoiResponse(json); +// const messageHeader = Convert.toMessageHeader(json); +// const abortRequest = Convert.toAbortRequest(json); +// const balanceInquiryRequest = Convert.toBalanceInquiryRequest(json); +// const batchRequest = Convert.toBatchRequest(json); +// const cardAcquisitionRequest = Convert.toCardAcquisitionRequest(json); +// const adminRequest = Convert.toAdminRequest(json); +// const diagnosisRequest = Convert.toDiagnosisRequest(json); +// const displayRequest = Convert.toDisplayRequest(json); +// const enableServiceRequest = Convert.toEnableServiceRequest(json); +// const eventNotification = Convert.toEventNotification(json); +// const getTotalsRequest = Convert.toGetTotalsRequest(json); +// const inputRequest = Convert.toInputRequest(json); +// const inputUpdate = Convert.toInputUpdate(json); +// const loginRequest = Convert.toLoginRequest(json); +// const logoutRequest = Convert.toLogoutRequest(json); +// const loyaltyRequest = Convert.toLoyaltyRequest(json); +// const paymentRequest = Convert.toPaymentRequest(json); +// const pinRequest = Convert.toPinRequest(json); +// const printRequest = Convert.toPrintRequest(json); +// const cardReaderInitRequest = Convert.toCardReaderInitRequest(json); +// const cardReaderApduRequest = Convert.toCardReaderApduRequest(json); +// const cardReaderPowerOffRequest = Convert.toCardReaderPowerOffRequest(json); +// const reconciliationRequest = Convert.toReconciliationRequest(json); +// const reversalRequest = Convert.toReversalRequest(json); +// const soundRequest = Convert.toSoundRequest(json); +// const storedValueRequest = Convert.toStoredValueRequest(json); +// const transactionStatusRequest = Convert.toTransactionStatusRequest(json); +// const transmitRequest = Convert.toTransmitRequest(json); +// const contentInformation = Convert.toContentInformation(json); +// const balanceInquiryResponse = Convert.toBalanceInquiryResponse(json); +// const batchResponse = Convert.toBatchResponse(json); +// const cardAcquisitionResponse = Convert.toCardAcquisitionResponse(json); +// const adminResponse = Convert.toAdminResponse(json); +// const diagnosisResponse = Convert.toDiagnosisResponse(json); +// const displayResponse = Convert.toDisplayResponse(json); +// const enableServiceResponse = Convert.toEnableServiceResponse(json); +// const getTotalsResponse = Convert.toGetTotalsResponse(json); +// const inputResponse = Convert.toInputResponse(json); +// const loginResponse = Convert.toLoginResponse(json); +// const logoutResponse = Convert.toLogoutResponse(json); +// const loyaltyResponse = Convert.toLoyaltyResponse(json); +// const paymentResponse = Convert.toPaymentResponse(json); +// const pinResponse = Convert.toPinResponse(json); +// const printResponse = Convert.toPrintResponse(json); +// const cardReaderInitResponse = Convert.toCardReaderInitResponse(json); +// const cardReaderApduResponse = Convert.toCardReaderApduResponse(json); +// const cardReaderPowerOffResponse = Convert.toCardReaderPowerOffResponse(json); +// const reconciliationResponse = Convert.toReconciliationResponse(json); +// const reversalResponse = Convert.toReversalResponse(json); +// const soundResponse = Convert.toSoundResponse(json); +// const storedValueResponse = Convert.toStoredValueResponse(json); +// const transactionStatusResponse = Convert.toTransactionStatusResponse(json); +// const transmitResponse = Convert.toTransmitResponse(json); +// const messageReference = Convert.toMessageReference(json); +// const displayOutput = Convert.toDisplayOutput(json); +// const paymentAccountReq = Convert.toPaymentAccountReq(json); +// const loyaltyAccountReq = Convert.toLoyaltyAccountReq(json); +// const transactionToPerform = Convert.toTransactionToPerform(json); +// const saleData = Convert.toSaleData(json); +// const cardAcquisitionTransaction = Convert.toCardAcquisitionTransaction(json); +// const xmlGregorianCalendar = Convert.toXmlGregorianCalendar(json); +// const totalFilter = Convert.toTotalFilter(json); +// const inputData = Convert.toInputData(json); +// const outputContent = Convert.toOutputContent(json); +// const menuEntry = Convert.toMenuEntry(json); +// const saleSoftware = Convert.toSaleSoftware(json); +// const saleTerminalData = Convert.toSaleTerminalData(json); +// const loyaltyTransaction = Convert.toLoyaltyTransaction(json); +// const loyaltyData = Convert.toLoyaltyData(json); +// const paymentTransaction = Convert.toPaymentTransaction(json); +// const paymentData = Convert.toPaymentData(json); +// const cardholderPin = Convert.toCardholderPin(json); +// const printOutput = Convert.toPrintOutput(json); +// const originalPoiTransaction = Convert.toOriginalPoiTransaction(json); +// const customerOrder = Convert.toCustomerOrder(json); +// const soundContent = Convert.toSoundContent(json); +// const storedValueData = Convert.toStoredValueData(json); +// const envelopedData = Convert.toEnvelopedData(json); +// const authenticatedData = Convert.toAuthenticatedData(json); +// const signedData = Convert.toSignedData(json); +// const digestedData = Convert.toDigestedData(json); +// const namedKeyEncryptedData = Convert.toNamedKeyEncryptedData(json); +// const response = Convert.toResponse(json); +// const paymentAccountStatus = Convert.toPaymentAccountStatus(json); +// const loyaltyAccountStatus = Convert.toLoyaltyAccountStatus(json); +// const performedTransaction = Convert.toPerformedTransaction(json); +// const poiData = Convert.toPoiData(json); +// const paymentInstrumentData = Convert.toPaymentInstrumentData(json); +// const loyaltyAccount = Convert.toLoyaltyAccount(json); +// const poiStatus = Convert.toPoiStatus(json); +// const hostStatus = Convert.toHostStatus(json); +// const outputResult = Convert.toOutputResult(json); +// const transactionTotals = Convert.toTransactionTotals(json); +// const inputResult = Convert.toInputResult(json); +// const poiSystemData = Convert.toPoiSystemData(json); +// const loyaltyResult = Convert.toLoyaltyResult(json); +// const paymentReceipt = Convert.toPaymentReceipt(json); +// const paymentResult = Convert.toPaymentResult(json); +// const trackData = Convert.toTrackData(json); +// const iccResetData = Convert.toIccResetData(json); +// const storedValueResult = Convert.toStoredValueResult(json); +// const repeatedMessageResponse = Convert.toRepeatedMessageResponse(json); +// const transactionIdentification = Convert.toTransactionIdentification(json); +// const loyaltyAccountId = Convert.toLoyaltyAccountId(json); +// const sponsoredMerchant = Convert.toSponsoredMerchant(json); +// const saleToIssuerData = Convert.toSaleToIssuerData(json); +// const cloneable = Convert.toCloneable(json); +// const predefinedContent = Convert.toPredefinedContent(json); +// const outputText = Convert.toOutputText(json); +// const outputBarcode = Convert.toOutputBarcode(json); +// const saleProfile = Convert.toSaleProfile(json); +// const transactionConditions = Convert.toTransactionConditions(json); +// const saleItem = Convert.toSaleItem(json); +// const loyaltyAmount = Convert.toLoyaltyAmount(json); +// const amountsReq = Convert.toAmountsReq(json); +// const instalment = Convert.toInstalment(json); +// const storedValueAccountId = Convert.toStoredValueAccountId(json); +// const encryptedContent = Convert.toEncryptedContent(json); +// const algorithmIdentifier = Convert.toAlgorithmIdentifier(json); +// const encapsulatedContent = Convert.toEncapsulatedContent(json); +// const signer = Convert.toSigner(json); +// const paymentAcquirerData = Convert.toPaymentAcquirerData(json); +// const cardData = Convert.toCardData(json); +// const checkData = Convert.toCheckData(json); +// const mobileData = Convert.toMobileData(json); +// const cashHandlingDevice = Convert.toCashHandlingDevice(json); +// const paymentTotals = Convert.toPaymentTotals(json); +// const loyaltyTotals = Convert.toLoyaltyTotals(json); +// const input = Convert.toInput(json); +// const poiSoftware = Convert.toPoiSoftware(json); +// const poiTerminalData = Convert.toPoiTerminalData(json); +// const loyaltyAcquirerData = Convert.toLoyaltyAcquirerData(json); +// const rebates = Convert.toRebates(json); +// const amountsResp = Convert.toAmountsResp(json); +// const currencyConversion = Convert.toCurrencyConversion(json); +// const capturedSignature = Convert.toCapturedSignature(json); +// const storedValueAccountStatus = Convert.toStoredValueAccountStatus(json); +// const repeatedResponseMessageBody = Convert.toRepeatedResponseMessageBody(json); +// const parameter = Convert.toParameter(json); +// const signerIdentifier = Convert.toSignerIdentifier(json); +// const sensitiveCardData = Convert.toSensitiveCardData(json); +// const allowedProduct = Convert.toAllowedProduct(json); +// const paymentToken = Convert.toPaymentToken(json); +// const geolocation = Convert.toGeolocation(json); +// const sensitiveMobileData = Convert.toSensitiveMobileData(json); +// const coinsOrBills = Convert.toCoinsOrBills(json); +// const poiProfile = Convert.toPoiProfile(json); +// const saleItemRebate = Convert.toSaleItemRebate(json); +// const amount = Convert.toAmount(json); +// const areaSize = Convert.toAreaSize(json); +// const signaturePoint = Convert.toSignaturePoint(json); +// const issuerAndSerialNumber = Convert.toIssuerAndSerialNumber(json); +// const geographicCoordinates = Convert.toGeographicCoordinates(json); +// const utmCoordinates = Convert.toUtmCoordinates(json); +// const issuer = Convert.toIssuer(json); +// const relativeDistinguishedName = Convert.toRelativeDistinguishedName(json); +// const messageClassType = Convert.toMessageClassType(json); +// const messageCategoryType = Convert.toMessageCategoryType(json); +// const messageType = Convert.toMessageType(json); +// const servicesEnabledType = Convert.toServicesEnabledType(json); +// const transactionActionType = Convert.toTransactionActionType(json); +// const eventToNotifyType = Convert.toEventToNotifyType(json); +// const totalDetailsType = Convert.toTotalDetailsType(json); +// const tokenRequestedType = Convert.toTokenRequestedType(json); +// const customerOrderReqType = Convert.toCustomerOrderReqType(json); +// const pinRequestType = Convert.toPinRequestType(json); +// const pinFormatType = Convert.toPinFormatType(json); +// const forceEntryModeType = Convert.toForceEntryModeType(json); +// const reconciliationType = Convert.toReconciliationType(json); +// const reversalReasonType = Convert.toReversalReasonType(json); +// const responseModeType = Convert.toResponseModeType(json); +// const soundActionType = Convert.toSoundActionType(json); +// const documentQualifierType = Convert.toDocumentQualifierType(json); +// const contentType = Convert.toContentType(json); +// const entryModeType = Convert.toEntryModeType(json); +// const deviceType = Convert.toDeviceType(json); +// const infoQualifyType = Convert.toInfoQualifyType(json); +// const accountType = Convert.toAccountType(json); +// const loyaltyHandlingType = Convert.toLoyaltyHandlingType(json); +// const paymentType = Convert.toPaymentType(json); +// const inputCommandType = Convert.toInputCommandType(json); +// const outputFormatType = Convert.toOutputFormatType(json); +// const menuEntryTagType = Convert.toMenuEntryTagType(json); +// const saleCapabilitiesType = Convert.toSaleCapabilitiesType(json); +// const terminalEnvironmentType = Convert.toTerminalEnvironmentType(json); +// const loyaltyTransactionType = Convert.toLoyaltyTransactionType(json); +// const soundFormatType = Convert.toSoundFormatType(json); +// const storedValueTransactionType = Convert.toStoredValueTransactionType(json); +// const versionType = Convert.toVersionType(json); +// const resultType = Convert.toResultType(json); +// const errorConditionType = Convert.toErrorConditionType(json); +// const loyaltyUnitType = Convert.toLoyaltyUnitType(json); +// const paymentInstrumentType = Convert.toPaymentInstrumentType(json); +// const globalStatusType = Convert.toGlobalStatusType(json); +// const printerStatusType = Convert.toPrinterStatusType(json); +// const authenticationMethodType = Convert.toAuthenticationMethodType(json); +// const trackFormatType = Convert.toTrackFormatType(json); +// const identificationType = Convert.toIdentificationType(json); +// const identificationSupportType = Convert.toIdentificationSupportType(json); +// const colorType = Convert.toColorType(json); +// const characterWidthType = Convert.toCharacterWidthType(json); +// const characterHeightType = Convert.toCharacterHeightType(json); +// const characterStyleType = Convert.toCharacterStyleType(json); +// const alignmentType = Convert.toAlignmentType(json); +// const barcodeType = Convert.toBarcodeType(json); +// const serviceProfilesType = Convert.toServiceProfilesType(json); +// const genericProfileType = Convert.toGenericProfileType(json); +// const unitOfMeasureType = Convert.toUnitOfMeasureType(json); +// const instalmentType = Convert.toInstalmentType(json); +// const periodUnitType = Convert.toPeriodUnitType(json); +// const storedValueAccountType = Convert.toStoredValueAccountType(json); +// const algorithmType = Convert.toAlgorithmType(json); +// const checkTypeCodeType = Convert.toCheckTypeCodeType(json); +// const transactionType = Convert.toTransactionType(json); +// const poiCapabilitiesType = Convert.toPoiCapabilitiesType(json); +// +// These functions will throw an error if the JSON doesn't +// match the expected interface, even if the JSON is valid. + +export interface TerminalApiRequest { + saleToPoiRequest?: SaleToPoiRequest; +} + +export interface SaleToPoiRequest { + abortRequest?: AbortRequest; + adminRequest?: AdminRequest; + balanceInquiryRequest?: BalanceInquiryRequest; + batchRequest?: BatchRequest; + cardAcquisitionRequest?: CardAcquisitionRequest; + cardReaderApduRequest?: CardReaderApduRequest; + cardReaderInitRequest?: CardReaderInitRequest; + cardReaderPowerOffRequest?: CardReaderPowerOffRequest; + diagnosisRequest?: DiagnosisRequest; + displayRequest?: DisplayRequest; + enableServiceRequest?: EnableServiceRequest; + eventNotification?: EventNotification; + getTotalsRequest?: GetTotalsRequest; + inputRequest?: InputRequest; + inputUpdate?: InputUpdate; + loginRequest?: LoginRequest; + logoutRequest?: LogoutRequest; + loyaltyRequest?: LoyaltyRequest; + messageHeader: MessageHeader; + paymentRequest?: PaymentRequest; + pinRequest?: PinRequest; + printRequest?: PrintRequest; + reconciliationRequest?: ReconciliationRequest; + reversalRequest?: ReversalRequest; + securityTrailer?: ContentInformation; + soundRequest?: SoundRequest; + storedValueRequest?: StoredValueRequest; + transactionStatusRequest?: TransactionStatusRequest; + transmitRequest?: TransmitRequest; +} + +export interface AbortRequest { + abortReason: string; + displayOutput?: DisplayOutput; + messageReference: MessageReference; +} + +export interface DisplayOutput { + device: DeviceType; + infoQualify: InfoQualifyType; + menuEntry?: MenuEntry[]; + minimumDisplayTime?: number; + outputContent: OutputContent; + outputSignature?: any; + responseRequiredFlag?: boolean; +} + +export enum DeviceType { + CashierDisplay = "CashierDisplay", + CashierInput = "CashierInput", + CustomerDisplay = "CustomerDisplay", + CustomerInput = "CustomerInput", +} + +export enum InfoQualifyType { + CustomerAssistance = "CustomerAssistance", + Display = "Display", + Document = "Document", + Error = "Error", + Input = "Input", + PoiReplication = "POIReplication", + Receipt = "Receipt", + Sound = "Sound", + Status = "Status", + Voucher = "Voucher", +} + +export interface MenuEntry { + defaultSelectedFlag?: boolean; + menuEntryTag?: MenuEntryTagType; + outputFormat: OutputFormatType; + outputText?: OutputText[]; + outputXhtml?: any; + predefinedContent?: PredefinedContent; +} + +export enum MenuEntryTagType { + NonSelectable = "NonSelectable", + NonSelectableSubMenu = "NonSelectableSubMenu", + Selectable = "Selectable", + SubMenu = "SubMenu", +} + +export enum OutputFormatType { + BarCode = "BarCode", + MessageRef = "MessageRef", + Text = "Text", + Xhtml = "XHTML", +} + +export interface OutputText { + alignment?: AlignmentType; + characterHeight?: CharacterHeightType; + characterSet?: number; + characterStyle?: CharacterStyleType; + characterWidth?: CharacterWidthType; + color?: ColorType; + endOfLineFlag?: boolean; + font?: string; + startColumn?: number; + startRow?: number; + text?: string; +} + +export enum AlignmentType { + Centred = "Centred", + Justified = "Justified", + Left = "Left", + Right = "Right", +} + +export enum CharacterHeightType { + DoubleHeight = "DoubleHeight", + HalfHeight = "HalfHeight", + SingleHeight = "SingleHeight", +} + +export enum CharacterStyleType { + Bold = "Bold", + Italic = "Italic", + Normal = "Normal", + Underlined = "Underlined", +} + +export enum CharacterWidthType { + DoubleWidth = "DoubleWidth", + SingleWidth = "SingleWidth", +} + +export enum ColorType { + Black = "Black", + Blue = "Blue", + Cyan = "Cyan", + Green = "Green", + Magenta = "Magenta", + Red = "Red", + White = "White", + Yellow = "Yellow", +} + +export interface PredefinedContent { + language?: string; + referenceId: string; +} + +export interface OutputContent { + outputBarcode?: OutputBarcode; + outputFormat: OutputFormatType; + outputText?: OutputText[]; + outputXhtml?: any; + predefinedContent?: PredefinedContent; +} + +export interface OutputBarcode { + barcodeType?: BarcodeType; + value?: string; +} + +export enum BarcodeType { + Code128 = "Code128", + Code25 = "Code25", + Ean13 = "EAN13", + Ean8 = "EAN8", + Pdf417 = "PDF417", + Qrcode = "QRCODE", + Upca = "UPCA", +} + +export interface MessageReference { + deviceId?: string; + messageCategory?: MessageCategoryType; + poiid?: string; + saleId?: string; + serviceId?: string; +} + +export enum MessageCategoryType { + Abort = "Abort", + Admin = "Admin", + BalanceInquiry = "BalanceInquiry", + Batch = "Batch", + CardAcquisition = "CardAcquisition", + CardReaderApdu = "CardReaderAPDU", + CardReaderInit = "CardReaderInit", + CardReaderPowerOff = "CardReaderPowerOff", + Diagnosis = "Diagnosis", + Display = "Display", + EnableService = "EnableService", + Event = "Event", + GetTotals = "GetTotals", + Input = "Input", + InputUpdate = "InputUpdate", + Login = "Login", + Logout = "Logout", + Loyalty = "Loyalty", + Payment = "Payment", + Pin = "PIN", + Print = "Print", + Reconciliation = "Reconciliation", + Reversal = "Reversal", + Sound = "Sound", + StoredValue = "StoredValue", + TransactionStatus = "TransactionStatus", + Transmit = "Transmit", +} + +export interface AdminRequest { + serviceIdentification?: string; +} + +export interface BalanceInquiryRequest { + loyaltyAccountReq?: LoyaltyAccountReq; + paymentAccountReq?: PaymentAccountReq; +} + +export interface LoyaltyAccountReq { + cardAcquisitionReference?: TransactionIdentification; + loyaltyAccountId?: LoyaltyAccountId; +} + +export interface TransactionIdentification { + timeStamp: string; + transactionId: string; +} + +export interface LoyaltyAccountId { + entryMode: EntryModeType[]; + identificationSupport?: IdentificationSupportType; + identificationType: IdentificationType; + value?: string; +} + +export enum EntryModeType { + Contactless = "Contactless", + File = "File", + Icc = "ICC", + Keyed = "Keyed", + MagStripe = "MagStripe", + Manual = "Manual", + Mobile = "Mobile", + Rfid = "RFID", + Scanned = "Scanned", + SynchronousIcc = "SynchronousICC", + Tapped = "Tapped", +} + +export enum IdentificationSupportType { + HybridCard = "HybridCard", + LinkedCard = "LinkedCard", + LoyaltyCard = "LoyaltyCard", + NoCard = "NoCard", +} + +export enum IdentificationType { + AccountNumber = "AccountNumber", + BarCode = "BarCode", + IsoTrack2 = "ISOTrack2", + Pan = "PAN", + PhoneNumber = "PhoneNumber", +} + +export interface PaymentAccountReq { + accountType?: AccountType; + cardAcquisitionReference?: TransactionIdentification; + paymentInstrumentData?: PaymentInstrumentData; +} + +export enum AccountType { + CardTotals = "CardTotals", + Checking = "Checking", + CreditCard = "CreditCard", + Default = "Default", + EpurseCard = "EpurseCard", + Investment = "Investment", + Savings = "Savings", + Universal = "Universal", +} + +export interface PaymentInstrumentData { + cardData?: CardData; + checkData?: CheckData; + mobileData?: MobileData; + paymentInstrumentType: PaymentInstrumentType; +} + +export interface CardData { + allowedProduct?: AllowedProduct[]; + allowedProductCode?: string[]; + cardCountryCode?: string; + customerOrder?: CustomerOrder[]; + entryMode?: EntryModeType[]; + maskedPan?: string; + paymentAccountRef?: string; + paymentBrand?: string; + paymentToken?: PaymentToken; + protectedCardData?: ContentInformation; + sensitiveCardData?: SensitiveCardData; +} + +export interface AllowedProduct { + additionalProductInfo?: string; + eanUpc?: string; + productCode: string; + productLabel?: string; +} + +export interface CustomerOrder { + accessedBy?: string; + additionalInformation?: string; + currency?: string; + currentAmount: number; + customerOrderId: string; + endDate?: { [key: string]: any }; + forecastedAmount: number; + openOrderState?: boolean; + startDate: { [key: string]: any }; +} + +export interface PaymentToken { + expiryDateTime?: { [key: string]: any }; + tokenRequestedType: TokenRequestedType; + tokenValue: string; +} + +export enum TokenRequestedType { + Customer = "Customer", + Transaction = "Transaction", +} + +export interface ContentInformation { + authenticatedData?: AuthenticatedData; + contentType: ContentType; + digestedData?: DigestedData; + envelopedData?: EnvelopedData; + namedKeyEncryptedData?: NamedKeyEncryptedData; + signedData?: SignedData; +} + +export interface AuthenticatedData { + encapsulatedContent: EncapsulatedContent; + keyTransportOrKek?: any[]; + mac: any; + macAlgorithm: AlgorithmIdentifier; + version?: VersionType; +} + +export interface EncapsulatedContent { + content?: any; + contentType: ContentType; +} + +export enum ContentType { + IdCtAuthData = "id-ct-authData", + IdData = "id-data", + IdDigestedData = "id-digestedData", + IdEncryptedData = "id-encryptedData", + IdEnvelopedData = "id-envelopedData", + IdSignedData = "id-signedData", +} + +export interface AlgorithmIdentifier { + algorithm: AlgorithmType; + parameter?: Parameter; +} + +export enum AlgorithmType { + DesEde3Cbc = "des-ede3-cbc", + DesEde3Ecb = "des-ede3-ecb", + IdDukptWrap = "id-dukpt-wrap", + IdRetailCbcMac = "id-retail-cbc-mac", + IdRetailCbcMacSha256 = "id-retail-cbc-mac-sha-256", + IdSha256 = "id-sha256", + IdUkptWrap = "id-ukpt-wrap ", + RsaEncryption = "rsaEncryption", + Sha256WithRsaEncryption = "sha256WithRSAEncryption", +} + +export interface Parameter { + initialisationVector?: any; +} + +export enum VersionType { + V0 = "v0", + V1 = "v1", + V2 = "v2", + V3 = "v3", + V4 = "v4", + V5 = "v5", +} + +export interface DigestedData { + digest: any; + digestAlgorithm: AlgorithmIdentifier; + encapsulatedContent: EncapsulatedContent; + version?: VersionType; +} + +export interface EnvelopedData { + encryptedContent: EncryptedContent; + keyTransportOrKek?: any[]; + version?: VersionType; +} + +export interface EncryptedContent { + contentEncryptionAlgorithm: AlgorithmIdentifier; + contentType: ContentType; + encryptedData: any; +} + +export interface NamedKeyEncryptedData { + encryptedContent: EncryptedContent; + keyName?: string; + version?: VersionType; +} + +export interface SignedData { + certificate?: any[]; + digestAlgorithm: AlgorithmIdentifier[]; + encapsulatedContent: EncapsulatedContent; + signer: Signer[]; + version?: VersionType; +} + +export interface Signer { + digestAlgorithm: AlgorithmIdentifier; + signature: any; + signatureAlgorithm: AlgorithmIdentifier; + signerIdentifier: SignerIdentifier; + version?: VersionType; +} + +export interface SignerIdentifier { + issuerAndSerialNumber: IssuerAndSerialNumber; +} + +export interface IssuerAndSerialNumber { + issuer: Issuer; + serialNumber: number; +} + +export interface Issuer { + relativeDistinguishedName: RelativeDistinguishedName[]; +} + +export interface RelativeDistinguishedName { + attribute: string; + attributeValue: string; +} + +export interface SensitiveCardData { + cardSeqNumb?: string; + expiryDate?: string; + pan?: string; + trackData?: TrackData[]; +} + +export interface TrackData { + trackFormat?: TrackFormatType; + trackNumb?: number; + value?: string; +} + +export enum TrackFormatType { + Aamva = "AAMVA", + Cmc7 = "CMC-7", + E13B = "E-13B", + Iso = "ISO", + JisI = "JIS-I", + JisIi = "JIS-II", +} + +export interface CheckData { + accountNumber?: string; + bankId?: string; + checkCardNumber?: string; + checkNumber?: string; + country?: string; + trackData?: TrackData; + type?: CheckTypeCodeType; +} + +export enum CheckTypeCodeType { + Company = "Company", + Personal = "Personal", +} + +export interface MobileData { + geolocation?: Geolocation; + maskedMsisdn?: string; + mobileCountryCode?: string; + mobileNetworkCode?: string; + protectedMobileData?: ContentInformation; + sensitiveMobileData?: SensitiveMobileData; +} + +export interface Geolocation { + geographicCoordinates?: GeographicCoordinates; + utmCoordinates?: UtmCoordinates; +} + +export interface GeographicCoordinates { + latitude: string; + longitude: string; +} + +export interface UtmCoordinates { + utmEastward: string; + utmNorthward: string; + utmZone: string; +} + +export interface SensitiveMobileData { + imei?: string; + imsi?: string; + msisdn: string; +} + +export enum PaymentInstrumentType { + Card = "Card", + Cash = "Cash", + Check = "Check", + Mobile = "Mobile", + StoredValue = "StoredValue", +} + +export interface BatchRequest { + removeAllFlag?: boolean; + transactionToPerform?: TransactionToPerform[]; +} + +export interface TransactionToPerform { + loyaltyRequest?: LoyaltyRequest; + paymentRequest?: PaymentRequest; + reversalRequest?: ReversalRequest; +} + +export interface LoyaltyRequest { + loyaltyData?: LoyaltyData[]; + loyaltyTransaction: LoyaltyTransaction; + saleData: SaleData; +} + +export interface LoyaltyData { + cardAcquisitionReference?: TransactionIdentification; + loyaltyAccountId?: LoyaltyAccountId; + loyaltyAmount?: LoyaltyAmount; +} + +export interface LoyaltyAmount { + currency?: string; + loyaltyUnit?: LoyaltyUnitType; + value?: number; +} + +export enum LoyaltyUnitType { + Monetary = "Monetary", + Point = "Point", +} + +export interface LoyaltyTransaction { + currency?: string; + loyaltyTransactionType: LoyaltyTransactionType; + originalPoiTransaction?: OriginalPoiTransaction; + saleItem?: SaleItem[]; + totalAmount?: number; + transactionConditions?: TransactionConditions; +} + +export enum LoyaltyTransactionType { + Award = "Award", + AwardRefund = "AwardRefund", + Rebate = "Rebate", + RebateRefund = "RebateRefund", + Redemption = "Redemption", + RedemptionRefund = "RedemptionRefund", +} + +export interface OriginalPoiTransaction { + acquirerId?: string; + approvalCode?: string; + customerLanguage?: string; + hostTransactionId?: TransactionIdentification; + poiid?: string; + poiTransactionId?: TransactionIdentification; + reuseCardDataFlag?: boolean; + saleId?: string; +} + +export interface SaleItem { + additionalProductInfo?: string; + eanUpc?: string; + itemAmount: number; + itemId: number; + productCode: string; + productLabel?: string; + quantity?: number; + saleChannel?: string; + taxCode?: string; + unitOfMeasure?: UnitOfMeasureType; + unitPrice?: number; +} + +export enum UnitOfMeasureType { + Case = "Case", + Centilitre = "Centilitre", + Centimetre = "Centimetre", + Foot = "Foot", + Gram = "Gram", + Inch = "Inch", + Kilogram = "Kilogram", + Kilometre = "Kilometre", + Litre = "Litre", + Meter = "Meter", + Mile = "Mile", + Other = "Other", + Ounce = "Ounce", + Pint = "Pint", + Pound = "Pound", + Quart = "Quart", + UkGallon = "UKGallon", + UsGallon = "USGallon", + Yard = "Yard", +} + +export interface TransactionConditions { + acquirerId?: string[]; + allowedLoyaltyBrand?: string[]; + allowedPaymentBrand?: string[]; + customerLanguage?: string; + debitPreferredFlag?: boolean; + forceEntryMode?: Array; + forceOnlineFlag?: boolean; + loyaltyHandling?: LoyaltyHandlingType; + merchantCategoryCode?: string; +} + +export enum ForceEntryModeType { + CheckReader = "CheckReader", + Contactless = "Contactless", + File = "File", + Icc = "ICC", + Keyed = "Keyed", + MagStripe = "MagStripe", + Manual = "Manual", + Rfid = "RFID", + Scanned = "Scanned", + SynchronousIcc = "SynchronousICC", + Tapped = "Tapped", +} + +export enum LoyaltyHandlingType { + Allowed = "Allowed", + Forbidden = "Forbidden", + Processed = "Processed", + Proposed = "Proposed", + Required = "Required", +} + +export interface SaleData { + customerOrderId?: string; + customerOrderReq?: CustomerOrderReqType[]; + operatorId?: string; + operatorLanguage?: string; + saleReferenceId?: string; + saleTerminalData?: SaleTerminalData; + saleToAcquirerData?: string; + saleToIssuerData?: SaleToIssuerData; + saleToPoiData?: string; + saleTransactionId: TransactionIdentification; + shiftNumber?: string; + sponsoredMerchant?: SponsoredMerchant[]; + tokenRequestedType?: TokenRequestedType; +} + +export enum CustomerOrderReqType { + Both = "Both", + Closed = "Closed", + Open = "Open", +} + +export interface SaleTerminalData { + saleCapabilities?: SaleCapabilitiesType[]; + saleProfile?: SaleProfile; + terminalEnvironment?: TerminalEnvironmentType; + totalsGroupId?: string; +} + +export enum SaleCapabilitiesType { + CashierDisplay = "CashierDisplay", + CashierError = "CashierError", + CashierInput = "CashierInput", + CashierStatus = "CashierStatus", + CustomerAssistance = "CustomerAssistance", + CustomerDisplay = "CustomerDisplay", + CustomerError = "CustomerError", + CustomerInput = "CustomerInput", + EmvContactless = "EMVContactless", + Icc = "ICC", + MagStripe = "MagStripe", + PoiReplication = "POIReplication", + PrinterDocument = "PrinterDocument", + PrinterReceipt = "PrinterReceipt", + PrinterVoucher = "PrinterVoucher", +} + +export interface SaleProfile { + genericProfile?: GenericProfileType; + serviceProfiles?: ServiceProfilesType[]; +} + +export enum GenericProfileType { + Basic = "Basic", + Extended = "Extended", + Standard = "Standard", +} + +export enum ServiceProfilesType { + Batch = "Batch", + CardReader = "CardReader", + Communication = "Communication", + Loyalty = "Loyalty", + OneTimeRes = "OneTimeRes", + Pin = "PIN", + Reservation = "Reservation", + Sound = "Sound", + StoredValue = "StoredValue", + Synchro = "Synchro", +} + +export enum TerminalEnvironmentType { + Attended = "Attended", + SemiAttended = "SemiAttended", + Unattended = "Unattended", +} + +export interface SaleToIssuerData { + statementReference?: string; +} + +export interface SponsoredMerchant { + merchantAddress?: string; + merchantCategoryCode: string; + merchantCountry: string; + merchantName: string; + registrationId: string; +} + +export interface PaymentRequest { + loyaltyData?: LoyaltyData[]; + paymentData?: PaymentData; + paymentTransaction: PaymentTransaction; + saleData: SaleData; +} + +export interface PaymentData { + cardAcquisitionReference?: TransactionIdentification; + customerOrder?: CustomerOrder; + instalment?: Instalment; + paymentInstrumentData?: PaymentInstrumentData; + paymentType?: PaymentType; + requestedValidityDate?: string; + splitPaymentFlag?: boolean; +} + +export interface Instalment { + charges?: number; + cumulativeAmount?: number; + firstAmount?: number; + firstPaymentDate?: string; + instalment?: InstalmentType[]; + period?: number; + periodUnit?: PeriodUnitType; + planId?: string; + sequenceNumber?: number; + totalNbOfPayments?: number; +} + +export enum InstalmentType { + DeferredInstalments = "DeferredInstalments", + EqualInstalments = "EqualInstalments", + InequalInstalments = "InequalInstalments", +} + +export enum PeriodUnitType { + Annual = "Annual", + Daily = "Daily", + Monthly = "Monthly", + Weekly = "Weekly", +} + +export enum PaymentType { + CashAdvance = "CashAdvance", + CashDeposit = "CashDeposit", + Completion = "Completion", + FirstReservation = "FirstReservation", + Instalment = "Instalment", + IssuerInstalment = "IssuerInstalment", + Normal = "Normal", + OneTimeReservation = "OneTimeReservation", + PaidOut = "PaidOut", + Recurring = "Recurring", + Refund = "Refund", + UpdateReservation = "UpdateReservation", +} + +export interface PaymentTransaction { + amountsReq: AmountsReq; + originalPoiTransaction?: OriginalPoiTransaction; + saleItem?: SaleItem[]; + transactionConditions?: TransactionConditions; +} + +export interface AmountsReq { + cashBackAmount?: number; + currency: string; + maximumCashBackAmount?: number; + minimumAmountToDeliver?: number; + minimumSplitAmount?: number; + paidAmount?: number; + requestedAmount?: number; + tipAmount?: number; +} + +export interface ReversalRequest { + customerOrderId?: CustomerOrder; + originalPoiTransaction: OriginalPoiTransaction; + reversalReason: ReversalReasonType; + reversedAmount?: number; + saleReferenceId?: string; +} + +export enum ReversalReasonType { + CustCancel = "CustCancel", + Malfunction = "Malfunction", + MerchantCancel = "MerchantCancel", + Unable2Compl = "Unable2Compl", +} + +export interface CardAcquisitionRequest { + cardAcquisitionTransaction: CardAcquisitionTransaction; + saleData: SaleData; +} + +export interface CardAcquisitionTransaction { + allowedLoyaltyBrand?: string[]; + allowedPaymentBrand?: string[]; + cashBackFlag?: boolean; + customerLanguage?: string; + forceCustomerSelectionFlag?: boolean; + forceEntryMode?: Array; + loyaltyHandling?: LoyaltyHandlingType; + paymentType?: PaymentType; + totalAmount?: number; +} + +export interface CardReaderApduRequest { + apduClass: any; + apduData?: any; + apduExpectedLength?: any; + apduInstruction: any; + apduPar1: any; + apduPar2: any; +} + +export interface CardReaderInitRequest { + displayOutput?: DisplayOutput; + forceEntryMode?: Array; + leaveCardFlag?: boolean; + maxWaitingTime?: number; + warmResetFlag?: boolean; +} + +export interface CardReaderPowerOffRequest { + displayOutput?: DisplayOutput; + maxWaitingTime?: number; +} + +export interface DiagnosisRequest { + acquirerId?: string[]; + hostDiagnosisFlag?: boolean; + poiid?: string; +} + +export interface DisplayRequest { + displayOutput: DisplayOutput[]; +} + +export interface EnableServiceRequest { + displayOutput?: DisplayOutput; + servicesEnabled?: ServicesEnabledType[]; + transactionAction: TransactionActionType; +} + +export enum ServicesEnabledType { + CardAcquisition = "CardAcquisition", + Loyalty = "Loyalty", + Payment = "Payment", +} + +export enum TransactionActionType { + AbortTransaction = "AbortTransaction", + StartTransaction = "StartTransaction", +} + +export interface EventNotification { + customerLanguage?: string; + displayOutput?: DisplayOutput; + eventDetails?: string; + eventToNotify: EventToNotifyType; + maintenanceRequiredFlag?: boolean; + rejectedMessage?: any; + timeStamp: string; +} + +export enum EventToNotifyType { + Abort = "Abort", + BeginMaintenance = "BeginMaintenance", + CardInserted = "CardInserted", + CardRemoved = "CardRemoved", + Completed = "Completed", + CustomerLanguage = "CustomerLanguage", + EndMaintenance = "EndMaintenance", + Initialised = "Initialised", + KeyPressed = "KeyPressed", + OutOfOrder = "OutOfOrder", + Reject = "Reject", + SaleAdmin = "SaleAdmin", + SaleWakeUp = "SaleWakeUp", + SecurityAlarm = "SecurityAlarm", + Shutdown = "Shutdown", + StopAssistance = "StopAssistance", +} + +export interface GetTotalsRequest { + totalDetails?: TotalDetailsType[]; + totalFilter?: TotalFilter; +} + +export enum TotalDetailsType { + OperatorId = "OperatorID", + Poiid = "POIID", + SaleId = "SaleID", + ShiftNumber = "ShiftNumber", + TotalsGroupId = "TotalsGroupID", +} + +export interface TotalFilter { + operatorId?: string; + poiid?: string; + saleId?: string; + shiftNumber?: string; + totalsGroupId?: string; +} + +export interface InputRequest { + displayOutput?: DisplayOutput; + inputData: InputData; +} + +export interface InputData { + beepKeyFlag?: boolean; + defaultInputString?: string; + device: DeviceType; + disableCancelFlag?: boolean; + disableCorrectFlag?: boolean; + disableValidFlag?: boolean; + fromRightToLeftFlag?: boolean; + globalCorrectionFlag?: boolean; + immediateResponseFlag?: boolean; + infoQualify: InfoQualifyType; + inputCommand: InputCommandType; + maskCharactersFlag?: boolean; + maxDecimalLength?: number; + maxInputTime?: number; + maxLength?: number; + menuBackFlag?: boolean; + minLength?: number; + notifyCardInputFlag?: boolean; + stringMask?: string; + waitUserValidationFlag?: boolean; +} + +export enum InputCommandType { + DecimalString = "DecimalString", + DigitString = "DigitString", + GetAnyKey = "GetAnyKey", + GetConfirmation = "GetConfirmation", + GetFunctionKey = "GetFunctionKey", + GetMenuEntry = "GetMenuEntry", + Password = "Password", + SiteManager = "SiteManager", + TextString = "TextString", +} + +export interface InputUpdate { + maxDecimalLength?: number; + maxLength?: number; + menuEntry?: MenuEntry[]; + messageReference: MessageReference; + minLength?: number; + outputContent: OutputContent; + outputSignature?: any; +} + +export interface LoginRequest { + customerOrderReq?: CustomerOrderReqType[]; + dateTime: { [key: string]: any }; + operatorId?: string; + operatorLanguage: string; + poiSerialNumber?: string; + saleSoftware: SaleSoftware; + saleTerminalData?: SaleTerminalData; + shiftNumber?: string; + tokenRequestedType?: TokenRequestedType; + trainingModeFlag?: boolean; +} + +export interface SaleSoftware { + applicationName: string; + certificationCode: string; + manufacturerId: string; + softwareVersion: string; +} + +export interface LogoutRequest { + maintenanceAllowed?: boolean; +} + +export interface MessageHeader { + deviceId?: string; + messageCategory: MessageCategoryType; + messageClass: MessageClassType; + messageType: MessageType; + poiid: string; + protocolVersion?: string; + saleId: string; + serviceId?: string; +} + +export enum MessageClassType { + Device = "Device", + Event = "Event", + Service = "Service", +} + +export enum MessageType { + Notification = "Notification", + Request = "Request", + Response = "Response", +} + +export interface PinRequest { + additionalInput?: string; + cardholderPin?: CardholderPin; + keyReference?: string; + maxWaitingTime?: number; + pinEncAlgorithm?: string; + pinFormat?: PinFormatType; + pinRequestType: PinRequestType; + pinVerifMethod?: string; +} + +export interface CardholderPin { + additionalInput?: string; + encrPinBlock: ContentInformation; + pinFormat: PinFormatType; +} + +export enum PinFormatType { + Iso0 = "ISO0", + Iso1 = "ISO1", + Iso2 = "ISO2", + Iso3 = "ISO3", +} + +export enum PinRequestType { + PinEnter = "PINEnter", + PinVerify = "PINVerify", + PinVerifyOnly = "PINVerifyOnly", +} + +export interface PrintRequest { + printOutput: PrintOutput; +} + +export interface PrintOutput { + documentQualifier: DocumentQualifierType; + integratedPrintFlag?: boolean; + outputContent: OutputContent; + outputSignature?: any; + requiredSignatureFlag?: boolean; + responseMode: ResponseModeType; +} + +export enum DocumentQualifierType { + CashierReceipt = "CashierReceipt", + CustomerReceipt = "CustomerReceipt", + Document = "Document", + Journal = "Journal", + SaleReceipt = "SaleReceipt", + Voucher = "Voucher", +} + +export enum ResponseModeType { + Immediate = "Immediate", + NotRequired = "NotRequired", + PrintEnd = "PrintEnd", + SoundEnd = "SoundEnd", +} + +export interface ReconciliationRequest { + acquirerId?: string[]; + poiReconciliationId?: string; + reconciliationType: ReconciliationType; +} + +export enum ReconciliationType { + AcquirerReconciliation = "AcquirerReconciliation", + AcquirerSynchronisation = "AcquirerSynchronisation", + PreviousReconciliation = "PreviousReconciliation", + SaleReconciliation = "SaleReconciliation", +} + +export interface SoundRequest { + responseMode?: ResponseModeType; + soundAction: SoundActionType; + soundContent: SoundContent; + soundVolume?: number; +} + +export enum SoundActionType { + SetDefaultVolume = "SetDefaultVolume", + StartSound = "StartSound", + StopSound = "StopSound", +} + +export interface SoundContent { + language?: string; + referenceId?: string; + soundFormat?: SoundFormatType; + value?: string; +} + +export enum SoundFormatType { + MessageRef = "MessageRef", + SoundRef = "SoundRef", + Text = "Text", +} + +export interface StoredValueRequest { + customerLanguage?: string; + saleData: SaleData; + storedValueData: StoredValueData[]; +} + +export interface StoredValueData { + currency: string; + eanUpc?: string; + itemAmount: number; + originalPoiTransaction?: OriginalPoiTransaction; + productCode?: string; + storedValueAccountId?: StoredValueAccountId; + storedValueProvider?: string; + storedValueTransactionType: StoredValueTransactionType; +} + +export interface StoredValueAccountId { + entryMode: EntryModeType[]; + expiryDate?: string; + identificationType: IdentificationType; + ownerName?: string; + storedValueAccountType: StoredValueAccountType; + storedValueProvider?: string; + value?: string; +} + +export enum StoredValueAccountType { + GiftCard = "GiftCard", + Other = "Other", + PhoneCard = "PhoneCard", +} + +export enum StoredValueTransactionType { + Activate = "Activate", + Duplicate = "Duplicate", + Load = "Load", + Reserve = "Reserve", + Reverse = "Reverse", + Unload = "Unload", +} + +export interface TransactionStatusRequest { + documentQualifier?: DocumentQualifierType[]; + messageReference?: MessageReference; + receiptReprintFlag?: boolean; +} + +export interface TransmitRequest { + destinationAddress: string; + maximumTransmitTime: number; + message: any; + waitResponseFlag?: boolean; +} + +export interface TerminalApiResponse { + saleToPoiResponse?: SaleToPoiResponse; +} + +export interface SaleToPoiResponse { + adminResponse?: AdminResponse; + balanceInquiryResponse?: BalanceInquiryResponse; + batchResponse?: BatchResponse; + cardAcquisitionResponse?: CardAcquisitionResponse; + cardReaderApduResponse?: CardReaderApduResponse; + cardReaderInitResponse?: CardReaderInitResponse; + cardReaderPowerOffResponse?: CardReaderPowerOffResponse; + diagnosisResponse?: DiagnosisResponse; + displayResponse?: DisplayResponse; + enableServiceResponse?: EnableServiceResponse; + getTotalsResponse?: GetTotalsResponse; + inputResponse?: InputResponse; + loginResponse?: LoginResponse; + logoutResponse?: LogoutResponse; + loyaltyResponse?: LoyaltyResponse; + messageHeader: MessageHeader; + paymentResponse?: PaymentResponse; + pinResponse?: PinResponse; + printResponse?: PrintResponse; + reconciliationResponse?: ReconciliationResponse; + reversalResponse?: ReversalResponse; + securityTrailer?: ContentInformation; + soundResponse?: SoundResponse; + storedValueResponse?: StoredValueResponse; + transactionStatusResponse?: TransactionStatusResponse; + transmitResponse?: TransmitResponse; +} + +export interface AdminResponse { + response: Response; +} + +export interface Response { + additionalResponse?: string; + errorCondition?: ErrorConditionType; + result: ResultType; +} + +export enum ErrorConditionType { + Aborted = "Aborted", + Busy = "Busy", + Cancel = "Cancel", + DeviceOut = "DeviceOut", + InProgress = "InProgress", + InsertedCard = "InsertedCard", + InvalidCard = "InvalidCard", + LoggedOut = "LoggedOut", + MessageFormat = "MessageFormat", + NotAllowed = "NotAllowed", + NotFound = "NotFound", + PaymentRestriction = "PaymentRestriction", + Refusal = "Refusal", + UnavailableDevice = "UnavailableDevice", + UnavailableService = "UnavailableService", + UnreachableHost = "UnreachableHost", + WrongPin = "WrongPIN", +} + +export enum ResultType { + Failure = "Failure", + Partial = "Partial", + Success = "Success", +} + +export interface BalanceInquiryResponse { + loyaltyAccountStatus?: LoyaltyAccountStatus; + paymentAccountStatus?: PaymentAccountStatus; + response: Response; +} + +export interface LoyaltyAccountStatus { + currency?: string; + currentBalance?: number; + loyaltyAccount: LoyaltyAccount; + loyaltyUnit?: LoyaltyUnitType; +} + +export interface LoyaltyAccount { + loyaltyAccountId: LoyaltyAccountId; + loyaltyBrand?: string; +} + +export interface PaymentAccountStatus { + currency?: string; + currentBalance?: number; + loyaltyAccountStatus?: LoyaltyAccountStatus; + paymentAcquirerData?: PaymentAcquirerData; + paymentInstrumentData?: PaymentInstrumentData; +} + +export interface PaymentAcquirerData { + acquirerId?: string; + acquirerPoiid: string; + acquirerTransactionId?: TransactionIdentification; + approvalCode?: string; + merchantId: string; +} + +export interface BatchResponse { + performedTransaction?: PerformedTransaction[]; + response: Response; +} + +export interface PerformedTransaction { + loyaltyResult?: LoyaltyResult[]; + paymentResult?: PaymentResult; + poiData: PoiData; + response: Response; + reversedAmount?: number; + saleData?: SaleData; +} + +export interface LoyaltyResult { + currentBalance?: number; + loyaltyAccount: LoyaltyAccount; + loyaltyAcquirerData?: LoyaltyAcquirerData; + loyaltyAmount?: LoyaltyAmount; + rebates?: Rebates; +} + +export interface LoyaltyAcquirerData { + approvalCode?: string; + hostReconciliationId?: string; + loyaltyAcquirerId?: string; + loyaltyTransactionId?: TransactionIdentification; +} + +export interface Rebates { + rebateLabel?: string; + saleItemRebate?: SaleItemRebate[]; + totalRebate?: number; +} + +export interface SaleItemRebate { + eanUpc?: string; + itemAmount?: number; + itemId: number; + productCode: string; + quantity?: number; + rebateLabel?: string; + unitOfMeasure?: UnitOfMeasureType; +} + +export interface PoiData { + poiReconciliationId?: string; + poiTransactionId: TransactionIdentification; +} + +export interface PaymentResult { + amountsResp?: AmountsResp; + authenticationMethod?: AuthenticationMethodType[]; + capturedSignature?: CapturedSignature; + currencyConversion?: CurrencyConversion[]; + customerLanguage?: string; + instalment?: Instalment; + merchantOverrideFlag?: boolean; + onlineFlag?: boolean; + paymentAcquirerData?: PaymentAcquirerData; + paymentInstrumentData?: PaymentInstrumentData; + paymentType?: PaymentType; + protectedSignature?: ContentInformation; + validityDate?: string; +} + +export interface AmountsResp { + authorizedAmount: number; + cashBackAmount?: number; + currency?: string; + tipAmount?: number; + totalFeesAmount?: number; + totalRebatesAmount?: number; +} + +export enum AuthenticationMethodType { + Bypass = "Bypass", + ManualVerification = "ManualVerification", + MerchantAuthentication = "MerchantAuthentication", + OfflinePin = "OfflinePIN", + OnLinePin = "OnLinePIN", + PaperSignature = "PaperSignature", + SecureCertificate = "SecureCertificate", + SecureNoCertificate = "SecureNoCertificate", + SecuredChannel = "SecuredChannel", + SignatureCapture = "SignatureCapture", + UnknownMethod = "UnknownMethod", +} + +export interface CapturedSignature { + areaSize?: AreaSize; + signaturePoint: SignaturePoint[]; +} + +export interface AreaSize { + x: string; + y: string; +} + +export interface SignaturePoint { + x: string; + y: string; +} + +export interface CurrencyConversion { + commission?: number; + convertedAmount: Amount; + customerApprovedFlag?: boolean; + declaration?: string; + markup?: number; + rate?: number; +} + +export interface Amount { + currency?: string; + value?: number; +} + +export interface CardAcquisitionResponse { + customerOrder?: CustomerOrder[]; + loyaltyAccount?: LoyaltyAccount[]; + paymentBrand?: string[]; + paymentInstrumentData?: PaymentInstrumentData; + poiData: PoiData; + response: Response; + saleData: SaleData; +} + +export interface CardReaderApduResponse { + apduData?: any; + cardStatusWords: any; + response: Response; +} + +export interface CardReaderInitResponse { + entryMode?: EntryModeType[]; + iccResetData?: IccResetData; + response: Response; + trackData?: TrackData[]; +} + +export interface IccResetData { + atrValue?: any; + cardStatusWords?: any; +} + +export interface CardReaderPowerOffResponse { + response: Response; +} + +export interface DiagnosisResponse { + hostStatus?: HostStatus[]; + loggedSaleId?: string[]; + poiStatus?: PoiStatus; + response: Response; +} + +export interface HostStatus { + acquirerId: string; + isReachableFlag?: boolean; +} + +export interface PoiStatus { + cardReaderOkFlag?: boolean; + cashHandlingDevice?: CashHandlingDevice[]; + communicationOkFlag?: boolean; + fraudPreventionFlag?: boolean; + globalStatus: GlobalStatusType; + pedokFlag?: boolean; + printerStatus?: PrinterStatusType; + securityOkFlag?: boolean; +} + +export interface CashHandlingDevice { + cashHandlingOkFlag: boolean; + coinsOrBills: CoinsOrBills[]; + currency: string; +} + +export interface CoinsOrBills { + number: number; + unitValue: number; +} + +export enum GlobalStatusType { + Busy = "Busy", + Maintenance = "Maintenance", + Ok = "OK", + Unreachable = "Unreachable", +} + +export enum PrinterStatusType { + NoPaper = "NoPaper", + Ok = "OK", + OutOfOrder = "OutOfOrder", + PaperJam = "PaperJam", + PaperLow = "PaperLow", +} + +export interface DisplayResponse { + outputResult: OutputResult[]; +} + +export interface OutputResult { + device: DeviceType; + infoQualify: InfoQualifyType; + response: Response; +} + +export interface EnableServiceResponse { + response: Response; +} + +export interface GetTotalsResponse { + poiReconciliationId: string; + response: Response; + transactionTotals?: TransactionTotals[]; +} + +export interface TransactionTotals { + acquirerId?: string; + cardBrand?: string; + errorCondition?: ErrorConditionType; + hostReconciliationId?: string; + loyaltyCurrency?: string; + loyaltyTotals?: LoyaltyTotals[]; + loyaltyUnit?: LoyaltyUnitType; + operatorId?: string; + paymentCurrency?: string; + paymentInstrumentType: PaymentInstrumentType; + paymentTotals?: PaymentTotals[]; + poiid?: string; + saleId?: string; + shiftNumber?: string; + totalsGroupId?: string; +} + +export interface LoyaltyTotals { + transactionAmount: number; + transactionCount: number; + transactionType: TransactionType; +} + +export enum TransactionType { + Award = "Award", + CashAdvance = "CashAdvance", + CompletedDeffered = "CompletedDeffered", + CompletedReservation = "CompletedReservation", + Credit = "Credit", + Debit = "Debit", + Declined = "Declined", + Failed = "Failed", + FirstReservation = "FirstReservation", + IssuerInstalment = "IssuerInstalment", + OneTimeReservation = "OneTimeReservation", + Rebate = "Rebate", + Redemption = "Redemption", + ReverseAward = "ReverseAward", + ReverseCredit = "ReverseCredit", + ReverseDebit = "ReverseDebit", + ReverseRebate = "ReverseRebate", + ReverseRedemption = "ReverseRedemption", + UpdateReservation = "UpdateReservation", +} + +export interface PaymentTotals { + transactionAmount: number; + transactionCount: number; + transactionType: TransactionType; +} + +export interface InputResponse { + inputResult: InputResult; + outputResult?: OutputResult; +} + +export interface InputResult { + device: DeviceType; + infoQualify: InfoQualifyType; + input?: Input; + response: Response; +} + +export interface Input { + confirmedFlag?: boolean; + digitInput?: string; + functionKey?: string; + inputCommand: InputCommandType; + menuEntryNumber?: number; + password?: ContentInformation; + textInput?: string; +} + +export interface LoginResponse { + poiSystemData?: PoiSystemData; + response: Response; +} + +export interface PoiSystemData { + dateTime: { [key: string]: any }; + poiSoftware: PoiSoftware; + poiStatus?: PoiStatus; + poiTerminalData?: PoiTerminalData; +} + +export interface PoiSoftware { + applicationName: string; + certificationCode: string; + manufacturerId: string; + softwareVersion: string; +} + +export interface PoiTerminalData { + poiCapabilities: PoiCapabilitiesType[]; + poiProfile?: PoiProfile; + poiSerialNumber: string; + terminalEnvironment: TerminalEnvironmentType; +} + +export enum PoiCapabilitiesType { + CashHandling = "CashHandling", + CashierDisplay = "CashierDisplay", + CashierError = "CashierError", + CashierInput = "CashierInput", + CustomerDisplay = "CustomerDisplay", + CustomerError = "CustomerError", + CustomerInput = "CustomerInput", + EmvContactless = "EMVContactless", + Icc = "ICC", + MagStripe = "MagStripe", + PrinterDocument = "PrinterDocument", + PrinterReceipt = "PrinterReceipt", + PrinterVoucher = "PrinterVoucher", +} + +export interface PoiProfile { + genericProfile?: GenericProfileType; + serviceProfiles?: ServiceProfilesType[]; +} + +export interface LogoutResponse { + response: Response; +} + +export interface LoyaltyResponse { + loyaltyResult?: LoyaltyResult[]; + paymentReceipt?: PaymentReceipt[]; + poiData: PoiData; + response: Response; + saleData: SaleData; +} + +export interface PaymentReceipt { + documentQualifier: DocumentQualifierType; + integratedPrintFlag?: boolean; + outputContent: OutputContent; + requiredSignatureFlag?: boolean; +} + +export interface PinResponse { + cardholderPin?: CardholderPin; + response: Response; +} + +export interface PaymentResponse { + customerOrder?: CustomerOrder[]; + loyaltyResult?: LoyaltyResult[]; + paymentReceipt?: PaymentReceipt[]; + paymentResult?: PaymentResult; + poiData: PoiData; + response: Response; + saleData: SaleData; +} + +export interface PrintResponse { + documentQualifier: DocumentQualifierType; + response: Response; +} + +export interface ReconciliationResponse { + poiReconciliationId?: string; + reconciliationType: ReconciliationType; + response: Response; + transactionTotals?: TransactionTotals[]; +} + +export interface ReversalResponse { + customerOrderId?: string; + originalPoiTransaction?: OriginalPoiTransaction; + paymentReceipt?: PaymentReceipt[]; + poiData?: PoiData; + response: Response; + reversedAmount?: number; +} + +export interface SoundResponse { + response: Response; +} + +export interface StoredValueResponse { + poiData: PoiData; + response: Response; + saleData: SaleData; + storedValueResult?: StoredValueResult[]; +} + +export interface StoredValueResult { + currency: string; + eanUpc?: string; + hostTransactionId?: TransactionIdentification; + itemAmount: number; + productCode: string; + storedValueAccountStatus: StoredValueAccountStatus; + storedValueTransactionType: StoredValueTransactionType; +} + +export interface StoredValueAccountStatus { + currentBalance?: number; + storedValueAccountId: StoredValueAccountId; +} + +export interface TransactionStatusResponse { + messageReference?: MessageReference; + repeatedMessageResponse?: RepeatedMessageResponse; + response: Response; +} + +export interface RepeatedMessageResponse { + messageHeader: MessageHeader; + repeatedResponseMessageBody: RepeatedResponseMessageBody; +} + +export interface RepeatedResponseMessageBody { + cardAcquisitionResponse?: CardAcquisitionResponse; + cardReaderApduResponse?: CardReaderApduResponse; + loyaltyResponse?: LoyaltyResponse; + paymentResponse?: PaymentResponse; + reversalResponse?: ReversalResponse; + storedValueResponse?: StoredValueResponse; +} + +export interface TransmitResponse { + message?: any; + response: Response; +} + +export interface TerminalApiSecuredRequest { + saleToPoiRequest?: SaleToPoiSecuredMessage; +} + +export interface SaleToPoiSecuredMessage { + messageHeader?: MessageHeader; + nexoBlob?: string; + securityTrailer?: SecurityTrailer; +} + +export interface SecurityTrailer { + adyenCryptoVersion?: number; + hmac?: any; + keyIdentifier?: string; + keyVersion?: number; + nonce?: any; +} + +export interface TerminalApiSecuredResponse { + saleToPoiResponse?: SaleToPoiSecuredMessage; +} + +export interface NexoDerivedKey { + cipherKey?: any; + hmacKey?: any; + iv?: any; +} + +export interface SecurityKey { + adyenCryptoVersion?: number; + keyIdentifier?: string; + keyVersion?: number; + passphrase?: string; +} + +// Converts JSON strings to/from your types +// and asserts the results of JSON.parse at runtime +export class Convert { + public static toTerminalApiRequest(json: string): TerminalApiRequest { + return cast(JSON.parse(json), r("TerminalApiRequest")); + } + + public static terminalApiRequestToJson(value: TerminalApiRequest): string { + return JSON.stringify(uncast(value, r("TerminalApiRequest")), null, 2); + } + + public static toTerminalApiResponse(json: string): TerminalApiResponse { + return cast(JSON.parse(json), r("TerminalApiResponse")); + } + + public static terminalApiResponseToJson(value: TerminalApiResponse): string { + return JSON.stringify(uncast(value, r("TerminalApiResponse")), null, 2); + } + + public static toTerminalApiSecuredRequest(json: string): TerminalApiSecuredRequest { + return cast(JSON.parse(json), r("TerminalApiSecuredRequest")); + } + + public static terminalApiSecuredRequestToJson(value: TerminalApiSecuredRequest): string { + return JSON.stringify(uncast(value, r("TerminalApiSecuredRequest")), null, 2); + } + + public static toTerminalApiSecuredResponse(json: string): TerminalApiSecuredResponse { + return cast(JSON.parse(json), r("TerminalApiSecuredResponse")); + } + + public static terminalApiSecuredResponseToJson(value: TerminalApiSecuredResponse): string { + return JSON.stringify(uncast(value, r("TerminalApiSecuredResponse")), null, 2); + } + + public static toNexoDerivedKey(json: string): NexoDerivedKey { + return cast(JSON.parse(json), r("NexoDerivedKey")); + } + + public static nexoDerivedKeyToJson(value: NexoDerivedKey): string { + return JSON.stringify(uncast(value, r("NexoDerivedKey")), null, 2); + } + + public static toSaleToPoiSecuredMessage(json: string): SaleToPoiSecuredMessage { + return cast(JSON.parse(json), r("SaleToPoiSecuredMessage")); + } + + public static saleToPoiSecuredMessageToJson(value: SaleToPoiSecuredMessage): string { + return JSON.stringify(uncast(value, r("SaleToPoiSecuredMessage")), null, 2); + } + + public static toSecurityKey(json: string): SecurityKey { + return cast(JSON.parse(json), r("SecurityKey")); + } + + public static securityKeyToJson(value: SecurityKey): string { + return JSON.stringify(uncast(value, r("SecurityKey")), null, 2); + } + + public static toSecurityTrailer(json: string): SecurityTrailer { + return cast(JSON.parse(json), r("SecurityTrailer")); + } + + public static securityTrailerToJson(value: SecurityTrailer): string { + return JSON.stringify(uncast(value, r("SecurityTrailer")), null, 2); + } + + public static toSaleToPoiRequest(json: string): SaleToPoiRequest { + return cast(JSON.parse(json), r("SaleToPoiRequest")); + } + + public static saleToPoiRequestToJson(value: SaleToPoiRequest): string { + return JSON.stringify(uncast(value, r("SaleToPoiRequest")), null, 2); + } + + public static toSaleToPoiResponse(json: string): SaleToPoiResponse { + return cast(JSON.parse(json), r("SaleToPoiResponse")); + } + + public static saleToPoiResponseToJson(value: SaleToPoiResponse): string { + return JSON.stringify(uncast(value, r("SaleToPoiResponse")), null, 2); + } + + public static toMessageHeader(json: string): MessageHeader { + return cast(JSON.parse(json), r("MessageHeader")); + } + + public static messageHeaderToJson(value: MessageHeader): string { + return JSON.stringify(uncast(value, r("MessageHeader")), null, 2); + } + + public static toAbortRequest(json: string): AbortRequest { + return cast(JSON.parse(json), r("AbortRequest")); + } + + public static abortRequestToJson(value: AbortRequest): string { + return JSON.stringify(uncast(value, r("AbortRequest")), null, 2); + } + + public static toBalanceInquiryRequest(json: string): BalanceInquiryRequest { + return cast(JSON.parse(json), r("BalanceInquiryRequest")); + } + + public static balanceInquiryRequestToJson(value: BalanceInquiryRequest): string { + return JSON.stringify(uncast(value, r("BalanceInquiryRequest")), null, 2); + } + + public static toBatchRequest(json: string): BatchRequest { + return cast(JSON.parse(json), r("BatchRequest")); + } + + public static batchRequestToJson(value: BatchRequest): string { + return JSON.stringify(uncast(value, r("BatchRequest")), null, 2); + } + + public static toCardAcquisitionRequest(json: string): CardAcquisitionRequest { + return cast(JSON.parse(json), r("CardAcquisitionRequest")); + } + + public static cardAcquisitionRequestToJson(value: CardAcquisitionRequest): string { + return JSON.stringify(uncast(value, r("CardAcquisitionRequest")), null, 2); + } + + public static toAdminRequest(json: string): AdminRequest { + return cast(JSON.parse(json), r("AdminRequest")); + } + + public static adminRequestToJson(value: AdminRequest): string { + return JSON.stringify(uncast(value, r("AdminRequest")), null, 2); + } + + public static toDiagnosisRequest(json: string): DiagnosisRequest { + return cast(JSON.parse(json), r("DiagnosisRequest")); + } + + public static diagnosisRequestToJson(value: DiagnosisRequest): string { + return JSON.stringify(uncast(value, r("DiagnosisRequest")), null, 2); + } + + public static toDisplayRequest(json: string): DisplayRequest { + return cast(JSON.parse(json), r("DisplayRequest")); + } + + public static displayRequestToJson(value: DisplayRequest): string { + return JSON.stringify(uncast(value, r("DisplayRequest")), null, 2); + } + + public static toEnableServiceRequest(json: string): EnableServiceRequest { + return cast(JSON.parse(json), r("EnableServiceRequest")); + } + + public static enableServiceRequestToJson(value: EnableServiceRequest): string { + return JSON.stringify(uncast(value, r("EnableServiceRequest")), null, 2); + } + + public static toEventNotification(json: string): EventNotification { + return cast(JSON.parse(json), r("EventNotification")); + } + + public static eventNotificationToJson(value: EventNotification): string { + return JSON.stringify(uncast(value, r("EventNotification")), null, 2); + } + + public static toGetTotalsRequest(json: string): GetTotalsRequest { + return cast(JSON.parse(json), r("GetTotalsRequest")); + } + + public static getTotalsRequestToJson(value: GetTotalsRequest): string { + return JSON.stringify(uncast(value, r("GetTotalsRequest")), null, 2); + } + + public static toInputRequest(json: string): InputRequest { + return cast(JSON.parse(json), r("InputRequest")); + } + + public static inputRequestToJson(value: InputRequest): string { + return JSON.stringify(uncast(value, r("InputRequest")), null, 2); + } + + public static toInputUpdate(json: string): InputUpdate { + return cast(JSON.parse(json), r("InputUpdate")); + } + + public static inputUpdateToJson(value: InputUpdate): string { + return JSON.stringify(uncast(value, r("InputUpdate")), null, 2); + } + + public static toLoginRequest(json: string): LoginRequest { + return cast(JSON.parse(json), r("LoginRequest")); + } + + public static loginRequestToJson(value: LoginRequest): string { + return JSON.stringify(uncast(value, r("LoginRequest")), null, 2); + } + + public static toLogoutRequest(json: string): LogoutRequest { + return cast(JSON.parse(json), r("LogoutRequest")); + } + + public static logoutRequestToJson(value: LogoutRequest): string { + return JSON.stringify(uncast(value, r("LogoutRequest")), null, 2); + } + + public static toLoyaltyRequest(json: string): LoyaltyRequest { + return cast(JSON.parse(json), r("LoyaltyRequest")); + } + + public static loyaltyRequestToJson(value: LoyaltyRequest): string { + return JSON.stringify(uncast(value, r("LoyaltyRequest")), null, 2); + } + + public static toPaymentRequest(json: string): PaymentRequest { + return cast(JSON.parse(json), r("PaymentRequest")); + } + + public static paymentRequestToJson(value: PaymentRequest): string { + return JSON.stringify(uncast(value, r("PaymentRequest")), null, 2); + } + + public static toPinRequest(json: string): PinRequest { + return cast(JSON.parse(json), r("PinRequest")); + } + + public static pinRequestToJson(value: PinRequest): string { + return JSON.stringify(uncast(value, r("PinRequest")), null, 2); + } + + public static toPrintRequest(json: string): PrintRequest { + return cast(JSON.parse(json), r("PrintRequest")); + } + + public static printRequestToJson(value: PrintRequest): string { + return JSON.stringify(uncast(value, r("PrintRequest")), null, 2); + } + + public static toCardReaderInitRequest(json: string): CardReaderInitRequest { + return cast(JSON.parse(json), r("CardReaderInitRequest")); + } + + public static cardReaderInitRequestToJson(value: CardReaderInitRequest): string { + return JSON.stringify(uncast(value, r("CardReaderInitRequest")), null, 2); + } + + public static toCardReaderApduRequest(json: string): CardReaderApduRequest { + return cast(JSON.parse(json), r("CardReaderApduRequest")); + } + + public static cardReaderApduRequestToJson(value: CardReaderApduRequest): string { + return JSON.stringify(uncast(value, r("CardReaderApduRequest")), null, 2); + } + + public static toCardReaderPowerOffRequest(json: string): CardReaderPowerOffRequest { + return cast(JSON.parse(json), r("CardReaderPowerOffRequest")); + } + + public static cardReaderPowerOffRequestToJson(value: CardReaderPowerOffRequest): string { + return JSON.stringify(uncast(value, r("CardReaderPowerOffRequest")), null, 2); + } + + public static toReconciliationRequest(json: string): ReconciliationRequest { + return cast(JSON.parse(json), r("ReconciliationRequest")); + } + + public static reconciliationRequestToJson(value: ReconciliationRequest): string { + return JSON.stringify(uncast(value, r("ReconciliationRequest")), null, 2); + } + + public static toReversalRequest(json: string): ReversalRequest { + return cast(JSON.parse(json), r("ReversalRequest")); + } + + public static reversalRequestToJson(value: ReversalRequest): string { + return JSON.stringify(uncast(value, r("ReversalRequest")), null, 2); + } + + public static toSoundRequest(json: string): SoundRequest { + return cast(JSON.parse(json), r("SoundRequest")); + } + + public static soundRequestToJson(value: SoundRequest): string { + return JSON.stringify(uncast(value, r("SoundRequest")), null, 2); + } + + public static toStoredValueRequest(json: string): StoredValueRequest { + return cast(JSON.parse(json), r("StoredValueRequest")); + } + + public static storedValueRequestToJson(value: StoredValueRequest): string { + return JSON.stringify(uncast(value, r("StoredValueRequest")), null, 2); + } + + public static toTransactionStatusRequest(json: string): TransactionStatusRequest { + return cast(JSON.parse(json), r("TransactionStatusRequest")); + } + + public static transactionStatusRequestToJson(value: TransactionStatusRequest): string { + return JSON.stringify(uncast(value, r("TransactionStatusRequest")), null, 2); + } + + public static toTransmitRequest(json: string): TransmitRequest { + return cast(JSON.parse(json), r("TransmitRequest")); + } + + public static transmitRequestToJson(value: TransmitRequest): string { + return JSON.stringify(uncast(value, r("TransmitRequest")), null, 2); + } + + public static toContentInformation(json: string): ContentInformation { + return cast(JSON.parse(json), r("ContentInformation")); + } + + public static contentInformationToJson(value: ContentInformation): string { + return JSON.stringify(uncast(value, r("ContentInformation")), null, 2); + } + + public static toBalanceInquiryResponse(json: string): BalanceInquiryResponse { + return cast(JSON.parse(json), r("BalanceInquiryResponse")); + } + + public static balanceInquiryResponseToJson(value: BalanceInquiryResponse): string { + return JSON.stringify(uncast(value, r("BalanceInquiryResponse")), null, 2); + } + + public static toBatchResponse(json: string): BatchResponse { + return cast(JSON.parse(json), r("BatchResponse")); + } + + public static batchResponseToJson(value: BatchResponse): string { + return JSON.stringify(uncast(value, r("BatchResponse")), null, 2); + } + + public static toCardAcquisitionResponse(json: string): CardAcquisitionResponse { + return cast(JSON.parse(json), r("CardAcquisitionResponse")); + } + + public static cardAcquisitionResponseToJson(value: CardAcquisitionResponse): string { + return JSON.stringify(uncast(value, r("CardAcquisitionResponse")), null, 2); + } + + public static toAdminResponse(json: string): AdminResponse { + return cast(JSON.parse(json), r("AdminResponse")); + } + + public static adminResponseToJson(value: AdminResponse): string { + return JSON.stringify(uncast(value, r("AdminResponse")), null, 2); + } + + public static toDiagnosisResponse(json: string): DiagnosisResponse { + return cast(JSON.parse(json), r("DiagnosisResponse")); + } + + public static diagnosisResponseToJson(value: DiagnosisResponse): string { + return JSON.stringify(uncast(value, r("DiagnosisResponse")), null, 2); + } + + public static toDisplayResponse(json: string): DisplayResponse { + return cast(JSON.parse(json), r("DisplayResponse")); + } + + public static displayResponseToJson(value: DisplayResponse): string { + return JSON.stringify(uncast(value, r("DisplayResponse")), null, 2); + } + + public static toEnableServiceResponse(json: string): EnableServiceResponse { + return cast(JSON.parse(json), r("EnableServiceResponse")); + } + + public static enableServiceResponseToJson(value: EnableServiceResponse): string { + return JSON.stringify(uncast(value, r("EnableServiceResponse")), null, 2); + } + + public static toGetTotalsResponse(json: string): GetTotalsResponse { + return cast(JSON.parse(json), r("GetTotalsResponse")); + } + + public static getTotalsResponseToJson(value: GetTotalsResponse): string { + return JSON.stringify(uncast(value, r("GetTotalsResponse")), null, 2); + } + + public static toInputResponse(json: string): InputResponse { + return cast(JSON.parse(json), r("InputResponse")); + } + + public static inputResponseToJson(value: InputResponse): string { + return JSON.stringify(uncast(value, r("InputResponse")), null, 2); + } + + public static toLoginResponse(json: string): LoginResponse { + return cast(JSON.parse(json), r("LoginResponse")); + } + + public static loginResponseToJson(value: LoginResponse): string { + return JSON.stringify(uncast(value, r("LoginResponse")), null, 2); + } + + public static toLogoutResponse(json: string): LogoutResponse { + return cast(JSON.parse(json), r("LogoutResponse")); + } + + public static logoutResponseToJson(value: LogoutResponse): string { + return JSON.stringify(uncast(value, r("LogoutResponse")), null, 2); + } + + public static toLoyaltyResponse(json: string): LoyaltyResponse { + return cast(JSON.parse(json), r("LoyaltyResponse")); + } + + public static loyaltyResponseToJson(value: LoyaltyResponse): string { + return JSON.stringify(uncast(value, r("LoyaltyResponse")), null, 2); + } + + public static toPaymentResponse(json: string): PaymentResponse { + return cast(JSON.parse(json), r("PaymentResponse")); + } + + public static paymentResponseToJson(value: PaymentResponse): string { + return JSON.stringify(uncast(value, r("PaymentResponse")), null, 2); + } + + public static toPinResponse(json: string): PinResponse { + return cast(JSON.parse(json), r("PinResponse")); + } + + public static pinResponseToJson(value: PinResponse): string { + return JSON.stringify(uncast(value, r("PinResponse")), null, 2); + } + + public static toPrintResponse(json: string): PrintResponse { + return cast(JSON.parse(json), r("PrintResponse")); + } + + public static printResponseToJson(value: PrintResponse): string { + return JSON.stringify(uncast(value, r("PrintResponse")), null, 2); + } + + public static toCardReaderInitResponse(json: string): CardReaderInitResponse { + return cast(JSON.parse(json), r("CardReaderInitResponse")); + } + + public static cardReaderInitResponseToJson(value: CardReaderInitResponse): string { + return JSON.stringify(uncast(value, r("CardReaderInitResponse")), null, 2); + } + + public static toCardReaderApduResponse(json: string): CardReaderApduResponse { + return cast(JSON.parse(json), r("CardReaderApduResponse")); + } + + public static cardReaderApduResponseToJson(value: CardReaderApduResponse): string { + return JSON.stringify(uncast(value, r("CardReaderApduResponse")), null, 2); + } + + public static toCardReaderPowerOffResponse(json: string): CardReaderPowerOffResponse { + return cast(JSON.parse(json), r("CardReaderPowerOffResponse")); + } + + public static cardReaderPowerOffResponseToJson(value: CardReaderPowerOffResponse): string { + return JSON.stringify(uncast(value, r("CardReaderPowerOffResponse")), null, 2); + } + + public static toReconciliationResponse(json: string): ReconciliationResponse { + return cast(JSON.parse(json), r("ReconciliationResponse")); + } + + public static reconciliationResponseToJson(value: ReconciliationResponse): string { + return JSON.stringify(uncast(value, r("ReconciliationResponse")), null, 2); + } + + public static toReversalResponse(json: string): ReversalResponse { + return cast(JSON.parse(json), r("ReversalResponse")); + } + + public static reversalResponseToJson(value: ReversalResponse): string { + return JSON.stringify(uncast(value, r("ReversalResponse")), null, 2); + } + + public static toSoundResponse(json: string): SoundResponse { + return cast(JSON.parse(json), r("SoundResponse")); + } + + public static soundResponseToJson(value: SoundResponse): string { + return JSON.stringify(uncast(value, r("SoundResponse")), null, 2); + } + + public static toStoredValueResponse(json: string): StoredValueResponse { + return cast(JSON.parse(json), r("StoredValueResponse")); + } + + public static storedValueResponseToJson(value: StoredValueResponse): string { + return JSON.stringify(uncast(value, r("StoredValueResponse")), null, 2); + } + + public static toTransactionStatusResponse(json: string): TransactionStatusResponse { + return cast(JSON.parse(json), r("TransactionStatusResponse")); + } + + public static transactionStatusResponseToJson(value: TransactionStatusResponse): string { + return JSON.stringify(uncast(value, r("TransactionStatusResponse")), null, 2); + } + + public static toTransmitResponse(json: string): TransmitResponse { + return cast(JSON.parse(json), r("TransmitResponse")); + } + + public static transmitResponseToJson(value: TransmitResponse): string { + return JSON.stringify(uncast(value, r("TransmitResponse")), null, 2); + } + + public static toMessageReference(json: string): MessageReference { + return cast(JSON.parse(json), r("MessageReference")); + } + + public static messageReferenceToJson(value: MessageReference): string { + return JSON.stringify(uncast(value, r("MessageReference")), null, 2); + } + + public static toDisplayOutput(json: string): DisplayOutput { + return cast(JSON.parse(json), r("DisplayOutput")); + } + + public static displayOutputToJson(value: DisplayOutput): string { + return JSON.stringify(uncast(value, r("DisplayOutput")), null, 2); + } + + public static toPaymentAccountReq(json: string): PaymentAccountReq { + return cast(JSON.parse(json), r("PaymentAccountReq")); + } + + public static paymentAccountReqToJson(value: PaymentAccountReq): string { + return JSON.stringify(uncast(value, r("PaymentAccountReq")), null, 2); + } + + public static toLoyaltyAccountReq(json: string): LoyaltyAccountReq { + return cast(JSON.parse(json), r("LoyaltyAccountReq")); + } + + public static loyaltyAccountReqToJson(value: LoyaltyAccountReq): string { + return JSON.stringify(uncast(value, r("LoyaltyAccountReq")), null, 2); + } + + public static toTransactionToPerform(json: string): TransactionToPerform { + return cast(JSON.parse(json), r("TransactionToPerform")); + } + + public static transactionToPerformToJson(value: TransactionToPerform): string { + return JSON.stringify(uncast(value, r("TransactionToPerform")), null, 2); + } + + public static toSaleData(json: string): SaleData { + return cast(JSON.parse(json), r("SaleData")); + } + + public static saleDataToJson(value: SaleData): string { + return JSON.stringify(uncast(value, r("SaleData")), null, 2); + } + + public static toCardAcquisitionTransaction(json: string): CardAcquisitionTransaction { + return cast(JSON.parse(json), r("CardAcquisitionTransaction")); + } + + public static cardAcquisitionTransactionToJson(value: CardAcquisitionTransaction): string { + return JSON.stringify(uncast(value, r("CardAcquisitionTransaction")), null, 2); + } + + public static toXmlGregorianCalendar(json: string): { [key: string]: any } { + return cast(JSON.parse(json), m("any")); + } + + public static xmlGregorianCalendarToJson(value: { [key: string]: any }): string { + return JSON.stringify(uncast(value, m("any")), null, 2); + } + + public static toTotalFilter(json: string): TotalFilter { + return cast(JSON.parse(json), r("TotalFilter")); + } + + public static totalFilterToJson(value: TotalFilter): string { + return JSON.stringify(uncast(value, r("TotalFilter")), null, 2); + } + + public static toInputData(json: string): InputData { + return cast(JSON.parse(json), r("InputData")); + } + + public static inputDataToJson(value: InputData): string { + return JSON.stringify(uncast(value, r("InputData")), null, 2); + } + + public static toOutputContent(json: string): OutputContent { + return cast(JSON.parse(json), r("OutputContent")); + } + + public static outputContentToJson(value: OutputContent): string { + return JSON.stringify(uncast(value, r("OutputContent")), null, 2); + } + + public static toMenuEntry(json: string): MenuEntry { + return cast(JSON.parse(json), r("MenuEntry")); + } + + public static menuEntryToJson(value: MenuEntry): string { + return JSON.stringify(uncast(value, r("MenuEntry")), null, 2); + } + + public static toSaleSoftware(json: string): SaleSoftware { + return cast(JSON.parse(json), r("SaleSoftware")); + } + + public static saleSoftwareToJson(value: SaleSoftware): string { + return JSON.stringify(uncast(value, r("SaleSoftware")), null, 2); + } + + public static toSaleTerminalData(json: string): SaleTerminalData { + return cast(JSON.parse(json), r("SaleTerminalData")); + } + + public static saleTerminalDataToJson(value: SaleTerminalData): string { + return JSON.stringify(uncast(value, r("SaleTerminalData")), null, 2); + } + + public static toLoyaltyTransaction(json: string): LoyaltyTransaction { + return cast(JSON.parse(json), r("LoyaltyTransaction")); + } + + public static loyaltyTransactionToJson(value: LoyaltyTransaction): string { + return JSON.stringify(uncast(value, r("LoyaltyTransaction")), null, 2); + } + + public static toLoyaltyData(json: string): LoyaltyData { + return cast(JSON.parse(json), r("LoyaltyData")); + } + + public static loyaltyDataToJson(value: LoyaltyData): string { + return JSON.stringify(uncast(value, r("LoyaltyData")), null, 2); + } + + public static toPaymentTransaction(json: string): PaymentTransaction { + return cast(JSON.parse(json), r("PaymentTransaction")); + } + + public static paymentTransactionToJson(value: PaymentTransaction): string { + return JSON.stringify(uncast(value, r("PaymentTransaction")), null, 2); + } + + public static toPaymentData(json: string): PaymentData { + return cast(JSON.parse(json), r("PaymentData")); + } + + public static paymentDataToJson(value: PaymentData): string { + return JSON.stringify(uncast(value, r("PaymentData")), null, 2); + } + + public static toCardholderPin(json: string): CardholderPin { + return cast(JSON.parse(json), r("CardholderPin")); + } + + public static cardholderPinToJson(value: CardholderPin): string { + return JSON.stringify(uncast(value, r("CardholderPin")), null, 2); + } + + public static toPrintOutput(json: string): PrintOutput { + return cast(JSON.parse(json), r("PrintOutput")); + } + + public static printOutputToJson(value: PrintOutput): string { + return JSON.stringify(uncast(value, r("PrintOutput")), null, 2); + } + + public static toOriginalPoiTransaction(json: string): OriginalPoiTransaction { + return cast(JSON.parse(json), r("OriginalPoiTransaction")); + } + + public static originalPoiTransactionToJson(value: OriginalPoiTransaction): string { + return JSON.stringify(uncast(value, r("OriginalPoiTransaction")), null, 2); + } + + public static toCustomerOrder(json: string): CustomerOrder { + return cast(JSON.parse(json), r("CustomerOrder")); + } + + public static customerOrderToJson(value: CustomerOrder): string { + return JSON.stringify(uncast(value, r("CustomerOrder")), null, 2); + } + + public static toSoundContent(json: string): SoundContent { + return cast(JSON.parse(json), r("SoundContent")); + } + + public static soundContentToJson(value: SoundContent): string { + return JSON.stringify(uncast(value, r("SoundContent")), null, 2); + } + + public static toStoredValueData(json: string): StoredValueData { + return cast(JSON.parse(json), r("StoredValueData")); + } + + public static storedValueDataToJson(value: StoredValueData): string { + return JSON.stringify(uncast(value, r("StoredValueData")), null, 2); + } + + public static toEnvelopedData(json: string): EnvelopedData { + return cast(JSON.parse(json), r("EnvelopedData")); + } + + public static envelopedDataToJson(value: EnvelopedData): string { + return JSON.stringify(uncast(value, r("EnvelopedData")), null, 2); + } + + public static toAuthenticatedData(json: string): AuthenticatedData { + return cast(JSON.parse(json), r("AuthenticatedData")); + } + + public static authenticatedDataToJson(value: AuthenticatedData): string { + return JSON.stringify(uncast(value, r("AuthenticatedData")), null, 2); + } + + public static toSignedData(json: string): SignedData { + return cast(JSON.parse(json), r("SignedData")); + } + + public static signedDataToJson(value: SignedData): string { + return JSON.stringify(uncast(value, r("SignedData")), null, 2); + } + + public static toDigestedData(json: string): DigestedData { + return cast(JSON.parse(json), r("DigestedData")); + } + + public static digestedDataToJson(value: DigestedData): string { + return JSON.stringify(uncast(value, r("DigestedData")), null, 2); + } + + public static toNamedKeyEncryptedData(json: string): NamedKeyEncryptedData { + return cast(JSON.parse(json), r("NamedKeyEncryptedData")); + } + + public static namedKeyEncryptedDataToJson(value: NamedKeyEncryptedData): string { + return JSON.stringify(uncast(value, r("NamedKeyEncryptedData")), null, 2); + } + + public static toResponse(json: string): Response { + return cast(JSON.parse(json), r("Response")); + } + + public static responseToJson(value: Response): string { + return JSON.stringify(uncast(value, r("Response")), null, 2); + } + + public static toPaymentAccountStatus(json: string): PaymentAccountStatus { + return cast(JSON.parse(json), r("PaymentAccountStatus")); + } + + public static paymentAccountStatusToJson(value: PaymentAccountStatus): string { + return JSON.stringify(uncast(value, r("PaymentAccountStatus")), null, 2); + } + + public static toLoyaltyAccountStatus(json: string): LoyaltyAccountStatus { + return cast(JSON.parse(json), r("LoyaltyAccountStatus")); + } + + public static loyaltyAccountStatusToJson(value: LoyaltyAccountStatus): string { + return JSON.stringify(uncast(value, r("LoyaltyAccountStatus")), null, 2); + } + + public static toPerformedTransaction(json: string): PerformedTransaction { + return cast(JSON.parse(json), r("PerformedTransaction")); + } + + public static performedTransactionToJson(value: PerformedTransaction): string { + return JSON.stringify(uncast(value, r("PerformedTransaction")), null, 2); + } + + public static toPoiData(json: string): PoiData { + return cast(JSON.parse(json), r("PoiData")); + } + + public static poiDataToJson(value: PoiData): string { + return JSON.stringify(uncast(value, r("PoiData")), null, 2); + } + + public static toPaymentInstrumentData(json: string): PaymentInstrumentData { + return cast(JSON.parse(json), r("PaymentInstrumentData")); + } + + public static paymentInstrumentDataToJson(value: PaymentInstrumentData): string { + return JSON.stringify(uncast(value, r("PaymentInstrumentData")), null, 2); + } + + public static toLoyaltyAccount(json: string): LoyaltyAccount { + return cast(JSON.parse(json), r("LoyaltyAccount")); + } + + public static loyaltyAccountToJson(value: LoyaltyAccount): string { + return JSON.stringify(uncast(value, r("LoyaltyAccount")), null, 2); + } + + public static toPoiStatus(json: string): PoiStatus { + return cast(JSON.parse(json), r("PoiStatus")); + } + + public static poiStatusToJson(value: PoiStatus): string { + return JSON.stringify(uncast(value, r("PoiStatus")), null, 2); + } + + public static toHostStatus(json: string): HostStatus { + return cast(JSON.parse(json), r("HostStatus")); + } + + public static hostStatusToJson(value: HostStatus): string { + return JSON.stringify(uncast(value, r("HostStatus")), null, 2); + } + + public static toOutputResult(json: string): OutputResult { + return cast(JSON.parse(json), r("OutputResult")); + } + + public static outputResultToJson(value: OutputResult): string { + return JSON.stringify(uncast(value, r("OutputResult")), null, 2); + } + + public static toTransactionTotals(json: string): TransactionTotals { + return cast(JSON.parse(json), r("TransactionTotals")); + } + + public static transactionTotalsToJson(value: TransactionTotals): string { + return JSON.stringify(uncast(value, r("TransactionTotals")), null, 2); + } + + public static toInputResult(json: string): InputResult { + return cast(JSON.parse(json), r("InputResult")); + } + + public static inputResultToJson(value: InputResult): string { + return JSON.stringify(uncast(value, r("InputResult")), null, 2); + } + + public static toPoiSystemData(json: string): PoiSystemData { + return cast(JSON.parse(json), r("PoiSystemData")); + } + + public static poiSystemDataToJson(value: PoiSystemData): string { + return JSON.stringify(uncast(value, r("PoiSystemData")), null, 2); + } + + public static toLoyaltyResult(json: string): LoyaltyResult { + return cast(JSON.parse(json), r("LoyaltyResult")); + } + + public static loyaltyResultToJson(value: LoyaltyResult): string { + return JSON.stringify(uncast(value, r("LoyaltyResult")), null, 2); + } + + public static toPaymentReceipt(json: string): PaymentReceipt { + return cast(JSON.parse(json), r("PaymentReceipt")); + } + + public static paymentReceiptToJson(value: PaymentReceipt): string { + return JSON.stringify(uncast(value, r("PaymentReceipt")), null, 2); + } + + public static toPaymentResult(json: string): PaymentResult { + return cast(JSON.parse(json), r("PaymentResult")); + } + + public static paymentResultToJson(value: PaymentResult): string { + return JSON.stringify(uncast(value, r("PaymentResult")), null, 2); + } + + public static toTrackData(json: string): TrackData { + return cast(JSON.parse(json), r("TrackData")); + } + + public static trackDataToJson(value: TrackData): string { + return JSON.stringify(uncast(value, r("TrackData")), null, 2); + } + + public static toIccResetData(json: string): IccResetData { + return cast(JSON.parse(json), r("IccResetData")); + } + + public static iccResetDataToJson(value: IccResetData): string { + return JSON.stringify(uncast(value, r("IccResetData")), null, 2); + } + + public static toStoredValueResult(json: string): StoredValueResult { + return cast(JSON.parse(json), r("StoredValueResult")); + } + + public static storedValueResultToJson(value: StoredValueResult): string { + return JSON.stringify(uncast(value, r("StoredValueResult")), null, 2); + } + + public static toRepeatedMessageResponse(json: string): RepeatedMessageResponse { + return cast(JSON.parse(json), r("RepeatedMessageResponse")); + } + + public static repeatedMessageResponseToJson(value: RepeatedMessageResponse): string { + return JSON.stringify(uncast(value, r("RepeatedMessageResponse")), null, 2); + } + + public static toTransactionIdentification(json: string): TransactionIdentification { + return cast(JSON.parse(json), r("TransactionIdentification")); + } + + public static transactionIdentificationToJson(value: TransactionIdentification): string { + return JSON.stringify(uncast(value, r("TransactionIdentification")), null, 2); + } + + public static toLoyaltyAccountId(json: string): LoyaltyAccountId { + return cast(JSON.parse(json), r("LoyaltyAccountId")); + } + + public static loyaltyAccountIdToJson(value: LoyaltyAccountId): string { + return JSON.stringify(uncast(value, r("LoyaltyAccountId")), null, 2); + } + + public static toSponsoredMerchant(json: string): SponsoredMerchant { + return cast(JSON.parse(json), r("SponsoredMerchant")); + } + + public static sponsoredMerchantToJson(value: SponsoredMerchant): string { + return JSON.stringify(uncast(value, r("SponsoredMerchant")), null, 2); + } + + public static toSaleToIssuerData(json: string): SaleToIssuerData { + return cast(JSON.parse(json), r("SaleToIssuerData")); + } + + public static saleToIssuerDataToJson(value: SaleToIssuerData): string { + return JSON.stringify(uncast(value, r("SaleToIssuerData")), null, 2); + } + + public static toCloneable(json: string): { [key: string]: any } { + return cast(JSON.parse(json), m("any")); + } + + public static cloneableToJson(value: { [key: string]: any }): string { + return JSON.stringify(uncast(value, m("any")), null, 2); + } + + public static toPredefinedContent(json: string): PredefinedContent { + return cast(JSON.parse(json), r("PredefinedContent")); + } + + public static predefinedContentToJson(value: PredefinedContent): string { + return JSON.stringify(uncast(value, r("PredefinedContent")), null, 2); + } + + public static toOutputText(json: string): OutputText { + return cast(JSON.parse(json), r("OutputText")); + } + + public static outputTextToJson(value: OutputText): string { + return JSON.stringify(uncast(value, r("OutputText")), null, 2); + } + + public static toOutputBarcode(json: string): OutputBarcode { + return cast(JSON.parse(json), r("OutputBarcode")); + } + + public static outputBarcodeToJson(value: OutputBarcode): string { + return JSON.stringify(uncast(value, r("OutputBarcode")), null, 2); + } + + public static toSaleProfile(json: string): SaleProfile { + return cast(JSON.parse(json), r("SaleProfile")); + } + + public static saleProfileToJson(value: SaleProfile): string { + return JSON.stringify(uncast(value, r("SaleProfile")), null, 2); + } + + public static toTransactionConditions(json: string): TransactionConditions { + return cast(JSON.parse(json), r("TransactionConditions")); + } + + public static transactionConditionsToJson(value: TransactionConditions): string { + return JSON.stringify(uncast(value, r("TransactionConditions")), null, 2); + } + + public static toSaleItem(json: string): SaleItem { + return cast(JSON.parse(json), r("SaleItem")); + } + + public static saleItemToJson(value: SaleItem): string { + return JSON.stringify(uncast(value, r("SaleItem")), null, 2); + } + + public static toLoyaltyAmount(json: string): LoyaltyAmount { + return cast(JSON.parse(json), r("LoyaltyAmount")); + } + + public static loyaltyAmountToJson(value: LoyaltyAmount): string { + return JSON.stringify(uncast(value, r("LoyaltyAmount")), null, 2); + } + + public static toAmountsReq(json: string): AmountsReq { + return cast(JSON.parse(json), r("AmountsReq")); + } + + public static amountsReqToJson(value: AmountsReq): string { + return JSON.stringify(uncast(value, r("AmountsReq")), null, 2); + } + + public static toInstalment(json: string): Instalment { + return cast(JSON.parse(json), r("Instalment")); + } + + public static instalmentToJson(value: Instalment): string { + return JSON.stringify(uncast(value, r("Instalment")), null, 2); + } + + public static toStoredValueAccountId(json: string): StoredValueAccountId { + return cast(JSON.parse(json), r("StoredValueAccountId")); + } + + public static storedValueAccountIdToJson(value: StoredValueAccountId): string { + return JSON.stringify(uncast(value, r("StoredValueAccountId")), null, 2); + } + + public static toEncryptedContent(json: string): EncryptedContent { + return cast(JSON.parse(json), r("EncryptedContent")); + } + + public static encryptedContentToJson(value: EncryptedContent): string { + return JSON.stringify(uncast(value, r("EncryptedContent")), null, 2); + } + + public static toAlgorithmIdentifier(json: string): AlgorithmIdentifier { + return cast(JSON.parse(json), r("AlgorithmIdentifier")); + } + + public static algorithmIdentifierToJson(value: AlgorithmIdentifier): string { + return JSON.stringify(uncast(value, r("AlgorithmIdentifier")), null, 2); + } + + public static toEncapsulatedContent(json: string): EncapsulatedContent { + return cast(JSON.parse(json), r("EncapsulatedContent")); + } + + public static encapsulatedContentToJson(value: EncapsulatedContent): string { + return JSON.stringify(uncast(value, r("EncapsulatedContent")), null, 2); + } + + public static toSigner(json: string): Signer { + return cast(JSON.parse(json), r("Signer")); + } + + public static signerToJson(value: Signer): string { + return JSON.stringify(uncast(value, r("Signer")), null, 2); + } + + public static toPaymentAcquirerData(json: string): PaymentAcquirerData { + return cast(JSON.parse(json), r("PaymentAcquirerData")); + } + + public static paymentAcquirerDataToJson(value: PaymentAcquirerData): string { + return JSON.stringify(uncast(value, r("PaymentAcquirerData")), null, 2); + } + + public static toCardData(json: string): CardData { + return cast(JSON.parse(json), r("CardData")); + } + + public static cardDataToJson(value: CardData): string { + return JSON.stringify(uncast(value, r("CardData")), null, 2); + } + + public static toCheckData(json: string): CheckData { + return cast(JSON.parse(json), r("CheckData")); + } + + public static checkDataToJson(value: CheckData): string { + return JSON.stringify(uncast(value, r("CheckData")), null, 2); + } + + public static toMobileData(json: string): MobileData { + return cast(JSON.parse(json), r("MobileData")); + } + + public static mobileDataToJson(value: MobileData): string { + return JSON.stringify(uncast(value, r("MobileData")), null, 2); + } + + public static toCashHandlingDevice(json: string): CashHandlingDevice { + return cast(JSON.parse(json), r("CashHandlingDevice")); + } + + public static cashHandlingDeviceToJson(value: CashHandlingDevice): string { + return JSON.stringify(uncast(value, r("CashHandlingDevice")), null, 2); + } + + public static toPaymentTotals(json: string): PaymentTotals { + return cast(JSON.parse(json), r("PaymentTotals")); + } + + public static paymentTotalsToJson(value: PaymentTotals): string { + return JSON.stringify(uncast(value, r("PaymentTotals")), null, 2); + } + + public static toLoyaltyTotals(json: string): LoyaltyTotals { + return cast(JSON.parse(json), r("LoyaltyTotals")); + } + + public static loyaltyTotalsToJson(value: LoyaltyTotals): string { + return JSON.stringify(uncast(value, r("LoyaltyTotals")), null, 2); + } + + public static toInput(json: string): Input { + return cast(JSON.parse(json), r("Input")); + } + + public static inputToJson(value: Input): string { + return JSON.stringify(uncast(value, r("Input")), null, 2); + } + + public static toPoiSoftware(json: string): PoiSoftware { + return cast(JSON.parse(json), r("PoiSoftware")); + } + + public static poiSoftwareToJson(value: PoiSoftware): string { + return JSON.stringify(uncast(value, r("PoiSoftware")), null, 2); + } + + public static toPoiTerminalData(json: string): PoiTerminalData { + return cast(JSON.parse(json), r("PoiTerminalData")); + } + + public static poiTerminalDataToJson(value: PoiTerminalData): string { + return JSON.stringify(uncast(value, r("PoiTerminalData")), null, 2); + } + + public static toLoyaltyAcquirerData(json: string): LoyaltyAcquirerData { + return cast(JSON.parse(json), r("LoyaltyAcquirerData")); + } + + public static loyaltyAcquirerDataToJson(value: LoyaltyAcquirerData): string { + return JSON.stringify(uncast(value, r("LoyaltyAcquirerData")), null, 2); + } + + public static toRebates(json: string): Rebates { + return cast(JSON.parse(json), r("Rebates")); + } + + public static rebatesToJson(value: Rebates): string { + return JSON.stringify(uncast(value, r("Rebates")), null, 2); + } + + public static toAmountsResp(json: string): AmountsResp { + return cast(JSON.parse(json), r("AmountsResp")); + } + + public static amountsRespToJson(value: AmountsResp): string { + return JSON.stringify(uncast(value, r("AmountsResp")), null, 2); + } + + public static toCurrencyConversion(json: string): CurrencyConversion { + return cast(JSON.parse(json), r("CurrencyConversion")); + } + + public static currencyConversionToJson(value: CurrencyConversion): string { + return JSON.stringify(uncast(value, r("CurrencyConversion")), null, 2); + } + + public static toCapturedSignature(json: string): CapturedSignature { + return cast(JSON.parse(json), r("CapturedSignature")); + } + + public static capturedSignatureToJson(value: CapturedSignature): string { + return JSON.stringify(uncast(value, r("CapturedSignature")), null, 2); + } + + public static toStoredValueAccountStatus(json: string): StoredValueAccountStatus { + return cast(JSON.parse(json), r("StoredValueAccountStatus")); + } + + public static storedValueAccountStatusToJson(value: StoredValueAccountStatus): string { + return JSON.stringify(uncast(value, r("StoredValueAccountStatus")), null, 2); + } + + public static toRepeatedResponseMessageBody(json: string): RepeatedResponseMessageBody { + return cast(JSON.parse(json), r("RepeatedResponseMessageBody")); + } + + public static repeatedResponseMessageBodyToJson(value: RepeatedResponseMessageBody): string { + return JSON.stringify(uncast(value, r("RepeatedResponseMessageBody")), null, 2); + } + + public static toParameter(json: string): Parameter { + return cast(JSON.parse(json), r("Parameter")); + } + + public static parameterToJson(value: Parameter): string { + return JSON.stringify(uncast(value, r("Parameter")), null, 2); + } + + public static toSignerIdentifier(json: string): SignerIdentifier { + return cast(JSON.parse(json), r("SignerIdentifier")); + } + + public static signerIdentifierToJson(value: SignerIdentifier): string { + return JSON.stringify(uncast(value, r("SignerIdentifier")), null, 2); + } + + public static toSensitiveCardData(json: string): SensitiveCardData { + return cast(JSON.parse(json), r("SensitiveCardData")); + } + + public static sensitiveCardDataToJson(value: SensitiveCardData): string { + return JSON.stringify(uncast(value, r("SensitiveCardData")), null, 2); + } + + public static toAllowedProduct(json: string): AllowedProduct { + return cast(JSON.parse(json), r("AllowedProduct")); + } + + public static allowedProductToJson(value: AllowedProduct): string { + return JSON.stringify(uncast(value, r("AllowedProduct")), null, 2); + } + + public static toPaymentToken(json: string): PaymentToken { + return cast(JSON.parse(json), r("PaymentToken")); + } + + public static paymentTokenToJson(value: PaymentToken): string { + return JSON.stringify(uncast(value, r("PaymentToken")), null, 2); + } + + public static toGeolocation(json: string): Geolocation { + return cast(JSON.parse(json), r("Geolocation")); + } + + public static geolocationToJson(value: Geolocation): string { + return JSON.stringify(uncast(value, r("Geolocation")), null, 2); + } + + public static toSensitiveMobileData(json: string): SensitiveMobileData { + return cast(JSON.parse(json), r("SensitiveMobileData")); + } + + public static sensitiveMobileDataToJson(value: SensitiveMobileData): string { + return JSON.stringify(uncast(value, r("SensitiveMobileData")), null, 2); + } + + public static toCoinsOrBills(json: string): CoinsOrBills { + return cast(JSON.parse(json), r("CoinsOrBills")); + } + + public static coinsOrBillsToJson(value: CoinsOrBills): string { + return JSON.stringify(uncast(value, r("CoinsOrBills")), null, 2); + } + + public static toPoiProfile(json: string): PoiProfile { + return cast(JSON.parse(json), r("PoiProfile")); + } + + public static poiProfileToJson(value: PoiProfile): string { + return JSON.stringify(uncast(value, r("PoiProfile")), null, 2); + } + + public static toSaleItemRebate(json: string): SaleItemRebate { + return cast(JSON.parse(json), r("SaleItemRebate")); + } + + public static saleItemRebateToJson(value: SaleItemRebate): string { + return JSON.stringify(uncast(value, r("SaleItemRebate")), null, 2); + } + + public static toAmount(json: string): Amount { + return cast(JSON.parse(json), r("Amount")); + } + + public static amountToJson(value: Amount): string { + return JSON.stringify(uncast(value, r("Amount")), null, 2); + } + + public static toAreaSize(json: string): AreaSize { + return cast(JSON.parse(json), r("AreaSize")); + } + + public static areaSizeToJson(value: AreaSize): string { + return JSON.stringify(uncast(value, r("AreaSize")), null, 2); + } + + public static toSignaturePoint(json: string): SignaturePoint { + return cast(JSON.parse(json), r("SignaturePoint")); + } + + public static signaturePointToJson(value: SignaturePoint): string { + return JSON.stringify(uncast(value, r("SignaturePoint")), null, 2); + } + + public static toIssuerAndSerialNumber(json: string): IssuerAndSerialNumber { + return cast(JSON.parse(json), r("IssuerAndSerialNumber")); + } + + public static issuerAndSerialNumberToJson(value: IssuerAndSerialNumber): string { + return JSON.stringify(uncast(value, r("IssuerAndSerialNumber")), null, 2); + } + + public static toGeographicCoordinates(json: string): GeographicCoordinates { + return cast(JSON.parse(json), r("GeographicCoordinates")); + } + + public static geographicCoordinatesToJson(value: GeographicCoordinates): string { + return JSON.stringify(uncast(value, r("GeographicCoordinates")), null, 2); + } + + public static toUtmCoordinates(json: string): UtmCoordinates { + return cast(JSON.parse(json), r("UtmCoordinates")); + } + + public static utmCoordinatesToJson(value: UtmCoordinates): string { + return JSON.stringify(uncast(value, r("UtmCoordinates")), null, 2); + } + + public static toIssuer(json: string): Issuer { + return cast(JSON.parse(json), r("Issuer")); + } + + public static issuerToJson(value: Issuer): string { + return JSON.stringify(uncast(value, r("Issuer")), null, 2); + } + + public static toRelativeDistinguishedName(json: string): RelativeDistinguishedName { + return cast(JSON.parse(json), r("RelativeDistinguishedName")); + } + + public static relativeDistinguishedNameToJson(value: RelativeDistinguishedName): string { + return JSON.stringify(uncast(value, r("RelativeDistinguishedName")), null, 2); + } + + public static toMessageClassType(json: string): MessageClassType { + return cast(JSON.parse(json), r("MessageClassType")); + } + + public static messageClassTypeToJson(value: MessageClassType): string { + return JSON.stringify(uncast(value, r("MessageClassType")), null, 2); + } + + public static toMessageCategoryType(json: string): MessageCategoryType { + return cast(JSON.parse(json), r("MessageCategoryType")); + } + + public static messageCategoryTypeToJson(value: MessageCategoryType): string { + return JSON.stringify(uncast(value, r("MessageCategoryType")), null, 2); + } + + public static toMessageType(json: string): MessageType { + return cast(JSON.parse(json), r("MessageType")); + } + + public static messageTypeToJson(value: MessageType): string { + return JSON.stringify(uncast(value, r("MessageType")), null, 2); + } + + public static toServicesEnabledType(json: string): ServicesEnabledType { + return cast(JSON.parse(json), r("ServicesEnabledType")); + } + + public static servicesEnabledTypeToJson(value: ServicesEnabledType): string { + return JSON.stringify(uncast(value, r("ServicesEnabledType")), null, 2); + } + + public static toTransactionActionType(json: string): TransactionActionType { + return cast(JSON.parse(json), r("TransactionActionType")); + } + + public static transactionActionTypeToJson(value: TransactionActionType): string { + return JSON.stringify(uncast(value, r("TransactionActionType")), null, 2); + } + + public static toEventToNotifyType(json: string): EventToNotifyType { + return cast(JSON.parse(json), r("EventToNotifyType")); + } + + public static eventToNotifyTypeToJson(value: EventToNotifyType): string { + return JSON.stringify(uncast(value, r("EventToNotifyType")), null, 2); + } + + public static toTotalDetailsType(json: string): TotalDetailsType { + return cast(JSON.parse(json), r("TotalDetailsType")); + } + + public static totalDetailsTypeToJson(value: TotalDetailsType): string { + return JSON.stringify(uncast(value, r("TotalDetailsType")), null, 2); + } + + public static toTokenRequestedType(json: string): TokenRequestedType { + return cast(JSON.parse(json), r("TokenRequestedType")); + } + + public static tokenRequestedTypeToJson(value: TokenRequestedType): string { + return JSON.stringify(uncast(value, r("TokenRequestedType")), null, 2); + } + + public static toCustomerOrderReqType(json: string): CustomerOrderReqType { + return cast(JSON.parse(json), r("CustomerOrderReqType")); + } + + public static customerOrderReqTypeToJson(value: CustomerOrderReqType): string { + return JSON.stringify(uncast(value, r("CustomerOrderReqType")), null, 2); + } + + public static toPinRequestType(json: string): PinRequestType { + return cast(JSON.parse(json), r("PinRequestType")); + } + + public static pinRequestTypeToJson(value: PinRequestType): string { + return JSON.stringify(uncast(value, r("PinRequestType")), null, 2); + } + + public static toPinFormatType(json: string): PinFormatType { + return cast(JSON.parse(json), r("PinFormatType")); + } + + public static pinFormatTypeToJson(value: PinFormatType): string { + return JSON.stringify(uncast(value, r("PinFormatType")), null, 2); + } + + public static toForceEntryModeType(json: string): ForceEntryModeType { + return cast(JSON.parse(json), r("ForceEntryModeType")); + } + + public static forceEntryModeTypeToJson(value: ForceEntryModeType): string { + return JSON.stringify(uncast(value, r("ForceEntryModeType")), null, 2); + } + + public static toReconciliationType(json: string): ReconciliationType { + return cast(JSON.parse(json), r("ReconciliationType")); + } + + public static reconciliationTypeToJson(value: ReconciliationType): string { + return JSON.stringify(uncast(value, r("ReconciliationType")), null, 2); + } + + public static toReversalReasonType(json: string): ReversalReasonType { + return cast(JSON.parse(json), r("ReversalReasonType")); + } + + public static reversalReasonTypeToJson(value: ReversalReasonType): string { + return JSON.stringify(uncast(value, r("ReversalReasonType")), null, 2); + } + + public static toResponseModeType(json: string): ResponseModeType { + return cast(JSON.parse(json), r("ResponseModeType")); + } + + public static responseModeTypeToJson(value: ResponseModeType): string { + return JSON.stringify(uncast(value, r("ResponseModeType")), null, 2); + } + + public static toSoundActionType(json: string): SoundActionType { + return cast(JSON.parse(json), r("SoundActionType")); + } + + public static soundActionTypeToJson(value: SoundActionType): string { + return JSON.stringify(uncast(value, r("SoundActionType")), null, 2); + } + + public static toDocumentQualifierType(json: string): DocumentQualifierType { + return cast(JSON.parse(json), r("DocumentQualifierType")); + } + + public static documentQualifierTypeToJson(value: DocumentQualifierType): string { + return JSON.stringify(uncast(value, r("DocumentQualifierType")), null, 2); + } + + public static toContentType(json: string): ContentType { + return cast(JSON.parse(json), r("ContentType")); + } + + public static contentTypeToJson(value: ContentType): string { + return JSON.stringify(uncast(value, r("ContentType")), null, 2); + } + + public static toEntryModeType(json: string): EntryModeType { + return cast(JSON.parse(json), r("EntryModeType")); + } + + public static entryModeTypeToJson(value: EntryModeType): string { + return JSON.stringify(uncast(value, r("EntryModeType")), null, 2); + } + + public static toDeviceType(json: string): DeviceType { + return cast(JSON.parse(json), r("DeviceType")); + } + + public static deviceTypeToJson(value: DeviceType): string { + return JSON.stringify(uncast(value, r("DeviceType")), null, 2); + } + + public static toInfoQualifyType(json: string): InfoQualifyType { + return cast(JSON.parse(json), r("InfoQualifyType")); + } + + public static infoQualifyTypeToJson(value: InfoQualifyType): string { + return JSON.stringify(uncast(value, r("InfoQualifyType")), null, 2); + } + + public static toAccountType(json: string): AccountType { + return cast(JSON.parse(json), r("AccountType")); + } + + public static accountTypeToJson(value: AccountType): string { + return JSON.stringify(uncast(value, r("AccountType")), null, 2); + } + + public static toLoyaltyHandlingType(json: string): LoyaltyHandlingType { + return cast(JSON.parse(json), r("LoyaltyHandlingType")); + } + + public static loyaltyHandlingTypeToJson(value: LoyaltyHandlingType): string { + return JSON.stringify(uncast(value, r("LoyaltyHandlingType")), null, 2); + } + + public static toPaymentType(json: string): PaymentType { + return cast(JSON.parse(json), r("PaymentType")); + } + + public static paymentTypeToJson(value: PaymentType): string { + return JSON.stringify(uncast(value, r("PaymentType")), null, 2); + } + + public static toInputCommandType(json: string): InputCommandType { + return cast(JSON.parse(json), r("InputCommandType")); + } + + public static inputCommandTypeToJson(value: InputCommandType): string { + return JSON.stringify(uncast(value, r("InputCommandType")), null, 2); + } + + public static toOutputFormatType(json: string): OutputFormatType { + return cast(JSON.parse(json), r("OutputFormatType")); + } + + public static outputFormatTypeToJson(value: OutputFormatType): string { + return JSON.stringify(uncast(value, r("OutputFormatType")), null, 2); + } + + public static toMenuEntryTagType(json: string): MenuEntryTagType { + return cast(JSON.parse(json), r("MenuEntryTagType")); + } + + public static menuEntryTagTypeToJson(value: MenuEntryTagType): string { + return JSON.stringify(uncast(value, r("MenuEntryTagType")), null, 2); + } + + public static toSaleCapabilitiesType(json: string): SaleCapabilitiesType { + return cast(JSON.parse(json), r("SaleCapabilitiesType")); + } + + public static saleCapabilitiesTypeToJson(value: SaleCapabilitiesType): string { + return JSON.stringify(uncast(value, r("SaleCapabilitiesType")), null, 2); + } + + public static toTerminalEnvironmentType(json: string): TerminalEnvironmentType { + return cast(JSON.parse(json), r("TerminalEnvironmentType")); + } + + public static terminalEnvironmentTypeToJson(value: TerminalEnvironmentType): string { + return JSON.stringify(uncast(value, r("TerminalEnvironmentType")), null, 2); + } + + public static toLoyaltyTransactionType(json: string): LoyaltyTransactionType { + return cast(JSON.parse(json), r("LoyaltyTransactionType")); + } + + public static loyaltyTransactionTypeToJson(value: LoyaltyTransactionType): string { + return JSON.stringify(uncast(value, r("LoyaltyTransactionType")), null, 2); + } + + public static toSoundFormatType(json: string): SoundFormatType { + return cast(JSON.parse(json), r("SoundFormatType")); + } + + public static soundFormatTypeToJson(value: SoundFormatType): string { + return JSON.stringify(uncast(value, r("SoundFormatType")), null, 2); + } + + public static toStoredValueTransactionType(json: string): StoredValueTransactionType { + return cast(JSON.parse(json), r("StoredValueTransactionType")); + } + + public static storedValueTransactionTypeToJson(value: StoredValueTransactionType): string { + return JSON.stringify(uncast(value, r("StoredValueTransactionType")), null, 2); + } + + public static toVersionType(json: string): VersionType { + return cast(JSON.parse(json), r("VersionType")); + } + + public static versionTypeToJson(value: VersionType): string { + return JSON.stringify(uncast(value, r("VersionType")), null, 2); + } + + public static toResultType(json: string): ResultType { + return cast(JSON.parse(json), r("ResultType")); + } + + public static resultTypeToJson(value: ResultType): string { + return JSON.stringify(uncast(value, r("ResultType")), null, 2); + } + + public static toErrorConditionType(json: string): ErrorConditionType { + return cast(JSON.parse(json), r("ErrorConditionType")); + } + + public static errorConditionTypeToJson(value: ErrorConditionType): string { + return JSON.stringify(uncast(value, r("ErrorConditionType")), null, 2); + } + + public static toLoyaltyUnitType(json: string): LoyaltyUnitType { + return cast(JSON.parse(json), r("LoyaltyUnitType")); + } + + public static loyaltyUnitTypeToJson(value: LoyaltyUnitType): string { + return JSON.stringify(uncast(value, r("LoyaltyUnitType")), null, 2); + } + + public static toPaymentInstrumentType(json: string): PaymentInstrumentType { + return cast(JSON.parse(json), r("PaymentInstrumentType")); + } + + public static paymentInstrumentTypeToJson(value: PaymentInstrumentType): string { + return JSON.stringify(uncast(value, r("PaymentInstrumentType")), null, 2); + } + + public static toGlobalStatusType(json: string): GlobalStatusType { + return cast(JSON.parse(json), r("GlobalStatusType")); + } + + public static globalStatusTypeToJson(value: GlobalStatusType): string { + return JSON.stringify(uncast(value, r("GlobalStatusType")), null, 2); + } + + public static toPrinterStatusType(json: string): PrinterStatusType { + return cast(JSON.parse(json), r("PrinterStatusType")); + } + + public static printerStatusTypeToJson(value: PrinterStatusType): string { + return JSON.stringify(uncast(value, r("PrinterStatusType")), null, 2); + } + + public static toAuthenticationMethodType(json: string): AuthenticationMethodType { + return cast(JSON.parse(json), r("AuthenticationMethodType")); + } + + public static authenticationMethodTypeToJson(value: AuthenticationMethodType): string { + return JSON.stringify(uncast(value, r("AuthenticationMethodType")), null, 2); + } + + public static toTrackFormatType(json: string): TrackFormatType { + return cast(JSON.parse(json), r("TrackFormatType")); + } + + public static trackFormatTypeToJson(value: TrackFormatType): string { + return JSON.stringify(uncast(value, r("TrackFormatType")), null, 2); + } + + public static toIdentificationType(json: string): IdentificationType { + return cast(JSON.parse(json), r("IdentificationType")); + } + + public static identificationTypeToJson(value: IdentificationType): string { + return JSON.stringify(uncast(value, r("IdentificationType")), null, 2); + } + + public static toIdentificationSupportType(json: string): IdentificationSupportType { + return cast(JSON.parse(json), r("IdentificationSupportType")); + } + + public static identificationSupportTypeToJson(value: IdentificationSupportType): string { + return JSON.stringify(uncast(value, r("IdentificationSupportType")), null, 2); + } + + public static toColorType(json: string): ColorType { + return cast(JSON.parse(json), r("ColorType")); + } + + public static colorTypeToJson(value: ColorType): string { + return JSON.stringify(uncast(value, r("ColorType")), null, 2); + } + + public static toCharacterWidthType(json: string): CharacterWidthType { + return cast(JSON.parse(json), r("CharacterWidthType")); + } + + public static characterWidthTypeToJson(value: CharacterWidthType): string { + return JSON.stringify(uncast(value, r("CharacterWidthType")), null, 2); + } + + public static toCharacterHeightType(json: string): CharacterHeightType { + return cast(JSON.parse(json), r("CharacterHeightType")); + } + + public static characterHeightTypeToJson(value: CharacterHeightType): string { + return JSON.stringify(uncast(value, r("CharacterHeightType")), null, 2); + } + + public static toCharacterStyleType(json: string): CharacterStyleType { + return cast(JSON.parse(json), r("CharacterStyleType")); + } + + public static characterStyleTypeToJson(value: CharacterStyleType): string { + return JSON.stringify(uncast(value, r("CharacterStyleType")), null, 2); + } + + public static toAlignmentType(json: string): AlignmentType { + return cast(JSON.parse(json), r("AlignmentType")); + } + + public static alignmentTypeToJson(value: AlignmentType): string { + return JSON.stringify(uncast(value, r("AlignmentType")), null, 2); + } + + public static toBarcodeType(json: string): BarcodeType { + return cast(JSON.parse(json), r("BarcodeType")); + } + + public static barcodeTypeToJson(value: BarcodeType): string { + return JSON.stringify(uncast(value, r("BarcodeType")), null, 2); + } + + public static toServiceProfilesType(json: string): ServiceProfilesType { + return cast(JSON.parse(json), r("ServiceProfilesType")); + } + + public static serviceProfilesTypeToJson(value: ServiceProfilesType): string { + return JSON.stringify(uncast(value, r("ServiceProfilesType")), null, 2); + } + + public static toGenericProfileType(json: string): GenericProfileType { + return cast(JSON.parse(json), r("GenericProfileType")); + } + + public static genericProfileTypeToJson(value: GenericProfileType): string { + return JSON.stringify(uncast(value, r("GenericProfileType")), null, 2); + } + + public static toUnitOfMeasureType(json: string): UnitOfMeasureType { + return cast(JSON.parse(json), r("UnitOfMeasureType")); + } + + public static unitOfMeasureTypeToJson(value: UnitOfMeasureType): string { + return JSON.stringify(uncast(value, r("UnitOfMeasureType")), null, 2); + } + + public static toInstalmentType(json: string): InstalmentType { + return cast(JSON.parse(json), r("InstalmentType")); + } + + public static instalmentTypeToJson(value: InstalmentType): string { + return JSON.stringify(uncast(value, r("InstalmentType")), null, 2); + } + + public static toPeriodUnitType(json: string): PeriodUnitType { + return cast(JSON.parse(json), r("PeriodUnitType")); + } + + public static periodUnitTypeToJson(value: PeriodUnitType): string { + return JSON.stringify(uncast(value, r("PeriodUnitType")), null, 2); + } + + public static toStoredValueAccountType(json: string): StoredValueAccountType { + return cast(JSON.parse(json), r("StoredValueAccountType")); + } + + public static storedValueAccountTypeToJson(value: StoredValueAccountType): string { + return JSON.stringify(uncast(value, r("StoredValueAccountType")), null, 2); + } + + public static toAlgorithmType(json: string): AlgorithmType { + return cast(JSON.parse(json), r("AlgorithmType")); + } + + public static algorithmTypeToJson(value: AlgorithmType): string { + return JSON.stringify(uncast(value, r("AlgorithmType")), null, 2); + } + + public static toCheckTypeCodeType(json: string): CheckTypeCodeType { + return cast(JSON.parse(json), r("CheckTypeCodeType")); + } + + public static checkTypeCodeTypeToJson(value: CheckTypeCodeType): string { + return JSON.stringify(uncast(value, r("CheckTypeCodeType")), null, 2); + } + + public static toTransactionType(json: string): TransactionType { + return cast(JSON.parse(json), r("TransactionType")); + } + + public static transactionTypeToJson(value: TransactionType): string { + return JSON.stringify(uncast(value, r("TransactionType")), null, 2); + } + + public static toPoiCapabilitiesType(json: string): PoiCapabilitiesType { + return cast(JSON.parse(json), r("PoiCapabilitiesType")); + } + + public static poiCapabilitiesTypeToJson(value: PoiCapabilitiesType): string { + return JSON.stringify(uncast(value, r("PoiCapabilitiesType")), null, 2); + } +} + +function invalidValue(typ: any, val: any): never { + throw Error(`Invalid value ${JSON.stringify(val)} for type ${JSON.stringify(typ)}`); +} + +function jsonToJSProps(typ: any): any { + if (typ.jsonToJS === undefined) { + var map: any = {}; + typ.props.forEach((p: any) => map[p.json] = { key: p.js, typ: p.typ }); + typ.jsonToJS = map; + } + return typ.jsonToJS; +} + +function jsToJSONProps(typ: any): any { + if (typ.jsToJSON === undefined) { + var map: any = {}; + typ.props.forEach((p: any) => map[p.js] = { key: p.json, typ: p.typ }); + typ.jsToJSON = map; + } + return typ.jsToJSON; +} + +function transform(val: any, typ: any, getProps: any): any { + function transformPrimitive(typ: string, val: any): any { + if (typeof typ === typeof val) return val; + return invalidValue(typ, val); + } + + function transformUnion(typs: any[], val: any): any { + // val must validate against one typ in typs + var l = typs.length; + for (var i = 0; i < l; i++) { + var typ = typs[i]; + try { + return transform(val, typ, getProps); + } catch (_) {} + } + return invalidValue(typs, val); + } + + function transformEnum(cases: string[], val: any): any { + if (cases.indexOf(val) !== -1) return val; + return invalidValue(cases, val); + } + + function transformArray(typ: any, val: any): any { + // val must be an array with no invalid elements + if (!Array.isArray(val)) return invalidValue("array", val); + return val.map(el => transform(el, typ, getProps)); + } + + function transformDate(typ: any, val: any): any { + if (val === null) { + return null; + } + const d = new Date(val); + if (isNaN(d.valueOf())) { + return invalidValue("Date", val); + } + return d; + } + + function transformObject(props: { [k: string]: any }, additional: any, val: any): any { + if (val === null || typeof val !== "object" || Array.isArray(val)) { + return invalidValue("object", val); + } + var result: any = {}; + Object.getOwnPropertyNames(props).forEach(key => { + const prop = props[key]; + const v = Object.prototype.hasOwnProperty.call(val, key) ? val[key] : undefined; + result[prop.key] = transform(v, prop.typ, getProps); + }); + Object.getOwnPropertyNames(val).forEach(key => { + if (!Object.prototype.hasOwnProperty.call(props, key)) { + result[key] = transform(val[key], additional, getProps); + } + }); + return result; + } + + if (typ === "any") return val; + if (typ === null) { + if (val === null) return val; + return invalidValue(typ, val); + } + if (typ === false) return invalidValue(typ, val); + while (typeof typ === "object" && typ.ref !== undefined) { + typ = typeMap[typ.ref]; + } + if (Array.isArray(typ)) return transformEnum(typ, val); + if (typeof typ === "object") { + return typ.hasOwnProperty("unionMembers") ? transformUnion(typ.unionMembers, val) + : typ.hasOwnProperty("arrayItems") ? transformArray(typ.arrayItems, val) + : typ.hasOwnProperty("props") ? transformObject(getProps(typ), typ.additional, val) + : invalidValue(typ, val); + } + // Numbers can be parsed by Date but shouldn't be. + if (typ === Date && typeof val !== "number") return transformDate(typ, val); + return transformPrimitive(typ, val); +} + +function cast(val: any, typ: any): T { + return transform(val, typ, jsonToJSProps); +} + +function uncast(val: T, typ: any): any { + return transform(val, typ, jsToJSONProps); +} + +function a(typ: any) { + return { arrayItems: typ }; +} + +function u(...typs: any[]) { + return { unionMembers: typs }; +} + +function o(props: any[], additional: any) { + return { props, additional }; +} + +function m(additional: any) { + // @ts-ignore + return { props: [], additional }; +} + +function r(name: string) { + return { ref: name }; +} + +const typeMap: any = { + "TerminalApiRequest": o([ + { json: "SaleToPOIRequest", js: "saleToPoiRequest", typ: u(undefined, r("SaleToPoiRequest")) }, + ], "any"), + "SaleToPoiRequest": o([ + { json: "AbortRequest", js: "abortRequest", typ: u(undefined, r("AbortRequest")) }, + { json: "AdminRequest", js: "adminRequest", typ: u(undefined, r("AdminRequest")) }, + { json: "BalanceInquiryRequest", js: "balanceInquiryRequest", typ: u(undefined, r("BalanceInquiryRequest")) }, + { json: "BatchRequest", js: "batchRequest", typ: u(undefined, r("BatchRequest")) }, + { json: "CardAcquisitionRequest", js: "cardAcquisitionRequest", typ: u(undefined, r("CardAcquisitionRequest")) }, + { json: "CardReaderAPDURequest", js: "cardReaderApduRequest", typ: u(undefined, r("CardReaderApduRequest")) }, + { json: "CardReaderInitRequest", js: "cardReaderInitRequest", typ: u(undefined, r("CardReaderInitRequest")) }, + { json: "CardReaderPowerOffRequest", js: "cardReaderPowerOffRequest", typ: u(undefined, r("CardReaderPowerOffRequest")) }, + { json: "DiagnosisRequest", js: "diagnosisRequest", typ: u(undefined, r("DiagnosisRequest")) }, + { json: "DisplayRequest", js: "displayRequest", typ: u(undefined, r("DisplayRequest")) }, + { json: "EnableServiceRequest", js: "enableServiceRequest", typ: u(undefined, r("EnableServiceRequest")) }, + { json: "EventNotification", js: "eventNotification", typ: u(undefined, r("EventNotification")) }, + { json: "GetTotalsRequest", js: "getTotalsRequest", typ: u(undefined, r("GetTotalsRequest")) }, + { json: "InputRequest", js: "inputRequest", typ: u(undefined, r("InputRequest")) }, + { json: "InputUpdate", js: "inputUpdate", typ: u(undefined, r("InputUpdate")) }, + { json: "LoginRequest", js: "loginRequest", typ: u(undefined, r("LoginRequest")) }, + { json: "LogoutRequest", js: "logoutRequest", typ: u(undefined, r("LogoutRequest")) }, + { json: "LoyaltyRequest", js: "loyaltyRequest", typ: u(undefined, r("LoyaltyRequest")) }, + { json: "MessageHeader", js: "messageHeader", typ: r("MessageHeader") }, + { json: "PaymentRequest", js: "paymentRequest", typ: u(undefined, r("PaymentRequest")) }, + { json: "PINRequest", js: "pinRequest", typ: u(undefined, r("PinRequest")) }, + { json: "PrintRequest", js: "printRequest", typ: u(undefined, r("PrintRequest")) }, + { json: "ReconciliationRequest", js: "reconciliationRequest", typ: u(undefined, r("ReconciliationRequest")) }, + { json: "ReversalRequest", js: "reversalRequest", typ: u(undefined, r("ReversalRequest")) }, + { json: "SecurityTrailer", js: "securityTrailer", typ: u(undefined, r("ContentInformation")) }, + { json: "SoundRequest", js: "soundRequest", typ: u(undefined, r("SoundRequest")) }, + { json: "StoredValueRequest", js: "storedValueRequest", typ: u(undefined, r("StoredValueRequest")) }, + { json: "TransactionStatusRequest", js: "transactionStatusRequest", typ: u(undefined, r("TransactionStatusRequest")) }, + { json: "TransmitRequest", js: "transmitRequest", typ: u(undefined, r("TransmitRequest")) }, + ], "any"), + "AbortRequest": o([ + { json: "AbortReason", js: "abortReason", typ: "" }, + { json: "DisplayOutput", js: "displayOutput", typ: u(undefined, r("DisplayOutput")) }, + { json: "MessageReference", js: "messageReference", typ: r("MessageReference") }, + ], "any"), + "DisplayOutput": o([ + { json: "Device", js: "device", typ: r("DeviceType") }, + { json: "InfoQualify", js: "infoQualify", typ: r("InfoQualifyType") }, + { json: "MenuEntry", js: "menuEntry", typ: u(undefined, a(r("MenuEntry"))) }, + { json: "MinimumDisplayTime", js: "minimumDisplayTime", typ: u(undefined, 3.14) }, + { json: "OutputContent", js: "outputContent", typ: r("OutputContent") }, + { json: "OutputSignature", js: "outputSignature", typ: u(undefined, "any") }, + { json: "ResponseRequiredFlag", js: "responseRequiredFlag", typ: u(undefined, true) }, + ], "any"), + "MenuEntry": o([ + { json: "DefaultSelectedFlag", js: "defaultSelectedFlag", typ: u(undefined, true) }, + { json: "MenuEntryTag", js: "menuEntryTag", typ: u(undefined, r("MenuEntryTagType")) }, + { json: "OutputFormat", js: "outputFormat", typ: r("OutputFormatType") }, + { json: "OutputText", js: "outputText", typ: u(undefined, a(r("OutputText"))) }, + { json: "OutputXHTML", js: "outputXhtml", typ: u(undefined, "any") }, + { json: "PredefinedContent", js: "predefinedContent", typ: u(undefined, r("PredefinedContent")) }, + ], "any"), + "OutputText": o([ + { json: "Alignment", js: "alignment", typ: u(undefined, r("AlignmentType")) }, + { json: "CharacterHeight", js: "characterHeight", typ: u(undefined, r("CharacterHeightType")) }, + { json: "CharacterSet", js: "characterSet", typ: u(undefined, 3.14) }, + { json: "CharacterStyle", js: "characterStyle", typ: u(undefined, r("CharacterStyleType")) }, + { json: "CharacterWidth", js: "characterWidth", typ: u(undefined, r("CharacterWidthType")) }, + { json: "Color", js: "color", typ: u(undefined, r("ColorType")) }, + { json: "EndOfLineFlag", js: "endOfLineFlag", typ: u(undefined, true) }, + { json: "Font", js: "font", typ: u(undefined, "") }, + { json: "StartColumn", js: "startColumn", typ: u(undefined, 3.14) }, + { json: "StartRow", js: "startRow", typ: u(undefined, 3.14) }, + { json: "Text", js: "text", typ: u(undefined, "") }, + ], "any"), + "PredefinedContent": o([ + { json: "Language", js: "language", typ: u(undefined, "") }, + { json: "ReferenceID", js: "referenceId", typ: "" }, + ], "any"), + "OutputContent": o([ + { json: "OutputBarcode", js: "outputBarcode", typ: u(undefined, r("OutputBarcode")) }, + { json: "OutputFormat", js: "outputFormat", typ: r("OutputFormatType") }, + { json: "OutputText", js: "outputText", typ: u(undefined, a(r("OutputText"))) }, + { json: "OutputXHTML", js: "outputXhtml", typ: u(undefined, "any") }, + { json: "PredefinedContent", js: "predefinedContent", typ: u(undefined, r("PredefinedContent")) }, + ], "any"), + "OutputBarcode": o([ + { json: "BarcodeType", js: "barcodeType", typ: u(undefined, r("BarcodeType")) }, + { json: "value", js: "value", typ: u(undefined, "") }, + ], "any"), + "MessageReference": o([ + { json: "DeviceID", js: "deviceId", typ: u(undefined, "") }, + { json: "MessageCategory", js: "messageCategory", typ: u(undefined, r("MessageCategoryType")) }, + { json: "POIID", js: "poiid", typ: u(undefined, "") }, + { json: "SaleID", js: "saleId", typ: u(undefined, "") }, + { json: "ServiceID", js: "serviceId", typ: u(undefined, "") }, + ], "any"), + "AdminRequest": o([ + { json: "ServiceIdentification", js: "serviceIdentification", typ: u(undefined, "") }, + ], "any"), + "BalanceInquiryRequest": o([ + { json: "LoyaltyAccountReq", js: "loyaltyAccountReq", typ: u(undefined, r("LoyaltyAccountReq")) }, + { json: "PaymentAccountReq", js: "paymentAccountReq", typ: u(undefined, r("PaymentAccountReq")) }, + ], "any"), + "LoyaltyAccountReq": o([ + { json: "CardAcquisitionReference", js: "cardAcquisitionReference", typ: u(undefined, r("TransactionIdentification")) }, + { json: "LoyaltyAccountID", js: "loyaltyAccountId", typ: u(undefined, r("LoyaltyAccountId")) }, + ], "any"), + "TransactionIdentification": o([ + { json: "TimeStamp", js: "timeStamp", typ: "" }, + { json: "TransactionID", js: "transactionId", typ: "" }, + ], "any"), + "LoyaltyAccountId": o([ + { json: "EntryMode", js: "entryMode", typ: a(r("EntryModeType")) }, + { json: "IdentificationSupport", js: "identificationSupport", typ: u(undefined, r("IdentificationSupportType")) }, + { json: "IdentificationType", js: "identificationType", typ: r("IdentificationType") }, + { json: "value", js: "value", typ: u(undefined, "") }, + ], "any"), + "PaymentAccountReq": o([ + { json: "AccountType", js: "accountType", typ: u(undefined, r("AccountType")) }, + { json: "CardAcquisitionReference", js: "cardAcquisitionReference", typ: u(undefined, r("TransactionIdentification")) }, + { json: "PaymentInstrumentData", js: "paymentInstrumentData", typ: u(undefined, r("PaymentInstrumentData")) }, + ], "any"), + "PaymentInstrumentData": o([ + { json: "CardData", js: "cardData", typ: u(undefined, r("CardData")) }, + { json: "CheckData", js: "checkData", typ: u(undefined, r("CheckData")) }, + { json: "MobileData", js: "mobileData", typ: u(undefined, r("MobileData")) }, + { json: "PaymentInstrumentType", js: "paymentInstrumentType", typ: r("PaymentInstrumentType") }, + ], "any"), + "CardData": o([ + { json: "AllowedProduct", js: "allowedProduct", typ: u(undefined, a(r("AllowedProduct"))) }, + { json: "AllowedProductCode", js: "allowedProductCode", typ: u(undefined, a("")) }, + { json: "CardCountryCode", js: "cardCountryCode", typ: u(undefined, "") }, + { json: "CustomerOrder", js: "customerOrder", typ: u(undefined, a(r("CustomerOrder"))) }, + { json: "EntryMode", js: "entryMode", typ: u(undefined, a(r("EntryModeType"))) }, + { json: "MaskedPan", js: "maskedPan", typ: u(undefined, "") }, + { json: "PaymentAccountRef", js: "paymentAccountRef", typ: u(undefined, "") }, + { json: "PaymentBrand", js: "paymentBrand", typ: u(undefined, "") }, + { json: "PaymentToken", js: "paymentToken", typ: u(undefined, r("PaymentToken")) }, + { json: "ProtectedCardData", js: "protectedCardData", typ: u(undefined, r("ContentInformation")) }, + { json: "SensitiveCardData", js: "sensitiveCardData", typ: u(undefined, r("SensitiveCardData")) }, + ], "any"), + "AllowedProduct": o([ + { json: "AdditionalProductInfo", js: "additionalProductInfo", typ: u(undefined, "") }, + { json: "EanUpc", js: "eanUpc", typ: u(undefined, "") }, + { json: "ProductCode", js: "productCode", typ: "" }, + { json: "ProductLabel", js: "productLabel", typ: u(undefined, "") }, + ], "any"), + "CustomerOrder": o([ + { json: "AccessedBy", js: "accessedBy", typ: u(undefined, "") }, + { json: "AdditionalInformation", js: "additionalInformation", typ: u(undefined, "") }, + { json: "Currency", js: "currency", typ: u(undefined, "") }, + { json: "CurrentAmount", js: "currentAmount", typ: 3.14 }, + { json: "CustomerOrderID", js: "customerOrderId", typ: "" }, + { json: "EndDate", js: "endDate", typ: u(undefined, m("any")) }, + { json: "ForecastedAmount", js: "forecastedAmount", typ: 3.14 }, + { json: "OpenOrderState", js: "openOrderState", typ: u(undefined, true) }, + { json: "StartDate", js: "startDate", typ: m("any") }, + ], "any"), + "PaymentToken": o([ + { json: "ExpiryDateTime", js: "expiryDateTime", typ: u(undefined, m("any")) }, + { json: "TokenRequestedType", js: "tokenRequestedType", typ: r("TokenRequestedType") }, + { json: "TokenValue", js: "tokenValue", typ: "" }, + ], "any"), + "ContentInformation": o([ + { json: "AuthenticatedData", js: "authenticatedData", typ: u(undefined, r("AuthenticatedData")) }, + { json: "ContentType", js: "contentType", typ: r("ContentType") }, + { json: "DigestedData", js: "digestedData", typ: u(undefined, r("DigestedData")) }, + { json: "EnvelopedData", js: "envelopedData", typ: u(undefined, r("EnvelopedData")) }, + { json: "NamedKeyEncryptedData", js: "namedKeyEncryptedData", typ: u(undefined, r("NamedKeyEncryptedData")) }, + { json: "SignedData", js: "signedData", typ: u(undefined, r("SignedData")) }, + ], "any"), + "AuthenticatedData": o([ + { json: "EncapsulatedContent", js: "encapsulatedContent", typ: r("EncapsulatedContent") }, + { json: "keyTransportOrKEK", js: "keyTransportOrKek", typ: u(undefined, a("any")) }, + { json: "MAC", js: "mac", typ: "any" }, + { json: "MACAlgorithm", js: "macAlgorithm", typ: r("AlgorithmIdentifier") }, + { json: "Version", js: "version", typ: u(undefined, r("VersionType")) }, + ], "any"), + "EncapsulatedContent": o([ + { json: "Content", js: "content", typ: u(undefined, "any") }, + { json: "ContentType", js: "contentType", typ: r("ContentType") }, + ], "any"), + "AlgorithmIdentifier": o([ + { json: "Algorithm", js: "algorithm", typ: r("AlgorithmType") }, + { json: "Parameter", js: "parameter", typ: u(undefined, r("Parameter")) }, + ], "any"), + "Parameter": o([ + { json: "InitialisationVector", js: "initialisationVector", typ: u(undefined, "any") }, + ], "any"), + "DigestedData": o([ + { json: "Digest", js: "digest", typ: "any" }, + { json: "DigestAlgorithm", js: "digestAlgorithm", typ: r("AlgorithmIdentifier") }, + { json: "EncapsulatedContent", js: "encapsulatedContent", typ: r("EncapsulatedContent") }, + { json: "Version", js: "version", typ: u(undefined, r("VersionType")) }, + ], "any"), + "EnvelopedData": o([ + { json: "EncryptedContent", js: "encryptedContent", typ: r("EncryptedContent") }, + { json: "keyTransportOrKEK", js: "keyTransportOrKek", typ: u(undefined, a("any")) }, + { json: "Version", js: "version", typ: u(undefined, r("VersionType")) }, + ], "any"), + "EncryptedContent": o([ + { json: "ContentEncryptionAlgorithm", js: "contentEncryptionAlgorithm", typ: r("AlgorithmIdentifier") }, + { json: "ContentType", js: "contentType", typ: r("ContentType") }, + { json: "EncryptedData", js: "encryptedData", typ: "any" }, + ], "any"), + "NamedKeyEncryptedData": o([ + { json: "EncryptedContent", js: "encryptedContent", typ: r("EncryptedContent") }, + { json: "KeyName", js: "keyName", typ: u(undefined, "") }, + { json: "Version", js: "version", typ: u(undefined, r("VersionType")) }, + ], "any"), + "SignedData": o([ + { json: "Certificate", js: "certificate", typ: u(undefined, a("any")) }, + { json: "DigestAlgorithm", js: "digestAlgorithm", typ: a(r("AlgorithmIdentifier")) }, + { json: "EncapsulatedContent", js: "encapsulatedContent", typ: r("EncapsulatedContent") }, + { json: "Signer", js: "signer", typ: a(r("Signer")) }, + { json: "Version", js: "version", typ: u(undefined, r("VersionType")) }, + ], "any"), + "Signer": o([ + { json: "DigestAlgorithm", js: "digestAlgorithm", typ: r("AlgorithmIdentifier") }, + { json: "Signature", js: "signature", typ: "any" }, + { json: "SignatureAlgorithm", js: "signatureAlgorithm", typ: r("AlgorithmIdentifier") }, + { json: "SignerIdentifier", js: "signerIdentifier", typ: r("SignerIdentifier") }, + { json: "Version", js: "version", typ: u(undefined, r("VersionType")) }, + ], "any"), + "SignerIdentifier": o([ + { json: "IssuerAndSerialNumber", js: "issuerAndSerialNumber", typ: r("IssuerAndSerialNumber") }, + ], "any"), + "IssuerAndSerialNumber": o([ + { json: "Issuer", js: "issuer", typ: r("Issuer") }, + { json: "SerialNumber", js: "serialNumber", typ: 3.14 }, + ], "any"), + "Issuer": o([ + { json: "RelativeDistinguishedName", js: "relativeDistinguishedName", typ: a(r("RelativeDistinguishedName")) }, + ], "any"), + "RelativeDistinguishedName": o([ + { json: "Attribute", js: "attribute", typ: "" }, + { json: "AttributeValue", js: "attributeValue", typ: "" }, + ], "any"), + "SensitiveCardData": o([ + { json: "CardSeqNumb", js: "cardSeqNumb", typ: u(undefined, "") }, + { json: "ExpiryDate", js: "expiryDate", typ: u(undefined, "") }, + { json: "PAN", js: "pan", typ: u(undefined, "") }, + { json: "TrackData", js: "trackData", typ: u(undefined, a(r("TrackData"))) }, + ], "any"), + "TrackData": o([ + { json: "TrackFormat", js: "trackFormat", typ: u(undefined, r("TrackFormatType")) }, + { json: "TrackNumb", js: "trackNumb", typ: u(undefined, 3.14) }, + { json: "value", js: "value", typ: u(undefined, "") }, + ], "any"), + "CheckData": o([ + { json: "AccountNumber", js: "accountNumber", typ: u(undefined, "") }, + { json: "BankID", js: "bankId", typ: u(undefined, "") }, + { json: "CheckCardNumber", js: "checkCardNumber", typ: u(undefined, "") }, + { json: "CheckNumber", js: "checkNumber", typ: u(undefined, "") }, + { json: "Country", js: "country", typ: u(undefined, "") }, + { json: "TrackData", js: "trackData", typ: u(undefined, r("TrackData")) }, + { json: "Type", js: "type", typ: u(undefined, r("CheckTypeCodeType")) }, + ], "any"), + "MobileData": o([ + { json: "Geolocation", js: "geolocation", typ: u(undefined, r("Geolocation")) }, + { json: "MaskedMSISDN", js: "maskedMsisdn", typ: u(undefined, "") }, + { json: "MobileCountryCode", js: "mobileCountryCode", typ: u(undefined, "") }, + { json: "MobileNetworkCode", js: "mobileNetworkCode", typ: u(undefined, "") }, + { json: "ProtectedMobileData", js: "protectedMobileData", typ: u(undefined, r("ContentInformation")) }, + { json: "SensitiveMobileData", js: "sensitiveMobileData", typ: u(undefined, r("SensitiveMobileData")) }, + ], "any"), + "Geolocation": o([ + { json: "GeographicCoordinates", js: "geographicCoordinates", typ: u(undefined, r("GeographicCoordinates")) }, + { json: "UTMCoordinates", js: "utmCoordinates", typ: u(undefined, r("UtmCoordinates")) }, + ], "any"), + "GeographicCoordinates": o([ + { json: "Latitude", js: "latitude", typ: "" }, + { json: "Longitude", js: "longitude", typ: "" }, + ], "any"), + "UtmCoordinates": o([ + { json: "UTMEastward", js: "utmEastward", typ: "" }, + { json: "UTMNorthward", js: "utmNorthward", typ: "" }, + { json: "UTMZone", js: "utmZone", typ: "" }, + ], "any"), + "SensitiveMobileData": o([ + { json: "IMEI", js: "imei", typ: u(undefined, "") }, + { json: "IMSI", js: "imsi", typ: u(undefined, "") }, + { json: "MSISDN", js: "msisdn", typ: "" }, + ], "any"), + "BatchRequest": o([ + { json: "RemoveAllFlag", js: "removeAllFlag", typ: u(undefined, true) }, + { json: "TransactionToPerform", js: "transactionToPerform", typ: u(undefined, a(r("TransactionToPerform"))) }, + ], "any"), + "TransactionToPerform": o([ + { json: "LoyaltyRequest", js: "loyaltyRequest", typ: u(undefined, r("LoyaltyRequest")) }, + { json: "PaymentRequest", js: "paymentRequest", typ: u(undefined, r("PaymentRequest")) }, + { json: "ReversalRequest", js: "reversalRequest", typ: u(undefined, r("ReversalRequest")) }, + ], "any"), + "LoyaltyRequest": o([ + { json: "LoyaltyData", js: "loyaltyData", typ: u(undefined, a(r("LoyaltyData"))) }, + { json: "LoyaltyTransaction", js: "loyaltyTransaction", typ: r("LoyaltyTransaction") }, + { json: "SaleData", js: "saleData", typ: r("SaleData") }, + ], "any"), + "LoyaltyData": o([ + { json: "CardAcquisitionReference", js: "cardAcquisitionReference", typ: u(undefined, r("TransactionIdentification")) }, + { json: "LoyaltyAccountID", js: "loyaltyAccountId", typ: u(undefined, r("LoyaltyAccountId")) }, + { json: "LoyaltyAmount", js: "loyaltyAmount", typ: u(undefined, r("LoyaltyAmount")) }, + ], "any"), + "LoyaltyAmount": o([ + { json: "Currency", js: "currency", typ: u(undefined, "") }, + { json: "LoyaltyUnit", js: "loyaltyUnit", typ: u(undefined, r("LoyaltyUnitType")) }, + { json: "value", js: "value", typ: u(undefined, 3.14) }, + ], "any"), + "LoyaltyTransaction": o([ + { json: "Currency", js: "currency", typ: u(undefined, "") }, + { json: "LoyaltyTransactionType", js: "loyaltyTransactionType", typ: r("LoyaltyTransactionType") }, + { json: "OriginalPOITransaction", js: "originalPoiTransaction", typ: u(undefined, r("OriginalPoiTransaction")) }, + { json: "SaleItem", js: "saleItem", typ: u(undefined, a(r("SaleItem"))) }, + { json: "TotalAmount", js: "totalAmount", typ: u(undefined, 3.14) }, + { json: "TransactionConditions", js: "transactionConditions", typ: u(undefined, r("TransactionConditions")) }, + ], "any"), + "OriginalPoiTransaction": o([ + { json: "AcquirerID", js: "acquirerId", typ: u(undefined, "") }, + { json: "ApprovalCode", js: "approvalCode", typ: u(undefined, "") }, + { json: "CustomerLanguage", js: "customerLanguage", typ: u(undefined, "") }, + { json: "HostTransactionID", js: "hostTransactionId", typ: u(undefined, r("TransactionIdentification")) }, + { json: "POIID", js: "poiid", typ: u(undefined, "") }, + { json: "POITransactionID", js: "poiTransactionId", typ: u(undefined, r("TransactionIdentification")) }, + { json: "ReuseCardDataFlag", js: "reuseCardDataFlag", typ: u(undefined, true) }, + { json: "SaleID", js: "saleId", typ: u(undefined, "") }, + ], "any"), + "SaleItem": o([ + { json: "AdditionalProductInfo", js: "additionalProductInfo", typ: u(undefined, "") }, + { json: "EanUpc", js: "eanUpc", typ: u(undefined, "") }, + { json: "ItemAmount", js: "itemAmount", typ: 3.14 }, + { json: "ItemID", js: "itemId", typ: 3.14 }, + { json: "ProductCode", js: "productCode", typ: "" }, + { json: "ProductLabel", js: "productLabel", typ: u(undefined, "") }, + { json: "Quantity", js: "quantity", typ: u(undefined, 3.14) }, + { json: "SaleChannel", js: "saleChannel", typ: u(undefined, "") }, + { json: "TaxCode", js: "taxCode", typ: u(undefined, "") }, + { json: "UnitOfMeasure", js: "unitOfMeasure", typ: u(undefined, r("UnitOfMeasureType")) }, + { json: "UnitPrice", js: "unitPrice", typ: u(undefined, 3.14) }, + ], "any"), + "TransactionConditions": o([ + { json: "AcquirerID", js: "acquirerId", typ: u(undefined, a("")) }, + { json: "AllowedLoyaltyBrand", js: "allowedLoyaltyBrand", typ: u(undefined, a("")) }, + { json: "AllowedPaymentBrand", js: "allowedPaymentBrand", typ: u(undefined, a("")) }, + { json: "CustomerLanguage", js: "customerLanguage", typ: u(undefined, "") }, + { json: "DebitPreferredFlag", js: "debitPreferredFlag", typ: u(undefined, true) }, + { json: "ForceEntryMode", js: "forceEntryMode", typ: u(undefined, a(a(r("ForceEntryModeType")))) }, + { json: "ForceOnlineFlag", js: "forceOnlineFlag", typ: u(undefined, true) }, + { json: "LoyaltyHandling", js: "loyaltyHandling", typ: u(undefined, r("LoyaltyHandlingType")) }, + { json: "MerchantCategoryCode", js: "merchantCategoryCode", typ: u(undefined, "") }, + ], "any"), + "SaleData": o([ + { json: "CustomerOrderID", js: "customerOrderId", typ: u(undefined, "") }, + { json: "CustomerOrderReq", js: "customerOrderReq", typ: u(undefined, a(r("CustomerOrderReqType"))) }, + { json: "OperatorID", js: "operatorId", typ: u(undefined, "") }, + { json: "OperatorLanguage", js: "operatorLanguage", typ: u(undefined, "") }, + { json: "SaleReferenceID", js: "saleReferenceId", typ: u(undefined, "") }, + { json: "SaleTerminalData", js: "saleTerminalData", typ: u(undefined, r("SaleTerminalData")) }, + { json: "SaleToAcquirerData", js: "saleToAcquirerData", typ: u(undefined, "") }, + { json: "SaleToIssuerData", js: "saleToIssuerData", typ: u(undefined, r("SaleToIssuerData")) }, + { json: "SaleToPOIData", js: "saleToPoiData", typ: u(undefined, "") }, + { json: "SaleTransactionID", js: "saleTransactionId", typ: r("TransactionIdentification") }, + { json: "ShiftNumber", js: "shiftNumber", typ: u(undefined, "") }, + { json: "SponsoredMerchant", js: "sponsoredMerchant", typ: u(undefined, a(r("SponsoredMerchant"))) }, + { json: "TokenRequestedType", js: "tokenRequestedType", typ: u(undefined, r("TokenRequestedType")) }, + ], "any"), + "SaleTerminalData": o([ + { json: "SaleCapabilities", js: "saleCapabilities", typ: u(undefined, a(r("SaleCapabilitiesType"))) }, + { json: "SaleProfile", js: "saleProfile", typ: u(undefined, r("SaleProfile")) }, + { json: "TerminalEnvironment", js: "terminalEnvironment", typ: u(undefined, r("TerminalEnvironmentType")) }, + { json: "TotalsGroupID", js: "totalsGroupId", typ: u(undefined, "") }, + ], "any"), + "SaleProfile": o([ + { json: "GenericProfile", js: "genericProfile", typ: u(undefined, r("GenericProfileType")) }, + { json: "ServiceProfiles", js: "serviceProfiles", typ: u(undefined, a(r("ServiceProfilesType"))) }, + ], "any"), + "SaleToIssuerData": o([ + { json: "StatementReference", js: "statementReference", typ: u(undefined, "") }, + ], "any"), + "SponsoredMerchant": o([ + { json: "MerchantAddress", js: "merchantAddress", typ: u(undefined, "") }, + { json: "MerchantCategoryCode", js: "merchantCategoryCode", typ: "" }, + { json: "MerchantCountry", js: "merchantCountry", typ: "" }, + { json: "MerchantName", js: "merchantName", typ: "" }, + { json: "RegistrationID", js: "registrationId", typ: "" }, + ], "any"), + "PaymentRequest": o([ + { json: "LoyaltyData", js: "loyaltyData", typ: u(undefined, a(r("LoyaltyData"))) }, + { json: "PaymentData", js: "paymentData", typ: u(undefined, r("PaymentData")) }, + { json: "PaymentTransaction", js: "paymentTransaction", typ: r("PaymentTransaction") }, + { json: "SaleData", js: "saleData", typ: r("SaleData") }, + ], "any"), + "PaymentData": o([ + { json: "CardAcquisitionReference", js: "cardAcquisitionReference", typ: u(undefined, r("TransactionIdentification")) }, + { json: "CustomerOrder", js: "customerOrder", typ: u(undefined, r("CustomerOrder")) }, + { json: "Instalment", js: "instalment", typ: u(undefined, r("Instalment")) }, + { json: "PaymentInstrumentData", js: "paymentInstrumentData", typ: u(undefined, r("PaymentInstrumentData")) }, + { json: "PaymentType", js: "paymentType", typ: u(undefined, r("PaymentType")) }, + { json: "RequestedValidityDate", js: "requestedValidityDate", typ: u(undefined, "") }, + { json: "SplitPaymentFlag", js: "splitPaymentFlag", typ: u(undefined, true) }, + ], "any"), + "Instalment": o([ + { json: "Charges", js: "charges", typ: u(undefined, 3.14) }, + { json: "CumulativeAmount", js: "cumulativeAmount", typ: u(undefined, 3.14) }, + { json: "FirstAmount", js: "firstAmount", typ: u(undefined, 3.14) }, + { json: "FirstPaymentDate", js: "firstPaymentDate", typ: u(undefined, "") }, + { json: "Instalment", js: "instalment", typ: u(undefined, a(r("InstalmentType"))) }, + { json: "Period", js: "period", typ: u(undefined, 3.14) }, + { json: "PeriodUnit", js: "periodUnit", typ: u(undefined, r("PeriodUnitType")) }, + { json: "PlanID", js: "planId", typ: u(undefined, "") }, + { json: "SequenceNumber", js: "sequenceNumber", typ: u(undefined, 3.14) }, + { json: "TotalNbOfPayments", js: "totalNbOfPayments", typ: u(undefined, 3.14) }, + ], "any"), + "PaymentTransaction": o([ + { json: "AmountsReq", js: "amountsReq", typ: r("AmountsReq") }, + { json: "OriginalPOITransaction", js: "originalPoiTransaction", typ: u(undefined, r("OriginalPoiTransaction")) }, + { json: "SaleItem", js: "saleItem", typ: u(undefined, a(r("SaleItem"))) }, + { json: "TransactionConditions", js: "transactionConditions", typ: u(undefined, r("TransactionConditions")) }, + ], "any"), + "AmountsReq": o([ + { json: "CashBackAmount", js: "cashBackAmount", typ: u(undefined, 3.14) }, + { json: "Currency", js: "currency", typ: "" }, + { json: "MaximumCashBackAmount", js: "maximumCashBackAmount", typ: u(undefined, 3.14) }, + { json: "MinimumAmountToDeliver", js: "minimumAmountToDeliver", typ: u(undefined, 3.14) }, + { json: "MinimumSplitAmount", js: "minimumSplitAmount", typ: u(undefined, 3.14) }, + { json: "PaidAmount", js: "paidAmount", typ: u(undefined, 3.14) }, + { json: "RequestedAmount", js: "requestedAmount", typ: u(undefined, 3.14) }, + { json: "TipAmount", js: "tipAmount", typ: u(undefined, 3.14) }, + ], "any"), + "ReversalRequest": o([ + { json: "CustomerOrderID", js: "customerOrderId", typ: u(undefined, r("CustomerOrder")) }, + { json: "OriginalPOITransaction", js: "originalPoiTransaction", typ: r("OriginalPoiTransaction") }, + { json: "ReversalReason", js: "reversalReason", typ: r("ReversalReasonType") }, + { json: "ReversedAmount", js: "reversedAmount", typ: u(undefined, 3.14) }, + { json: "SaleReferenceID", js: "saleReferenceId", typ: u(undefined, "") }, + ], "any"), + "CardAcquisitionRequest": o([ + { json: "CardAcquisitionTransaction", js: "cardAcquisitionTransaction", typ: r("CardAcquisitionTransaction") }, + { json: "SaleData", js: "saleData", typ: r("SaleData") }, + ], "any"), + "CardAcquisitionTransaction": o([ + { json: "AllowedLoyaltyBrand", js: "allowedLoyaltyBrand", typ: u(undefined, a("")) }, + { json: "AllowedPaymentBrand", js: "allowedPaymentBrand", typ: u(undefined, a("")) }, + { json: "CashBackFlag", js: "cashBackFlag", typ: u(undefined, true) }, + { json: "CustomerLanguage", js: "customerLanguage", typ: u(undefined, "") }, + { json: "ForceCustomerSelectionFlag", js: "forceCustomerSelectionFlag", typ: u(undefined, true) }, + { json: "ForceEntryMode", js: "forceEntryMode", typ: u(undefined, a(a(r("ForceEntryModeType")))) }, + { json: "LoyaltyHandling", js: "loyaltyHandling", typ: u(undefined, r("LoyaltyHandlingType")) }, + { json: "PaymentType", js: "paymentType", typ: u(undefined, r("PaymentType")) }, + { json: "TotalAmount", js: "totalAmount", typ: u(undefined, 3.14) }, + ], "any"), + "CardReaderApduRequest": o([ + { json: "APDUClass", js: "apduClass", typ: "any" }, + { json: "APDUData", js: "apduData", typ: u(undefined, "any") }, + { json: "APDUExpectedLength", js: "apduExpectedLength", typ: u(undefined, "any") }, + { json: "APDUInstruction", js: "apduInstruction", typ: "any" }, + { json: "APDUPar1", js: "apduPar1", typ: "any" }, + { json: "APDUPar2", js: "apduPar2", typ: "any" }, + ], "any"), + "CardReaderInitRequest": o([ + { json: "DisplayOutput", js: "displayOutput", typ: u(undefined, r("DisplayOutput")) }, + { json: "ForceEntryMode", js: "forceEntryMode", typ: u(undefined, a(a(r("ForceEntryModeType")))) }, + { json: "LeaveCardFlag", js: "leaveCardFlag", typ: u(undefined, true) }, + { json: "MaxWaitingTime", js: "maxWaitingTime", typ: u(undefined, 3.14) }, + { json: "WarmResetFlag", js: "warmResetFlag", typ: u(undefined, true) }, + ], "any"), + "CardReaderPowerOffRequest": o([ + { json: "DisplayOutput", js: "displayOutput", typ: u(undefined, r("DisplayOutput")) }, + { json: "MaxWaitingTime", js: "maxWaitingTime", typ: u(undefined, 3.14) }, + ], "any"), + "DiagnosisRequest": o([ + { json: "AcquirerID", js: "acquirerId", typ: u(undefined, a("")) }, + { json: "HostDiagnosisFlag", js: "hostDiagnosisFlag", typ: u(undefined, true) }, + { json: "POIID", js: "poiid", typ: u(undefined, "") }, + ], "any"), + "DisplayRequest": o([ + { json: "DisplayOutput", js: "displayOutput", typ: a(r("DisplayOutput")) }, + ], "any"), + "EnableServiceRequest": o([ + { json: "DisplayOutput", js: "displayOutput", typ: u(undefined, r("DisplayOutput")) }, + { json: "ServicesEnabled", js: "servicesEnabled", typ: u(undefined, a(r("ServicesEnabledType"))) }, + { json: "TransactionAction", js: "transactionAction", typ: r("TransactionActionType") }, + ], "any"), + "EventNotification": o([ + { json: "CustomerLanguage", js: "customerLanguage", typ: u(undefined, "") }, + { json: "DisplayOutput", js: "displayOutput", typ: u(undefined, r("DisplayOutput")) }, + { json: "EventDetails", js: "eventDetails", typ: u(undefined, "") }, + { json: "EventToNotify", js: "eventToNotify", typ: r("EventToNotifyType") }, + { json: "MaintenanceRequiredFlag", js: "maintenanceRequiredFlag", typ: u(undefined, true) }, + { json: "RejectedMessage", js: "rejectedMessage", typ: u(undefined, "any") }, + { json: "TimeStamp", js: "timeStamp", typ: "" }, + ], "any"), + "GetTotalsRequest": o([ + { json: "TotalDetails", js: "totalDetails", typ: u(undefined, a(r("TotalDetailsType"))) }, + { json: "TotalFilter", js: "totalFilter", typ: u(undefined, r("TotalFilter")) }, + ], "any"), + "TotalFilter": o([ + { json: "OperatorID", js: "operatorId", typ: u(undefined, "") }, + { json: "POIID", js: "poiid", typ: u(undefined, "") }, + { json: "SaleID", js: "saleId", typ: u(undefined, "") }, + { json: "ShiftNumber", js: "shiftNumber", typ: u(undefined, "") }, + { json: "TotalsGroupID", js: "totalsGroupId", typ: u(undefined, "") }, + ], "any"), + "InputRequest": o([ + { json: "DisplayOutput", js: "displayOutput", typ: u(undefined, r("DisplayOutput")) }, + { json: "InputData", js: "inputData", typ: r("InputData") }, + ], "any"), + "InputData": o([ + { json: "BeepKeyFlag", js: "beepKeyFlag", typ: u(undefined, true) }, + { json: "DefaultInputString", js: "defaultInputString", typ: u(undefined, "") }, + { json: "Device", js: "device", typ: r("DeviceType") }, + { json: "DisableCancelFlag", js: "disableCancelFlag", typ: u(undefined, true) }, + { json: "DisableCorrectFlag", js: "disableCorrectFlag", typ: u(undefined, true) }, + { json: "DisableValidFlag", js: "disableValidFlag", typ: u(undefined, true) }, + { json: "FromRightToLeftFlag", js: "fromRightToLeftFlag", typ: u(undefined, true) }, + { json: "GlobalCorrectionFlag", js: "globalCorrectionFlag", typ: u(undefined, true) }, + { json: "ImmediateResponseFlag", js: "immediateResponseFlag", typ: u(undefined, true) }, + { json: "InfoQualify", js: "infoQualify", typ: r("InfoQualifyType") }, + { json: "InputCommand", js: "inputCommand", typ: r("InputCommandType") }, + { json: "MaskCharactersFlag", js: "maskCharactersFlag", typ: u(undefined, true) }, + { json: "MaxDecimalLength", js: "maxDecimalLength", typ: u(undefined, 3.14) }, + { json: "MaxInputTime", js: "maxInputTime", typ: u(undefined, 3.14) }, + { json: "MaxLength", js: "maxLength", typ: u(undefined, 3.14) }, + { json: "MenuBackFlag", js: "menuBackFlag", typ: u(undefined, true) }, + { json: "MinLength", js: "minLength", typ: u(undefined, 3.14) }, + { json: "NotifyCardInputFlag", js: "notifyCardInputFlag", typ: u(undefined, true) }, + { json: "StringMask", js: "stringMask", typ: u(undefined, "") }, + { json: "WaitUserValidationFlag", js: "waitUserValidationFlag", typ: u(undefined, true) }, + ], "any"), + "InputUpdate": o([ + { json: "MaxDecimalLength", js: "maxDecimalLength", typ: u(undefined, 3.14) }, + { json: "MaxLength", js: "maxLength", typ: u(undefined, 3.14) }, + { json: "MenuEntry", js: "menuEntry", typ: u(undefined, a(r("MenuEntry"))) }, + { json: "MessageReference", js: "messageReference", typ: r("MessageReference") }, + { json: "MinLength", js: "minLength", typ: u(undefined, 3.14) }, + { json: "OutputContent", js: "outputContent", typ: r("OutputContent") }, + { json: "OutputSignature", js: "outputSignature", typ: u(undefined, "any") }, + ], "any"), + "LoginRequest": o([ + { json: "CustomerOrderReq", js: "customerOrderReq", typ: u(undefined, a(r("CustomerOrderReqType"))) }, + { json: "DateTime", js: "dateTime", typ: m("any") }, + { json: "OperatorID", js: "operatorId", typ: u(undefined, "") }, + { json: "OperatorLanguage", js: "operatorLanguage", typ: "" }, + { json: "POISerialNumber", js: "poiSerialNumber", typ: u(undefined, "") }, + { json: "SaleSoftware", js: "saleSoftware", typ: r("SaleSoftware") }, + { json: "SaleTerminalData", js: "saleTerminalData", typ: u(undefined, r("SaleTerminalData")) }, + { json: "ShiftNumber", js: "shiftNumber", typ: u(undefined, "") }, + { json: "TokenRequestedType", js: "tokenRequestedType", typ: u(undefined, r("TokenRequestedType")) }, + { json: "TrainingModeFlag", js: "trainingModeFlag", typ: u(undefined, true) }, + ], "any"), + "SaleSoftware": o([ + { json: "ApplicationName", js: "applicationName", typ: "" }, + { json: "CertificationCode", js: "certificationCode", typ: "" }, + { json: "ManufacturerID", js: "manufacturerId", typ: "" }, + { json: "SoftwareVersion", js: "softwareVersion", typ: "" }, + ], "any"), + "LogoutRequest": o([ + { json: "MaintenanceAllowed", js: "maintenanceAllowed", typ: u(undefined, true) }, + ], "any"), + "MessageHeader": o([ + { json: "DeviceID", js: "deviceId", typ: u(undefined, "") }, + { json: "MessageCategory", js: "messageCategory", typ: r("MessageCategoryType") }, + { json: "MessageClass", js: "messageClass", typ: r("MessageClassType") }, + { json: "MessageType", js: "messageType", typ: r("MessageType") }, + { json: "POIID", js: "poiid", typ: "" }, + { json: "ProtocolVersion", js: "protocolVersion", typ: u(undefined, "") }, + { json: "SaleID", js: "saleId", typ: "" }, + { json: "ServiceID", js: "serviceId", typ: u(undefined, "") }, + ], "any"), + "PinRequest": o([ + { json: "AdditionalInput", js: "additionalInput", typ: u(undefined, "") }, + { json: "CardholderPIN", js: "cardholderPin", typ: u(undefined, r("CardholderPin")) }, + { json: "KeyReference", js: "keyReference", typ: u(undefined, "") }, + { json: "MaxWaitingTime", js: "maxWaitingTime", typ: u(undefined, 3.14) }, + { json: "PINEncAlgorithm", js: "pinEncAlgorithm", typ: u(undefined, "") }, + { json: "PINFormat", js: "pinFormat", typ: u(undefined, r("PinFormatType")) }, + { json: "PINRequestType", js: "pinRequestType", typ: r("PinRequestType") }, + { json: "PINVerifMethod", js: "pinVerifMethod", typ: u(undefined, "") }, + ], "any"), + "CardholderPin": o([ + { json: "AdditionalInput", js: "additionalInput", typ: u(undefined, "") }, + { json: "EncrPINBlock", js: "encrPinBlock", typ: r("ContentInformation") }, + { json: "PINFormat", js: "pinFormat", typ: r("PinFormatType") }, + ], "any"), + "PrintRequest": o([ + { json: "PrintOutput", js: "printOutput", typ: r("PrintOutput") }, + ], "any"), + "PrintOutput": o([ + { json: "DocumentQualifier", js: "documentQualifier", typ: r("DocumentQualifierType") }, + { json: "IntegratedPrintFlag", js: "integratedPrintFlag", typ: u(undefined, true) }, + { json: "OutputContent", js: "outputContent", typ: r("OutputContent") }, + { json: "OutputSignature", js: "outputSignature", typ: u(undefined, "any") }, + { json: "RequiredSignatureFlag", js: "requiredSignatureFlag", typ: u(undefined, true) }, + { json: "ResponseMode", js: "responseMode", typ: r("ResponseModeType") }, + ], "any"), + "ReconciliationRequest": o([ + { json: "AcquirerID", js: "acquirerId", typ: u(undefined, a("")) }, + { json: "POIReconciliationID", js: "poiReconciliationId", typ: u(undefined, "") }, + { json: "ReconciliationType", js: "reconciliationType", typ: r("ReconciliationType") }, + ], "any"), + "SoundRequest": o([ + { json: "ResponseMode", js: "responseMode", typ: u(undefined, r("ResponseModeType")) }, + { json: "SoundAction", js: "soundAction", typ: r("SoundActionType") }, + { json: "SoundContent", js: "soundContent", typ: r("SoundContent") }, + { json: "SoundVolume", js: "soundVolume", typ: u(undefined, 3.14) }, + ], "any"), + "SoundContent": o([ + { json: "Language", js: "language", typ: u(undefined, "") }, + { json: "ReferenceID", js: "referenceId", typ: u(undefined, "") }, + { json: "SoundFormat", js: "soundFormat", typ: u(undefined, r("SoundFormatType")) }, + { json: "value", js: "value", typ: u(undefined, "") }, + ], "any"), + "StoredValueRequest": o([ + { json: "CustomerLanguage", js: "customerLanguage", typ: u(undefined, "") }, + { json: "SaleData", js: "saleData", typ: r("SaleData") }, + { json: "StoredValueData", js: "storedValueData", typ: a(r("StoredValueData")) }, + ], "any"), + "StoredValueData": o([ + { json: "Currency", js: "currency", typ: "" }, + { json: "EanUpc", js: "eanUpc", typ: u(undefined, "") }, + { json: "ItemAmount", js: "itemAmount", typ: 3.14 }, + { json: "OriginalPOITransaction", js: "originalPoiTransaction", typ: u(undefined, r("OriginalPoiTransaction")) }, + { json: "ProductCode", js: "productCode", typ: u(undefined, "") }, + { json: "StoredValueAccountID", js: "storedValueAccountId", typ: u(undefined, r("StoredValueAccountId")) }, + { json: "StoredValueProvider", js: "storedValueProvider", typ: u(undefined, "") }, + { json: "StoredValueTransactionType", js: "storedValueTransactionType", typ: r("StoredValueTransactionType") }, + ], "any"), + "StoredValueAccountId": o([ + { json: "EntryMode", js: "entryMode", typ: a(r("EntryModeType")) }, + { json: "ExpiryDate", js: "expiryDate", typ: u(undefined, "") }, + { json: "IdentificationType", js: "identificationType", typ: r("IdentificationType") }, + { json: "OwnerName", js: "ownerName", typ: u(undefined, "") }, + { json: "StoredValueAccountType", js: "storedValueAccountType", typ: r("StoredValueAccountType") }, + { json: "StoredValueProvider", js: "storedValueProvider", typ: u(undefined, "") }, + { json: "value", js: "value", typ: u(undefined, "") }, + ], "any"), + "TransactionStatusRequest": o([ + { json: "DocumentQualifier", js: "documentQualifier", typ: u(undefined, a(r("DocumentQualifierType"))) }, + { json: "MessageReference", js: "messageReference", typ: u(undefined, r("MessageReference")) }, + { json: "ReceiptReprintFlag", js: "receiptReprintFlag", typ: u(undefined, true) }, + ], "any"), + "TransmitRequest": o([ + { json: "DestinationAddress", js: "destinationAddress", typ: "" }, + { json: "MaximumTransmitTime", js: "maximumTransmitTime", typ: 3.14 }, + { json: "Message", js: "message", typ: "any" }, + { json: "WaitResponseFlag", js: "waitResponseFlag", typ: u(undefined, true) }, + ], "any"), + "TerminalApiResponse": o([ + { json: "SaleToPOIResponse", js: "saleToPoiResponse", typ: u(undefined, r("SaleToPoiResponse")) }, + ], "any"), + "SaleToPoiResponse": o([ + { json: "AdminResponse", js: "adminResponse", typ: u(undefined, r("AdminResponse")) }, + { json: "BalanceInquiryResponse", js: "balanceInquiryResponse", typ: u(undefined, r("BalanceInquiryResponse")) }, + { json: "BatchResponse", js: "batchResponse", typ: u(undefined, r("BatchResponse")) }, + { json: "CardAcquisitionResponse", js: "cardAcquisitionResponse", typ: u(undefined, r("CardAcquisitionResponse")) }, + { json: "CardReaderAPDUResponse", js: "cardReaderApduResponse", typ: u(undefined, r("CardReaderApduResponse")) }, + { json: "CardReaderInitResponse", js: "cardReaderInitResponse", typ: u(undefined, r("CardReaderInitResponse")) }, + { json: "CardReaderPowerOffResponse", js: "cardReaderPowerOffResponse", typ: u(undefined, r("CardReaderPowerOffResponse")) }, + { json: "DiagnosisResponse", js: "diagnosisResponse", typ: u(undefined, r("DiagnosisResponse")) }, + { json: "DisplayResponse", js: "displayResponse", typ: u(undefined, r("DisplayResponse")) }, + { json: "EnableServiceResponse", js: "enableServiceResponse", typ: u(undefined, r("EnableServiceResponse")) }, + { json: "GetTotalsResponse", js: "getTotalsResponse", typ: u(undefined, r("GetTotalsResponse")) }, + { json: "InputResponse", js: "inputResponse", typ: u(undefined, r("InputResponse")) }, + { json: "LoginResponse", js: "loginResponse", typ: u(undefined, r("LoginResponse")) }, + { json: "LogoutResponse", js: "logoutResponse", typ: u(undefined, r("LogoutResponse")) }, + { json: "LoyaltyResponse", js: "loyaltyResponse", typ: u(undefined, r("LoyaltyResponse")) }, + { json: "MessageHeader", js: "messageHeader", typ: r("MessageHeader") }, + { json: "PaymentResponse", js: "paymentResponse", typ: u(undefined, r("PaymentResponse")) }, + { json: "PINResponse", js: "pinResponse", typ: u(undefined, r("PinResponse")) }, + { json: "PrintResponse", js: "printResponse", typ: u(undefined, r("PrintResponse")) }, + { json: "ReconciliationResponse", js: "reconciliationResponse", typ: u(undefined, r("ReconciliationResponse")) }, + { json: "ReversalResponse", js: "reversalResponse", typ: u(undefined, r("ReversalResponse")) }, + { json: "SecurityTrailer", js: "securityTrailer", typ: u(undefined, r("ContentInformation")) }, + { json: "SoundResponse", js: "soundResponse", typ: u(undefined, r("SoundResponse")) }, + { json: "StoredValueResponse", js: "storedValueResponse", typ: u(undefined, r("StoredValueResponse")) }, + { json: "TransactionStatusResponse", js: "transactionStatusResponse", typ: u(undefined, r("TransactionStatusResponse")) }, + { json: "TransmitResponse", js: "transmitResponse", typ: u(undefined, r("TransmitResponse")) }, + ], "any"), + "AdminResponse": o([ + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "Response": o([ + { json: "AdditionalResponse", js: "additionalResponse", typ: u(undefined, "") }, + { json: "ErrorCondition", js: "errorCondition", typ: u(undefined, r("ErrorConditionType")) }, + { json: "Result", js: "result", typ: r("ResultType") }, + ], "any"), + "BalanceInquiryResponse": o([ + { json: "LoyaltyAccountStatus", js: "loyaltyAccountStatus", typ: u(undefined, r("LoyaltyAccountStatus")) }, + { json: "PaymentAccountStatus", js: "paymentAccountStatus", typ: u(undefined, r("PaymentAccountStatus")) }, + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "LoyaltyAccountStatus": o([ + { json: "Currency", js: "currency", typ: u(undefined, "") }, + { json: "CurrentBalance", js: "currentBalance", typ: u(undefined, 3.14) }, + { json: "LoyaltyAccount", js: "loyaltyAccount", typ: r("LoyaltyAccount") }, + { json: "LoyaltyUnit", js: "loyaltyUnit", typ: u(undefined, r("LoyaltyUnitType")) }, + ], "any"), + "LoyaltyAccount": o([ + { json: "LoyaltyAccountID", js: "loyaltyAccountId", typ: r("LoyaltyAccountId") }, + { json: "LoyaltyBrand", js: "loyaltyBrand", typ: u(undefined, "") }, + ], "any"), + "PaymentAccountStatus": o([ + { json: "Currency", js: "currency", typ: u(undefined, "") }, + { json: "CurrentBalance", js: "currentBalance", typ: u(undefined, 3.14) }, + { json: "LoyaltyAccountStatus", js: "loyaltyAccountStatus", typ: u(undefined, r("LoyaltyAccountStatus")) }, + { json: "PaymentAcquirerData", js: "paymentAcquirerData", typ: u(undefined, r("PaymentAcquirerData")) }, + { json: "PaymentInstrumentData", js: "paymentInstrumentData", typ: u(undefined, r("PaymentInstrumentData")) }, + ], "any"), + "PaymentAcquirerData": o([ + { json: "AcquirerID", js: "acquirerId", typ: u(undefined, "") }, + { json: "AcquirerPOIID", js: "acquirerPoiid", typ: "" }, + { json: "AcquirerTransactionID", js: "acquirerTransactionId", typ: u(undefined, r("TransactionIdentification")) }, + { json: "ApprovalCode", js: "approvalCode", typ: u(undefined, "") }, + { json: "MerchantID", js: "merchantId", typ: "" }, + ], "any"), + "BatchResponse": o([ + { json: "PerformedTransaction", js: "performedTransaction", typ: u(undefined, a(r("PerformedTransaction"))) }, + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "PerformedTransaction": o([ + { json: "LoyaltyResult", js: "loyaltyResult", typ: u(undefined, a(r("LoyaltyResult"))) }, + { json: "PaymentResult", js: "paymentResult", typ: u(undefined, r("PaymentResult")) }, + { json: "POIData", js: "poiData", typ: r("PoiData") }, + { json: "Response", js: "response", typ: r("Response") }, + { json: "ReversedAmount", js: "reversedAmount", typ: u(undefined, 3.14) }, + { json: "SaleData", js: "saleData", typ: u(undefined, r("SaleData")) }, + ], "any"), + "LoyaltyResult": o([ + { json: "CurrentBalance", js: "currentBalance", typ: u(undefined, 3.14) }, + { json: "LoyaltyAccount", js: "loyaltyAccount", typ: r("LoyaltyAccount") }, + { json: "LoyaltyAcquirerData", js: "loyaltyAcquirerData", typ: u(undefined, r("LoyaltyAcquirerData")) }, + { json: "LoyaltyAmount", js: "loyaltyAmount", typ: u(undefined, r("LoyaltyAmount")) }, + { json: "Rebates", js: "rebates", typ: u(undefined, r("Rebates")) }, + ], "any"), + "LoyaltyAcquirerData": o([ + { json: "ApprovalCode", js: "approvalCode", typ: u(undefined, "") }, + { json: "HostReconciliationID", js: "hostReconciliationId", typ: u(undefined, "") }, + { json: "LoyaltyAcquirerID", js: "loyaltyAcquirerId", typ: u(undefined, "") }, + { json: "LoyaltyTransactionID", js: "loyaltyTransactionId", typ: u(undefined, r("TransactionIdentification")) }, + ], "any"), + "Rebates": o([ + { json: "RebateLabel", js: "rebateLabel", typ: u(undefined, "") }, + { json: "SaleItemRebate", js: "saleItemRebate", typ: u(undefined, a(r("SaleItemRebate"))) }, + { json: "TotalRebate", js: "totalRebate", typ: u(undefined, 3.14) }, + ], "any"), + "SaleItemRebate": o([ + { json: "EanUpc", js: "eanUpc", typ: u(undefined, "") }, + { json: "ItemAmount", js: "itemAmount", typ: u(undefined, 3.14) }, + { json: "ItemID", js: "itemId", typ: 3.14 }, + { json: "ProductCode", js: "productCode", typ: "" }, + { json: "Quantity", js: "quantity", typ: u(undefined, 3.14) }, + { json: "RebateLabel", js: "rebateLabel", typ: u(undefined, "") }, + { json: "UnitOfMeasure", js: "unitOfMeasure", typ: u(undefined, r("UnitOfMeasureType")) }, + ], "any"), + "PoiData": o([ + { json: "POIReconciliationID", js: "poiReconciliationId", typ: u(undefined, "") }, + { json: "POITransactionID", js: "poiTransactionId", typ: r("TransactionIdentification") }, + ], "any"), + "PaymentResult": o([ + { json: "AmountsResp", js: "amountsResp", typ: u(undefined, r("AmountsResp")) }, + { json: "AuthenticationMethod", js: "authenticationMethod", typ: u(undefined, a(r("AuthenticationMethodType"))) }, + { json: "CapturedSignature", js: "capturedSignature", typ: u(undefined, r("CapturedSignature")) }, + { json: "CurrencyConversion", js: "currencyConversion", typ: u(undefined, a(r("CurrencyConversion"))) }, + { json: "CustomerLanguage", js: "customerLanguage", typ: u(undefined, "") }, + { json: "Instalment", js: "instalment", typ: u(undefined, r("Instalment")) }, + { json: "MerchantOverrideFlag", js: "merchantOverrideFlag", typ: u(undefined, true) }, + { json: "OnlineFlag", js: "onlineFlag", typ: u(undefined, true) }, + { json: "PaymentAcquirerData", js: "paymentAcquirerData", typ: u(undefined, r("PaymentAcquirerData")) }, + { json: "PaymentInstrumentData", js: "paymentInstrumentData", typ: u(undefined, r("PaymentInstrumentData")) }, + { json: "PaymentType", js: "paymentType", typ: u(undefined, r("PaymentType")) }, + { json: "ProtectedSignature", js: "protectedSignature", typ: u(undefined, r("ContentInformation")) }, + { json: "ValidityDate", js: "validityDate", typ: u(undefined, "") }, + ], "any"), + "AmountsResp": o([ + { json: "AuthorizedAmount", js: "authorizedAmount", typ: 3.14 }, + { json: "CashBackAmount", js: "cashBackAmount", typ: u(undefined, 3.14) }, + { json: "Currency", js: "currency", typ: u(undefined, "") }, + { json: "TipAmount", js: "tipAmount", typ: u(undefined, 3.14) }, + { json: "TotalFeesAmount", js: "totalFeesAmount", typ: u(undefined, 3.14) }, + { json: "TotalRebatesAmount", js: "totalRebatesAmount", typ: u(undefined, 3.14) }, + ], "any"), + "CapturedSignature": o([ + { json: "AreaSize", js: "areaSize", typ: u(undefined, r("AreaSize")) }, + { json: "SignaturePoint", js: "signaturePoint", typ: a(r("SignaturePoint")) }, + ], "any"), + "AreaSize": o([ + { json: "X", js: "x", typ: "" }, + { json: "Y", js: "y", typ: "" }, + ], "any"), + "SignaturePoint": o([ + { json: "X", js: "x", typ: "" }, + { json: "Y", js: "y", typ: "" }, + ], "any"), + "CurrencyConversion": o([ + { json: "Commission", js: "commission", typ: u(undefined, 3.14) }, + { json: "ConvertedAmount", js: "convertedAmount", typ: r("Amount") }, + { json: "CustomerApprovedFlag", js: "customerApprovedFlag", typ: u(undefined, true) }, + { json: "Declaration", js: "declaration", typ: u(undefined, "") }, + { json: "Markup", js: "markup", typ: u(undefined, 3.14) }, + { json: "Rate", js: "rate", typ: u(undefined, 3.14) }, + ], "any"), + "Amount": o([ + { json: "Currency", js: "currency", typ: u(undefined, "") }, + { json: "value", js: "value", typ: u(undefined, 3.14) }, + ], "any"), + "CardAcquisitionResponse": o([ + { json: "CustomerOrder", js: "customerOrder", typ: u(undefined, a(r("CustomerOrder"))) }, + { json: "LoyaltyAccount", js: "loyaltyAccount", typ: u(undefined, a(r("LoyaltyAccount"))) }, + { json: "PaymentBrand", js: "paymentBrand", typ: u(undefined, a("")) }, + { json: "PaymentInstrumentData", js: "paymentInstrumentData", typ: u(undefined, r("PaymentInstrumentData")) }, + { json: "POIData", js: "poiData", typ: r("PoiData") }, + { json: "Response", js: "response", typ: r("Response") }, + { json: "SaleData", js: "saleData", typ: r("SaleData") }, + ], "any"), + "CardReaderApduResponse": o([ + { json: "APDUData", js: "apduData", typ: u(undefined, "any") }, + { json: "CardStatusWords", js: "cardStatusWords", typ: "any" }, + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "CardReaderInitResponse": o([ + { json: "EntryMode", js: "entryMode", typ: u(undefined, a(r("EntryModeType"))) }, + { json: "ICCResetData", js: "iccResetData", typ: u(undefined, r("IccResetData")) }, + { json: "Response", js: "response", typ: r("Response") }, + { json: "TrackData", js: "trackData", typ: u(undefined, a(r("TrackData"))) }, + ], "any"), + "IccResetData": o([ + { json: "ATRValue", js: "atrValue", typ: u(undefined, "any") }, + { json: "CardStatusWords", js: "cardStatusWords", typ: u(undefined, "any") }, + ], "any"), + "CardReaderPowerOffResponse": o([ + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "DiagnosisResponse": o([ + { json: "HostStatus", js: "hostStatus", typ: u(undefined, a(r("HostStatus"))) }, + { json: "LoggedSaleID", js: "loggedSaleId", typ: u(undefined, a("")) }, + { json: "POIStatus", js: "poiStatus", typ: u(undefined, r("PoiStatus")) }, + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "HostStatus": o([ + { json: "AcquirerID", js: "acquirerId", typ: "" }, + { json: "IsReachableFlag", js: "isReachableFlag", typ: u(undefined, true) }, + ], "any"), + "PoiStatus": o([ + { json: "CardReaderOKFlag", js: "cardReaderOkFlag", typ: u(undefined, true) }, + { json: "CashHandlingDevice", js: "cashHandlingDevice", typ: u(undefined, a(r("CashHandlingDevice"))) }, + { json: "CommunicationOKFlag", js: "communicationOkFlag", typ: u(undefined, true) }, + { json: "FraudPreventionFlag", js: "fraudPreventionFlag", typ: u(undefined, true) }, + { json: "GlobalStatus", js: "globalStatus", typ: r("GlobalStatusType") }, + { json: "PEDOKFlag", js: "pedokFlag", typ: u(undefined, true) }, + { json: "PrinterStatus", js: "printerStatus", typ: u(undefined, r("PrinterStatusType")) }, + { json: "SecurityOKFlag", js: "securityOkFlag", typ: u(undefined, true) }, + ], "any"), + "CashHandlingDevice": o([ + { json: "CashHandlingOKFlag", js: "cashHandlingOkFlag", typ: true }, + { json: "CoinsOrBills", js: "coinsOrBills", typ: a(r("CoinsOrBills")) }, + { json: "Currency", js: "currency", typ: "" }, + ], "any"), + "CoinsOrBills": o([ + { json: "Number", js: "number", typ: 3.14 }, + { json: "UnitValue", js: "unitValue", typ: 3.14 }, + ], "any"), + "DisplayResponse": o([ + { json: "OutputResult", js: "outputResult", typ: a(r("OutputResult")) }, + ], "any"), + "OutputResult": o([ + { json: "Device", js: "device", typ: r("DeviceType") }, + { json: "InfoQualify", js: "infoQualify", typ: r("InfoQualifyType") }, + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "EnableServiceResponse": o([ + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "GetTotalsResponse": o([ + { json: "POIReconciliationID", js: "poiReconciliationId", typ: "" }, + { json: "Response", js: "response", typ: r("Response") }, + { json: "TransactionTotals", js: "transactionTotals", typ: u(undefined, a(r("TransactionTotals"))) }, + ], "any"), + "TransactionTotals": o([ + { json: "AcquirerID", js: "acquirerId", typ: u(undefined, "") }, + { json: "CardBrand", js: "cardBrand", typ: u(undefined, "") }, + { json: "ErrorCondition", js: "errorCondition", typ: u(undefined, r("ErrorConditionType")) }, + { json: "HostReconciliationID", js: "hostReconciliationId", typ: u(undefined, "") }, + { json: "LoyaltyCurrency", js: "loyaltyCurrency", typ: u(undefined, "") }, + { json: "LoyaltyTotals", js: "loyaltyTotals", typ: u(undefined, a(r("LoyaltyTotals"))) }, + { json: "LoyaltyUnit", js: "loyaltyUnit", typ: u(undefined, r("LoyaltyUnitType")) }, + { json: "OperatorID", js: "operatorId", typ: u(undefined, "") }, + { json: "PaymentCurrency", js: "paymentCurrency", typ: u(undefined, "") }, + { json: "PaymentInstrumentType", js: "paymentInstrumentType", typ: r("PaymentInstrumentType") }, + { json: "PaymentTotals", js: "paymentTotals", typ: u(undefined, a(r("PaymentTotals"))) }, + { json: "POIID", js: "poiid", typ: u(undefined, "") }, + { json: "SaleID", js: "saleId", typ: u(undefined, "") }, + { json: "ShiftNumber", js: "shiftNumber", typ: u(undefined, "") }, + { json: "TotalsGroupID", js: "totalsGroupId", typ: u(undefined, "") }, + ], "any"), + "LoyaltyTotals": o([ + { json: "TransactionAmount", js: "transactionAmount", typ: 3.14 }, + { json: "TransactionCount", js: "transactionCount", typ: 3.14 }, + { json: "TransactionType", js: "transactionType", typ: r("TransactionType") }, + ], "any"), + "PaymentTotals": o([ + { json: "TransactionAmount", js: "transactionAmount", typ: 3.14 }, + { json: "TransactionCount", js: "transactionCount", typ: 3.14 }, + { json: "TransactionType", js: "transactionType", typ: r("TransactionType") }, + ], "any"), + "InputResponse": o([ + { json: "InputResult", js: "inputResult", typ: r("InputResult") }, + { json: "OutputResult", js: "outputResult", typ: u(undefined, r("OutputResult")) }, + ], "any"), + "InputResult": o([ + { json: "Device", js: "device", typ: r("DeviceType") }, + { json: "InfoQualify", js: "infoQualify", typ: r("InfoQualifyType") }, + { json: "Input", js: "input", typ: u(undefined, r("Input")) }, + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "Input": o([ + { json: "ConfirmedFlag", js: "confirmedFlag", typ: u(undefined, true) }, + { json: "DigitInput", js: "digitInput", typ: u(undefined, "") }, + { json: "FunctionKey", js: "functionKey", typ: u(undefined, "") }, + { json: "InputCommand", js: "inputCommand", typ: r("InputCommandType") }, + { json: "MenuEntryNumber", js: "menuEntryNumber", typ: u(undefined, 3.14) }, + { json: "Password", js: "password", typ: u(undefined, r("ContentInformation")) }, + { json: "TextInput", js: "textInput", typ: u(undefined, "") }, + ], "any"), + "LoginResponse": o([ + { json: "POISystemData", js: "poiSystemData", typ: u(undefined, r("PoiSystemData")) }, + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "PoiSystemData": o([ + { json: "DateTime", js: "dateTime", typ: m("any") }, + { json: "POISoftware", js: "poiSoftware", typ: r("PoiSoftware") }, + { json: "POIStatus", js: "poiStatus", typ: u(undefined, r("PoiStatus")) }, + { json: "POITerminalData", js: "poiTerminalData", typ: u(undefined, r("PoiTerminalData")) }, + ], "any"), + "PoiSoftware": o([ + { json: "ApplicationName", js: "applicationName", typ: "" }, + { json: "CertificationCode", js: "certificationCode", typ: "" }, + { json: "ManufacturerID", js: "manufacturerId", typ: "" }, + { json: "SoftwareVersion", js: "softwareVersion", typ: "" }, + ], "any"), + "PoiTerminalData": o([ + { json: "POICapabilities", js: "poiCapabilities", typ: a(r("PoiCapabilitiesType")) }, + { json: "POIProfile", js: "poiProfile", typ: u(undefined, r("PoiProfile")) }, + { json: "POISerialNumber", js: "poiSerialNumber", typ: "" }, + { json: "TerminalEnvironment", js: "terminalEnvironment", typ: r("TerminalEnvironmentType") }, + ], "any"), + "PoiProfile": o([ + { json: "GenericProfile", js: "genericProfile", typ: u(undefined, r("GenericProfileType")) }, + { json: "ServiceProfiles", js: "serviceProfiles", typ: u(undefined, a(r("ServiceProfilesType"))) }, + ], "any"), + "LogoutResponse": o([ + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "LoyaltyResponse": o([ + { json: "LoyaltyResult", js: "loyaltyResult", typ: u(undefined, a(r("LoyaltyResult"))) }, + { json: "PaymentReceipt", js: "paymentReceipt", typ: u(undefined, a(r("PaymentReceipt"))) }, + { json: "POIData", js: "poiData", typ: r("PoiData") }, + { json: "Response", js: "response", typ: r("Response") }, + { json: "SaleData", js: "saleData", typ: r("SaleData") }, + ], "any"), + "PaymentReceipt": o([ + { json: "DocumentQualifier", js: "documentQualifier", typ: r("DocumentQualifierType") }, + { json: "IntegratedPrintFlag", js: "integratedPrintFlag", typ: u(undefined, true) }, + { json: "OutputContent", js: "outputContent", typ: r("OutputContent") }, + { json: "RequiredSignatureFlag", js: "requiredSignatureFlag", typ: u(undefined, true) }, + ], "any"), + "PinResponse": o([ + { json: "CardholderPIN", js: "cardholderPin", typ: u(undefined, r("CardholderPin")) }, + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "PaymentResponse": o([ + { json: "CustomerOrder", js: "customerOrder", typ: u(undefined, a(r("CustomerOrder"))) }, + { json: "LoyaltyResult", js: "loyaltyResult", typ: u(undefined, a(r("LoyaltyResult"))) }, + { json: "PaymentReceipt", js: "paymentReceipt", typ: u(undefined, a(r("PaymentReceipt"))) }, + { json: "PaymentResult", js: "paymentResult", typ: u(undefined, r("PaymentResult")) }, + { json: "POIData", js: "poiData", typ: r("PoiData") }, + { json: "Response", js: "response", typ: r("Response") }, + { json: "SaleData", js: "saleData", typ: r("SaleData") }, + ], "any"), + "PrintResponse": o([ + { json: "DocumentQualifier", js: "documentQualifier", typ: r("DocumentQualifierType") }, + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "ReconciliationResponse": o([ + { json: "POIReconciliationID", js: "poiReconciliationId", typ: u(undefined, "") }, + { json: "ReconciliationType", js: "reconciliationType", typ: r("ReconciliationType") }, + { json: "Response", js: "response", typ: r("Response") }, + { json: "TransactionTotals", js: "transactionTotals", typ: u(undefined, a(r("TransactionTotals"))) }, + ], "any"), + "ReversalResponse": o([ + { json: "CustomerOrderID", js: "customerOrderId", typ: u(undefined, "") }, + { json: "OriginalPOITransaction", js: "originalPoiTransaction", typ: u(undefined, r("OriginalPoiTransaction")) }, + { json: "PaymentReceipt", js: "paymentReceipt", typ: u(undefined, a(r("PaymentReceipt"))) }, + { json: "POIData", js: "poiData", typ: u(undefined, r("PoiData")) }, + { json: "Response", js: "response", typ: r("Response") }, + { json: "ReversedAmount", js: "reversedAmount", typ: u(undefined, 3.14) }, + ], "any"), + "SoundResponse": o([ + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "StoredValueResponse": o([ + { json: "POIData", js: "poiData", typ: r("PoiData") }, + { json: "Response", js: "response", typ: r("Response") }, + { json: "SaleData", js: "saleData", typ: r("SaleData") }, + { json: "StoredValueResult", js: "storedValueResult", typ: u(undefined, a(r("StoredValueResult"))) }, + ], "any"), + "StoredValueResult": o([ + { json: "Currency", js: "currency", typ: "" }, + { json: "EanUpc", js: "eanUpc", typ: u(undefined, "") }, + { json: "HostTransactionID", js: "hostTransactionId", typ: u(undefined, r("TransactionIdentification")) }, + { json: "ItemAmount", js: "itemAmount", typ: 3.14 }, + { json: "ProductCode", js: "productCode", typ: "" }, + { json: "StoredValueAccountStatus", js: "storedValueAccountStatus", typ: r("StoredValueAccountStatus") }, + { json: "StoredValueTransactionType", js: "storedValueTransactionType", typ: r("StoredValueTransactionType") }, + ], "any"), + "StoredValueAccountStatus": o([ + { json: "CurrentBalance", js: "currentBalance", typ: u(undefined, 3.14) }, + { json: "StoredValueAccountID", js: "storedValueAccountId", typ: r("StoredValueAccountId") }, + ], "any"), + "TransactionStatusResponse": o([ + { json: "MessageReference", js: "messageReference", typ: u(undefined, r("MessageReference")) }, + { json: "RepeatedMessageResponse", js: "repeatedMessageResponse", typ: u(undefined, r("RepeatedMessageResponse")) }, + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "RepeatedMessageResponse": o([ + { json: "MessageHeader", js: "messageHeader", typ: r("MessageHeader") }, + { json: "RepeatedResponseMessageBody", js: "repeatedResponseMessageBody", typ: r("RepeatedResponseMessageBody") }, + ], "any"), + "RepeatedResponseMessageBody": o([ + { json: "CardAcquisitionResponse", js: "cardAcquisitionResponse", typ: u(undefined, r("CardAcquisitionResponse")) }, + { json: "CardReaderAPDUResponse", js: "cardReaderApduResponse", typ: u(undefined, r("CardReaderApduResponse")) }, + { json: "LoyaltyResponse", js: "loyaltyResponse", typ: u(undefined, r("LoyaltyResponse")) }, + { json: "PaymentResponse", js: "paymentResponse", typ: u(undefined, r("PaymentResponse")) }, + { json: "ReversalResponse", js: "reversalResponse", typ: u(undefined, r("ReversalResponse")) }, + { json: "StoredValueResponse", js: "storedValueResponse", typ: u(undefined, r("StoredValueResponse")) }, + ], "any"), + "TransmitResponse": o([ + { json: "Message", js: "message", typ: u(undefined, "any") }, + { json: "Response", js: "response", typ: r("Response") }, + ], "any"), + "TerminalApiSecuredRequest": o([ + { json: "SaleToPOIRequest", js: "saleToPoiRequest", typ: u(undefined, r("SaleToPoiSecuredMessage")) }, + ], "any"), + "SaleToPoiSecuredMessage": o([ + { json: "MessageHeader", js: "messageHeader", typ: u(undefined, r("MessageHeader")) }, + { json: "NexoBlob", js: "nexoBlob", typ: u(undefined, "") }, + { json: "SecurityTrailer", js: "securityTrailer", typ: u(undefined, r("SecurityTrailer")) }, + ], "any"), + "SecurityTrailer": o([ + { json: "AdyenCryptoVersion", js: "adyenCryptoVersion", typ: u(undefined, 3.14) }, + { json: "Hmac", js: "hmac", typ: u(undefined, "any") }, + { json: "KeyIdentifier", js: "keyIdentifier", typ: u(undefined, "") }, + { json: "KeyVersion", js: "keyVersion", typ: u(undefined, 3.14) }, + { json: "Nonce", js: "nonce", typ: u(undefined, "any") }, + ], "any"), + "TerminalApiSecuredResponse": o([ + { json: "SaleToPOIResponse", js: "saleToPoiResponse", typ: u(undefined, r("SaleToPoiSecuredMessage")) }, + ], "any"), + "NexoDerivedKey": o([ + { json: "CipherKey", js: "cipherKey", typ: u(undefined, "any") }, + { json: "HmacKey", js: "hmacKey", typ: u(undefined, "any") }, + { json: "Iv", js: "iv", typ: u(undefined, "any") }, + ], "any"), + "SecurityKey": o([ + { json: "adyenCryptoVersion", js: "adyenCryptoVersion", typ: u(undefined, 3.14) }, + { json: "keyIdentifier", js: "keyIdentifier", typ: u(undefined, "") }, + { json: "keyVersion", js: "keyVersion", typ: u(undefined, 3.14) }, + { json: "passphrase", js: "passphrase", typ: u(undefined, "") }, + ], "any"), + "DeviceType": [ + "CashierDisplay", + "CashierInput", + "CustomerDisplay", + "CustomerInput", + ], + "InfoQualifyType": [ + "CustomerAssistance", + "Display", + "Document", + "Error", + "Input", + "POIReplication", + "Receipt", + "Sound", + "Status", + "Voucher", + ], + "MenuEntryTagType": [ + "NonSelectable", + "NonSelectableSubMenu", + "Selectable", + "SubMenu", + ], + "OutputFormatType": [ + "BarCode", + "MessageRef", + "Text", + "XHTML", + ], + "AlignmentType": [ + "Centred", + "Justified", + "Left", + "Right", + ], + "CharacterHeightType": [ + "DoubleHeight", + "HalfHeight", + "SingleHeight", + ], + "CharacterStyleType": [ + "Bold", + "Italic", + "Normal", + "Underlined", + ], + "CharacterWidthType": [ + "DoubleWidth", + "SingleWidth", + ], + "ColorType": [ + "Black", + "Blue", + "Cyan", + "Green", + "Magenta", + "Red", + "White", + "Yellow", + ], + "BarcodeType": [ + "Code128", + "Code25", + "EAN13", + "EAN8", + "PDF417", + "QRCODE", + "UPCA", + ], + "MessageCategoryType": [ + "Abort", + "Admin", + "BalanceInquiry", + "Batch", + "CardAcquisition", + "CardReaderAPDU", + "CardReaderInit", + "CardReaderPowerOff", + "Diagnosis", + "Display", + "EnableService", + "Event", + "GetTotals", + "Input", + "InputUpdate", + "Login", + "Logout", + "Loyalty", + "Payment", + "PIN", + "Print", + "Reconciliation", + "Reversal", + "Sound", + "StoredValue", + "TransactionStatus", + "Transmit", + ], + "EntryModeType": [ + "Contactless", + "File", + "ICC", + "Keyed", + "MagStripe", + "Manual", + "Mobile", + "RFID", + "Scanned", + "SynchronousICC", + "Tapped", + ], + "IdentificationSupportType": [ + "HybridCard", + "LinkedCard", + "LoyaltyCard", + "NoCard", + ], + "IdentificationType": [ + "AccountNumber", + "BarCode", + "ISOTrack2", + "PAN", + "PhoneNumber", + ], + "AccountType": [ + "CardTotals", + "Checking", + "CreditCard", + "Default", + "EpurseCard", + "Investment", + "Savings", + "Universal", + ], + "TokenRequestedType": [ + "Customer", + "Transaction", + ], + "ContentType": [ + "id-ct-authData", + "id-data", + "id-digestedData", + "id-encryptedData", + "id-envelopedData", + "id-signedData", + ], + "AlgorithmType": [ + "des-ede3-cbc", + "des-ede3-ecb", + "id-dukpt-wrap", + "id-retail-cbc-mac", + "id-retail-cbc-mac-sha-256", + "id-sha256", + "id-ukpt-wrap ", + "rsaEncryption", + "sha256WithRSAEncryption", + ], + "VersionType": [ + "v0", + "v1", + "v2", + "v3", + "v4", + "v5", + ], + "TrackFormatType": [ + "AAMVA", + "CMC-7", + "E-13B", + "ISO", + "JIS-I", + "JIS-II", + ], + "CheckTypeCodeType": [ + "Company", + "Personal", + ], + "PaymentInstrumentType": [ + "Card", + "Cash", + "Check", + "Mobile", + "StoredValue", + ], + "LoyaltyUnitType": [ + "Monetary", + "Point", + ], + "LoyaltyTransactionType": [ + "Award", + "AwardRefund", + "Rebate", + "RebateRefund", + "Redemption", + "RedemptionRefund", + ], + "UnitOfMeasureType": [ + "Case", + "Centilitre", + "Centimetre", + "Foot", + "Gram", + "Inch", + "Kilogram", + "Kilometre", + "Litre", + "Meter", + "Mile", + "Other", + "Ounce", + "Pint", + "Pound", + "Quart", + "UKGallon", + "USGallon", + "Yard", + ], + "ForceEntryModeType": [ + "CheckReader", + "Contactless", + "File", + "ICC", + "Keyed", + "MagStripe", + "Manual", + "RFID", + "Scanned", + "SynchronousICC", + "Tapped", + ], + "LoyaltyHandlingType": [ + "Allowed", + "Forbidden", + "Processed", + "Proposed", + "Required", + ], + "CustomerOrderReqType": [ + "Both", + "Closed", + "Open", + ], + "SaleCapabilitiesType": [ + "CashierDisplay", + "CashierError", + "CashierInput", + "CashierStatus", + "CustomerAssistance", + "CustomerDisplay", + "CustomerError", + "CustomerInput", + "EMVContactless", + "ICC", + "MagStripe", + "POIReplication", + "PrinterDocument", + "PrinterReceipt", + "PrinterVoucher", + ], + "GenericProfileType": [ + "Basic", + "Extended", + "Standard", + ], + "ServiceProfilesType": [ + "Batch", + "CardReader", + "Communication", + "Loyalty", + "OneTimeRes", + "PIN", + "Reservation", + "Sound", + "StoredValue", + "Synchro", + ], + "TerminalEnvironmentType": [ + "Attended", + "SemiAttended", + "Unattended", + ], + "InstalmentType": [ + "DeferredInstalments", + "EqualInstalments", + "InequalInstalments", + ], + "PeriodUnitType": [ + "Annual", + "Daily", + "Monthly", + "Weekly", + ], + "PaymentType": [ + "CashAdvance", + "CashDeposit", + "Completion", + "FirstReservation", + "Instalment", + "IssuerInstalment", + "Normal", + "OneTimeReservation", + "PaidOut", + "Recurring", + "Refund", + "UpdateReservation", + ], + "ReversalReasonType": [ + "CustCancel", + "Malfunction", + "MerchantCancel", + "Unable2Compl", + ], + "ServicesEnabledType": [ + "CardAcquisition", + "Loyalty", + "Payment", + ], + "TransactionActionType": [ + "AbortTransaction", + "StartTransaction", + ], + "EventToNotifyType": [ + "Abort", + "BeginMaintenance", + "CardInserted", + "CardRemoved", + "Completed", + "CustomerLanguage", + "EndMaintenance", + "Initialised", + "KeyPressed", + "OutOfOrder", + "Reject", + "SaleAdmin", + "SaleWakeUp", + "SecurityAlarm", + "Shutdown", + "StopAssistance", + ], + "TotalDetailsType": [ + "OperatorID", + "POIID", + "SaleID", + "ShiftNumber", + "TotalsGroupID", + ], + "InputCommandType": [ + "DecimalString", + "DigitString", + "GetAnyKey", + "GetConfirmation", + "GetFunctionKey", + "GetMenuEntry", + "Password", + "SiteManager", + "TextString", + ], + "MessageClassType": [ + "Device", + "Event", + "Service", + ], + "MessageType": [ + "Notification", + "Request", + "Response", + ], + "PinFormatType": [ + "ISO0", + "ISO1", + "ISO2", + "ISO3", + ], + "PinRequestType": [ + "PINEnter", + "PINVerify", + "PINVerifyOnly", + ], + "DocumentQualifierType": [ + "CashierReceipt", + "CustomerReceipt", + "Document", + "Journal", + "SaleReceipt", + "Voucher", + ], + "ResponseModeType": [ + "Immediate", + "NotRequired", + "PrintEnd", + "SoundEnd", + ], + "ReconciliationType": [ + "AcquirerReconciliation", + "AcquirerSynchronisation", + "PreviousReconciliation", + "SaleReconciliation", + ], + "SoundActionType": [ + "SetDefaultVolume", + "StartSound", + "StopSound", + ], + "SoundFormatType": [ + "MessageRef", + "SoundRef", + "Text", + ], + "StoredValueAccountType": [ + "GiftCard", + "Other", + "PhoneCard", + ], + "StoredValueTransactionType": [ + "Activate", + "Duplicate", + "Load", + "Reserve", + "Reverse", + "Unload", + ], + "ErrorConditionType": [ + "Aborted", + "Busy", + "Cancel", + "DeviceOut", + "InProgress", + "InsertedCard", + "InvalidCard", + "LoggedOut", + "MessageFormat", + "NotAllowed", + "NotFound", + "PaymentRestriction", + "Refusal", + "UnavailableDevice", + "UnavailableService", + "UnreachableHost", + "WrongPIN", + ], + "ResultType": [ + "Failure", + "Partial", + "Success", + ], + "AuthenticationMethodType": [ + "Bypass", + "ManualVerification", + "MerchantAuthentication", + "OfflinePIN", + "OnLinePIN", + "PaperSignature", + "SecureCertificate", + "SecureNoCertificate", + "SecuredChannel", + "SignatureCapture", + "UnknownMethod", + ], + "GlobalStatusType": [ + "Busy", + "Maintenance", + "OK", + "Unreachable", + ], + "PrinterStatusType": [ + "NoPaper", + "OK", + "OutOfOrder", + "PaperJam", + "PaperLow", + ], + "TransactionType": [ + "Award", + "CashAdvance", + "CompletedDeffered", + "CompletedReservation", + "Credit", + "Debit", + "Declined", + "Failed", + "FirstReservation", + "IssuerInstalment", + "OneTimeReservation", + "Rebate", + "Redemption", + "ReverseAward", + "ReverseCredit", + "ReverseDebit", + "ReverseRebate", + "ReverseRedemption", + "UpdateReservation", + ], + "PoiCapabilitiesType": [ + "CashHandling", + "CashierDisplay", + "CashierError", + "CashierInput", + "CustomerDisplay", + "CustomerError", + "CustomerInput", + "EMVContactless", + "ICC", + "MagStripe", + "PrinterDocument", + "PrinterReceipt", + "PrinterVoucher", + ], +}; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..1fe9f98 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "outDir": "./dist/lib", + "module": "commonjs", + "target": "es5", + "lib": ["es6"], + "sourceMap": true, + "declaration": true, + "moduleResolution": "node", + "rootDir": "src", + "noImplicitReturns": true, + "noImplicitThis": true, + "noImplicitAny": true, + "alwaysStrict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "resolveJsonModule": true, + }, + "include": [ + "src" + ], + "exclude": [ + "node_modules", + "**/__mocks__/*", + "**/__tests__/*" + ] +} diff --git a/tslint.json b/tslint.json new file mode 100644 index 0000000..941dd7c --- /dev/null +++ b/tslint.json @@ -0,0 +1,68 @@ + +{ + "extends": "tslint:latest", + "linterOptions": { + "exclude": ["./src/typings"] + }, + "rules": { + "variable-name": { + "options": "allow-leading-underscore" + }, + "class-name": true, + "comment-format": [ + true, + "check-space" + ], + "indent": [ + true, + "spaces" + ], + "one-line": [ + true, + "check-open-brace", + "check-whitespace" + ], + "no-var-keyword": true, + "quotemark": [ + true, + "double", + "avoid-escape" + ], + "semicolon": [ + true, + "always", + "ignore-bound-class-methods" + ], + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-type" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ], + "no-internal-module": true, + "no-trailing-whitespace": true, + "no-null-keyword": true, + "prefer-const": true, + "jsdoc-format": true + } +} \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..4282589 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,34 @@ +const path = require("path"); + +module.exports = { + context: process.cwd(), + mode: "production", + entry: "./src/index.ts", + devtool: "inline-source-map", + output: { + path: path.resolve(__dirname, "dist", "es5"), + filename: "[name].js", + library: "AdyenTerminalApi", + libraryTarget: "umd", + umdNamedDefine: true + }, + optimization: { + splitChunks: { + chunks: "all" + } + }, + module: { + rules: [ + { + test: /\.ts?$/, + use: [{ + loader: "ts-loader", + }] + } + ] + }, + resolve: { + extensions: [".ts", ".js"] + }, + target: "node" +};