globalpayments-api 3.10.13 → 3.10.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +240 -236
- package/LICENSE.md +257 -257
- package/README.md +148 -148
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiAuthorizationRequestBuilder.js +21 -0
- package/lib/src/Builders/RequestBuilder/GpApi/GpApiAuthorizationRequestBuilder.js.map +1 -1
- package/lib/src/Gateways/GpApiConnector.d.ts +0 -6
- package/lib/src/Gateways/GpApiConnector.js +1 -41
- package/lib/src/Gateways/GpApiConnector.js.map +1 -1
- package/lib/src/Gateways/PorticoConnector.js +2 -6
- package/lib/src/Gateways/PorticoConnector.js.map +1 -1
- package/lib/src/Terminals/Builders/TerminalAuthBuilder.d.ts +1 -1
- package/lib/src/Terminals/Builders/TerminalAuthBuilder.js +11 -18
- package/lib/src/Terminals/Builders/TerminalAuthBuilder.js.map +1 -1
- package/lib/src/Terminals/Builders/TerminalManageBuilder.d.ts +1 -0
- package/lib/src/Terminals/Builders/TerminalManageBuilder.js +4 -0
- package/lib/src/Terminals/Builders/TerminalManageBuilder.js.map +1 -1
- package/lib/src/Terminals/UPA/Reponses/TransactionResponse.js +9 -2
- package/lib/src/Terminals/UPA/Reponses/TransactionResponse.js.map +1 -1
- package/lib/src/Terminals/UPA/UpaController.js +4 -1
- package/lib/src/Terminals/UPA/UpaController.js.map +1 -1
- package/lib/src/Utils/SdkVersion.d.ts +1 -0
- package/lib/src/Utils/SdkVersion.js +48 -0
- package/lib/src/Utils/SdkVersion.js.map +1 -0
- package/lib/src/Utils/index.d.ts +1 -0
- package/lib/src/Utils/index.js +1 -0
- package/lib/src/Utils/index.js.map +1 -1
- package/lib/test/Integration/Gateways/CI/gpapi/GpApiTransactionsTests.test.js +69 -0
- package/lib/test/Integration/Gateways/CI/gpapi/GpApiTransactionsTests.test.js.map +1 -0
- package/lib/test/Integration/Gateways/CI/portico/PorticoCreditTests.test.js +111 -0
- package/lib/test/Integration/Gateways/CI/portico/PorticoCreditTests.test.js.map +1 -0
- package/lib/test/Integration/Gateways/CI/upa_mitc/UpaFunctionalityTests.test.js +84 -0
- package/lib/test/Integration/Gateways/CI/upa_mitc/UpaFunctionalityTests.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/3DS2.test.js +15 -15
- package/lib/test/Integration/Gateways/GpApiConnector/3DSecure.test.js +5 -5
- package/lib/test/Integration/Gateways/GpApiConnector/VisaAft.test.d.ts +1 -0
- package/lib/test/Integration/Gateways/GpApiConnector/VisaAft.test.js +168 -0
- package/lib/test/Integration/Gateways/GpApiConnector/VisaAft.test.js.map +1 -0
- package/lib/test/Integration/Gateways/GpEcomConnector/Credit.test.js +4 -4
- package/lib/test/Integration/Gateways/PorticoConnector/Ecommerce.test.js +8 -8
- package/lib/test/Utils/CiTestingHarness.d.ts +21 -0
- package/lib/test/Utils/CiTestingHarness.js +65 -7
- package/lib/test/Utils/CiTestingHarness.js.map +1 -1
- package/package.json +63 -63
- package/appsec.properties +0 -8
- package/lib/test/Integration/Gateways/CI/GpApiCreditCardNotPresentTests.test.js +0 -90
- package/lib/test/Integration/Gateways/CI/GpApiCreditCardNotPresentTests.test.js.map +0 -1
- package/lib/test/Integration/Gateways/CI/PorticoCreditTests.test.js +0 -63
- package/lib/test/Integration/Gateways/CI/PorticoCreditTests.test.js.map +0 -1
- package/lib/test/Integration/Gateways/CI/UpaMicTests.test.js +0 -52
- package/lib/test/Integration/Gateways/CI/UpaMicTests.test.js.map +0 -1
- /package/lib/test/Integration/Gateways/CI/{GpApiCreditCardNotPresentTests.test.d.ts → gpapi/GpApiTransactionsTests.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/CI/{PorticoCreditTests.test.d.ts → portico/PorticoCreditTests.test.d.ts} +0 -0
- /package/lib/test/Integration/Gateways/CI/{UpaMicTests.test.d.ts → upa_mitc/UpaFunctionalityTests.test.d.ts} +0 -0
|
@@ -39,6 +39,10 @@ class CiTestingHarness {
|
|
|
39
39
|
testName;
|
|
40
40
|
idMap;
|
|
41
41
|
fixedTimestamp;
|
|
42
|
+
language = "node";
|
|
43
|
+
category = null;
|
|
44
|
+
subcategory = null;
|
|
45
|
+
currentFunction = null;
|
|
42
46
|
constructor(targetServiceUrl, cacheMode, testName) {
|
|
43
47
|
this.targetServiceUrl = targetServiceUrl;
|
|
44
48
|
this.cacheMode = cacheMode;
|
|
@@ -71,19 +75,70 @@ class CiTestingHarness {
|
|
|
71
75
|
],
|
|
72
76
|
});
|
|
73
77
|
}
|
|
78
|
+
/**
|
|
79
|
+
* Set the function being tested. The convention is "category|subcategory|function".
|
|
80
|
+
* This is parsed at runtime into the respective fields and appended to the proxy URL
|
|
81
|
+
* so the proxy validates them against its functionality list and records the test run.
|
|
82
|
+
*/
|
|
83
|
+
setFunction(functionPath) {
|
|
84
|
+
if (functionPath === null) {
|
|
85
|
+
this.category = null;
|
|
86
|
+
this.subcategory = null;
|
|
87
|
+
this.currentFunction = null;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
const parts = functionPath.split("|", 3);
|
|
91
|
+
if (parts.length === 3) {
|
|
92
|
+
this.category = parts[0];
|
|
93
|
+
this.subcategory = parts[1];
|
|
94
|
+
this.currentFunction = parts[2];
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
this.category = null;
|
|
98
|
+
this.subcategory = null;
|
|
99
|
+
this.currentFunction = functionPath;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Override the default language tag ("node") sent to the proxy.
|
|
105
|
+
* This is rarely needed; it exists for cross-language test scenarios.
|
|
106
|
+
*/
|
|
107
|
+
setLanguage(language) {
|
|
108
|
+
this.language = language;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Reset the harness fields so a stale function tag does not leak from one test
|
|
112
|
+
* method into the next. Call this after the test URL has been consumed.
|
|
113
|
+
*/
|
|
114
|
+
reset() {
|
|
115
|
+
this.category = null;
|
|
116
|
+
this.subcategory = null;
|
|
117
|
+
this.currentFunction = null;
|
|
118
|
+
}
|
|
74
119
|
getTestingUrl() {
|
|
75
120
|
const cacheReturns = this.cacheMode === CacheMode.Locked;
|
|
76
121
|
let targetHost = this.targetServiceUrl;
|
|
77
122
|
// Strip protocol prefix and replace with https:/
|
|
78
123
|
targetHost = targetHost.replace(/^https?:\/\//, "");
|
|
79
124
|
targetHost = "https:/" + targetHost;
|
|
80
|
-
|
|
125
|
+
let args = `cacheReturns:${cacheReturns}`;
|
|
126
|
+
if (this.language !== null &&
|
|
127
|
+
this.category !== null &&
|
|
128
|
+
this.subcategory !== null &&
|
|
129
|
+
this.currentFunction !== null) {
|
|
130
|
+
args += `,language:${this.encodeUrlPathSegment(this.language)}`;
|
|
131
|
+
args += `,category:${this.encodeUrlPathSegment(this.category)}`;
|
|
132
|
+
args += `,subcategory:${this.encodeUrlPathSegment(this.subcategory)}`;
|
|
133
|
+
args += `,function:${this.encodeUrlPathSegment(this.currentFunction)}`;
|
|
134
|
+
}
|
|
135
|
+
return `${CiTestingHarness.PROXY_ENDPOINT}/(${args})/${targetHost}`;
|
|
81
136
|
}
|
|
82
137
|
generateRandomId(key) {
|
|
83
|
-
if (this.idMap[key]) {
|
|
84
|
-
return this.idMap[key];
|
|
85
|
-
}
|
|
86
138
|
if (this.cacheMode === CacheMode.Locked) {
|
|
139
|
+
if (this.idMap[key]) {
|
|
140
|
+
return this.idMap[key];
|
|
141
|
+
}
|
|
87
142
|
throw new Error(`Harness is locked but no cached ID found for key: ${key}. Run tests in Unlocked mode first.`);
|
|
88
143
|
}
|
|
89
144
|
const id = (Math.floor(Math.random() * 90000000) + 10000000).toString();
|
|
@@ -92,10 +147,10 @@ class CiTestingHarness {
|
|
|
92
147
|
return id;
|
|
93
148
|
}
|
|
94
149
|
generateRandomAmount(key, min, max, decimals) {
|
|
95
|
-
if (this.idMap[key]) {
|
|
96
|
-
return this.idMap[key];
|
|
97
|
-
}
|
|
98
150
|
if (this.cacheMode === CacheMode.Locked) {
|
|
151
|
+
if (this.idMap[key]) {
|
|
152
|
+
return this.idMap[key];
|
|
153
|
+
}
|
|
99
154
|
throw new Error(`Harness is locked but no cached value found for key: ${key}. Run tests in Unlocked mode first.`);
|
|
100
155
|
}
|
|
101
156
|
const raw = min + Math.random() * (max - min);
|
|
@@ -115,6 +170,9 @@ class CiTestingHarness {
|
|
|
115
170
|
getCurrentTime() {
|
|
116
171
|
return new Date();
|
|
117
172
|
}
|
|
173
|
+
encodeUrlPathSegment(value) {
|
|
174
|
+
return encodeURIComponent(value);
|
|
175
|
+
}
|
|
118
176
|
loadExistingIds() {
|
|
119
177
|
const jsonFilePath = this.getJsonFilePath();
|
|
120
178
|
if (fs.existsSync(jsonFilePath)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CiTestingHarness.js","sourceRoot":"","sources":["../../../test/Utils/CiTestingHarness.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAG7B,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;AACvB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB;AAED,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;AAEjD,MAAa,gBAAgB;IACnB,MAAM,CAAU,cAAc,GAAG,WAAW,aAAa,QAAQ,CAAC;IAElE,gBAAgB,CAAS;IACzB,SAAS,CAAY;IACrB,QAAQ,CAAS;IACjB,KAAK,CAAyB;IAC9B,cAAc,CAAS;
|
|
1
|
+
{"version":3,"file":"CiTestingHarness.js","sourceRoot":"","sources":["../../../test/Utils/CiTestingHarness.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAG7B,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,8BAA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,EAAE,IAAI,EAAE,CAAC,CAAC;SACxC;QACD,EAAE,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACtE,CAAC;;AA3NH,4CA4NC"}
|
package/package.json
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "globalpayments-api",
|
|
3
|
-
"version": "3.10.
|
|
4
|
-
"description": "Global Payments SDK for NodeJS for Global Payments eCommerce gateways",
|
|
5
|
-
"author": "Global Payments",
|
|
6
|
-
"license": "GPL-2.0",
|
|
7
|
-
"engines": {
|
|
8
|
-
"node": ">=16.20.2"
|
|
9
|
-
},
|
|
10
|
-
"repository": {
|
|
11
|
-
"type": "git",
|
|
12
|
-
"url": "https://github.com/globalpayments/node-sdk.git"
|
|
13
|
-
},
|
|
14
|
-
"main": "./lib/src/index.js",
|
|
15
|
-
"typings": "./lib/src/index",
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "tsc",
|
|
18
|
-
"test:jest": "jest",
|
|
19
|
-
"test:serial": "jest --runInBand --testPathPattern=DataResidency.test.ts$ --",
|
|
20
|
-
"build:netsuite": "webpack --env.GP_NETSUITE_BUILD --config config/webpack.netsuite.js && node bin/netsuite-post.js",
|
|
21
|
-
"build:clean": "rimraf lib",
|
|
22
|
-
"docs": "typedoc --mode file --name \"GlobalPayments.Api\" --project tsconfig.json --out docs src",
|
|
23
|
-
"format": "prettier --write --config .prettierrc 'src/**/*.ts' 'test/**/*.ts' '*.md'",
|
|
24
|
-
"prebuild": "npm-run-all test:lint",
|
|
25
|
-
"prepublish": "npm-run-all build",
|
|
26
|
-
"prepublishOnly": "npm-run-all build",
|
|
27
|
-
"pretest": "npm-run-all build:clean test:lint build",
|
|
28
|
-
"test:lint": "eslint \"src/**/*.ts*\" \"test/**/*.ts\" --fix"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@azz/elementtree": "^0.1.6",
|
|
32
|
-
"es6-promise": "^4.2.8",
|
|
33
|
-
"eslint-config-prettier": "^9.0.0",
|
|
34
|
-
"sha1": "^1.1.1",
|
|
35
|
-
"typedarray": "^0.0.6",
|
|
36
|
-
"url": "^0.11.0"
|
|
37
|
-
},
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"@hitc/netsuite-types": "^2017.2.32",
|
|
40
|
-
"@types/jest": "^29.5.12",
|
|
41
|
-
"@types/node": "20.6.0",
|
|
42
|
-
"@typescript-eslint/eslint-plugin": "^6.7.3",
|
|
43
|
-
"@typescript-eslint/parser": "^6.7.3",
|
|
44
|
-
"eslint": "^8.50.0",
|
|
45
|
-
"eslint-plugin-prettier": "^5.0.0",
|
|
46
|
-
"jest": "^29.7.0",
|
|
47
|
-
"npm-run-all": "^4.1.5",
|
|
48
|
-
"prettier": "3.0.3",
|
|
49
|
-
"rimraf": "^2.6.3",
|
|
50
|
-
"ts-jest": "^29.1.5",
|
|
51
|
-
"tslint": "^6.1.3",
|
|
52
|
-
"typedoc": "0.25.1",
|
|
53
|
-
"typescript": "5.2.2",
|
|
54
|
-
"webpack": "^5.94.0"
|
|
55
|
-
},
|
|
56
|
-
"files": [
|
|
57
|
-
"lib/src/**",
|
|
58
|
-
"lib/test/**",
|
|
59
|
-
"appsec.properties",
|
|
60
|
-
"CHANGELOG.md"
|
|
61
|
-
],
|
|
62
|
-
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
63
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "globalpayments-api",
|
|
3
|
+
"version" : "3.10.14",
|
|
4
|
+
"description": "Global Payments SDK for NodeJS for Global Payments eCommerce gateways",
|
|
5
|
+
"author": "Global Payments",
|
|
6
|
+
"license": "GPL-2.0",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=16.20.2"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/globalpayments/node-sdk.git"
|
|
13
|
+
},
|
|
14
|
+
"main": "./lib/src/index.js",
|
|
15
|
+
"typings": "./lib/src/index",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"test:jest": "jest",
|
|
19
|
+
"test:serial": "jest --runInBand --testPathPattern=DataResidency.test.ts$ --",
|
|
20
|
+
"build:netsuite": "webpack --env.GP_NETSUITE_BUILD --config config/webpack.netsuite.js && node bin/netsuite-post.js",
|
|
21
|
+
"build:clean": "rimraf lib",
|
|
22
|
+
"docs": "typedoc --mode file --name \"GlobalPayments.Api\" --project tsconfig.json --out docs src",
|
|
23
|
+
"format": "prettier --write --config .prettierrc 'src/**/*.ts' 'test/**/*.ts' '*.md'",
|
|
24
|
+
"prebuild": "npm-run-all test:lint",
|
|
25
|
+
"prepublish": "npm-run-all build",
|
|
26
|
+
"prepublishOnly": "npm-run-all build",
|
|
27
|
+
"pretest": "npm-run-all build:clean test:lint build",
|
|
28
|
+
"test:lint": "eslint \"src/**/*.ts*\" \"test/**/*.ts\" --fix"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@azz/elementtree": "^0.1.6",
|
|
32
|
+
"es6-promise": "^4.2.8",
|
|
33
|
+
"eslint-config-prettier": "^9.0.0",
|
|
34
|
+
"sha1": "^1.1.1",
|
|
35
|
+
"typedarray": "^0.0.6",
|
|
36
|
+
"url": "^0.11.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@hitc/netsuite-types": "^2017.2.32",
|
|
40
|
+
"@types/jest": "^29.5.12",
|
|
41
|
+
"@types/node": "20.6.0",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^6.7.3",
|
|
43
|
+
"@typescript-eslint/parser": "^6.7.3",
|
|
44
|
+
"eslint": "^8.50.0",
|
|
45
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
46
|
+
"jest": "^29.7.0",
|
|
47
|
+
"npm-run-all": "^4.1.5",
|
|
48
|
+
"prettier": "3.0.3",
|
|
49
|
+
"rimraf": "^2.6.3",
|
|
50
|
+
"ts-jest": "^29.1.5",
|
|
51
|
+
"tslint": "^6.1.3",
|
|
52
|
+
"typedoc": "0.25.1",
|
|
53
|
+
"typescript": "5.2.2",
|
|
54
|
+
"webpack": "^5.94.0"
|
|
55
|
+
},
|
|
56
|
+
"files": [
|
|
57
|
+
"lib/src/**",
|
|
58
|
+
"lib/test/**",
|
|
59
|
+
"appsec.properties",
|
|
60
|
+
"CHANGELOG.md"
|
|
61
|
+
],
|
|
62
|
+
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
|
63
|
+
}
|
package/appsec.properties
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
application_id = GP13428
|
|
2
|
-
dev_team_lead = russell.everett@e-hps.com
|
|
3
|
-
security_champion = philip.white@e-hps.com
|
|
4
|
-
observers = developers@globalpay.com
|
|
5
|
-
prod_branch = master
|
|
6
|
-
dev_branch = NextRelease
|
|
7
|
-
prod_urls = https://github.com/globalpayments/node-sdk
|
|
8
|
-
dev_urls = https://github.globalpay.com/Developer-Experience/node-sdk
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const src_1 = require("../../../../src");
|
|
4
|
-
const CiTestingHarness_1 = require("../../../Utils/CiTestingHarness");
|
|
5
|
-
const harness = new CiTestingHarness_1.CiTestingHarness("https://apis.sandbox.globalpay.com/ucp", CiTestingHarness_1.CacheMode.Locked, "GpApiCreditCardNotPresentTest");
|
|
6
|
-
const currentTime = harness.getCurrentTime();
|
|
7
|
-
const expMonth = (currentTime.getMonth() + 1).toString();
|
|
8
|
-
const expYear = (currentTime.getFullYear() + 1).toString();
|
|
9
|
-
const card = new src_1.CreditCardData();
|
|
10
|
-
card.number = "4263970000005262";
|
|
11
|
-
card.expMonth = expMonth;
|
|
12
|
-
card.expYear = expYear;
|
|
13
|
-
card.cvn = "123";
|
|
14
|
-
card.cardPresent = true;
|
|
15
|
-
const amount = "2.02";
|
|
16
|
-
const currency = "USD";
|
|
17
|
-
beforeAll(() => {
|
|
18
|
-
const config = new src_1.GpApiConfig();
|
|
19
|
-
config.appId = "4gPqnGBkppGYvoE5UX9EWQlotTxGUDbs";
|
|
20
|
-
config.appKey = "FQyJA5VuEQfcji2M";
|
|
21
|
-
config.channel = src_1.Channel.CardNotPresent;
|
|
22
|
-
config.serviceUrl = harness.getTestingUrl();
|
|
23
|
-
config.accessTokenInfo = new src_1.AccessTokenInfo();
|
|
24
|
-
config.accessTokenInfo.transactionProcessingAccountName =
|
|
25
|
-
"transaction_processing";
|
|
26
|
-
src_1.ServicesContainer.configureService(config);
|
|
27
|
-
});
|
|
28
|
-
test("credit sale", async () => {
|
|
29
|
-
const address = new src_1.Address();
|
|
30
|
-
address.streetAddress1 = "123 Main St.";
|
|
31
|
-
address.city = "Downtown";
|
|
32
|
-
address.state = "NJ";
|
|
33
|
-
address.postalCode = "12345";
|
|
34
|
-
const response = await card
|
|
35
|
-
.charge(amount)
|
|
36
|
-
.withCurrency(currency)
|
|
37
|
-
.withAddress(address)
|
|
38
|
-
.withClientTransactionId(harness.generateRandomId("creditSale"))
|
|
39
|
-
.execute();
|
|
40
|
-
expect(response).toBeTruthy();
|
|
41
|
-
expect(response.responseCode).toBe("SUCCESS");
|
|
42
|
-
expect(response.responseMessage).toBe(src_1.TransactionStatus.CAPTURED);
|
|
43
|
-
});
|
|
44
|
-
test("credit authorization and capture", async () => {
|
|
45
|
-
const transaction = await card
|
|
46
|
-
.authorize("14")
|
|
47
|
-
.withCurrency(currency)
|
|
48
|
-
.withClientTransactionId(harness.generateRandomId("creditAuthorizationAndCapture_auth"))
|
|
49
|
-
.execute();
|
|
50
|
-
expect(transaction).toBeTruthy();
|
|
51
|
-
expect(transaction.responseCode).toBe("SUCCESS");
|
|
52
|
-
expect(transaction.responseMessage).toBe(src_1.TransactionStatus.PREAUTHORIZED);
|
|
53
|
-
const capture = await transaction
|
|
54
|
-
.capture("16")
|
|
55
|
-
.withGratuity("2")
|
|
56
|
-
.withClientTransactionId(harness.generateRandomId("creditAuthorizationAndCapture_capture"))
|
|
57
|
-
.execute();
|
|
58
|
-
expect(capture).toBeTruthy();
|
|
59
|
-
expect(capture.responseCode).toBe("SUCCESS");
|
|
60
|
-
expect(capture.responseMessage).toBe(src_1.TransactionStatus.CAPTURED);
|
|
61
|
-
});
|
|
62
|
-
test("credit verify", async () => {
|
|
63
|
-
const response = await card
|
|
64
|
-
.verify()
|
|
65
|
-
.withCurrency(currency)
|
|
66
|
-
.withClientTransactionId(harness.generateRandomId("creditVerify"))
|
|
67
|
-
.execute();
|
|
68
|
-
expect(response).toBeTruthy();
|
|
69
|
-
expect(response.responseCode).toBe("SUCCESS");
|
|
70
|
-
expect(response.responseMessage).toBe("VERIFIED");
|
|
71
|
-
});
|
|
72
|
-
test("credit refund transaction", async () => {
|
|
73
|
-
const transaction = await card
|
|
74
|
-
.charge(amount)
|
|
75
|
-
.withCurrency(currency)
|
|
76
|
-
.withClientTransactionId(harness.generateRandomId("creditRefundTransaction_charge"))
|
|
77
|
-
.execute();
|
|
78
|
-
expect(transaction).toBeTruthy();
|
|
79
|
-
expect(transaction.responseCode).toBe("SUCCESS");
|
|
80
|
-
expect(transaction.responseMessage).toBe(src_1.TransactionStatus.CAPTURED);
|
|
81
|
-
const response = await transaction
|
|
82
|
-
.refund(amount)
|
|
83
|
-
.withCurrency(currency)
|
|
84
|
-
.withClientTransactionId(harness.generateRandomId("creditRefundTransaction_refund"))
|
|
85
|
-
.execute();
|
|
86
|
-
expect(response).toBeTruthy();
|
|
87
|
-
expect(response.responseCode).toBe("SUCCESS");
|
|
88
|
-
expect(response.responseMessage).toBe(src_1.TransactionStatus.CAPTURED);
|
|
89
|
-
});
|
|
90
|
-
//# sourceMappingURL=GpApiCreditCardNotPresentTests.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GpApiCreditCardNotPresentTests.test.js","sourceRoot":"","sources":["../../../../../test/Integration/Gateways/CI/GpApiCreditCardNotPresentTests.test.ts"],"names":[],"mappings":";;AAAA,yCAQyB;AACzB,sEAA8E;AAE9E,MAAM,OAAO,GAAG,IAAI,mCAAgB,CAClC,wCAAwC,EACxC,4BAAS,CAAC,MAAM,EAChB,+BAA+B,CAChC,CAAC;AAEF,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;AAC7C,MAAM,QAAQ,GAAG,CAAC,WAAW,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AACzD,MAAM,OAAO,GAAG,CAAC,WAAW,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAE3D,MAAM,IAAI,GAAG,IAAI,oBAAc,EAAE,CAAC;AAClC,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC;AACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;AACvB,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC;AACjB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;AAExB,MAAM,MAAM,GAAG,MAAM,CAAC;AACtB,MAAM,QAAQ,GAAG,KAAK,CAAC;AAEvB,SAAS,CAAC,GAAG,EAAE;IACb,MAAM,MAAM,GAAG,IAAI,iBAAW,EAAE,CAAC;IACjC,MAAM,CAAC,KAAK,GAAG,kCAAkC,CAAC;IAClD,MAAM,CAAC,MAAM,GAAG,kBAAkB,CAAC;IACnC,MAAM,CAAC,OAAO,GAAG,aAAO,CA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AI;SAC3B,MAAM,CAAC,MAAM,CAAC;SACd,YAAY,CAAC,QAAQ,CAAC;SACtB,uBAAuB,CACtB,OAAO,CAAC,gBAAgB,CAAC,gCAAgC,CAAC,CAC3D;SACA,OAAO,EAAE,CAAC;IACb,MAAM,CAAC,WAAW,CAAC,CAAC,UAAU,EAAE,CAAC;IACjC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,uBAAiB,CAAC,QAAQ,CAAC,CAAC;IAErE,MAAM,QAAQ,GAAG,MAAM,WAAW;SAC/B,MAAM,CAAC,MAAM,CAAC;SACd,YAAY,CAAC,QAAQ,CAAC;SACtB,uBAAuB,CACtB,OAAO,CAAC,gBAAgB,CAAC,gCAAgC,CAAC,CAC3D;SACA,OAAO,EAAE,CAAC;IACb,MAAM,CAAC,QAAQ,CAAC,CAAC,UAAU,EAAE,CAAC;IAC9B,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC9C,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,IAAI,CAAC,uBAAiB,CAAC,QAAQ,CAAC,CAAC;AACpE,CAAC,CAAC,CAAC"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const src_1 = require("../../../../src");
|
|
4
|
-
const CiTestingHarness_1 = require("../../../Utils/CiTestingHarness");
|
|
5
|
-
const harness = new CiTestingHarness_1.CiTestingHarness("https://cert.api2.heartlandportico.com", CiTestingHarness_1.CacheMode.Locked, "PorticoCreditTests");
|
|
6
|
-
const card = new src_1.CreditCardData();
|
|
7
|
-
card.number = "4111111111111111";
|
|
8
|
-
card.expMonth = "12";
|
|
9
|
-
card.expYear = "2025";
|
|
10
|
-
card.cvn = "123";
|
|
11
|
-
const track = new src_1.CreditTrackData();
|
|
12
|
-
track.value =
|
|
13
|
-
"<E1050711%B4012001000000016^VI TEST CREDIT^251200000000000000000000?|LO04K0WFOmdkDz0um+GwUkILL8ZZOP6Zc4rCpZ9+kg2T3JBT4AEOilWTI|+++++++Dbbn04ekG|11;4012001000000016=25120000000000000000?|1u2F/aEhbdoPixyAPGyIDv3gBfF|+++++++Dbbn04ekG|00|||/wECAQECAoFGAgEH2wYcShV78RZwb3NAc2VjdXJlZXhjaGFuZ2UubmV0PX50qfj4dt0lu9oFBESQQNkpoxEVpCW3ZKmoIV3T93zphPS3XKP4+DiVlM8VIOOmAuRrpzxNi0TN/DWXWSjUC8m/PI2dACGdl/hVJ/imfqIs68wYDnp8j0ZfgvM26MlnDbTVRrSx68Nzj2QAgpBCHcaBb/FZm9T7pfMr2Mlh2YcAt6gGG1i2bJgiEJn8IiSDX5M2ybzqRT86PCbKle/XCTwFFe1X|>;";
|
|
14
|
-
track.encryptionData = new src_1.EncryptionData();
|
|
15
|
-
track.encryptionData.version = "01";
|
|
16
|
-
beforeAll(() => {
|
|
17
|
-
const config = new src_1.PorticoConfig();
|
|
18
|
-
config.secretApiKey = "skapi_cert_MTeSAQAfG1UA9qQDrzl-kz4toXvARyieptFwSKP24w";
|
|
19
|
-
config.serviceUrl = harness.getTestingUrl();
|
|
20
|
-
config.developerId = "002914";
|
|
21
|
-
config.versionNumber = "3026";
|
|
22
|
-
src_1.ServicesContainer.configureService(config);
|
|
23
|
-
});
|
|
24
|
-
test("credit authorization", async () => {
|
|
25
|
-
const response = await card
|
|
26
|
-
.authorize("14")
|
|
27
|
-
.withCurrency("USD")
|
|
28
|
-
.withAllowDuplicates(true)
|
|
29
|
-
.execute();
|
|
30
|
-
expect(response).toBeTruthy();
|
|
31
|
-
expect(response.responseCode).toBe("00");
|
|
32
|
-
const capture = await response.capture("16").withGratuity("2").execute();
|
|
33
|
-
expect(capture).toBeTruthy();
|
|
34
|
-
expect(capture.responseCode).toBe("00");
|
|
35
|
-
});
|
|
36
|
-
test("credit sale", async () => {
|
|
37
|
-
const clientTxnID = harness.generateRandomId("creditSale");
|
|
38
|
-
const response = await card
|
|
39
|
-
.charge("15")
|
|
40
|
-
.withCurrency("USD")
|
|
41
|
-
.withClientTransactionId(clientTxnID)
|
|
42
|
-
.withAllowDuplicates(true)
|
|
43
|
-
.execute();
|
|
44
|
-
expect(response).toBeTruthy();
|
|
45
|
-
expect(response.responseCode).toBe("00");
|
|
46
|
-
});
|
|
47
|
-
test("credit swipe sale", async () => {
|
|
48
|
-
const clientTxnID = harness.generateRandomId("creditSwipeSale");
|
|
49
|
-
const response = await track
|
|
50
|
-
.charge("15")
|
|
51
|
-
.withCurrency("USD")
|
|
52
|
-
.withAllowDuplicates(true)
|
|
53
|
-
.withClientTransactionId(clientTxnID)
|
|
54
|
-
.execute();
|
|
55
|
-
expect(response).toBeTruthy();
|
|
56
|
-
expect(response.responseCode).toBe("00");
|
|
57
|
-
});
|
|
58
|
-
test("credit verify", async () => {
|
|
59
|
-
const response = await card.verify().withAllowDuplicates(true).execute();
|
|
60
|
-
expect(response).toBeTruthy();
|
|
61
|
-
expect(response.responseCode).toBe("00");
|
|
62
|
-
});
|
|
63
|
-
//# sourceMappingURL=PorticoCreditTests.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PorticoCreditTests.test.js","sourceRoot":"","sources":["../../../../../test/Integration/Gateways/CI/PorticoCreditTests.test.ts"],"names":[],"mappings":";;AAAA,yCAMyB;AACzB,sEAA8E;AAE9E,MAAM,OAAO,GAAG,IAAI,mCAAgB,CAClC,wCAAwC,EACxC,4BAAS,CAAC,MAAM,EAChB,oBAAoB,CACrB,CAAC;AAEF,MAAM,IAAI,GAAG,IAAI,oBAAc,EAAE,CAAC;AAClC,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC;AACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;AACrB,IAAI,CAAC,OAAO,G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CAAC;AAC3C,CAAC,CAAC,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const src_1 = require("../../../../src");
|
|
4
|
-
const DeviceService_1 = require("../../../../src/Services/DeviceService");
|
|
5
|
-
const Enums_1 = require("../../../../src/Terminals/Enums");
|
|
6
|
-
const CiTestingHarness_1 = require("../../../Utils/CiTestingHarness");
|
|
7
|
-
const MITC_UPA_APP_ID = "6l8Xr23kHL9tGmAtXUvCEXKskvF7aLGq";
|
|
8
|
-
const MITC_UPA_APP_KEY = "z0ApiLDfXrKmrlNa";
|
|
9
|
-
const harness = new CiTestingHarness_1.CiTestingHarness("https://apis.sandbox.globalpay.com/ucp", CiTestingHarness_1.CacheMode.Locked, "UpaMicTests");
|
|
10
|
-
const getGpApiConfig = () => {
|
|
11
|
-
const config = new src_1.GpApiConfig();
|
|
12
|
-
config.appId = MITC_UPA_APP_ID;
|
|
13
|
-
config.appKey = MITC_UPA_APP_KEY;
|
|
14
|
-
config.channel = src_1.Channel.CardPresent;
|
|
15
|
-
config.country = "US";
|
|
16
|
-
config.deviceCurrency = "USD";
|
|
17
|
-
config.serviceUrl = harness.getTestingUrl();
|
|
18
|
-
config.accessTokenInfo = new src_1.AccessTokenInfo();
|
|
19
|
-
config.accessTokenInfo.transactionProcessingAccountName = "90916726";
|
|
20
|
-
return config;
|
|
21
|
-
};
|
|
22
|
-
const createDevice = (testKey) => {
|
|
23
|
-
const config = new src_1.ConnectionConfig();
|
|
24
|
-
config.deviceType = src_1.DeviceType.UPA_DEVICE;
|
|
25
|
-
config.connectionMode = Enums_1.ConnectionModes.MEET_IN_THE_CLOUD;
|
|
26
|
-
config.timeout = 30000;
|
|
27
|
-
config.gatewayConfig = getGpApiConfig();
|
|
28
|
-
config.requestIdProvider = harness.createRequestIdProvider(testKey);
|
|
29
|
-
return DeviceService_1.DeviceService.create(config);
|
|
30
|
-
};
|
|
31
|
-
test("CreditSale", async () => {
|
|
32
|
-
const device = createDevice("CreditSale");
|
|
33
|
-
const amount = harness.generateRandomAmount("CreditSale_amount", 1, 10, 2);
|
|
34
|
-
const response = await device
|
|
35
|
-
.sale(parseFloat(amount))
|
|
36
|
-
.withEcrId(12)
|
|
37
|
-
.execute();
|
|
38
|
-
expect(response).toBeTruthy();
|
|
39
|
-
expect(response.deviceResponseText).toBe("COMPLETE");
|
|
40
|
-
});
|
|
41
|
-
test("CreditSale_WithZeroTip", async () => {
|
|
42
|
-
const device = createDevice("CreditSale_WithZeroTip");
|
|
43
|
-
const amount = harness.generateRandomAmount("CreditSale_WithZeroTip_amount", 1, 10, 2);
|
|
44
|
-
const response = await device
|
|
45
|
-
.sale(parseFloat(amount))
|
|
46
|
-
.withEcrId(12)
|
|
47
|
-
.withGratuity(0)
|
|
48
|
-
.execute();
|
|
49
|
-
expect(response).toBeTruthy();
|
|
50
|
-
expect(response.deviceResponseText).toBe("COMPLETE");
|
|
51
|
-
});
|
|
52
|
-
//# sourceMappingURL=UpaMicTests.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"UpaMicTests.test.js","sourceRoot":"","sources":["../../../../../test/Integration/Gateways/CI/UpaMicTests.test.ts"],"names":[],"mappings":";;AAAA,yCAOyB;AACzB,0EAAuE;AACvE,2DAAkE;AAClE,sEAA8E;AAE9E,MAAM,eAAe,GAAG,kCAAkC,CAAC;AAC3D,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAE5C,MAAM,OAAO,GAAG,IAAI,mCAAgB,CAClC,wCAAwC,EACxC,4BAAS,CAAC,MAAM,EAChB,aAAa,CACd,CAAC;AAEF,MAAM,cAAc,GAAG,GAAG,EAAE;IAC1B,MAAM,MAAM,GAAG,IAAI,iBAAW,EAAE,CAAC;IACjC,MAAM,CAAC,KAAK,GAAG,eAAe,CAAC;IAC/B,MAAM,CAAC,MAAM,GAAG,gBAAgB,CAAC;IACjC,MAAM,CAAC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