mirror of
https://github.com/jlengrand/adyen-node-api-library.git
synced 2026-04-14 08:01:18 +00:00
Compare commits
121 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4bf7494989 | ||
|
|
7f8170575f | ||
|
|
756a59e31a | ||
|
|
4013f70205 | ||
|
|
6858c8a599 | ||
|
|
2854236720 | ||
|
|
3b95f067aa | ||
|
|
a621245ced | ||
|
|
1ce8877d87 | ||
|
|
964be24ba7 | ||
|
|
4bcfb1810f | ||
|
|
b781030260 | ||
|
|
fa767eea8e | ||
|
|
f40092f94f | ||
|
|
2401b27dd4 | ||
|
|
d03fd6502d | ||
|
|
ebc72005e6 | ||
|
|
57f3135dee | ||
|
|
b4e9e2f480 | ||
|
|
9c21109c83 | ||
|
|
64c086a760 | ||
|
|
e8f82c4a82 | ||
|
|
86a551c06e | ||
|
|
9272fff378 | ||
|
|
520e73b57f | ||
|
|
2291cfad85 | ||
|
|
f3f9976e68 | ||
|
|
d50f84b230 | ||
|
|
ffb236e9f8 | ||
|
|
937ddc5623 | ||
|
|
6c38e717d7 | ||
|
|
204e68aa1e | ||
|
|
caa7e3a311 | ||
|
|
2f70fa2caf | ||
|
|
a26c04d99d | ||
|
|
9ea38e7da8 | ||
|
|
dddf016c6c | ||
|
|
9d87c490d9 | ||
|
|
a2db9a4ba1 | ||
|
|
66042b92e7 | ||
|
|
026ed69203 | ||
|
|
a5264a1b40 | ||
|
|
30f895b758 | ||
|
|
56e1805701 | ||
|
|
ea771b274f | ||
|
|
a55e9a5cf1 | ||
|
|
4f640a05ea | ||
|
|
acaa98d100 | ||
|
|
4956c01bea | ||
|
|
559b7fc224 | ||
|
|
1842ea21f2 | ||
|
|
d2472dd1f2 | ||
|
|
1d957df35d | ||
|
|
79a518d133 | ||
|
|
0b76d344ff | ||
|
|
38c12702c9 | ||
|
|
9884955c71 | ||
|
|
663a0c0ec7 | ||
|
|
db34fc68c3 | ||
|
|
aff2527194 | ||
|
|
cf07545dda | ||
|
|
9c4ab30240 | ||
|
|
147cea2d5b | ||
|
|
cd6a07f7bd | ||
|
|
6798edad03 | ||
|
|
b2f1c8b28b | ||
|
|
c0a494a4bd | ||
|
|
fc1769c30c | ||
|
|
a6a9961679 | ||
|
|
93e1dde831 | ||
|
|
6b45af1cdb | ||
|
|
a87b109f63 | ||
|
|
5d08dded6e | ||
|
|
7fd8e5dbb0 | ||
|
|
bf0d3b8457 | ||
|
|
da87e71c9f | ||
|
|
6797c684f9 | ||
|
|
95260f0499 | ||
|
|
9e35478973 | ||
|
|
25aeee2076 | ||
|
|
5435669388 | ||
|
|
eeb963d36f | ||
|
|
f39932208d | ||
|
|
25ea679283 | ||
|
|
07ca079203 | ||
|
|
63f95a5002 | ||
|
|
3b5e3d121d | ||
|
|
ac601cff87 | ||
|
|
1c8f750ff1 | ||
|
|
35e870c150 | ||
|
|
ee902f97c1 | ||
|
|
3b328c54c8 | ||
|
|
14c6a71fe9 | ||
|
|
e53550df2a | ||
|
|
97db576e1f | ||
|
|
be0a10bd40 | ||
|
|
7556858aee | ||
|
|
3cb0f91ac1 | ||
|
|
10e06c2edb | ||
|
|
1f10c5e4bf | ||
|
|
fd437777e4 | ||
|
|
9ae07636c7 | ||
|
|
4f688db18e | ||
|
|
816e10de41 | ||
|
|
f7dd296d3b | ||
|
|
412cf2f739 | ||
|
|
c86597eee6 | ||
|
|
b03ab5b822 | ||
|
|
c18ed88e2e | ||
|
|
b26fde99b5 | ||
|
|
7045ad97c2 | ||
|
|
18d1d362ee | ||
|
|
e20b5146d7 | ||
|
|
9aa31b0278 | ||
|
|
a86bc8b9a8 | ||
|
|
f2f3571928 | ||
|
|
9615e66444 | ||
|
|
199c47568d | ||
|
|
4bdc49e3b5 | ||
|
|
880298d03e | ||
|
|
1099081ea3 |
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -1 +1 @@
|
||||
* @KadoBOT @msilvagarcia @cyattilakiss @rkewlani @Aleffio @rikterbeek
|
||||
* @KadoBOT @msilvagarcia @cyattilakiss @zaiddreakh @Aleffio @rikterbeek
|
||||
|
||||
11
.github/stale.yml
vendored
Normal file
11
.github/stale.yml
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# Number of days of inactivity before an issue becomes stale
|
||||
daysUntilStale: 60
|
||||
# Number of days of inactivity before a stale issue is closed
|
||||
daysUntilClose: 7
|
||||
# Label to use when marking an issue as stale
|
||||
staleLabel: wontfix
|
||||
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||
markComment: >
|
||||
This issue has been automatically marked as stale because it has not had
|
||||
recent activity. It will be closed if no further activity occurs. Thank you
|
||||
for your contributions.
|
||||
35
.github/workflows/coveralls.yml
vendored
Normal file
35
.github/workflows/coveralls.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
on: ["push", "pull_request"]
|
||||
|
||||
name: Coveralls
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Use Node.js 12.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.x
|
||||
|
||||
- name: npm install, npm test:coverage
|
||||
run: |
|
||||
npm install
|
||||
npm run test:coverage
|
||||
env:
|
||||
CI: true
|
||||
|
||||
- name: Coveralls Parallel
|
||||
uses: coverallsapp/github-action@master
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
path-to-lcov: ./coverage/lcov.info # optional (default value)
|
||||
|
||||
- name: Coveralls Finished
|
||||
uses: coverallsapp/github-action@master
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
27
.github/workflows/nodejs.yml
vendored
Normal file
27
.github/workflows/nodejs.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
name: Node.js CI
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x, 12.x, 13.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- name: npm install, lint and test
|
||||
run: |
|
||||
npm install
|
||||
npm run lint:fix
|
||||
npm run lint
|
||||
npm test
|
||||
env:
|
||||
CI: true
|
||||
30
.github/workflows/npmpublish.yml
vendored
Normal file
30
.github/workflows/npmpublish.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: Node.js Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
- run: yarn install --frozen-lockfile
|
||||
- run: yarn run test
|
||||
|
||||
publish-npm:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12
|
||||
registry-url: https://registry.npmjs.org/
|
||||
- run: yarn install --frozen-lockfile
|
||||
- run: yarn publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,4 +11,3 @@ node_modules
|
||||
.ssh/
|
||||
.viminfo
|
||||
coverage/
|
||||
dist/
|
||||
|
||||
25
.travis.yml
25
.travis.yml
@@ -1,25 +0,0 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "8"
|
||||
- stable
|
||||
cache: yarn
|
||||
script:
|
||||
- yarn run lint:fix
|
||||
- yarn run lint
|
||||
- yarn run test
|
||||
jobs:
|
||||
include:
|
||||
- stage: npm release
|
||||
if: tag IS present
|
||||
node_js: stable
|
||||
script: yarn run build
|
||||
deploy:
|
||||
provider: npm
|
||||
email: "$NPM_EMAIL"
|
||||
api_key: "$NPM_TOKEN"
|
||||
skip_cleanup: true
|
||||
on:
|
||||
tags: true
|
||||
- stage: Produce Coverage
|
||||
node_js: stable
|
||||
script: jest --coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
|
||||
@@ -1,10 +1,12 @@
|
||||
# Adyen Node.js API Library
|
||||
[](https://travis-ci.org/Adyen/adyen-node-api-library)
|
||||

|
||||
[](https://coveralls.io/github/Adyen/adyen-node-api-library?branch=master)
|
||||
[](https://www.npmjs.com/package/@adyen/api-library)
|
||||

|
||||
[](https://www.npmjs.com/package/@adyen/api-library)
|
||||
[](https://sonarcloud.io/dashboard?id=Adyen_adyen-node-api-library)
|
||||
[](https://lgtm.com/projects/g/Adyen/adyen-node-api-library/alerts/)
|
||||
[](https://lgtm.com/projects/g/Adyen/adyen-node-api-library/context:javascript)
|
||||
|
||||
The Adyen API Library for NodeJS enables you to work with Adyen APIs.
|
||||
|
||||
@@ -22,7 +24,7 @@ The Library supports all APIs under the following services:
|
||||
|
||||
## Requirements
|
||||
|
||||
* Node 8.1.1 or higher
|
||||
* Node 10 or higher
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -36,7 +38,7 @@ npm install --save @adyen/api-library
|
||||
|
||||
## Documentation
|
||||
* https://docs.adyen.com/developers/development-resources/libraries
|
||||
* https://docs.adyen.com/developers/checkout/api-integration
|
||||
* https://docs.adyen.com/developers/checkout
|
||||
|
||||
## HTTP Client Configuration
|
||||
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
"@babel/env",
|
||||
[
|
||||
"@babel/preset-typescript",
|
||||
{
|
||||
targets: {
|
||||
node: "current"
|
||||
}
|
||||
}
|
||||
]
|
||||
],
|
||||
plugins: [
|
||||
"@babel/proposal-class-properties",
|
||||
"@babel/proposal-object-rest-spread"
|
||||
],
|
||||
env: {
|
||||
test: {
|
||||
plugins: [
|
||||
"@babel/plugin-transform-runtime",
|
||||
"@babel/plugin-transform-typescript"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
2
dist/es5/main.js
vendored
Normal file
2
dist/es5/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2
dist/es5/vendors~main.js
vendored
Normal file
2
dist/es5/vendors~main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
61
dist/lib-esm/package.json
vendored
Normal file
61
dist/lib-esm/package.json
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"name": "@adyen/api-library",
|
||||
"version": "3.1.1",
|
||||
"description": "The Adyen API Library for NodeJS enables you to work with Adyen APIs.",
|
||||
"main": "dist/lib/src/index.js",
|
||||
"types": "dist/lib/src/index.d.ts",
|
||||
"module": "dist/lib-esm/src/index.js",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"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",
|
||||
"test:coverage": "jest --coverage",
|
||||
"preversion": "npm test",
|
||||
"version": "npm run build && git add -A dist",
|
||||
"postversion": "git push && git push --tags && rm -rf build/temp",
|
||||
"release": "release-it --no-npm.publish"
|
||||
},
|
||||
"author": "Ricardo Ambrogi",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/jest": "25.1.4",
|
||||
"@types/nock": "11.1.0",
|
||||
"@typescript-eslint/eslint-plugin": "2.24.0",
|
||||
"@typescript-eslint/parser": "2.24.0",
|
||||
"coveralls": "3.0.9",
|
||||
"eslint": "6.8.0",
|
||||
"jest": "25.1.0",
|
||||
"nock": "12.0.3",
|
||||
"release-it": "13.1.1",
|
||||
"ts-jest": "25.2.1",
|
||||
"ts-loader": "6.2.1",
|
||||
"typescript": "3.8.3",
|
||||
"webpack": "4.42.0",
|
||||
"webpack-cli": "3.3.11"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "13.9.1",
|
||||
"https-proxy-agent": "5.0.0"
|
||||
}
|
||||
}
|
||||
4
dist/lib-esm/src/__mocks__/base.d.ts
vendored
Normal file
4
dist/lib-esm/src/__mocks__/base.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import Client from "../client";
|
||||
import { TerminalApiRequest } from "../typings/terminal";
|
||||
export declare const createMockClientFromResponse: () => Client;
|
||||
export declare const createTerminalAPIPaymentRequest: () => TerminalApiRequest;
|
||||
73
dist/lib-esm/src/__mocks__/base.js
vendored
Normal file
73
dist/lib-esm/src/__mocks__/base.js
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* ######
|
||||
* ######
|
||||
* ############ ####( ###### #####. ###### ############ ############
|
||||
* ############# #####( ###### #####. ###### ############# #############
|
||||
* ###### #####( ###### #####. ###### ##### ###### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ######
|
||||
* ############# ############# ############# ############# ##### ######
|
||||
* ############ ############ ############# ############ ##### ######
|
||||
* ######
|
||||
* #############
|
||||
* ############
|
||||
*
|
||||
* 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 { MessageCategoryType, MessageClassType, MessageType, } from "../typings/terminal";
|
||||
export var createMockClientFromResponse = function () {
|
||||
var config = new Config();
|
||||
config.terminalApiCloudEndpoint = Client.TERMINAL_API_ENDPOINT_TEST;
|
||||
config.terminalApiLocalEndpoint = "https://mocked_local_endpoint.com";
|
||||
config.hmacKey = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00";
|
||||
config.endpoint = Client.ENDPOINT_TEST;
|
||||
config.checkoutEndpoint = Client.CHECKOUT_ENDPOINT_TEST;
|
||||
config.apiKey = "MOCKED_API_KEY";
|
||||
var client = new Client({ config: config });
|
||||
return client;
|
||||
};
|
||||
export var createTerminalAPIPaymentRequest = function () {
|
||||
var messageHeader = {
|
||||
messageCategory: MessageCategoryType.Payment,
|
||||
messageClass: MessageClassType.Service,
|
||||
messageType: MessageType.Request,
|
||||
poiid: "P400Plus-123456789",
|
||||
protocolVersion: "3.0",
|
||||
saleId: "001",
|
||||
serviceId: "001",
|
||||
};
|
||||
var timestamp = new Date().toISOString();
|
||||
var transactionIdentification = {
|
||||
timeStamp: timestamp,
|
||||
transactionId: "001",
|
||||
};
|
||||
var saleData = {
|
||||
saleTransactionId: transactionIdentification,
|
||||
};
|
||||
var amountsReq = {
|
||||
currency: "EUR",
|
||||
requestedAmount: 1,
|
||||
};
|
||||
var paymentTransaction = {
|
||||
amountsReq: amountsReq,
|
||||
};
|
||||
var paymentRequest = {
|
||||
paymentTransaction: paymentTransaction,
|
||||
saleData: saleData,
|
||||
};
|
||||
var saleToPOIRequest = {
|
||||
messageHeader: messageHeader,
|
||||
paymentRequest: paymentRequest,
|
||||
};
|
||||
var terminalApiRequest = {
|
||||
saleToPoiRequest: saleToPOIRequest,
|
||||
};
|
||||
return terminalApiRequest;
|
||||
};
|
||||
//# sourceMappingURL=base.js.map
|
||||
1
dist/lib-esm/src/__mocks__/base.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/base.js.map
v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AAE,KAAK;KACvB,CAAC;IAEF,IAAM,QAAQ,GAAa;QACvB,iBAAiB,EAAE,yBAAyB;KAC/C,CAAC;IAEF,IAAM,UAAU,GAAe;QAC3B,QAAQ,EAAE,KAAK;QACf,eAAe,EAAE,CAAC;KACrB,CAAC;IAEF,IAAM,kBAAkB,GAAuB;QAC3C,UAAU,EAAE,UAAU;KACzB,CAAC;IAEF,IAAM,cAAc,GAAmB;QACnC,kBAAkB,EAAE,kBAAkB;QACtC,QAAQ,EAAE,QAAQ;KACrB,CAAC;IAEF,IAAM,gBAAgB,GAAqB;QACvC,aAAa,EAAE,aAAa;QAC5B,cAAc,EAAE,cAAc;KACjC,CAAC;IAEF,IAAM,kBAAkB,GAAuB;QAC3C,gBAAgB,EAAE,gBAAgB;KACrC,CAAC;IAEF,OAAO,kBAAkB,CAAC;AAC9B,CAAC,CAAC"}
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentMethodsSuccess.d.ts
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentMethodsSuccess.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const paymentMethodsSuccess: string;
|
||||
987
dist/lib-esm/src/__mocks__/checkout/paymentMethodsSuccess.js
vendored
Normal file
987
dist/lib-esm/src/__mocks__/checkout/paymentMethodsSuccess.js
vendored
Normal file
@@ -0,0 +1,987 @@
|
||||
/* tslint:disable */
|
||||
export var 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",
|
||||
},
|
||||
],
|
||||
});
|
||||
//# sourceMappingURL=paymentMethodsSuccess.js.map
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentMethodsSuccess.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentMethodsSuccess.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
6
dist/lib-esm/src/__mocks__/checkout/paymentSessionErrorInvalidData422.d.ts
vendored
Normal file
6
dist/lib-esm/src/__mocks__/checkout/paymentSessionErrorInvalidData422.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export declare const paymentSessionError: {
|
||||
statusCode: number;
|
||||
errorCode: string;
|
||||
message: string;
|
||||
errorType: string;
|
||||
};
|
||||
8
dist/lib-esm/src/__mocks__/checkout/paymentSessionErrorInvalidData422.js
vendored
Normal file
8
dist/lib-esm/src/__mocks__/checkout/paymentSessionErrorInvalidData422.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/* tslint:disable */
|
||||
export var paymentSessionError = {
|
||||
statusCode: 422,
|
||||
errorCode: "14_012",
|
||||
message: "The provided SDK token could not be parsed.",
|
||||
errorType: "validation",
|
||||
};
|
||||
//# sourceMappingURL=paymentSessionErrorInvalidData422.js.map
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentSessionErrorInvalidData422.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentSessionErrorInvalidData422.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"paymentSessionErrorInvalidData422.js","sourceRoot":"","sources":["../../../../../src/__mocks__/checkout/paymentSessionErrorInvalidData422.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,MAAM,CAAC,IAAM,mBAAmB,GAAG;IAC/B,UAAU,EAAE,GAAG;IACf,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,6CAA6C;IACtD,SAAS,EAAE,YAAY;CAC1B,CAAC"}
|
||||
3
dist/lib-esm/src/__mocks__/checkout/paymentSessionSucess.d.ts
vendored
Normal file
3
dist/lib-esm/src/__mocks__/checkout/paymentSessionSucess.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare const paymentSessionSuccess: {
|
||||
paymentSession: string;
|
||||
};
|
||||
5
dist/lib-esm/src/__mocks__/checkout/paymentSessionSucess.js
vendored
Normal file
5
dist/lib-esm/src/__mocks__/checkout/paymentSessionSucess.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/lib-esm/src/__mocks__/checkout/paymentSessionSucess.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentSessionSucess.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"paymentSessionSucess.js","sourceRoot":"","sources":["../../../../../src/__mocks__/checkout/paymentSessionSucess.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,MAAM,CAAC,IAAM,qBAAqB,GAAG;IACjC,cAAc,EAAE,k+YAAk+Y;CACr/Y,CAAC"}
|
||||
6
dist/lib-esm/src/__mocks__/checkout/paymentmethodsErrorForbidden403.d.ts
vendored
Normal file
6
dist/lib-esm/src/__mocks__/checkout/paymentmethodsErrorForbidden403.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export declare const paymentMethodsError: {
|
||||
errorCode: string;
|
||||
errorType: string;
|
||||
statusMessage: string;
|
||||
statusCode: number;
|
||||
};
|
||||
7
dist/lib-esm/src/__mocks__/checkout/paymentmethodsErrorForbidden403.js
vendored
Normal file
7
dist/lib-esm/src/__mocks__/checkout/paymentmethodsErrorForbidden403.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
export var paymentMethodsError = {
|
||||
errorCode: "901",
|
||||
errorType: "security",
|
||||
statusMessage: "Invalid Merchant Account",
|
||||
statusCode: 403,
|
||||
};
|
||||
//# sourceMappingURL=paymentmethodsErrorForbidden403.js.map
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentmethodsErrorForbidden403.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentmethodsErrorForbidden403.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"paymentmethodsErrorForbidden403.js","sourceRoot":"","sources":["../../../../../src/__mocks__/checkout/paymentmethodsErrorForbidden403.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,mBAAmB,GAAG;IAC/B,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,UAAU;IACrB,aAAa,EAAE,0BAA0B;IACzC,UAAU,EAAE,GAAG;CAClB,CAAC"}
|
||||
6
dist/lib-esm/src/__mocks__/checkout/paymentsDetailsErrorInvalidData422.d.ts
vendored
Normal file
6
dist/lib-esm/src/__mocks__/checkout/paymentsDetailsErrorInvalidData422.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export declare const paymentDetailsError: {
|
||||
statusCode: number;
|
||||
errorCode: string;
|
||||
message: string;
|
||||
errorType: string;
|
||||
};
|
||||
8
dist/lib-esm/src/__mocks__/checkout/paymentsDetailsErrorInvalidData422.js
vendored
Normal file
8
dist/lib-esm/src/__mocks__/checkout/paymentsDetailsErrorInvalidData422.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/* tslint:disable */
|
||||
export var paymentDetailsError = {
|
||||
statusCode: 422,
|
||||
errorCode: "101",
|
||||
message: "Invalid card number",
|
||||
errorType: "validation",
|
||||
};
|
||||
//# sourceMappingURL=paymentsDetailsErrorInvalidData422.js.map
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentsDetailsErrorInvalidData422.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentsDetailsErrorInvalidData422.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"paymentsDetailsErrorInvalidData422.js","sourceRoot":"","sources":["../../../../../src/__mocks__/checkout/paymentsDetailsErrorInvalidData422.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,MAAM,CAAC,IAAM,mBAAmB,GAAG;IAC/B,UAAU,EAAE,GAAG;IACf,SAAS,EAAE,KAAK;IAChB,OAAO,EAAE,qBAAqB;IAC9B,SAAS,EAAE,YAAY;CAC1B,CAAC"}
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentsDetailsSuccess.d.ts
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentsDetailsSuccess.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const paymentDetailsSuccess: string;
|
||||
10
dist/lib-esm/src/__mocks__/checkout/paymentsDetailsSuccess.js
vendored
Normal file
10
dist/lib-esm/src/__mocks__/checkout/paymentsDetailsSuccess.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/* tslint:disable */
|
||||
export var paymentDetailsSuccess = JSON.stringify({
|
||||
pspReference: "8515232733321252",
|
||||
resultCode: "Authorised",
|
||||
additionalData: {
|
||||
liabilityShift: "true",
|
||||
refusalReasonRaw: "AUTHORISED",
|
||||
},
|
||||
});
|
||||
//# sourceMappingURL=paymentsDetailsSuccess.js.map
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentsDetailsSuccess.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentsDetailsSuccess.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"paymentsDetailsSuccess.js","sourceRoot":"","sources":["../../../../../src/__mocks__/checkout/paymentsDetailsSuccess.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,MAAM,CAAC,IAAM,qBAAqB,GAAG,IAAI,CAAC,SAAS,CAAC;IAChD,YAAY,EAAE,kBAAkB;IAChC,UAAU,EAAE,YAAY;IACxB,cAAc,EAAE;QACZ,cAAc,EAAE,MAAM;QACtB,gBAAgB,EAAE,YAAY;KACjC;CACJ,CAAC,CAAC"}
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentsErrorInvalidData422.d.ts
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentsErrorInvalidData422.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const paymentsError: string;
|
||||
8
dist/lib-esm/src/__mocks__/checkout/paymentsErrorInvalidData422.js
vendored
Normal file
8
dist/lib-esm/src/__mocks__/checkout/paymentsErrorInvalidData422.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/* tslint:disable */
|
||||
export var paymentsError = JSON.stringify({
|
||||
statusCode: 422,
|
||||
errorCode: "130",
|
||||
statusMessage: "Reference Missing",
|
||||
errorType: "validation",
|
||||
});
|
||||
//# sourceMappingURL=paymentsErrorInvalidData422.js.map
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentsErrorInvalidData422.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentsErrorInvalidData422.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"paymentsErrorInvalidData422.js","sourceRoot":"","sources":["../../../../../src/__mocks__/checkout/paymentsErrorInvalidData422.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,MAAM,CAAC,IAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC;IACxC,UAAU,EAAE,GAAG;IACf,SAAS,EAAE,KAAK;IAChB,aAAa,EAAE,mBAAmB;IAClC,SAAS,EAAE,YAAY;CAC1B,CAAC,CAAC"}
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentsResultErrorInvalidDataPayload422.d.ts
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentsResultErrorInvalidDataPayload422.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const paymentsResultError: string;
|
||||
8
dist/lib-esm/src/__mocks__/checkout/paymentsResultErrorInvalidDataPayload422.js
vendored
Normal file
8
dist/lib-esm/src/__mocks__/checkout/paymentsResultErrorInvalidDataPayload422.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/* tslint:disable */
|
||||
export var paymentsResultError = JSON.stringify({
|
||||
statusCode: 422,
|
||||
errorCode: "14_018",
|
||||
message: "Invalid payload provided",
|
||||
errorType: "validation",
|
||||
});
|
||||
//# sourceMappingURL=paymentsResultErrorInvalidDataPayload422.js.map
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentsResultErrorInvalidDataPayload422.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentsResultErrorInvalidDataPayload422.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"paymentsResultErrorInvalidDataPayload422.js","sourceRoot":"","sources":["../../../../../src/__mocks__/checkout/paymentsResultErrorInvalidDataPayload422.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,MAAM,CAAC,IAAM,mBAAmB,GAAG,IAAI,CAAC,SAAS,CAAC;IAC9C,UAAU,EAAE,GAAG;IACf,SAAS,EAAE,QAAQ;IACnB,OAAO,EAAE,0BAA0B;IACnC,SAAS,EAAE,YAAY;CAC1B,CAAC,CAAC"}
|
||||
14
dist/lib-esm/src/__mocks__/checkout/paymentsResultMultibancoSuccess.d.ts
vendored
Normal file
14
dist/lib-esm/src/__mocks__/checkout/paymentsResultMultibancoSuccess.d.ts
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
export declare const paymentsResultMultibancoSuccess: {
|
||||
additionalData: {
|
||||
"cvcResult": string;
|
||||
"avsResult": string;
|
||||
"comprafacil.deadline": string;
|
||||
"comprafacil.reference": string;
|
||||
"paymentMethod": string;
|
||||
"paymentMethodVariant": string;
|
||||
"comprafacil.entity": string;
|
||||
"comprafacil.amount": string;
|
||||
};
|
||||
pspReference: string;
|
||||
resultCode: string;
|
||||
};
|
||||
16
dist/lib-esm/src/__mocks__/checkout/paymentsResultMultibancoSuccess.js
vendored
Normal file
16
dist/lib-esm/src/__mocks__/checkout/paymentsResultMultibancoSuccess.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
/* tslint:disable */
|
||||
export var paymentsResultMultibancoSuccess = {
|
||||
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",
|
||||
};
|
||||
//# sourceMappingURL=paymentsResultMultibancoSuccess.js.map
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentsResultMultibancoSuccess.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentsResultMultibancoSuccess.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"paymentsResultMultibancoSuccess.js","sourceRoot":"","sources":["../../../../../src/__mocks__/checkout/paymentsResultMultibancoSuccess.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,MAAM,CAAC,IAAM,+BAA+B,GAAG;IAC3C,cAAc,EAAE;QACZ,WAAW,EAAE,GAAG;QAChB,WAAW,EAAE,GAAG;QAChB,sBAAsB,EAAE,GAAG;QAC3B,uBAAuB,EAAE,aAAa;QACtC,eAAe,EAAE,YAAY;QAC7B,sBAAsB,EAAE,YAAY;QACpC,oBAAoB,EAAE,OAAO;QAC7B,oBAAoB,EAAE,QAAQ;KACjC;IACD,YAAY,EAAE,kBAAkB;IAChC,UAAU,EAAE,UAAU;CACzB,CAAC"}
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentsResultSucess.d.ts
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentsResultSucess.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const paymentsResultSuccess: string;
|
||||
6
dist/lib-esm/src/__mocks__/checkout/paymentsResultSucess.js
vendored
Normal file
6
dist/lib-esm/src/__mocks__/checkout/paymentsResultSucess.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/* tslint:disable */
|
||||
export var paymentsResultSuccess = JSON.stringify({
|
||||
pspReference: "8535253563623704",
|
||||
resultCode: "Authorised",
|
||||
});
|
||||
//# sourceMappingURL=paymentsResultSucess.js.map
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentsResultSucess.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentsResultSucess.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"paymentsResultSucess.js","sourceRoot":"","sources":["../../../../../src/__mocks__/checkout/paymentsResultSucess.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,MAAM,CAAC,IAAM,qBAAqB,GAAG,IAAI,CAAC,SAAS,CAAC;IAChD,YAAY,EAAE,kBAAkB;IAChC,UAAU,EAAE,YAAY;CAC3B,CAAC,CAAC"}
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentsSuccess.d.ts
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentsSuccess.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const paymentsSuccess: string;
|
||||
99
dist/lib-esm/src/__mocks__/checkout/paymentsSuccess.js
vendored
Normal file
99
dist/lib-esm/src/__mocks__/checkout/paymentsSuccess.js
vendored
Normal file
@@ -0,0 +1,99 @@
|
||||
/* tslint:disable */
|
||||
export var 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",
|
||||
});
|
||||
//# sourceMappingURL=paymentsSuccess.js.map
|
||||
1
dist/lib-esm/src/__mocks__/checkout/paymentsSuccess.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkout/paymentsSuccess.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"paymentsSuccess.js","sourceRoot":"","sources":["../../../../../src/__mocks__/checkout/paymentsSuccess.ts"],"names":[],"mappings":"AAAA,oBAAoB;AACpB,MAAM,CAAC,IAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC;IAC1C,cAAc,EAAE;QACZ,UAAU,EAAE,QAAQ;QACpB,eAAe,EAAE,OAAO;QACxB,OAAO,EAAE,QAAQ;QACjB,WAAW,EAAE,MAAM;QACnB,iBAAiB,EAAE,OAAO;QAC1B,SAAS,EAAE,SAAS;QACpB,KAAK,EAAE,kBAAkB;QACzB,iBAAiB,EAAE,MAAM;QACzB,kBAAkB,EAAE,IAAI;KAC3B;IACD,WAAW,EAAE;QACT,YAAY,EAAE,CAAC;QACf,OAAO,EAAE;YACL;gBACI,gBAAgB,EAAE;oBACd,YAAY,EAAE,CAAC;oBACf,OAAO,EAAE,CAAC;oBACV,IAAI,EAAE,gBAAgB;iBACzB;aACJ;YACD;gBACI,gBAAgB,EAAE;oBACd,YAAY,EAAE,CAAC;oBACf,OAAO,EAAE,CAAC;oBACV,IAAI,EAAE,oBAAoB;iBAC7B;aACJ;YACD;gBACI,gBAAgB,EAAE;oBACd,YAAY,EAAE,CAAC;oBACf,OAAO,EAAE,CAAC;oBACV,IAAI,EAAE,iBAAiB;iBAC1B;aACJ;YACD;gBACI,gBAAgB,EAAE;oBACd,YAAY,EAAE,CAAC;oBACf,OAAO,EAAE,CAAC;oBACV,IAAI,EAAE,uBAAuB;iBAChC;aACJ;YACD;gBACI,gBAAgB,EAAE;oBACd,YAAY,EAAE,CAAC;oBACf,OAAO,EAAE,EAAE;oBACX,IAAI,EAAE,gBAAgB;iBACzB;aACJ;YACD;gBACI,gBAAgB,EAAE;oBACd,YAAY,EAAE,CAAC;oBACf,OAAO,EAAE,EAAE;oBACX,IAAI,EAAE,wBAAwB;iBACjC;aACJ;YACD;gBACI,gBAAgB,EAAE;oBACd,YAAY,EAAE,CAAC;oBACf,OAAO,EAAE,EAAE;oBACX,IAAI,EAAE,iBAAiB;iBAC1B;aACJ;YACD;gBACI,gBAAgB,EAAE;oBACd,YAAY,EAAE,CAAC;oBACf,OAAO,EAAE,EAAE;oBACX,IAAI,EAAE,0BAA0B;iBACnC;aACJ;YACD;gBACI,gBAAgB,EAAE;oBACd,YAAY,EAAE,CAAC;oBACf,OAAO,EAAE,EAAE;oBACX,IAAI,EAAE,qBAAqB;iBAC9B;aACJ;YACD;gBACI,gBAAgB,EAAE;oBACd,YAAY,EAAE,CAAC;oBACf,OAAO,EAAE,EAAE;oBACX,IAAI,EAAE,kBAAkB;iBAC3B;aACJ;YACD;gBACI,gBAAgB,EAAE;oBACd,YAAY,EAAE,CAAC;oBACf,OAAO,EAAE,EAAE;oBACX,IAAI,EAAE,oBAAoB;iBAC7B;aACJ;SACJ;KACJ;IACD,YAAY,EAAE,kBAAkB;IAChC,UAAU,EAAE,YAAY;CAC3B,CAAC,CAAC"}
|
||||
1
dist/lib-esm/src/__mocks__/checkoutUtility/originkeysSuccess.d.ts
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkoutUtility/originkeysSuccess.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const originKeysSuccess: string;
|
||||
8
dist/lib-esm/src/__mocks__/checkoutUtility/originkeysSuccess.js
vendored
Normal file
8
dist/lib-esm/src/__mocks__/checkoutUtility/originkeysSuccess.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export var 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",
|
||||
},
|
||||
});
|
||||
//# sourceMappingURL=originkeysSuccess.js.map
|
||||
1
dist/lib-esm/src/__mocks__/checkoutUtility/originkeysSuccess.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/checkoutUtility/originkeysSuccess.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"originkeysSuccess.js","sourceRoot":"","sources":["../../../../../src/__mocks__/checkoutUtility/originkeysSuccess.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,CAAC;IAC5C,UAAU,EAAE;QACR,8BAA8B,EAAE,4GAA4G;QAC5I,8BAA8B,EAAE,4GAA4G;QAC5I,8BAA8B,EAAE,4GAA4G;KAC/I;CACJ,CAAC,CAAC"}
|
||||
36
dist/lib-esm/src/__mocks__/notification/authorisationTrue.json
vendored
Normal file
36
dist/lib-esm/src/__mocks__/notification/authorisationTrue.json
vendored
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
25
dist/lib-esm/src/__mocks__/notification/captureFalse.json
vendored
Normal file
25
dist/lib-esm/src/__mocks__/notification/captureFalse.json
vendored
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
25
dist/lib-esm/src/__mocks__/notification/captureTrue.json
vendored
Normal file
25
dist/lib-esm/src/__mocks__/notification/captureTrue.json
vendored
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
25
dist/lib-esm/src/__mocks__/notification/refundFalse.json
vendored
Normal file
25
dist/lib-esm/src/__mocks__/notification/refundFalse.json
vendored
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
25
dist/lib-esm/src/__mocks__/notification/refundTrue.json
vendored
Normal file
25
dist/lib-esm/src/__mocks__/notification/refundTrue.json
vendored
Normal file
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
3
dist/lib-esm/src/__mocks__/recurring/disableSuccess.d.ts
vendored
Normal file
3
dist/lib-esm/src/__mocks__/recurring/disableSuccess.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare const disableSuccess: {
|
||||
response: string;
|
||||
};
|
||||
4
dist/lib-esm/src/__mocks__/recurring/disableSuccess.js
vendored
Normal file
4
dist/lib-esm/src/__mocks__/recurring/disableSuccess.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export var disableSuccess = {
|
||||
response: "[detail-successfully-disabled]",
|
||||
};
|
||||
//# sourceMappingURL=disableSuccess.js.map
|
||||
1
dist/lib-esm/src/__mocks__/recurring/disableSuccess.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/recurring/disableSuccess.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"disableSuccess.js","sourceRoot":"","sources":["../../../../../src/__mocks__/recurring/disableSuccess.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,cAAc,GAAG;IAC1B,QAAQ,EAAE,gCAAgC;CAC7C,CAAC"}
|
||||
51
dist/lib-esm/src/__mocks__/recurring/listRecurringDetailsSuccess.d.ts
vendored
Normal file
51
dist/lib-esm/src/__mocks__/recurring/listRecurringDetailsSuccess.d.ts
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
export declare const listRecurringDetailsSuccess: {
|
||||
creationDate: string;
|
||||
details: ({
|
||||
additionalData: {
|
||||
cardBin: string;
|
||||
};
|
||||
alias: string;
|
||||
aliasType: string;
|
||||
card: {
|
||||
expiryMonth: string;
|
||||
expiryYear: string;
|
||||
holderName: string;
|
||||
number: string;
|
||||
};
|
||||
contractTypes: string[];
|
||||
creationDate: string;
|
||||
firstPspReference: string;
|
||||
paymentMethodVariant: string;
|
||||
recurringDetailReference: string;
|
||||
variant: string;
|
||||
billingAddress?: undefined;
|
||||
tokenDetails?: undefined;
|
||||
} | {
|
||||
billingAddress: {
|
||||
city: string;
|
||||
country: string;
|
||||
houseNumberOrName: string;
|
||||
postalCode: string;
|
||||
stateOrProvince: string;
|
||||
street: string;
|
||||
};
|
||||
contractTypes: string[];
|
||||
creationDate: string;
|
||||
firstPspReference: string;
|
||||
paymentMethodVariant: string;
|
||||
recurringDetailReference: string;
|
||||
tokenDetails: {
|
||||
tokenData: {
|
||||
"BillingAgreementId": string;
|
||||
"EmailId": string;
|
||||
"PayPal.PayerId": string;
|
||||
};
|
||||
tokenDataType: string;
|
||||
};
|
||||
variant: string;
|
||||
additionalData?: undefined;
|
||||
alias?: undefined;
|
||||
aliasType?: undefined;
|
||||
card?: undefined;
|
||||
})[];
|
||||
};
|
||||
53
dist/lib-esm/src/__mocks__/recurring/listRecurringDetailsSuccess.js
vendored
Normal file
53
dist/lib-esm/src/__mocks__/recurring/listRecurringDetailsSuccess.js
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
export var listRecurringDetailsSuccess = {
|
||||
creationDate: "2017-03-01T10:53:11.000",
|
||||
details: [
|
||||
{
|
||||
additionalData: {
|
||||
cardBin: "411111",
|
||||
},
|
||||
alias: "cardAlias",
|
||||
aliasType: "Default",
|
||||
card: {
|
||||
expiryMonth: "8",
|
||||
expiryYear: "2018",
|
||||
holderName: "Holder",
|
||||
number: "1111",
|
||||
},
|
||||
contractTypes: [
|
||||
"ONECLICK",
|
||||
],
|
||||
creationDate: "2017-03-01T10:53:11.000",
|
||||
firstPspReference: "8524888762135795",
|
||||
paymentMethodVariant: "visa",
|
||||
recurringDetailReference: "recurringReference",
|
||||
variant: "visa",
|
||||
},
|
||||
{
|
||||
billingAddress: {
|
||||
city: "City",
|
||||
country: "NL",
|
||||
houseNumberOrName: "1",
|
||||
postalCode: "2312aa",
|
||||
stateOrProvince: "NA",
|
||||
street: "Street",
|
||||
},
|
||||
contractTypes: [
|
||||
"RECURRING",
|
||||
],
|
||||
creationDate: "2017-03-01T10:53:11.000",
|
||||
firstPspReference: "8515076181707110",
|
||||
paymentMethodVariant: "paypal",
|
||||
recurringDetailReference: "8315076181982020",
|
||||
tokenDetails: {
|
||||
tokenData: {
|
||||
"BillingAgreementId": "B-7MA42752FE774625C",
|
||||
"EmailId": "tedtest@test.nl",
|
||||
"PayPal.PayerId": "H95EPL8B2KFE6",
|
||||
},
|
||||
tokenDataType: "PayPal",
|
||||
},
|
||||
variant: "paypal",
|
||||
},
|
||||
],
|
||||
};
|
||||
//# sourceMappingURL=listRecurringDetailsSuccess.js.map
|
||||
1
dist/lib-esm/src/__mocks__/recurring/listRecurringDetailsSuccess.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/recurring/listRecurringDetailsSuccess.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"listRecurringDetailsSuccess.js","sourceRoot":"","sources":["../../../../../src/__mocks__/recurring/listRecurringDetailsSuccess.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,2BAA2B,GAAG;IACvC,YAAY,EAAE,yBAAyB;IACvC,OAAO,EAAE;QACL;YACI,cAAc,EAAE;gBACZ,OAAO,EAAE,QAAQ;aACpB;YACD,KAAK,EAAE,WAAW;YAClB,SAAS,EAAE,SAAS;YACpB,IAAI,EAAE;gBACF,WAAW,EAAE,GAAG;gBAChB,UAAU,EAAE,MAAM;gBAClB,UAAU,EAAE,QAAQ;gBACpB,MAAM,EAAE,MAAM;aACjB;YACD,aAAa,EAAE;gBACX,UAAU;aACb;YACD,YAAY,EAAE,yBAAyB;YACvC,iBAAiB,EAAE,kBAAkB;YACrC,oBAAoB,EAAE,MAAM;YAC5B,wBAAwB,EAAE,oBAAoB;YAC9C,OAAO,EAAE,MAAM;SAClB;QACD;YACI,cAAc,EAAE;gBACZ,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,IAAI;gBACb,iBAAiB,EAAE,GAAG;gBACtB,UAAU,EAAE,QAAQ;gBACpB,eAAe,EAAE,IAAI;gBACrB,MAAM,EAAE,QAAQ;aACnB;YACD,aAAa,EAAE;gBACX,WAAW;aACd;YACD,YAAY,EAAE,yBAAyB;YACvC,iBAAiB,EAAE,kBAAkB;YACrC,oBAAoB,EAAE,QAAQ;YAC9B,wBAAwB,EAAE,kBAAkB;YAC5C,YAAY,EAAE;gBACV,SAAS,EAAE;oBACP,oBAAoB,EAAE,qBAAqB;oBAC3C,SAAS,EAAE,iBAAiB;oBAC5B,gBAAgB,EAAE,eAAe;iBACpC;gBACD,aAAa,EAAE,QAAQ;aAC1B;YACD,OAAO,EAAE,QAAQ;SACpB;KACJ;CACJ,CAAC"}
|
||||
1
dist/lib-esm/src/__mocks__/terminalApi/async.d.ts
vendored
Normal file
1
dist/lib-esm/src/__mocks__/terminalApi/async.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const asyncRes = "ok";
|
||||
2
dist/lib-esm/src/__mocks__/terminalApi/async.js
vendored
Normal file
2
dist/lib-esm/src/__mocks__/terminalApi/async.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export var asyncRes = "ok";
|
||||
//# sourceMappingURL=async.js.map
|
||||
1
dist/lib-esm/src/__mocks__/terminalApi/async.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/terminalApi/async.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"async.js","sourceRoot":"","sources":["../../../../../src/__mocks__/terminalApi/async.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,QAAQ,GAAG,IAAI,CAAC"}
|
||||
3
dist/lib-esm/src/__mocks__/terminalApi/local.d.ts
vendored
Normal file
3
dist/lib-esm/src/__mocks__/terminalApi/local.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export declare const localSecuredRes: string;
|
||||
export declare const localEncRes: string;
|
||||
export declare const wrongEncRes: string;
|
||||
372
dist/lib-esm/src/__mocks__/terminalApi/local.js
vendored
Normal file
372
dist/lib-esm/src/__mocks__/terminalApi/local.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/lib-esm/src/__mocks__/terminalApi/local.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/terminalApi/local.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/lib-esm/src/__mocks__/terminalApi/sync.d.ts
vendored
Normal file
1
dist/lib-esm/src/__mocks__/terminalApi/sync.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare const syncRes: string;
|
||||
320
dist/lib-esm/src/__mocks__/terminalApi/sync.js
vendored
Normal file
320
dist/lib-esm/src/__mocks__/terminalApi/sync.js
vendored
Normal file
@@ -0,0 +1,320 @@
|
||||
export var 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\n cator=false&expiryYear=2025&acquirerAccountCode=TestPmmAcquirerAccount&alias=M900978995070104&posOrigin\n alAmountCurrency=EUR&giftcardIndicator=false&authorisedAmountValue=100&pspReference=8515565295894301&pa\n ymentMethodVariant=mc&cardHolderName=N%2fA&refusalReasonRaw=APPROVED&authorisationMid=1000&expiryDate=1\n 2%2f2025&applicationPreferredName=MCC%20351%20v1%202&acquirerCode=TestPmmAcquirer&txtime=10%3a19%3a51&i\n so8601TxDate=2019-04-29T09%3a19%3a51.0000000%2b0000&cardType=mc&posOriginalAmountValue=100&offline=fals\n e&aliasType=Default&txdate=29-04-2019&paymentMethod=mc&cvcResult=0%20Unknown&avsResult=0%20Unknown&mid=\n 1000&merchantReference=003&transactionReferenceNumber=8515565295894301&expiryMonth=12&cardSummary=3511&\n posTotalAmountValue=100&posAuthAmountCurrency=EUR&cardHolderVerificationMethodResults=3F0300&authCode=1\n 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",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
//# sourceMappingURL=sync.js.map
|
||||
1
dist/lib-esm/src/__mocks__/terminalApi/sync.js.map
vendored
Normal file
1
dist/lib-esm/src/__mocks__/terminalApi/sync.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../../../src/__mocks__/terminalApi/sync.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC;IAClC,iBAAiB,EAAE;QACf,aAAa,EAAE;YACX,eAAe,EAAE,SAAS;YAC1B,YAAY,EAAE,SAAS;YACvB,WAAW,EAAE,UAAU;YACvB,KAAK,EAAE,oBAAoB;YAC3B,eAAe,EAAE,KAAK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,EAAE,MAAM;yBACrB;qBACJ;oBACD,qBAAqB,EAAE,MAAM;iBAChC;aACJ;YACD,QAAQ,EAAE;gBACN,kBAAkB,EAAE,kpCASiF;gBACrG,MAAM,EAAE,SAAS;aACpB;YACD,QAAQ,EAAE;gBACN,iBAAiB,EAAE;oBACf,SAAS,EAAE,0BAA0B;oBACrC,aAAa,EAAE,KAAK;iBACvB;aACJ;SACJ;KACJ;CACJ,CAAC,CAAC"}
|
||||
1
dist/lib-esm/src/__tests__/binLookup.spec.d.ts
vendored
Normal file
1
dist/lib-esm/src/__tests__/binLookup.spec.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
177
dist/lib-esm/src/__tests__/binLookup.spec.js
vendored
Normal file
177
dist/lib-esm/src/__tests__/binLookup.spec.js
vendored
Normal file
@@ -0,0 +1,177 @@
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
/*
|
||||
* ######
|
||||
* ######
|
||||
* ############ ####( ###### #####. ###### ############ ############
|
||||
* ############# #####( ###### #####. ###### ############# #############
|
||||
* ###### #####( ###### #####. ###### ##### ###### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ######
|
||||
* ############# ############# ############# ############# ##### ######
|
||||
* ############ ############ ############# ############ ##### ######
|
||||
* ######
|
||||
* #############
|
||||
* ############
|
||||
*
|
||||
* 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 nock from "nock";
|
||||
import { createMockClientFromResponse } from "../__mocks__/base";
|
||||
import BinLookup from "../services/binLookup";
|
||||
import Client from "../client";
|
||||
import HttpClientException from "../httpClient/httpClientException";
|
||||
var 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
|
||||
};
|
||||
var client;
|
||||
var binLookup;
|
||||
var scope;
|
||||
beforeEach(function () {
|
||||
client = createMockClientFromResponse();
|
||||
binLookup = new BinLookup(client);
|
||||
scope = nock("" + client.config.endpoint + Client.BIN_LOOKUP_PAL_SUFFIX + Client.BIN_LOOKUP_API_VERSION);
|
||||
});
|
||||
describe("Bin Lookup", function () {
|
||||
it("should succeed on get 3ds availability", function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var threeDSAvailabilityRequest, response;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
threeDSAvailabilityRequest = {
|
||||
merchantAccount: "MOCK_MERCHANT_ACCOUNT",
|
||||
brands: ["randomBrand"],
|
||||
cardNumber: "4111111111111111"
|
||||
};
|
||||
scope.post("/get3dsAvailability")
|
||||
.reply(200, threeDSAvailabilitySuccess);
|
||||
return [4 /*yield*/, binLookup.get3dsAvailability(threeDSAvailabilityRequest)];
|
||||
case 1:
|
||||
response = _a.sent();
|
||||
expect(response).toEqual(threeDSAvailabilitySuccess);
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
it("should fail with invalid merchant", function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var threeDSAvailabilityRequest, e_1;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
threeDSAvailabilityRequest = {
|
||||
merchantAccount: undefined,
|
||||
cardNumber: "4111111111111",
|
||||
brands: []
|
||||
};
|
||||
scope.post("/get3dsAvailability")
|
||||
.reply(403, JSON.stringify({ status: 403, message: "fail", errorCode: "171" }));
|
||||
_a.label = 1;
|
||||
case 1:
|
||||
_a.trys.push([1, 3, , 4]);
|
||||
return [4 /*yield*/, binLookup.get3dsAvailability(threeDSAvailabilityRequest)];
|
||||
case 2:
|
||||
_a.sent();
|
||||
fail("Expected request to fail");
|
||||
return [3 /*break*/, 4];
|
||||
case 3:
|
||||
e_1 = _a.sent();
|
||||
expect(e_1 instanceof HttpClientException).toBeTruthy();
|
||||
return [3 /*break*/, 4];
|
||||
case 4: return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
it("should succeed on get cost estimate", function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var response, costEstimateRequest, expected;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
response = {
|
||||
cardBin: { summary: "1111" },
|
||||
resultCode: "Unsupported",
|
||||
surchargeType: "ZERO"
|
||||
};
|
||||
costEstimateRequest = {
|
||||
amount: { currency: "EUR", value: 1000 },
|
||||
assumptions: {
|
||||
assumeLevel3Data: true,
|
||||
assume3DSecureAuthenticated: true
|
||||
},
|
||||
cardNumber: "411111111111",
|
||||
merchantAccount: "MOCKED_MERCHANT_ACC",
|
||||
merchantDetails: {
|
||||
countryCode: "NL",
|
||||
mcc: "7411",
|
||||
enrolledIn3DSecure: true
|
||||
},
|
||||
shopperInteraction: "Ecommerce"
|
||||
};
|
||||
scope.post("/getCostEstimate")
|
||||
.reply(200, response);
|
||||
return [4 /*yield*/, binLookup.getCostEstimate(costEstimateRequest)];
|
||||
case 1:
|
||||
expected = _a.sent();
|
||||
expect(response).toEqual(expected);
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=binLookup.spec.js.map
|
||||
1
dist/lib-esm/src/__tests__/binLookup.spec.js.map
vendored
Normal file
1
dist/lib-esm/src/__tests__/binLookup.spec.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"binLookup.spec.js","sourceRoot":"","sources":["../../../../src/__tests__/binLookup.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,4BAA4B,EAAC,MAAM,mBAAmB,CAAC;AAC/D,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAC9C,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,mBAAmB,MAAM,mCAAmC,CAAC;AAEpE,IAAM,0BAA0B,GAAG;IAC/B,YAAY,EAAE,CAAC;YACX,KAAK,EAAE,MAAM;YACb,iBAAiB,EAAE,YAAY;YAC/B,SAAS,EAAE,sfAAsf;SACpgB,CAAC;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CAAC,CAAC,CAAC"}
|
||||
1
dist/lib-esm/src/__tests__/checkServerIdentity.spec.d.ts
vendored
Normal file
1
dist/lib-esm/src/__tests__/checkServerIdentity.spec.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
77
dist/lib-esm/src/__tests__/checkServerIdentity.spec.js
vendored
Normal file
77
dist/lib-esm/src/__tests__/checkServerIdentity.spec.js
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
/* eslint-disable @typescript-eslint/camelcase */
|
||||
import checkServerIdentity from "../helpers/checkServerIdentity";
|
||||
var createMockedCertificate = function (CN) { return ({
|
||||
subjectaltname: "Adyen B.V",
|
||||
infoAccess: { mock: ["any"] },
|
||||
subject: {
|
||||
C: "AB",
|
||||
ST: "AB",
|
||||
L: "City",
|
||||
O: "Company Name",
|
||||
OU: "Mocked Value",
|
||||
CN: CN,
|
||||
},
|
||||
issuer: {
|
||||
C: "AB",
|
||||
ST: "AB",
|
||||
L: "City",
|
||||
O: "Issuer Name",
|
||||
OU: "Issuer",
|
||||
CN: "Issuer CN",
|
||||
},
|
||||
modulus: "ABC123",
|
||||
exponent: "01010101",
|
||||
valid_from: "Nov 19 15:03:32 2018 GMT",
|
||||
valid_to: "Nov 11 15:03:32 2048 GMT",
|
||||
fingerprint: "MOCKED_FINGERPRINT",
|
||||
ext_key_usage: ["1.2.3.4.5.6.7.8"],
|
||||
serialNumber: "1000",
|
||||
raw: Buffer.from("test")
|
||||
}); };
|
||||
describe("Certificate Server Identiy", function () {
|
||||
test.each([
|
||||
["legacy-terminal-certificate", "live"],
|
||||
["legacy-terminal-certificate", "test"],
|
||||
["P400-3123123", "live"],
|
||||
["P400-3123123", "test"],
|
||||
["MODEL-SN", "live"],
|
||||
["MODEL-SN", "test"],
|
||||
])("it should be valid: %s.%s", function (prefix, environment) {
|
||||
var cn = prefix + "." + environment + ".terminal.adyen.com";
|
||||
var mockedCertificate = createMockedCertificate(cn);
|
||||
expect(checkServerIdentity("any", mockedCertificate)).toBeUndefined();
|
||||
});
|
||||
test.each([
|
||||
"INVALID.adyen.com",
|
||||
"terminal.INVALID.com",
|
||||
"terminal.adyen.org",
|
||||
"google.com",
|
||||
"",
|
||||
])("it should fail because invalid domain: %s", function (domain) {
|
||||
var cn = "P400-123123.live." + domain;
|
||||
var mockedCertificate = createMockedCertificate(cn);
|
||||
expect(checkServerIdentity("any", mockedCertificate) instanceof Error).toBeTruthy();
|
||||
});
|
||||
test.each([
|
||||
"liive", "teest", "lve", "tst", "ANY", "invalid",
|
||||
])("it should fail because invalid environment: %s", function (environment) {
|
||||
var cn = "P400-123123." + environment + ".terminal.adyen.com";
|
||||
var mockedCertificate = createMockedCertificate(cn);
|
||||
expect(checkServerIdentity("any", mockedCertificate) instanceof Error).toBeTruthy();
|
||||
});
|
||||
test.each([
|
||||
"legacyy-terminal-certificate", "legacy-terminaal-certificate",
|
||||
"legacy-terminal-certificatee", "P400-", "-123123", "P400--123123", "P400123123",
|
||||
"ANY-ANY-ANY", "ANY", ""
|
||||
])("it should fail because invalid prefix: %s", function (prefix) {
|
||||
var cn = prefix + ".test.terminal.adyen.com";
|
||||
var mockedCertificate = createMockedCertificate(cn);
|
||||
expect(checkServerIdentity("any", mockedCertificate) instanceof Error).toBeTruthy();
|
||||
});
|
||||
it("should fail if no first part on CN", function () {
|
||||
var cn = "live.terminal.adyen.com";
|
||||
var mockedCertificate = createMockedCertificate(cn);
|
||||
expect(checkServerIdentity("any", mockedCertificate) instanceof Error).toBeTruthy();
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=checkServerIdentity.spec.js.map
|
||||
1
dist/lib-esm/src/__tests__/checkServerIdentity.spec.js.map
vendored
Normal file
1
dist/lib-esm/src/__tests__/checkServerIdentity.spec.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"checkServerIdentity.spec.js","sourceRoot":"","sources":["../../../../src/__tests__/checkServerIdentity.spec.ts"],"names":[],"mappings":"AAAA,iDAAiD;AAEjD,O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,CAAC,YAAY,KAAK,CAAC,CAAC,UAAU,EAAE,CAAC;IACxF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE;QACrC,IAAM,EAAE,GAAG,yBAAyB,CAAC;QACrC,IAAM,iBAAiB,GAAG,uBAAuB,CAAC,EAAE,CAAC,CAAC;QACtD,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,iBAAiB,CAAC,YAAY,KAAK,CAAC,CAAC,UAAU,EAAE,CAAC;IACxF,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
||||
1
dist/lib-esm/src/__tests__/checkout.spec.d.ts
vendored
Normal file
1
dist/lib-esm/src/__tests__/checkout.spec.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export declare function createPaymentsCheckoutRequest(): ICheckout.PaymentRequest;
|
||||
312
dist/lib-esm/src/__tests__/checkout.spec.js
vendored
Normal file
312
dist/lib-esm/src/__tests__/checkout.spec.js
vendored
Normal file
@@ -0,0 +1,312 @@
|
||||
/*
|
||||
* ######
|
||||
* ######
|
||||
* ############ ####( ###### #####. ###### ############ ############
|
||||
* ############# #####( ###### #####. ###### ############# #############
|
||||
* ###### #####( ###### #####. ###### ##### ###### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
|
||||
* ###### ###### #####( ###### #####. ###### ##### ##### ######
|
||||
* ############# ############# ############# ############# ##### ######
|
||||
* ############ ############ ############# ############ ##### ######
|
||||
* ######
|
||||
* #############
|
||||
* ############
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
import nock from "nock";
|
||||
import { createMockClientFromResponse } from "../__mocks__/base";
|
||||
import { paymentMethodsSuccess } from "../__mocks__/checkout/paymentMethodsSuccess";
|
||||
import { paymentsSuccess } from "../__mocks__/checkout/paymentsSuccess";
|
||||
import { paymentDetailsSuccess } from "../__mocks__/checkout/paymentsDetailsSuccess";
|
||||
import { paymentSessionSuccess } from "../__mocks__/checkout/paymentSessionSucess";
|
||||
import { paymentsResultMultibancoSuccess } from "../__mocks__/checkout/paymentsResultMultibancoSuccess";
|
||||
import { paymentsResultSuccess } from "../__mocks__/checkout/paymentsResultSucess";
|
||||
import Client from "../client";
|
||||
import Checkout from "../services/checkout";
|
||||
import HttpClientException from "../httpClient/httpClientException";
|
||||
var merchantAccount = "MagentoMerchantTest";
|
||||
var reference = "Your order number";
|
||||
function createAmountObject(currency, value) {
|
||||
return {
|
||||
currency: currency,
|
||||
value: value,
|
||||
};
|
||||
}
|
||||
function createPaymentsDetailsRequest() {
|
||||
return {
|
||||
details: {
|
||||
MD: "mdValue",
|
||||
PaRes: "paResValue",
|
||||
},
|
||||
paymentData: "Ab02b4c0!BQABAgCJN1wRZuGJmq8dMncmypvknj9s7l5Tj...",
|
||||
};
|
||||
}
|
||||
export function createPaymentsCheckoutRequest() {
|
||||
var paymentMethodDetails = {
|
||||
cvc: "737",
|
||||
expiryMonth: "10",
|
||||
expiryYear: "2018",
|
||||
holderName: "John Smith",
|
||||
number: "4111111111111111",
|
||||
type: "scheme",
|
||||
};
|
||||
return {
|
||||
amount: createAmountObject("USD", 1000),
|
||||
merchantAccount: merchantAccount,
|
||||
paymentMethod: paymentMethodDetails,
|
||||
reference: reference,
|
||||
returnUrl: "https://your-company.com/...",
|
||||
};
|
||||
}
|
||||
function createPaymentSessionRequest() {
|
||||
return {
|
||||
amount: createAmountObject("USD", 1000),
|
||||
countryCode: "NL",
|
||||
merchantAccount: merchantAccount,
|
||||
reference: reference,
|
||||
returnUrl: "https://your-company.com/...",
|
||||
};
|
||||
}
|
||||
var client;
|
||||
var checkout;
|
||||
var scope;
|
||||
beforeEach(function () {
|
||||
client = createMockClientFromResponse();
|
||||
scope = nock(client.config.checkoutEndpoint + "/" + Client.CHECKOUT_API_VERSION);
|
||||
checkout = new Checkout(client);
|
||||
});
|
||||
describe("Checkout", function () {
|
||||
it("should make a payment", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var paymentsRequest, paymentsResponse;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
scope.post("/payments")
|
||||
.reply(200, paymentsSuccess);
|
||||
paymentsRequest = createPaymentsCheckoutRequest();
|
||||
return [4 /*yield*/, checkout.payments(paymentsRequest)];
|
||||
case 1:
|
||||
paymentsResponse = _a.sent();
|
||||
expect(paymentsResponse.pspReference).toEqual("8535296650153317");
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); });
|
||||
it("should return correct Exception", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var paymentsRequest, e_1;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
_a.trys.push([0, 2, , 3]);
|
||||
scope.post("/payments")
|
||||
.reply(401);
|
||||
paymentsRequest = createPaymentsCheckoutRequest();
|
||||
return [4 /*yield*/, checkout.payments(paymentsRequest)];
|
||||
case 1:
|
||||
_a.sent();
|
||||
return [3 /*break*/, 3];
|
||||
case 2:
|
||||
e_1 = _a.sent();
|
||||
expect(e_1 instanceof HttpClientException).toBeTruthy();
|
||||
return [3 /*break*/, 3];
|
||||
case 3: return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); });
|
||||
it("should have valid payment methods", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var paymentMethodsRequest, paymentMethodsResponse;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
paymentMethodsRequest = { merchantAccount: "MagentoMerchantTest" };
|
||||
scope.post("/paymentMethods")
|
||||
.reply(200, paymentMethodsSuccess);
|
||||
return [4 /*yield*/, checkout.paymentMethods(paymentMethodsRequest)];
|
||||
case 1:
|
||||
paymentMethodsResponse = _a.sent();
|
||||
if (paymentMethodsResponse && paymentMethodsResponse.paymentMethods) {
|
||||
expect(paymentMethodsResponse.paymentMethods.length).toEqual(65);
|
||||
expect(paymentMethodsResponse.paymentMethods[0].name).toEqual("AliPay");
|
||||
}
|
||||
else {
|
||||
fail();
|
||||
}
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); });
|
||||
it("should have valid payment link", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var amount, expiresAt, paymentLinkRequest, paymentLinkSuccess, paymentSuccessLinkResponse;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
amount = createAmountObject("BRL", 1000);
|
||||
expiresAt = "2019-12-17T10:05:29Z";
|
||||
paymentLinkRequest = {
|
||||
allowedPaymentMethods: ["scheme", "boletobancario"],
|
||||
amount: amount,
|
||||
countryCode: "BR",
|
||||
merchantAccount: merchantAccount,
|
||||
shopperReference: "shopperReference",
|
||||
shopperEmail: "test@email.com",
|
||||
shopperLocale: "pt_BR",
|
||||
billingAddress: {
|
||||
street: "Roque Petroni Jr",
|
||||
postalCode: "59000060",
|
||||
city: "São Paulo",
|
||||
houseNumberOrName: "999",
|
||||
country: "BR",
|
||||
stateOrProvince: "SP"
|
||||
},
|
||||
deliveryAddress: {
|
||||
street: "Roque Petroni Jr",
|
||||
postalCode: "59000060",
|
||||
city: "São Paulo",
|
||||
houseNumberOrName: "999",
|
||||
country: "BR",
|
||||
stateOrProvince: "SP"
|
||||
},
|
||||
expiresAt: expiresAt,
|
||||
reference: reference
|
||||
};
|
||||
paymentLinkSuccess = {
|
||||
amount: amount,
|
||||
expiresAt: expiresAt,
|
||||
reference: reference,
|
||||
url: "paymentLinkResponse.url"
|
||||
};
|
||||
scope.post("/paymentLinks").reply(200, paymentLinkSuccess);
|
||||
return [4 /*yield*/, checkout.paymentLinks(paymentLinkRequest)];
|
||||
case 1:
|
||||
paymentSuccessLinkResponse = _a.sent();
|
||||
expect(paymentLinkSuccess).toEqual(paymentSuccessLinkResponse);
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); });
|
||||
it("should have payment details", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var paymentsResponse;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
scope.post("/payments/details")
|
||||
.reply(200, paymentDetailsSuccess);
|
||||
return [4 /*yield*/, checkout.paymentsDetails(createPaymentsDetailsRequest())];
|
||||
case 1:
|
||||
paymentsResponse = _a.sent();
|
||||
expect(paymentsResponse.resultCode).toEqual("Authorised");
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); });
|
||||
it("should have payment session success", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var paymentSessionRequest, paymentSessionResponse;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
scope.post("/paymentSession")
|
||||
.reply(200, paymentSessionSuccess);
|
||||
paymentSessionRequest = createPaymentSessionRequest();
|
||||
return [4 /*yield*/, checkout.paymentSession(paymentSessionRequest)];
|
||||
case 1:
|
||||
paymentSessionResponse = _a.sent();
|
||||
expect(paymentSessionResponse.paymentSession).not.toBeUndefined();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); });
|
||||
it("should have payments result", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var paymentResultRequest, paymentResultResponse;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
scope.post("/payments/result")
|
||||
.reply(200, paymentsResultSuccess);
|
||||
paymentResultRequest = {
|
||||
payload: "This is a test payload",
|
||||
};
|
||||
return [4 /*yield*/, checkout.paymentResult(paymentResultRequest)];
|
||||
case 1:
|
||||
paymentResultResponse = _a.sent();
|
||||
expect(paymentResultResponse.resultCode).toEqual("Authorised");
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); });
|
||||
it("should have missing identifier on live", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
return __generator(this, function (_a) {
|
||||
client.setEnvironment("LIVE");
|
||||
try {
|
||||
new Checkout(client);
|
||||
fail();
|
||||
}
|
||||
catch (e) {
|
||||
expect(e.message).toEqual("Please provide your unique live url prefix on the setEnvironment() call on the Client or provide checkoutEndpoint in your config object.");
|
||||
}
|
||||
return [2 /*return*/];
|
||||
});
|
||||
}); });
|
||||
it("should succeed on multibanco payment", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var paymentsRequest, paymentsResponse;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
scope.post("/payments")
|
||||
.reply(200, paymentsResultMultibancoSuccess);
|
||||
paymentsRequest = createPaymentsCheckoutRequest();
|
||||
return [4 /*yield*/, checkout.payments(paymentsRequest)];
|
||||
case 1:
|
||||
paymentsResponse = _a.sent();
|
||||
expect(paymentsResponse.pspReference).toEqual("8111111111111111");
|
||||
if (paymentsResponse.additionalData) {
|
||||
expect(paymentsResponse.additionalData["comprafacil.amount"]).toEqual("101.01");
|
||||
expect(paymentsResponse.additionalData["comprafacil.deadline"]).toEqual("3");
|
||||
expect(paymentsResponse.additionalData["comprafacil.entity"]).toEqual("12345");
|
||||
}
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); });
|
||||
});
|
||||
//# sourceMappingURL=checkout.spec.js.map
|
||||
1
dist/lib-esm/src/__tests__/checkout.spec.js.map
vendored
Normal file
1
dist/lib-esm/src/__tests__/checkout.spec.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/lib-esm/src/__tests__/checkoutUtility.spec.d.ts
vendored
Normal file
1
dist/lib-esm/src/__tests__/checkoutUtility.spec.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
89
dist/lib-esm/src/__tests__/checkoutUtility.spec.js
vendored
Normal file
89
dist/lib-esm/src/__tests__/checkoutUtility.spec.js
vendored
Normal file
@@ -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.
|
||||
*/
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
import nock from "nock";
|
||||
import { createMockClientFromResponse } from "../__mocks__/base";
|
||||
import { originKeysSuccess } from "../__mocks__/checkoutUtility/originkeysSuccess";
|
||||
import CheckoutUtility from "../services/checkoutUtility";
|
||||
import Client from "../client";
|
||||
describe("Checkout Utility", function () {
|
||||
it("should get origin keys", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var client, checkoutUtility, originKeysRequest, originKeysResponse;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
client = createMockClientFromResponse();
|
||||
checkoutUtility = new CheckoutUtility(client);
|
||||
originKeysRequest = {
|
||||
originDomains: ["www.test.com", "https://www.your-domain2.com"],
|
||||
};
|
||||
nock("" + client.config.checkoutEndpoint)
|
||||
.post("/" + Client.CHECKOUT_UTILITY_API_VERSION + "/originKeys")
|
||||
.reply(200, originKeysSuccess);
|
||||
return [4 /*yield*/, checkoutUtility.originKeys(originKeysRequest)];
|
||||
case 1:
|
||||
originKeysResponse = _a.sent();
|
||||
if (originKeysResponse.originKeys) {
|
||||
return [2 /*return*/, expect(originKeysResponse.originKeys["https://www.your-domain1.com"])
|
||||
.toEqual("pub.v2.7814286629520534.aHR0cHM6Ly93d3cueW91ci1kb21haW4xLmNvbQ.UEwIBmW9-c_uXo5wSEr2w8Hz8hVIpujXPHjpcEse3xI")];
|
||||
}
|
||||
fail("Error: originKeysResponse.originKeys is empty");
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); });
|
||||
});
|
||||
//# sourceMappingURL=checkoutUtility.spec.js.map
|
||||
1
dist/lib-esm/src/__tests__/checkoutUtility.spec.js.map
vendored
Normal file
1
dist/lib-esm/src/__tests__/checkoutUtility.spec.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"checkoutUtility.spec.js","sourceRoot":"","sources":["../../../../src/__tests__/checkoutUtility.spec.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAC,iBAAiB,EAAC,MAAM,gDAAgD,CAAC;AACjF,OAAO,eAAe,MAAM,6BAA6B,CAAC;AAC1D,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,QAAQ,CAAC,kBAAkB,EAAE;IACzB,EAAE,CAAC,wBAAwB,EAAE;;;;;oBACnB,MAAM,GAAG,4BAA4B,EAAE,CAAC;oBACxC,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC;oBAC9C,iBAAiB,GAA4C;wBAC/D,aAAa,EAAE,CAAC,cAAc,EAAE,8BAA8B,CAAC;qBAClE,CAAC;oBAEF,IAAI,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,gBAAkB,CAAC;yBACpC,IAAI,CAAC,MAAI,MAAM,CAAC,4BAA4B,gBAAa,CAAC;yBAC1D,KAAK,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;oBAER,qBAAM,eAAe,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAA;;oBAAxE,kBAAkB,GAAG,SAAmD;oBAC9E,IAAI,kBAAkB,CAAC,UAAU,EAAE;wBAC/B,sBAAO,MAAM,CAAC,kBAAkB,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC;iCACvE,OAAO,CAAC,4GAA4G,CAAC,EAAC;qBAC9H;oBACD,IAAI,CAAC,+CAA+C,CAAC,CAAC;;;;SACzD,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
||||
1
dist/lib-esm/src/__tests__/hmacValidator.spec.d.ts
vendored
Normal file
1
dist/lib-esm/src/__tests__/hmacValidator.spec.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
64
dist/lib-esm/src/__tests__/hmacValidator.spec.js
vendored
Normal file
64
dist/lib-esm/src/__tests__/hmacValidator.spec.js
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
var _a;
|
||||
import HmacValidator from "../utils/hmacValidator";
|
||||
import { ApiConstants } from "../constants/apiConstants";
|
||||
var key = "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00";
|
||||
var expectedSign = "ipnxGCaUZ4l8TUW75a71/ghd2Fe5ffvX0pV4TLTntIc=";
|
||||
var notificationRequestItem = {
|
||||
pspReference: "pspReference",
|
||||
originalReference: "originalReference",
|
||||
merchantAccountCode: "merchantAccount",
|
||||
merchantReference: "reference",
|
||||
amount: { currency: "EUR", value: 1000 },
|
||||
eventCode: "EVENT",
|
||||
eventDate: new Date("01-01-1970"),
|
||||
paymentMethod: "VISA",
|
||||
reason: "reason",
|
||||
success: "true",
|
||||
additionalData: (_a = {}, _a[ApiConstants.HMAC_SIGNATURE] = expectedSign, _a),
|
||||
};
|
||||
describe("HMAC Validator", function () {
|
||||
var hmacValidator;
|
||||
beforeEach(function () {
|
||||
hmacValidator = new HmacValidator();
|
||||
});
|
||||
it("should get correct data", function () {
|
||||
var dataToSign = hmacValidator.getDataToSign({ merchantAccount: "ACC", currencyCode: "EUR" });
|
||||
expect(dataToSign).toEqual("currencyCode:merchantAccount:EUR:ACC");
|
||||
});
|
||||
it("should get correct data with escaped characters", function () {
|
||||
var dataToSign = hmacValidator.getDataToSign({ currencyCode: "EUR", merchantAccount: "ACC:\\", sessionValidity: "2019-09-21T11:45:24.637Z" });
|
||||
expect(dataToSign).toEqual("currencyCode:merchantAccount:sessionValidity:EUR:ACC\\:\\\\:2019-09-21T11\\:45\\:24.637Z");
|
||||
});
|
||||
it("should encrypt correctly", function () {
|
||||
var data = "countryCode:currencyCode:merchantAccount:merchantReference:paymentAmount:sessionValidity:skinCode:NL:EUR:MagentoMerchantTest2:TEST-PAYMENT-2017-02-01-14\\:02\\:05:199:2017-02-02T14\\:02\\:05+01\\:00:PKz2KML1";
|
||||
var encrypted = hmacValidator.calculateHmac(data, "DFB1EB5485895CFA84146406857104ABB4CBCABDC8AAF103A624C8F6A3EAAB00");
|
||||
expect(encrypted).toEqual("34oR8T1whkQWTv9P+SzKyp8zhusf9n0dpqrm9nsqSJs=");
|
||||
});
|
||||
it("should get correct data to sign", function () {
|
||||
var data = hmacValidator.getDataToSign(notificationRequestItem);
|
||||
expect(data).toEqual("pspReference:originalReference:merchantAccount:reference:1000:EUR:EVENT:true");
|
||||
});
|
||||
it("should have valid hmac", function () {
|
||||
var encrypted = hmacValidator.calculateHmac(notificationRequestItem, key);
|
||||
expect(expectedSign).toEqual(encrypted);
|
||||
expect(hmacValidator.validateHMAC(notificationRequestItem, key)).toBeTruthy();
|
||||
});
|
||||
it("should have invalid hmac", function () {
|
||||
var _a;
|
||||
var invalidNotification = __assign(__assign({}, notificationRequestItem), { additionalData: (_a = {}, _a[ApiConstants.HMAC_SIGNATURE] = "notValidSign", _a) });
|
||||
var result = hmacValidator.validateHMAC(invalidNotification, key);
|
||||
expect(result).toBeFalsy();
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=hmacValidator.spec.js.map
|
||||
1
dist/lib-esm/src/__tests__/hmacValidator.spec.js.map
vendored
Normal file
1
dist/lib-esm/src/__tests__/hmacValidator.spec.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"hmacValidator.spec.js","sourceRoot":"","sources":["../../../../src/__tests__/hmacValidator.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,aAAa,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAEvD,IAAM,GAAG,GAAG,kEAAkE,CAAC;AAC/E,IAAM,YAAY,GAAG,8CAA8C,CAAC;AACpE,IAAM,uBAAuB,GAA4B;IACrD,YAAY,EAAE,cAAc;IAC5B,iBAAiB,EAAE,mBAAmB;IACtC,mBAAmB,EAAE,iBAAiB;IACtC,iBAAiB,EAAE,WAAW;IAC9B,MAAM,EAAE,EAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAC;IACtC,SAAS,EAAE,OAAO;IAClB,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC;IACjC,aAAa,EAAE,MAAM;IACrB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,MAAM;IACf,cAAc,YAAI,GAAC,YAAY,CAAC,cAAc,IAAG,YAAY,KAAE;CAClE,CAAC;AAE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CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QACxC,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,uBAAuB,EAAE,GAAG,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;IAClF,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE;;QAC3B,IAAM,mBAAmB,yBAClB,uBAAuB,KAC1B,cAAc,YAAI,GAAC,YAAY,CAAC,cAAc,IAAG,cAAc,QAClE,CAAC;QACF,IAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC;QACpE,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;IAC/B,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
||||
1
dist/lib-esm/src/__tests__/httpClient.spec.d.ts
vendored
Normal file
1
dist/lib-esm/src/__tests__/httpClient.spec.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
107
dist/lib-esm/src/__tests__/httpClient.spec.js
vendored
Normal file
107
dist/lib-esm/src/__tests__/httpClient.spec.js
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
||||
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
||||
return cooked;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
import nock from "nock";
|
||||
import Client from "../client";
|
||||
import Checkout from "../services/checkout";
|
||||
import ApiException from "../services/exception/apiException";
|
||||
import { createPaymentsCheckoutRequest } from "./checkout.spec";
|
||||
import HttpClientException from "../httpClient/httpClientException";
|
||||
beforeEach(function () {
|
||||
nock.cleanAll();
|
||||
});
|
||||
var getResponse = function (_a, cb) {
|
||||
var apiKey = _a.apiKey, environment = _a.environment;
|
||||
return __awaiter(void 0, void 0, void 0, function () {
|
||||
var client, checkout, scope, _b, errorMessageContains, errorMessageEquals, errorType, ErrorException, e_1;
|
||||
return __generator(this, function (_c) {
|
||||
switch (_c.label) {
|
||||
case 0:
|
||||
client = new Client({ apiKey: apiKey, environment: environment });
|
||||
checkout = new Checkout(client);
|
||||
scope = nock(client.config.checkoutEndpoint + "/" + Client.CHECKOUT_API_VERSION)
|
||||
.post("/payments");
|
||||
_b = cb(scope), errorMessageContains = _b.errorMessageContains, errorMessageEquals = _b.errorMessageEquals, errorType = _b.errorType;
|
||||
ErrorException = errorType === "ApiException" ? ApiException : HttpClientException;
|
||||
_c.label = 1;
|
||||
case 1:
|
||||
_c.trys.push([1, 3, , 4]);
|
||||
return [4 /*yield*/, checkout.payments(createPaymentsCheckoutRequest())];
|
||||
case 2:
|
||||
_c.sent();
|
||||
fail("request should fail");
|
||||
return [3 /*break*/, 4];
|
||||
case 3:
|
||||
e_1 = _c.sent();
|
||||
expect(e_1 instanceof ErrorException).toBeTruthy();
|
||||
if (errorMessageEquals)
|
||||
expect(e_1.message).toEqual(errorMessageEquals);
|
||||
if (errorMessageContains)
|
||||
expect(e_1.message.toLowerCase()).toContain(errorMessageContains);
|
||||
return [3 /*break*/, 4];
|
||||
case 4: return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
describe("HTTP Client", function () {
|
||||
var _this = this;
|
||||
it.each(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n apiKey | environment | withError | args | errorType | contains | equals \n ", " | ", " | ", " | ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", " | ", " | ", " | ", "\n "], ["\n apiKey | environment | withError | args | errorType | contains | equals \n ", " | ", " | ", " | ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", " | ", " | ", " | ", "\n "])), "", "TEST", true, ["mocked_error_response"], "ApiException", "x-api-key", "", "MOCKED_API_KEY", "TEST", true, ["some_error"], "ApiException", "", "some_error", "API_KEY", "TEST", false, [401, { status: 401, message: "Invalid Request", errorCode: "171", errorType: "validationError" }], "HttpClientException", "", "HTTP Exception: 401. null: Invalid Request", "API_KEY", "TEST", false, [401, {}], "HttpClientException", "", "HTTP Exception: 401. null", "API_KEY", "TEST", false, [401, "fail"], "HttpClientException", "", "HTTP Exception: 401. null")("Should return $errorType, $contains, $equals", function (_a) {
|
||||
var apiKey = _a.apiKey, environment = _a.environment, withError = _a.withError, args = _a.args, errorType = _a.errorType, contains = _a.contains, equals = _a.equals;
|
||||
return __awaiter(_this, void 0, void 0, function () {
|
||||
return __generator(this, function (_b) {
|
||||
switch (_b.label) {
|
||||
case 0: return [4 /*yield*/, getResponse({ apiKey: apiKey, environment: environment }, function (scope) {
|
||||
if (withError)
|
||||
scope.replyWithError(args[0]);
|
||||
else
|
||||
scope.reply(args[0], args[1]);
|
||||
return { errorType: errorType, errorMessageContains: contains, errorMessageEquals: equals };
|
||||
})];
|
||||
case 1:
|
||||
_b.sent();
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
var templateObject_1;
|
||||
//# sourceMappingURL=httpClient.spec.js.map
|
||||
1
dist/lib-esm/src/__tests__/httpClient.spec.js.map
vendored
Normal file
1
dist/lib-esm/src/__tests__/httpClient.spec.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"httpClient.spec.js","sourceRoot":"","sources":["../../../../src/__tests__/httpClient.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;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,EAAO,CAAC,GAAG,EAAE,MAAM,CAAC,EAA0F,qBAAqB,EAAM,EAAE,EAAe,2BAA2B,EACtO,8CAA8C,EAAE,UAAO,EAAqE;YAAnE,kBAAM,EAAE,4BAAW,EAAE,wBAAS,EAAE,cAAI,EAAE,wBAAS,EAAE,sBAAQ,EAAE,kBAAM;;;;4BACxH,qBAAM,WAAW,CAAC,EAAE,MAAM,QAAA,EAAE,WAAW,aAAA,EAAE,EAAE,UAAC,KAAK;4BAC7C,IAAI,SAAS;gCAAE,KAAK,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;;gCACxC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;4BAEnC,OAAO,EAAE,SAAS,WAAA,EAAE,oBAAoB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC;wBACrF,CAAC,CAAC,EAAA;;wBALF,SAKE,CAAC;;;;;KACN,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
||||
1
dist/lib-esm/src/__tests__/notification.spec.d.ts
vendored
Normal file
1
dist/lib-esm/src/__tests__/notification.spec.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
81
dist/lib-esm/src/__tests__/notification.spec.js
vendored
Normal file
81
dist/lib-esm/src/__tests__/notification.spec.js
vendored
Normal file
@@ -0,0 +1,81 @@
|
||||
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 } from "../typings/notification";
|
||||
describe("Notification Test", function () {
|
||||
it("should return authorisation success", function () {
|
||||
var notificationRequest = new NotificationRequest(authorisationTrue);
|
||||
expect(notificationRequest.notificationItems).toHaveLength(1);
|
||||
if (notificationRequest.notificationItems) {
|
||||
var notificationRequestItem = notificationRequest.notificationItems[0];
|
||||
expect(NotificationEnum.EVENT_CODE_AUTHORISATION).toEqual(notificationRequestItem.eventCode);
|
||||
expect(notificationRequestItem.success === "true").toBeTruthy();
|
||||
expect(notificationRequestItem.pspReference).toEqual("123456789");
|
||||
}
|
||||
else {
|
||||
fail();
|
||||
}
|
||||
});
|
||||
it("should return capture success", function () {
|
||||
var notificationRequest = new NotificationRequest(captureTrue);
|
||||
expect(notificationRequest.notificationItems).toHaveLength(1);
|
||||
if (notificationRequest.notificationItems) {
|
||||
var notificationRequestItem = notificationRequest.notificationItems[0];
|
||||
expect(NotificationEnum.EVENT_CODE_CAPTURE).toEqual(notificationRequestItem.eventCode);
|
||||
expect(notificationRequestItem.success === "true").toBeTruthy();
|
||||
expect(notificationRequestItem.pspReference).toEqual("PSP_REFERENCE");
|
||||
expect(notificationRequestItem.originalReference).toEqual("ORIGINAL_PSP");
|
||||
}
|
||||
else {
|
||||
fail();
|
||||
}
|
||||
});
|
||||
it("should return capture fail", function () {
|
||||
var notificationRequest = new NotificationRequest(captureFalse);
|
||||
expect(notificationRequest.notificationItems).toHaveLength(1);
|
||||
if (notificationRequest.notificationItems) {
|
||||
var notificationRequestItem = notificationRequest.notificationItems[0];
|
||||
expect(NotificationEnum.EVENT_CODE_CAPTURE).toEqual(notificationRequestItem.eventCode);
|
||||
expect(notificationRequestItem.success === "true").toBeFalsy();
|
||||
expect(notificationRequestItem.pspReference).toEqual("PSP_REFERENCE");
|
||||
expect(notificationRequestItem.originalReference).toEqual("ORIGINAL_PSP");
|
||||
}
|
||||
else {
|
||||
fail();
|
||||
}
|
||||
});
|
||||
it("should return refund success", function () {
|
||||
var notificationRequest = new NotificationRequest(refundTrue);
|
||||
expect(notificationRequest.notificationItems).toHaveLength(1);
|
||||
if (notificationRequest.notificationItems) {
|
||||
var notificationRequestItem = notificationRequest.notificationItems[0];
|
||||
expect(NotificationEnum.EVENT_CODE_REFUND).toEqual(notificationRequestItem.eventCode);
|
||||
expect(notificationRequestItem.success === "true").toBeTruthy();
|
||||
expect(notificationRequestItem.pspReference).toEqual("PSP_REFERENCE");
|
||||
expect(notificationRequestItem.originalReference).toEqual("ORIGINAL_PSP");
|
||||
expect(notificationRequestItem.eventDate).toBeDefined();
|
||||
}
|
||||
else {
|
||||
fail();
|
||||
}
|
||||
});
|
||||
it("should return refund fail", function () {
|
||||
var notificationRequest = new NotificationRequest(refundFalse);
|
||||
expect(notificationRequest.notificationItems).toHaveLength(1);
|
||||
if (notificationRequest.notificationItems) {
|
||||
var notificationRequestItem = notificationRequest.notificationItems[0];
|
||||
expect(NotificationEnum.EVENT_CODE_REFUND).toEqual(notificationRequestItem.eventCode);
|
||||
expect(notificationRequestItem.success === "true").toBeFalsy();
|
||||
expect(notificationRequestItem.pspReference).toEqual("PSP_REFERENCE");
|
||||
expect(notificationRequestItem.originalReference).toEqual("ORIGINAL_PSP");
|
||||
expect(notificationRequestItem.eventDate).toBeDefined();
|
||||
}
|
||||
else {
|
||||
fail();
|
||||
}
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=notification.spec.js.map
|
||||
1
dist/lib-esm/src/__tests__/notification.spec.js.map
vendored
Normal file
1
dist/lib-esm/src/__tests__/notification.spec.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"notification.spec.js","sourceRoot":"","sources":["../../../../src/__tests__/notification.spec.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,WAAW,MAAM,4CAA4C,CAAC;AACrE,OAAO,YAAY,MAAM,6CAA6C,CAAC;AACvE,OAAO,UAAU,MAAM,2CAA2C,CAAC;AACnE,OAAO,WAAW,MAAM,4CAA4C,CAAC;AACrE,OAAO,mBAAmB,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAe,gBAAgB,EAA0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out.spec.d.ts
vendored
Normal file
1
dist/lib-esm/src/__tests__/payout.spec.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
235
dist/lib-esm/src/__tests__/payout.spec.js
vendored
Normal file
235
dist/lib-esm/src/__tests__/payout.spec.js
vendored
Normal file
@@ -0,0 +1,235 @@
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
import nock from "nock";
|
||||
import { createMockClientFromResponse } from "../__mocks__/base";
|
||||
import Payout from "../services/payout";
|
||||
import Client from "../client";
|
||||
import { ApiConstants } from "../constants/apiConstants";
|
||||
var storeDetailAndSubmitThirdParty = JSON.stringify({
|
||||
additionalData: {
|
||||
fraudResultType: "GREEN",
|
||||
fraudManualReview: "false",
|
||||
},
|
||||
pspReference: "8515131751004933",
|
||||
resultCode: "[payout-submit-received]"
|
||||
});
|
||||
var storeDetail = JSON.stringify({
|
||||
pspReference: "8515136787207087",
|
||||
recurringDetailReference: "8415088571022720",
|
||||
resultCode: "Success"
|
||||
});
|
||||
var amountAndReference = {
|
||||
amount: {
|
||||
value: 1000,
|
||||
currency: "USD"
|
||||
},
|
||||
reference: "randomReference",
|
||||
};
|
||||
var defaultData = {
|
||||
dateOfBirth: (new Date()).toISOString(),
|
||||
nationality: "NL",
|
||||
shopperEmail: "johndoe@email.com",
|
||||
shopperReference: "shopperReference",
|
||||
};
|
||||
var mockStoreDetailRequest = function (merchantAccount) { return (__assign(__assign({}, defaultData), { entityType: "NaturalPerson", recurring: {
|
||||
contract: "ONECLICK"
|
||||
}, merchantAccount: merchantAccount })); };
|
||||
var mockSubmitRequest = function (merchantAccount) { return (__assign(__assign(__assign({ selectedRecurringDetailReference: "LATEST", recurring: {
|
||||
contract: "ONECLICK"
|
||||
} }, defaultData), amountAndReference), { merchantAccount: merchantAccount })); };
|
||||
var mockStoreDetailAndSubmitRequest = function (merchantAccount) { return (__assign(__assign({}, amountAndReference), (mockStoreDetailRequest(merchantAccount)))); };
|
||||
var mockPayoutRequest = function (merchantAccount) { return (__assign(__assign(__assign({}, amountAndReference), defaultData), { card: {
|
||||
expiryMonth: "10",
|
||||
expiryYear: "2020",
|
||||
holderName: "John Smith",
|
||||
number: "4111111111111111",
|
||||
}, merchantAccount: merchantAccount })); };
|
||||
var client;
|
||||
var payout;
|
||||
var scope;
|
||||
beforeEach(function () {
|
||||
client = createMockClientFromResponse();
|
||||
scope = nock(client.config.endpoint + "/pal/servlet/Payout/" + Client.API_VERSION);
|
||||
payout = new Payout(client);
|
||||
});
|
||||
describe("PayoutTest", function () {
|
||||
it("should succeed on store detail and submit third party", function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var request, result;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
request = mockStoreDetailAndSubmitRequest("" + client.config.merchantAccount);
|
||||
scope.post("/storeDetail").reply(200, storeDetailAndSubmitThirdParty);
|
||||
return [4 /*yield*/, payout.storeDetail(request)];
|
||||
case 1:
|
||||
result = _a.sent();
|
||||
expect(result.resultCode).toEqual("[payout-submit-received]");
|
||||
expect(result.pspReference).toEqual("8515131751004933");
|
||||
if (result.additionalData) {
|
||||
expect(result.additionalData[ApiConstants.FRAUD_RESULT_TYPE]).toEqual("GREEN");
|
||||
expect(result.additionalData[ApiConstants.FRAUD_MANUAL_REVIEW]).toEqual("false");
|
||||
}
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
it("should succeed on store detail", function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var request, result;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
scope.post("/storeDetail").reply(200, storeDetail);
|
||||
request = mockStoreDetailRequest("MOCKED_MERCHANT_ACC");
|
||||
return [4 /*yield*/, payout.storeDetail(request)];
|
||||
case 1:
|
||||
result = _a.sent();
|
||||
expect("Success").toEqual(result.resultCode);
|
||||
expect("8515136787207087").toEqual(result.pspReference);
|
||||
expect("8415088571022720").toEqual(result.recurringDetailReference);
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
it("should succeed on confirm third party", function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var request, result;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
scope.post("/confirmThirdParty")
|
||||
.reply(200, {
|
||||
pspReference: "8815131762537886",
|
||||
response: "[payout-confirm-received]"
|
||||
});
|
||||
request = {
|
||||
merchantAccount: "MOCKED_MERCHANT_ACCOUNT",
|
||||
originalReference: "reference"
|
||||
};
|
||||
return [4 /*yield*/, payout.confirmThirdParty(request)];
|
||||
case 1:
|
||||
result = _a.sent();
|
||||
expect(result.response).toEqual("[payout-confirm-received]");
|
||||
expect(result.pspReference).toEqual("8815131762537886");
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
it("should succeed on submit third party", function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var request, result;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
scope.post("/submitThirdParty").reply(200, storeDetailAndSubmitThirdParty);
|
||||
request = mockSubmitRequest("MOCKED_MERCHANT_ACC");
|
||||
return [4 /*yield*/, payout.submitThirdparty(request)];
|
||||
case 1:
|
||||
result = _a.sent();
|
||||
expect(result.resultCode).toEqual("[payout-submit-received]");
|
||||
expect(result.pspReference).toEqual("8515131751004933");
|
||||
if (result.additionalData) {
|
||||
expect(result.additionalData[ApiConstants.FRAUD_RESULT_TYPE]).toEqual("GREEN");
|
||||
expect(result.additionalData[ApiConstants.FRAUD_MANUAL_REVIEW]).toEqual("false");
|
||||
}
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
it("should succeed on decline third party", function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var request, result;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
scope.post("/storeDetailAndSubmitThirdParty").reply(200, {
|
||||
pspReference: "8815131762537886",
|
||||
response: "[payout-confirm-received]"
|
||||
});
|
||||
request = {
|
||||
merchantAccount: "MOCKED_MERCHANT_ACC",
|
||||
originalReference: "reference"
|
||||
};
|
||||
return [4 /*yield*/, payout.declineThirdParty(request)];
|
||||
case 1:
|
||||
result = _a.sent();
|
||||
expect(result.response).toEqual("[payout-confirm-received]");
|
||||
expect(result.pspReference).toEqual("8815131762537886");
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
it("should succeed on payout", function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var request, result;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
scope.post("/payout").reply(200, {
|
||||
pspReference: "8815131762537886",
|
||||
resultCode: "Received",
|
||||
});
|
||||
request = mockPayoutRequest("MOCKED_MERCHANT_ACC");
|
||||
return [4 /*yield*/, payout.payout(request)];
|
||||
case 1:
|
||||
result = _a.sent();
|
||||
expect(result.resultCode).toEqual("Received");
|
||||
expect(result.pspReference).toEqual("8815131762537886");
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=payout.spec.js.map
|
||||
1
dist/lib-esm/src/__tests__/payout.spec.js.map
vendored
Normal file
1
dist/lib-esm/src/__tests__/payout.spec.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"payout.spec.js","sourceRoot":"","sources":["../../../../src/__tests__/payout.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,4BAA4B,EAAC,MAAM,mBAAmB,CAAC;AAC/D,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,OAAO,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAEvD,IAAM,8BAA8B,GAAG,IAAI,CAAC,SAAS,CAAC;IAClD,cAAc,EAAE;QACZ,eAAe,EAAE,OAAO;QACxB,iBAAiB,EAAE,OAAO;KAE7B;IACD,YAAY,EAAE,kBAAkB;IAChC,UAAU,EAAE,0BAA0B;CACzC,CAAC,CAAC;AAEH,IAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC;IAC/B,YAAY,EAAE,kBAAkB;IAChC,wBAAwB,EAAE,kBAAkB;IAC5C,UAAU,EAAE,SAAS;CACxB,CAAC,CAAC;AAGH,IAAM,kBAAkB,GAAG;IACvB,MAAM,EAAE;QACJ,KAAK,EAAE,IAAI;QACX,QAAQ,EAAE,KAAK;KAClB;IACD,SAAS,EAAE,iBAAiB;CAC/B,CAAC;AAEF,IAAM,WAAW,GAAG;IAChB,WAAW,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE;IACvC,WAAW,EAAE,IAAI;IACjB,YAAY,EAAE,mBAAmB;IACjC,gBAAgB,EAAE,kBAAkB;CACvC,CAAC;AAEF,IAAM,sBAAsB,GAAG,UAAC,eAAuB,IAAkC,OAAA,uBAClF,WAAW,KACd,UAAU,EAAE,eAAe,EAC3B,SAAS,EAAE;QACP,QAAQ,EAAE,UAAU;K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D,YAAY,EAAE,kBAAkB;4BAChC,QAAQ,EAAE,2BAA2B;yBACxC,CAAC,CAAC;wBAEG,OAAO,GAA2B;4BACpC,eAAe,EAAE,qBAAqB;4BACtC,iBAAiB,EAAE,WAAW;yBACjC,CAAC;wBACa,qBAAM,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAA;;wBAAhD,MAAM,GAAG,SAAuC;wBAEtD,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;wBAC7D,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;;;;;KAC3D,CAAC,CAAC;IAEH,EAAE,CAAC,0BAA0B,EAAE;;;;;;wBAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE;4BAC7B,YAAY,EAAE,kBAAkB;4BAChC,UAAU,EAAE,UAAU;yBACzB,CAAC,CAAC;wBAEG,OAAO,GAAG,iBAAiB,CAAC,qBAAqB,CAAC,CAAC;wBAC1C,qBAAM,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAA;;wBAArC,MAAM,GAAG,SAA4B;wBAE3C,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;wBAC9C,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;;;;;KAC3D,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
||||
1
dist/lib-esm/src/__tests__/recurring.spec.d.ts
vendored
Normal file
1
dist/lib-esm/src/__tests__/recurring.spec.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
96
dist/lib-esm/src/__tests__/recurring.spec.js
vendored
Normal file
96
dist/lib-esm/src/__tests__/recurring.spec.js
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
import nock from "nock";
|
||||
import { createMockClientFromResponse } from "../__mocks__/base";
|
||||
import { disableSuccess } from "../__mocks__/recurring/disableSuccess";
|
||||
import { listRecurringDetailsSuccess } from "../__mocks__/recurring/listRecurringDetailsSuccess";
|
||||
import Recurring from "../services/recurring";
|
||||
import Client from "../client";
|
||||
var createRecurringDetailsRequest = function () {
|
||||
return {
|
||||
merchantAccount: "MerchantAccount",
|
||||
recurring: { contract: "ONECLICK" },
|
||||
shopperReference: "test-123",
|
||||
};
|
||||
};
|
||||
var client;
|
||||
var recurring;
|
||||
var scope;
|
||||
beforeEach(function () {
|
||||
client = createMockClientFromResponse();
|
||||
recurring = new Recurring(client);
|
||||
scope = nock(client.config.endpoint + "/pal/servlet/Recurring/" + Client.RECURRING_API_VERSION);
|
||||
});
|
||||
describe("Recurring", function () {
|
||||
it("should test have recurring details list", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var request, result;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
scope.post("/listRecurringDetails")
|
||||
.reply(200, listRecurringDetailsSuccess);
|
||||
request = createRecurringDetailsRequest();
|
||||
return [4 /*yield*/, recurring.listRecurringDetails(request)];
|
||||
case 1:
|
||||
result = _a.sent();
|
||||
expect(result).toEqual(listRecurringDetailsSuccess);
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); });
|
||||
it("should disable", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var request, result;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
scope.post("/disable")
|
||||
.reply(200, disableSuccess);
|
||||
request = {
|
||||
merchantAccount: "MerchantAccount",
|
||||
recurringDetailReference: "reference",
|
||||
shopperReference: "test-123",
|
||||
};
|
||||
return [4 /*yield*/, recurring.disable(request)];
|
||||
case 1:
|
||||
result = _a.sent();
|
||||
expect(result).toEqual(disableSuccess);
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); });
|
||||
});
|
||||
//# sourceMappingURL=recurring.spec.js.map
|
||||
1
dist/lib-esm/src/__tests__/recurring.spec.js.map
vendored
Normal file
1
dist/lib-esm/src/__tests__/recurring.spec.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"recurring.spec.js","sourceRoot":"","sources":["../../../../src/__tests__/recurring.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,4BAA4B,EAAC,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAC,cAAc,EAAC,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAC,2BAA2B,EAAC,MAAM,oDAAoD,CAAC;AAC/F,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAC9C,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,IAAM,6BAA6B,GAAG;IAClC,OAAO;QACH,eAAe,EAAE,iBAAiB;QAClC,SAAS,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE;QACnC,gBAAgB,EAAE,UAAU;KAC/B,CAAC;AACN,CAAC,CAAC;AAEF,IAAI,MAAc,CAAC;AACnB,IAAI,SAAoB,CAAC;AACzB,IAAI,KAAiB,CAAC;AAEtB,UAAU,CAAC;IACP,MAAM,GAAG,4BAA4B,EAAE,CAAC;IACxC,SAAS,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC;IAClC,KAAK,GAAG,IAAI,CAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,+BAA0B,MAAM,CAAC,qBAAuB,CAAC,CAAC;AACpG,CAAC,CAAC,CAAC;AACH,QAAQ,CAAC,WAAW,EAAE;IAClB,EAAE,CAAC,yCAAyC,EAAE;;;;;oBAC1C,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC;yBAC9B,KAAK,CAAC,GAAG,EAAE,2BAA2B,CAAC,CAAC;oBAEvC,OAAO,GAAG,6BAA6B,EAAE,CAAC;oBACjC,qBAAM,SAAS,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAA;;oBAAtD,MAAM,GAAG,SAA6C;oBAE5D,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC;;;;SACvD,CAAC,CAAC;IAEH,EAAE,CAAC,gBAAgB,EAAE;;;;;oBACjB,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;yBACjB,KAAK,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;oBAE1B,OAAO,GAA8B;wBACvC,eAAe,EAAE,iBAAiB;wBAClC,wBAAwB,EAAE,WAAW;wBACrC,gBAAgB,EAAE,UAAU;qBAC/B,CAAC;oBAEa,qBAAM,SAAS,CAAC,OAAO,CAAC,OAAO,CAAC,EAAA;;oBAAzC,MAAM,GAAG,SAAgC;oBAC/C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;;;;SAC1C,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
||||
1
dist/lib-esm/src/__tests__/terminalCloudAPI.spec.d.ts
vendored
Normal file
1
dist/lib-esm/src/__tests__/terminalCloudAPI.spec.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
84
dist/lib-esm/src/__tests__/terminalCloudAPI.spec.js
vendored
Normal file
84
dist/lib-esm/src/__tests__/terminalCloudAPI.spec.js
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
var __generator = (this && this.__generator) || function (thisArg, body) {
|
||||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
||||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
||||
function verb(n) { return function (v) { return step([n, v]); }; }
|
||||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
case 5: _.label++; y = op[1]; op = [0]; continue;
|
||||
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
||||
default:
|
||||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
||||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
||||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
||||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
||||
if (t[2]) _.ops.pop();
|
||||
_.trys.pop(); continue;
|
||||
}
|
||||
op = body.call(thisArg, _);
|
||||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
||||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
||||
}
|
||||
};
|
||||
import nock from "nock";
|
||||
import { createMockClientFromResponse, createTerminalAPIPaymentRequest } from "../__mocks__/base";
|
||||
import { asyncRes } from "../__mocks__/terminalApi/async";
|
||||
import { syncRes } from "../__mocks__/terminalApi/sync";
|
||||
import TerminalCloudAPI from "../services/terminalCloudAPI";
|
||||
import { Convert } from "../typings/terminal";
|
||||
var client;
|
||||
var terminalCloudAPI;
|
||||
var scope;
|
||||
beforeEach(function () {
|
||||
client = createMockClientFromResponse();
|
||||
terminalCloudAPI = new TerminalCloudAPI(client);
|
||||
scope = nock("" + client.config.terminalApiCloudEndpoint);
|
||||
});
|
||||
describe("Terminal Cloud API", function () {
|
||||
it("should make an async payment request", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var terminalAPIPaymentRequest, requestResponse;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
scope.post("/async").reply(200, asyncRes);
|
||||
terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();
|
||||
return [4 /*yield*/, terminalCloudAPI.async(terminalAPIPaymentRequest)];
|
||||
case 1:
|
||||
requestResponse = _a.sent();
|
||||
expect(requestResponse).toEqual("ok");
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); });
|
||||
it("should make a sync payment request", function () { return __awaiter(void 0, void 0, void 0, function () {
|
||||
var response, terminalAPIPaymentRequest, terminalAPIResponse;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
response = Convert.toTerminalApiResponse(syncRes);
|
||||
scope.post("/sync").reply(200, response);
|
||||
terminalAPIPaymentRequest = createTerminalAPIPaymentRequest();
|
||||
return [4 /*yield*/, terminalCloudAPI.sync(terminalAPIPaymentRequest)];
|
||||
case 1:
|
||||
terminalAPIResponse = _a.sent();
|
||||
expect(terminalAPIResponse).toEqual(response);
|
||||
return [2 /*return*/];
|
||||
}
|
||||
});
|
||||
}); });
|
||||
});
|
||||
//# sourceMappingURL=terminalCloudAPI.spec.js.map
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user