globalpayments-api 3.10.2 → 3.10.3

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.
Files changed (109) hide show
  1. package/CHANGELOG.md +191 -184
  2. package/LICENSE.md +257 -257
  3. package/README.md +141 -141
  4. package/lib/src/Gateways/PorticoConnector.js +3 -2
  5. package/lib/src/Gateways/PorticoConnector.js.map +1 -1
  6. package/lib/test/Integration/Gateways/GpApiConnector/3DS2.test.js +15 -15
  7. package/lib/test/Integration/Gateways/GpApiConnector/3DSecure.test.js +5 -5
  8. package/lib/test/Integration/Gateways/GpEcomConnector/Credit.test.js +4 -4
  9. package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js +26 -0
  10. package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js.map +1 -1
  11. package/lib/test/Integration/Gateways/PorticoConnector/Ecommerce.test.js +8 -8
  12. package/package.json +62 -62
  13. package/appsec.properties +0 -8
  14. package/lib/src/Gateways/RealexConnector.d.ts +0 -30
  15. package/lib/src/Gateways/RealexConnector.js +0 -523
  16. package/lib/src/ServicesConfig.d.ts +0 -27
  17. package/lib/src/ServicesConfig.js +0 -50
  18. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.d.ts +0 -1
  19. package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js +0 -112
  20. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.d.ts +0 -1
  21. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js +0 -483
  22. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.d.ts +0 -1
  23. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js +0 -83
  24. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.d.ts +0 -1
  25. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js +0 -1720
  26. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.d.ts +0 -1
  27. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js +0 -83
  28. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.d.ts +0 -1
  29. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js +0 -1757
  30. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.d.ts +0 -1
  31. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js +0 -682
  32. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.d.ts +0 -1
  33. package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js +0 -2218
  34. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.d.ts +0 -1
  35. package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js +0 -707
  36. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.d.ts +0 -1
  37. package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js +0 -151
  38. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.d.ts +0 -1
  39. package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js +0 -171
  40. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.d.ts +0 -1
  41. package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js +0 -192
  42. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.d.ts +0 -1
  43. package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js +0 -377
  44. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.d.ts +0 -1
  45. package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js +0 -196
  46. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.d.ts +0 -1
  47. package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js +0 -53
  48. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTests.d.ts +0 -1
  49. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTests.js +0 -100
  50. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTests.d.ts +0 -1
  51. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTests.js +0 -352
  52. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTests.d.ts +0 -1
  53. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTests.js +0 -123
  54. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTests.d.ts +0 -1
  55. package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTests.js +0 -142
  56. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTests.d.ts +0 -1
  57. package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTests.js +0 -100
  58. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTests.d.ts +0 -1
  59. package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTests.js +0 -535
  60. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTests.d.ts +0 -1
  61. package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTests.js +0 -124
  62. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTests.d.ts +0 -1
  63. package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTests.js +0 -144
  64. package/lib/test/Integration/Gateways/RealexConnector/Certification/AuthTest.d.ts +0 -1
  65. package/lib/test/Integration/Gateways/RealexConnector/Certification/AuthTest.js +0 -4373
  66. package/lib/test/Integration/Gateways/RealexConnector/Certification/AvsTest.d.ts +0 -1
  67. package/lib/test/Integration/Gateways/RealexConnector/Certification/AvsTest.js +0 -758
  68. package/lib/test/Integration/Gateways/RealexConnector/Certification/CreditTest.d.ts +0 -1
  69. package/lib/test/Integration/Gateways/RealexConnector/Certification/CreditTest.js +0 -2399
  70. package/lib/test/Integration/Gateways/RealexConnector/Certification/HoldTest.d.ts +0 -1
  71. package/lib/test/Integration/Gateways/RealexConnector/Certification/HoldTest.js +0 -1656
  72. package/lib/test/Integration/Gateways/RealexConnector/Certification/ManualTest.d.ts +0 -1
  73. package/lib/test/Integration/Gateways/RealexConnector/Certification/ManualTest.js +0 -5650
  74. package/lib/test/Integration/Gateways/RealexConnector/Certification/OtbTest.d.ts +0 -1
  75. package/lib/test/Integration/Gateways/RealexConnector/Certification/OtbTest.js +0 -1985
  76. package/lib/test/Integration/Gateways/RealexConnector/Certification/RebateTest.d.ts +0 -1
  77. package/lib/test/Integration/Gateways/RealexConnector/Certification/RebateTest.js +0 -2369
  78. package/lib/test/Integration/Gateways/RealexConnector/Certification/ReleaseTest.d.ts +0 -1
  79. package/lib/test/Integration/Gateways/RealexConnector/Certification/ReleaseTest.js +0 -1703
  80. package/lib/test/Integration/Gateways/RealexConnector/Certification/SettleTest.d.ts +0 -1
  81. package/lib/test/Integration/Gateways/RealexConnector/Certification/SettleTest.js +0 -2053
  82. package/lib/test/Integration/Gateways/RealexConnector/Certification/ValidationTest.d.ts +0 -1
  83. package/lib/test/Integration/Gateways/RealexConnector/Certification/ValidationTest.js +0 -2469
  84. package/lib/test/Integration/Gateways/RealexConnector/Certification/VerifyEnrolledTest.d.ts +0 -1
  85. package/lib/test/Integration/Gateways/RealexConnector/Certification/VerifyEnrolledTest.js +0 -3116
  86. package/lib/test/Integration/Gateways/RealexConnector/Certification/VoidTest.d.ts +0 -1
  87. package/lib/test/Integration/Gateways/RealexConnector/Certification/VoidTest.js +0 -2031
  88. package/lib/test/Integration/Gateways/RealexConnector/CreditTest.d.ts +0 -1
  89. package/lib/test/Integration/Gateways/RealexConnector/CreditTest.js +0 -322
  90. package/lib/test/Integration/Gateways/RealexConnector/HppTest.d.ts +0 -1
  91. package/lib/test/Integration/Gateways/RealexConnector/HppTest.js +0 -98
  92. package/lib/test/Integration/Gateways/RealexConnector/RecurringTest.d.ts +0 -1
  93. package/lib/test/Integration/Gateways/RealexConnector/RecurringTest.js +0 -263
  94. package/lib/test/Integration/Services/CheckServiceTest.d.ts +0 -1
  95. package/lib/test/Integration/Services/CheckServiceTest.js +0 -98
  96. package/lib/test/Integration/Services/CreditServiceTest.d.ts +0 -1
  97. package/lib/test/Integration/Services/CreditServiceTest.js +0 -313
  98. package/lib/test/Integration/Services/DebitServiceTest.d.ts +0 -1
  99. package/lib/test/Integration/Services/DebitServiceTest.js +0 -154
  100. package/lib/test/Integration/Services/EBTServiceTest.d.ts +0 -1
  101. package/lib/test/Integration/Services/EBTServiceTest.js +0 -135
  102. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.d.ts +0 -1
  103. package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js +0 -161
  104. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.d.ts +0 -1
  105. package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js +0 -139
  106. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.d.ts +0 -1
  107. package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js +0 -202
  108. package/lib/test/Unit/Gateways/RealexConnector/CreditTest.d.ts +0 -1
  109. package/lib/test/Unit/Gateways/RealexConnector/CreditTest.js +0 -29
@@ -1,1656 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
18
- 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;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
- }
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- var ava_1 = require("ava");
40
- var src_1 = require("../../../../../src/");
41
- var throttle = function () { return new Promise(function (resolve) { return setTimeout(resolve, 1500); }); };
42
- ava_1.default.beforeEach(function () { return __awaiter(void 0, void 0, void 0, function () {
43
- return __generator(this, function (_a) {
44
- switch (_a.label) {
45
- case 0: return [4 /*yield*/, throttle()];
46
- case 1:
47
- _a.sent();
48
- return [2 /*return*/];
49
- }
50
- });
51
- }); });
52
- // TODO
53
- ava_1.default("JAVA_Hold_Sample", function (t) { return __awaiter(void 0, void 0, void 0, function () {
54
- var config, card, saleResponse, response;
55
- return __generator(this, function (_a) {
56
- switch (_a.label) {
57
- case 0:
58
- t.plan(2);
59
- config = new src_1.ServicesConfig();
60
- config.merchantId = "heartlandgpsandbox";
61
- config.accountId = "api";
62
- config.sharedSecret = "secret";
63
- config.refundPassword = "refund";
64
- config.rebatePassword = "rebate";
65
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
66
- config.timeout = 5000;
67
- config.channel = "ECOM";
68
- src_1.ServicesContainer.configure(config);
69
- card = new src_1.CreditCardData();
70
- card.number = "4263970000005262";
71
- card.expMonth = "12";
72
- card.expYear = "2020";
73
- card.cvn = "123";
74
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
75
- card.cardHolderName = "James Mason";
76
- return [4 /*yield*/, card
77
- .charge(10)
78
- .withCurrency("EUR")
79
- .execute()];
80
- case 1:
81
- saleResponse = _a.sent();
82
- t.truthy(saleResponse);
83
- t.is("00", saleResponse.responseCode);
84
- return [4 /*yield*/, throttle()];
85
- case 2:
86
- _a.sent();
87
- return [4 /*yield*/, saleResponse
88
- .hold()
89
- .withReasonCode(src_1.ReasonCode.Fraud)
90
- .withDescription("JAVA-Hold")
91
- .execute()];
92
- case 3:
93
- response = _a.sent();
94
- t.truthy(response);
95
- t.is("00", response.responseCode);
96
- return [2 /*return*/];
97
- }
98
- });
99
- }); });
100
- ava_1.default("JAVA_Hold_006a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
101
- var config, card, saleResponse, response;
102
- return __generator(this, function (_a) {
103
- switch (_a.label) {
104
- case 0:
105
- t.plan(2);
106
- config = new src_1.ServicesConfig();
107
- config.merchantId = "heartlandgpsandbox";
108
- config.accountId = "api";
109
- config.sharedSecret = "secret";
110
- config.refundPassword = "refund";
111
- config.rebatePassword = "rebate";
112
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
113
- config.timeout = 5000;
114
- config.channel = "ECOM";
115
- src_1.ServicesContainer.configure(config);
116
- card = new src_1.CreditCardData();
117
- card.number = "4263970000005262";
118
- card.expMonth = "12";
119
- card.expYear = "2020";
120
- card.cvn = "123";
121
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
122
- card.cardHolderName = "James Mason";
123
- return [4 /*yield*/, card
124
- .charge(10)
125
- .withCurrency("EUR")
126
- .execute()];
127
- case 1:
128
- saleResponse = _a.sent();
129
- t.truthy(saleResponse);
130
- t.is("00", saleResponse.responseCode);
131
- return [4 /*yield*/, throttle()];
132
- case 2:
133
- _a.sent();
134
- return [4 /*yield*/, saleResponse
135
- .hold()
136
- .withReasonCode(src_1.ReasonCode.Fraud)
137
- .withDescription("JAVA-Hold")
138
- .execute()];
139
- case 3:
140
- response = _a.sent();
141
- t.truthy(response);
142
- t.is("00", response.responseCode);
143
- return [2 /*return*/];
144
- }
145
- });
146
- }); });
147
- ava_1.default("JAVA_Hold_006b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
148
- var config, card, saleResponse, response;
149
- return __generator(this, function (_a) {
150
- switch (_a.label) {
151
- case 0:
152
- t.plan(2);
153
- config = new src_1.ServicesConfig();
154
- config.merchantId = "heartlandgpsandbox";
155
- config.accountId = "api";
156
- config.sharedSecret = "secret";
157
- config.refundPassword = "refund";
158
- config.rebatePassword = "rebate";
159
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
160
- config.timeout = 5000;
161
- config.channel = "ECOM";
162
- src_1.ServicesContainer.configure(config);
163
- card = new src_1.CreditCardData();
164
- card.number = "4263970000005262";
165
- card.expMonth = "12";
166
- card.expYear = "2020";
167
- card.cvn = "123";
168
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
169
- card.cardHolderName = "James Mason";
170
- return [4 /*yield*/, card
171
- .charge(10)
172
- .withCurrency("EUR")
173
- .execute()];
174
- case 1:
175
- saleResponse = _a.sent();
176
- t.truthy(saleResponse);
177
- t.is("00", saleResponse.responseCode);
178
- return [4 /*yield*/, throttle()];
179
- case 2:
180
- _a.sent();
181
- return [4 /*yield*/, saleResponse
182
- .hold()
183
- .withReasonCode(src_1.ReasonCode.Fraud)
184
- .withDescription("JAVA-Hold")
185
- .execute()];
186
- case 3:
187
- response = _a.sent();
188
- t.truthy(response);
189
- t.is("00", response.responseCode);
190
- return [2 /*return*/];
191
- }
192
- });
193
- }); });
194
- ava_1.default("JAVA_Hold_006c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
195
- var config, card, saleResponse, response;
196
- return __generator(this, function (_a) {
197
- switch (_a.label) {
198
- case 0:
199
- t.plan(2);
200
- config = new src_1.ServicesConfig();
201
- config.merchantId = "heartlandgpsandbox";
202
- config.accountId = "api";
203
- config.sharedSecret = "secret";
204
- config.refundPassword = "refund";
205
- config.rebatePassword = "rebate";
206
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
207
- config.timeout = 5000;
208
- config.channel = "ECOM";
209
- src_1.ServicesContainer.configure(config);
210
- card = new src_1.CreditCardData();
211
- card.number = "4263970000005262";
212
- card.expMonth = "12";
213
- card.expYear = "2020";
214
- card.cvn = "123";
215
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
216
- card.cardHolderName = "James Mason";
217
- return [4 /*yield*/, card
218
- .charge(10)
219
- .withCurrency("EUR")
220
- .execute()];
221
- case 1:
222
- saleResponse = _a.sent();
223
- t.truthy(saleResponse);
224
- t.is("00", saleResponse.responseCode);
225
- return [4 /*yield*/, throttle()];
226
- case 2:
227
- _a.sent();
228
- return [4 /*yield*/, saleResponse
229
- .hold()
230
- .withReasonCode(src_1.ReasonCode.Fraud)
231
- .withDescription("JAVA-Hold")
232
- .execute()];
233
- case 3:
234
- response = _a.sent();
235
- t.truthy(response);
236
- t.is("00", response.responseCode);
237
- return [2 /*return*/];
238
- }
239
- });
240
- }); });
241
- ava_1.default("JAVA_Hold_006d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
242
- var config, card, saleResponse, response;
243
- return __generator(this, function (_a) {
244
- switch (_a.label) {
245
- case 0:
246
- t.plan(2);
247
- config = new src_1.ServicesConfig();
248
- config.merchantId = "heartlandgpsandbox";
249
- config.accountId = "api";
250
- config.sharedSecret = "secret";
251
- config.refundPassword = "refund";
252
- config.rebatePassword = "rebate";
253
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
254
- config.timeout = 5000;
255
- config.channel = "ECOM";
256
- src_1.ServicesContainer.configure(config);
257
- card = new src_1.CreditCardData();
258
- card.number = "4263970000005262";
259
- card.expMonth = "12";
260
- card.expYear = "2020";
261
- card.cvn = "123";
262
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
263
- card.cardHolderName = "James Mason";
264
- return [4 /*yield*/, card
265
- .charge(10)
266
- .withCurrency("EUR")
267
- .execute()];
268
- case 1:
269
- saleResponse = _a.sent();
270
- t.truthy(saleResponse);
271
- t.is("00", saleResponse.responseCode);
272
- return [4 /*yield*/, throttle()];
273
- case 2:
274
- _a.sent();
275
- return [4 /*yield*/, saleResponse
276
- .hold()
277
- .withReasonCode(src_1.ReasonCode.Fraud)
278
- .withDescription("JAVA-Hold")
279
- .execute()];
280
- case 3:
281
- response = _a.sent();
282
- t.truthy(response);
283
- t.is("00", response.responseCode);
284
- return [2 /*return*/];
285
- }
286
- });
287
- }); });
288
- ava_1.default("JAVA_Hold_006e", function (t) { return __awaiter(void 0, void 0, void 0, function () {
289
- var config, card, saleResponse, response;
290
- return __generator(this, function (_a) {
291
- switch (_a.label) {
292
- case 0:
293
- t.plan(2);
294
- config = new src_1.ServicesConfig();
295
- config.merchantId = "heartlandgpsandbox";
296
- config.accountId = "api";
297
- config.sharedSecret = "secret";
298
- config.refundPassword = "refund";
299
- config.rebatePassword = "rebate";
300
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
301
- config.timeout = 5000;
302
- config.channel = "ECOM";
303
- src_1.ServicesContainer.configure(config);
304
- card = new src_1.CreditCardData();
305
- card.number = "4263970000005262";
306
- card.expMonth = "12";
307
- card.expYear = "2020";
308
- card.cvn = "123";
309
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
310
- card.cardHolderName = "James Mason";
311
- return [4 /*yield*/, card
312
- .charge(10)
313
- .withCurrency("EUR")
314
- .execute()];
315
- case 1:
316
- saleResponse = _a.sent();
317
- t.truthy(saleResponse);
318
- t.is("00", saleResponse.responseCode);
319
- return [4 /*yield*/, throttle()];
320
- case 2:
321
- _a.sent();
322
- return [4 /*yield*/, saleResponse
323
- .hold()
324
- .withReasonCode(src_1.ReasonCode.Fraud)
325
- .withDescription("JAVA-Hold")
326
- .execute()];
327
- case 3:
328
- response = _a.sent();
329
- t.truthy(response);
330
- t.is("00", response.responseCode);
331
- return [2 /*return*/];
332
- }
333
- });
334
- }); });
335
- ava_1.default("JAVA_Hold_006f", function (t) { return __awaiter(void 0, void 0, void 0, function () {
336
- var config, card, saleResponse, response;
337
- return __generator(this, function (_a) {
338
- switch (_a.label) {
339
- case 0:
340
- t.plan(2);
341
- config = new src_1.ServicesConfig();
342
- config.merchantId = "heartlandgpsandbox";
343
- config.accountId = "api";
344
- config.sharedSecret = "secret";
345
- config.refundPassword = "refund";
346
- config.rebatePassword = "rebate";
347
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
348
- config.timeout = 5000;
349
- config.channel = "ECOM";
350
- src_1.ServicesContainer.configure(config);
351
- card = new src_1.CreditCardData();
352
- card.number = "4263970000005262";
353
- card.expMonth = "12";
354
- card.expYear = "2020";
355
- card.cvn = "123";
356
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
357
- card.cardHolderName = "James Mason";
358
- return [4 /*yield*/, card
359
- .charge(10)
360
- .withCurrency("EUR")
361
- .execute()];
362
- case 1:
363
- saleResponse = _a.sent();
364
- t.truthy(saleResponse);
365
- t.is("00", saleResponse.responseCode);
366
- return [4 /*yield*/, throttle()];
367
- case 2:
368
- _a.sent();
369
- return [4 /*yield*/, saleResponse
370
- .hold()
371
- .withReasonCode(src_1.ReasonCode.Fraud)
372
- .withDescription("JAVA-Hold")
373
- .execute()];
374
- case 3:
375
- response = _a.sent();
376
- t.truthy(response);
377
- t.is("00", response.responseCode);
378
- return [2 /*return*/];
379
- }
380
- });
381
- }); });
382
- ava_1.default("JAVA_Hold_006g", function (t) { return __awaiter(void 0, void 0, void 0, function () {
383
- var config, card, saleResponse, response;
384
- return __generator(this, function (_a) {
385
- switch (_a.label) {
386
- case 0:
387
- t.plan(2);
388
- config = new src_1.ServicesConfig();
389
- config.merchantId = "heartlandgpsandbox";
390
- config.accountId = "api";
391
- config.sharedSecret = "secret";
392
- config.refundPassword = "refund";
393
- config.rebatePassword = "rebate";
394
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
395
- config.timeout = 5000;
396
- config.channel = "ECOM";
397
- src_1.ServicesContainer.configure(config);
398
- card = new src_1.CreditCardData();
399
- card.number = "4263970000005262";
400
- card.expMonth = "12";
401
- card.expYear = "2020";
402
- card.cvn = "123";
403
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
404
- card.cardHolderName = "James Mason";
405
- return [4 /*yield*/, card
406
- .charge(10)
407
- .withCurrency("EUR")
408
- .execute()];
409
- case 1:
410
- saleResponse = _a.sent();
411
- t.truthy(saleResponse);
412
- t.is("00", saleResponse.responseCode);
413
- return [4 /*yield*/, throttle()];
414
- case 2:
415
- _a.sent();
416
- return [4 /*yield*/, saleResponse
417
- .hold()
418
- .withReasonCode(src_1.ReasonCode.Fraud)
419
- .withDescription("JAVA-Hold")
420
- .execute()];
421
- case 3:
422
- response = _a.sent();
423
- t.truthy(response);
424
- t.is("00", response.responseCode);
425
- return [2 /*return*/];
426
- }
427
- });
428
- }); });
429
- ava_1.default("JAVA_Hold_006h", function (t) { return __awaiter(void 0, void 0, void 0, function () {
430
- var config, card, saleResponse, response;
431
- return __generator(this, function (_a) {
432
- switch (_a.label) {
433
- case 0:
434
- t.plan(2);
435
- config = new src_1.ServicesConfig();
436
- config.merchantId = "heartlandgpsandbox";
437
- config.accountId = "api";
438
- config.sharedSecret = "secret";
439
- config.refundPassword = "refund";
440
- config.rebatePassword = "rebate";
441
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
442
- config.timeout = 5000;
443
- config.channel = "ECOM";
444
- src_1.ServicesContainer.configure(config);
445
- card = new src_1.CreditCardData();
446
- card.number = "4263970000005262";
447
- card.expMonth = "12";
448
- card.expYear = "2020";
449
- card.cvn = "123";
450
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
451
- card.cardHolderName = "James Mason";
452
- return [4 /*yield*/, card
453
- .charge(10)
454
- .withCurrency("EUR")
455
- .execute()];
456
- case 1:
457
- saleResponse = _a.sent();
458
- t.truthy(saleResponse);
459
- t.is("00", saleResponse.responseCode);
460
- return [4 /*yield*/, throttle()];
461
- case 2:
462
- _a.sent();
463
- return [4 /*yield*/, saleResponse
464
- .hold()
465
- .withReasonCode(src_1.ReasonCode.Fraud)
466
- .withDescription("JAVA-Hold")
467
- .execute()];
468
- case 3:
469
- response = _a.sent();
470
- t.truthy(response);
471
- t.is("00", response.responseCode);
472
- return [2 /*return*/];
473
- }
474
- });
475
- }); });
476
- ava_1.default("JAVA_Hold_006i", function (t) { return __awaiter(void 0, void 0, void 0, function () {
477
- var config, card, saleResponse, response;
478
- return __generator(this, function (_a) {
479
- switch (_a.label) {
480
- case 0:
481
- t.plan(2);
482
- config = new src_1.ServicesConfig();
483
- config.merchantId = "heartlandgpsandbox";
484
- config.accountId = "api";
485
- config.sharedSecret = "secret";
486
- config.refundPassword = "refund";
487
- config.rebatePassword = "rebate";
488
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
489
- config.timeout = 5000;
490
- config.channel = "ECOM";
491
- src_1.ServicesContainer.configure(config);
492
- card = new src_1.CreditCardData();
493
- card.number = "4263970000005262";
494
- card.expMonth = "12";
495
- card.expYear = "2020";
496
- card.cvn = "123";
497
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
498
- card.cardHolderName = "James Mason";
499
- return [4 /*yield*/, card
500
- .charge(10)
501
- .withCurrency("EUR")
502
- .execute()];
503
- case 1:
504
- saleResponse = _a.sent();
505
- t.truthy(saleResponse);
506
- t.is("00", saleResponse.responseCode);
507
- return [4 /*yield*/, throttle()];
508
- case 2:
509
- _a.sent();
510
- return [4 /*yield*/, saleResponse
511
- .hold()
512
- .withReasonCode(src_1.ReasonCode.Fraud)
513
- .withDescription("JAVA-Hold")
514
- .execute()];
515
- case 3:
516
- response = _a.sent();
517
- t.truthy(response);
518
- t.is("00", response.responseCode);
519
- return [2 /*return*/];
520
- }
521
- });
522
- }); });
523
- ava_1.default("JAVA_Hold_006k", function (t) { return __awaiter(void 0, void 0, void 0, function () {
524
- var config, card, saleResponse, response;
525
- return __generator(this, function (_a) {
526
- switch (_a.label) {
527
- case 0:
528
- t.plan(2);
529
- config = new src_1.ServicesConfig();
530
- config.merchantId = "heartlandgpsandbox";
531
- config.accountId = "api";
532
- config.sharedSecret = "secret";
533
- config.refundPassword = "refund";
534
- config.rebatePassword = "rebate";
535
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
536
- config.timeout = 5000;
537
- config.channel = "ECOM";
538
- src_1.ServicesContainer.configure(config);
539
- card = new src_1.CreditCardData();
540
- card.number = "4263970000005262";
541
- card.expMonth = "12";
542
- card.expYear = "2020";
543
- card.cvn = "123";
544
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
545
- card.cardHolderName = "James Mason";
546
- return [4 /*yield*/, card
547
- .charge(10)
548
- .withCurrency("EUR")
549
- .execute()];
550
- case 1:
551
- saleResponse = _a.sent();
552
- t.truthy(saleResponse);
553
- t.is("00", saleResponse.responseCode);
554
- return [4 /*yield*/, throttle()];
555
- case 2:
556
- _a.sent();
557
- return [4 /*yield*/, saleResponse
558
- .hold()
559
- .withReasonCode(src_1.ReasonCode.Fraud)
560
- .withDescription("JAVA-Hold")
561
- .execute()];
562
- case 3:
563
- response = _a.sent();
564
- t.truthy(response);
565
- t.is("00", response.responseCode);
566
- return [2 /*return*/];
567
- }
568
- });
569
- }); });
570
- ava_1.default("JAVA_Hold_006l", function (t) { return __awaiter(void 0, void 0, void 0, function () {
571
- var config, card, saleResponse, response;
572
- return __generator(this, function (_a) {
573
- switch (_a.label) {
574
- case 0:
575
- t.plan(2);
576
- config = new src_1.ServicesConfig();
577
- config.merchantId = "heartlandgpsandbox";
578
- config.accountId = "api";
579
- config.sharedSecret = "secret";
580
- config.refundPassword = "refund";
581
- config.rebatePassword = "rebate";
582
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
583
- config.timeout = 5000;
584
- config.channel = "ECOM";
585
- src_1.ServicesContainer.configure(config);
586
- card = new src_1.CreditCardData();
587
- card.number = "4263970000005262";
588
- card.expMonth = "12";
589
- card.expYear = "2020";
590
- card.cvn = "123";
591
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
592
- card.cardHolderName = "James Mason";
593
- return [4 /*yield*/, card
594
- .charge(10)
595
- .withCurrency("EUR")
596
- .execute()];
597
- case 1:
598
- saleResponse = _a.sent();
599
- t.truthy(saleResponse);
600
- t.is("00", saleResponse.responseCode);
601
- return [4 /*yield*/, throttle()];
602
- case 2:
603
- _a.sent();
604
- return [4 /*yield*/, saleResponse
605
- .hold()
606
- .withReasonCode(src_1.ReasonCode.Fraud)
607
- .withDescription("JAVA-Hold")
608
- .execute()];
609
- case 3:
610
- response = _a.sent();
611
- t.truthy(response);
612
- t.is("00", response.responseCode);
613
- return [2 /*return*/];
614
- }
615
- });
616
- }); });
617
- ava_1.default("JAVA_Hold_007a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
618
- var config, card, saleResponse, response;
619
- return __generator(this, function (_a) {
620
- switch (_a.label) {
621
- case 0:
622
- t.plan(2);
623
- config = new src_1.ServicesConfig();
624
- config.merchantId = "heartlandgpsandbox";
625
- config.accountId = "api";
626
- config.sharedSecret = "secret";
627
- config.refundPassword = "refund";
628
- config.rebatePassword = "rebate";
629
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
630
- config.timeout = 5000;
631
- config.channel = "ECOM";
632
- src_1.ServicesContainer.configure(config);
633
- card = new src_1.CreditCardData();
634
- card.number = "4263970000005262";
635
- card.expMonth = "12";
636
- card.expYear = "2020";
637
- card.cvn = "123";
638
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
639
- card.cardHolderName = "James Mason";
640
- return [4 /*yield*/, card
641
- .charge(10)
642
- .withCurrency("EUR")
643
- .execute()];
644
- case 1:
645
- saleResponse = _a.sent();
646
- t.truthy(saleResponse);
647
- t.is("00", saleResponse.responseCode);
648
- return [4 /*yield*/, throttle()];
649
- case 2:
650
- _a.sent();
651
- return [4 /*yield*/, saleResponse
652
- .hold()
653
- .withReasonCode(src_1.ReasonCode.Fraud)
654
- .withDescription("JAVA-Hold")
655
- .execute()];
656
- case 3:
657
- response = _a.sent();
658
- t.truthy(response);
659
- t.is("00", response.responseCode);
660
- return [2 /*return*/];
661
- }
662
- });
663
- }); });
664
- ava_1.default("JAVA_Hold_007b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
665
- var config, card, saleResponse, response;
666
- return __generator(this, function (_a) {
667
- switch (_a.label) {
668
- case 0:
669
- t.plan(2);
670
- config = new src_1.ServicesConfig();
671
- config.merchantId = "heartlandgpsandbox";
672
- config.accountId = "api";
673
- config.sharedSecret = "secret";
674
- config.refundPassword = "refund";
675
- config.rebatePassword = "rebate";
676
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
677
- config.timeout = 5000;
678
- config.channel = "ECOM";
679
- src_1.ServicesContainer.configure(config);
680
- card = new src_1.CreditCardData();
681
- card.number = "4263970000005262";
682
- card.expMonth = "12";
683
- card.expYear = "2020";
684
- card.cvn = "123";
685
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
686
- card.cardHolderName = "James Mason";
687
- return [4 /*yield*/, card
688
- .charge(10)
689
- .withCurrency("EUR")
690
- .execute()];
691
- case 1:
692
- saleResponse = _a.sent();
693
- t.truthy(saleResponse);
694
- t.is("00", saleResponse.responseCode);
695
- return [4 /*yield*/, throttle()];
696
- case 2:
697
- _a.sent();
698
- return [4 /*yield*/, saleResponse
699
- .hold()
700
- .withReasonCode(src_1.ReasonCode.Fraud)
701
- .withDescription("JAVA-Hold")
702
- .execute()];
703
- case 3:
704
- response = _a.sent();
705
- t.truthy(response);
706
- t.is("00", response.responseCode);
707
- return [2 /*return*/];
708
- }
709
- });
710
- }); });
711
- ava_1.default("JAVA_Hold_007c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
712
- var config, card, saleResponse, response;
713
- return __generator(this, function (_a) {
714
- switch (_a.label) {
715
- case 0:
716
- t.plan(2);
717
- config = new src_1.ServicesConfig();
718
- config.merchantId = "heartlandgpsandbox";
719
- config.accountId = "api";
720
- config.sharedSecret = "secret";
721
- config.refundPassword = "refund";
722
- config.rebatePassword = "rebate";
723
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
724
- config.timeout = 5000;
725
- config.channel = "ECOM";
726
- src_1.ServicesContainer.configure(config);
727
- card = new src_1.CreditCardData();
728
- card.number = "4263970000005262";
729
- card.expMonth = "12";
730
- card.expYear = "2020";
731
- card.cvn = "123";
732
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
733
- card.cardHolderName = "James Mason";
734
- return [4 /*yield*/, card
735
- .charge(10)
736
- .withCurrency("EUR")
737
- .execute()];
738
- case 1:
739
- saleResponse = _a.sent();
740
- t.truthy(saleResponse);
741
- t.is("00", saleResponse.responseCode);
742
- return [4 /*yield*/, throttle()];
743
- case 2:
744
- _a.sent();
745
- return [4 /*yield*/, saleResponse
746
- .hold()
747
- .withReasonCode(src_1.ReasonCode.Fraud)
748
- .withDescription("JAVA-Hold")
749
- .execute()];
750
- case 3:
751
- response = _a.sent();
752
- t.truthy(response);
753
- t.is("00", response.responseCode);
754
- return [2 /*return*/];
755
- }
756
- });
757
- }); });
758
- ava_1.default("JAVA_Hold_007d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
759
- var config, saleResponse, error;
760
- return __generator(this, function (_a) {
761
- t.plan(2);
762
- config = new src_1.ServicesConfig();
763
- config.merchantId = "heartlandgpsandbox";
764
- config.accountId = "api";
765
- config.sharedSecret = "secret";
766
- config.refundPassword = "refund";
767
- config.rebatePassword = "rebate";
768
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
769
- config.timeout = 5000;
770
- src_1.ServicesContainer.configure(config);
771
- saleResponse = src_1.Transaction.fromId(undefined);
772
- error = t.throws(function () {
773
- return saleResponse
774
- .hold()
775
- .withReasonCode(src_1.ReasonCode.Fraud)
776
- .execute();
777
- }, src_1.BuilderError);
778
- t.truthy(error.message);
779
- return [2 /*return*/];
780
- });
781
- }); });
782
- ava_1.default("JAVA_Hold_007e", function (t) { return __awaiter(void 0, void 0, void 0, function () {
783
- var config, saleResponse, error;
784
- return __generator(this, function (_a) {
785
- t.plan(2);
786
- config = new src_1.ServicesConfig();
787
- config.merchantId = "heartlandgpsandbox";
788
- config.accountId = "api";
789
- config.sharedSecret = "secret";
790
- config.refundPassword = "refund";
791
- config.rebatePassword = "rebate";
792
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
793
- config.timeout = 5000;
794
- src_1.ServicesContainer.configure(config);
795
- saleResponse = src_1.Transaction.fromId(undefined);
796
- error = t.throws(function () {
797
- return saleResponse
798
- .hold()
799
- .withReasonCode(src_1.ReasonCode.Fraud)
800
- .execute();
801
- }, src_1.BuilderError);
802
- t.truthy(error.message);
803
- return [2 /*return*/];
804
- });
805
- }); });
806
- ava_1.default("JAVA_Hold_008a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
807
- var config, card, saleResponse, response;
808
- return __generator(this, function (_a) {
809
- switch (_a.label) {
810
- case 0:
811
- t.plan(2);
812
- config = new src_1.ServicesConfig();
813
- config.merchantId = "heartlandgpsandbox";
814
- config.accountId = "api";
815
- config.sharedSecret = "secret";
816
- config.refundPassword = "refund";
817
- config.rebatePassword = "rebate";
818
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
819
- config.timeout = 5000;
820
- config.channel = "ECOM";
821
- src_1.ServicesContainer.configure(config);
822
- card = new src_1.CreditCardData();
823
- card.number = "4263970000005262";
824
- card.expMonth = "12";
825
- card.expYear = "2020";
826
- card.cvn = "123";
827
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
828
- card.cardHolderName = "James Mason";
829
- return [4 /*yield*/, card
830
- .charge(10)
831
- .withCurrency("EUR")
832
- .execute()];
833
- case 1:
834
- saleResponse = _a.sent();
835
- t.truthy(saleResponse);
836
- t.is("00", saleResponse.responseCode);
837
- return [4 /*yield*/, throttle()];
838
- case 2:
839
- _a.sent();
840
- return [4 /*yield*/, saleResponse
841
- .hold()
842
- .withReasonCode(src_1.ReasonCode.Fraud)
843
- .withDescription("JAVA-Hold")
844
- .execute()];
845
- case 3:
846
- response = _a.sent();
847
- t.truthy(response);
848
- t.is("00", response.responseCode);
849
- return [2 /*return*/];
850
- }
851
- });
852
- }); });
853
- ava_1.default("JAVA_Hold_008b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
854
- var config, card, saleResponse, response;
855
- return __generator(this, function (_a) {
856
- switch (_a.label) {
857
- case 0:
858
- t.plan(2);
859
- config = new src_1.ServicesConfig();
860
- config.merchantId = "heartlandgpsandbox";
861
- config.accountId = "api";
862
- config.sharedSecret = "secret";
863
- config.refundPassword = "refund";
864
- config.rebatePassword = "rebate";
865
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
866
- config.timeout = 5000;
867
- config.channel = "ECOM";
868
- src_1.ServicesContainer.configure(config);
869
- card = new src_1.CreditCardData();
870
- card.number = "4263970000005262";
871
- card.expMonth = "12";
872
- card.expYear = "2020";
873
- card.cvn = "123";
874
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
875
- card.cardHolderName = "James Mason";
876
- return [4 /*yield*/, card
877
- .charge(10)
878
- .withCurrency("EUR")
879
- .execute()];
880
- case 1:
881
- saleResponse = _a.sent();
882
- t.truthy(saleResponse);
883
- t.is("00", saleResponse.responseCode);
884
- return [4 /*yield*/, throttle()];
885
- case 2:
886
- _a.sent();
887
- return [4 /*yield*/, saleResponse
888
- .hold()
889
- .withReasonCode(src_1.ReasonCode.Fraud)
890
- .withDescription("JAVA-Hold")
891
- .execute()];
892
- case 3:
893
- response = _a.sent();
894
- t.truthy(response);
895
- t.is("00", response.responseCode);
896
- return [2 /*return*/];
897
- }
898
- });
899
- }); });
900
- ava_1.default("JAVA_Hold_008c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
901
- var config, saleResponse, error;
902
- return __generator(this, function (_a) {
903
- t.plan(2);
904
- config = new src_1.ServicesConfig();
905
- config.merchantId = "heartlandgpsandbox";
906
- config.accountId = "api";
907
- config.sharedSecret = "secret";
908
- config.refundPassword = "refund";
909
- config.rebatePassword = "rebate";
910
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
911
- config.timeout = 5000;
912
- src_1.ServicesContainer.configure(config);
913
- saleResponse = src_1.Transaction.fromId(undefined);
914
- error = t.throws(function () {
915
- return saleResponse
916
- .hold()
917
- .withReasonCode(src_1.ReasonCode.Fraud)
918
- .execute();
919
- }, src_1.BuilderError);
920
- t.truthy(error.message);
921
- return [2 /*return*/];
922
- });
923
- }); });
924
- ava_1.default("JAVA_Hold_008d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
925
- var config, saleResponse, error;
926
- return __generator(this, function (_a) {
927
- t.plan(2);
928
- config = new src_1.ServicesConfig();
929
- config.merchantId = "heartlandgpsandbox";
930
- config.accountId = "api";
931
- config.sharedSecret = "secret";
932
- config.refundPassword = "refund";
933
- config.rebatePassword = "rebate";
934
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
935
- config.timeout = 5000;
936
- src_1.ServicesContainer.configure(config);
937
- saleResponse = src_1.Transaction.fromId(undefined);
938
- error = t.throws(function () {
939
- return saleResponse
940
- .hold()
941
- .withReasonCode(src_1.ReasonCode.Fraud)
942
- .execute();
943
- }, src_1.BuilderError);
944
- t.truthy(error.message);
945
- return [2 /*return*/];
946
- });
947
- }); });
948
- ava_1.default("JAVA_Hold_008e", function (t) { return __awaiter(void 0, void 0, void 0, function () {
949
- var config, saleResponse, error;
950
- return __generator(this, function (_a) {
951
- t.plan(2);
952
- config = new src_1.ServicesConfig();
953
- config.merchantId = "heartlandgpsandbox";
954
- config.accountId = "api";
955
- config.sharedSecret = "secret";
956
- config.refundPassword = "refund";
957
- config.rebatePassword = "rebate";
958
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
959
- config.timeout = 5000;
960
- src_1.ServicesContainer.configure(config);
961
- saleResponse = src_1.Transaction.fromId(undefined);
962
- error = t.throws(function () {
963
- return saleResponse
964
- .hold()
965
- .withReasonCode(src_1.ReasonCode.Fraud)
966
- .execute();
967
- }, src_1.BuilderError);
968
- t.truthy(error.message);
969
- return [2 /*return*/];
970
- });
971
- }); });
972
- ava_1.default("JAVA_Hold_009c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
973
- var config, card, saleResponse, response;
974
- return __generator(this, function (_a) {
975
- switch (_a.label) {
976
- case 0:
977
- t.plan(2);
978
- config = new src_1.ServicesConfig();
979
- config.merchantId = "heartlandgpsandbox";
980
- config.accountId = "api";
981
- config.sharedSecret = "secret";
982
- config.refundPassword = "refund";
983
- config.rebatePassword = "rebate";
984
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
985
- config.timeout = 5000;
986
- config.channel = "ECOM";
987
- src_1.ServicesContainer.configure(config);
988
- card = new src_1.CreditCardData();
989
- card.number = "4263970000005262";
990
- card.expMonth = "12";
991
- card.expYear = "2020";
992
- card.cvn = "123";
993
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
994
- card.cardHolderName = "James Mason";
995
- return [4 /*yield*/, card
996
- .charge(10)
997
- .withCurrency("EUR")
998
- .execute()];
999
- case 1:
1000
- saleResponse = _a.sent();
1001
- t.truthy(saleResponse);
1002
- t.is("00", saleResponse.responseCode);
1003
- return [4 /*yield*/, throttle()];
1004
- case 2:
1005
- _a.sent();
1006
- return [4 /*yield*/, saleResponse
1007
- .hold()
1008
- .withReasonCode(src_1.ReasonCode.Fraud)
1009
- .withDescription("JAVA-Hold")
1010
- .execute()];
1011
- case 3:
1012
- response = _a.sent();
1013
- t.truthy(response);
1014
- t.is("00", response.responseCode);
1015
- return [2 /*return*/];
1016
- }
1017
- });
1018
- }); });
1019
- ava_1.default("JAVA_Hold_009d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1020
- var config, saleResponse, error;
1021
- return __generator(this, function (_a) {
1022
- t.plan(2);
1023
- config = new src_1.ServicesConfig();
1024
- config.merchantId = "heartlandgpsandbox";
1025
- config.accountId = "api";
1026
- config.sharedSecret = "secret";
1027
- config.refundPassword = "refund";
1028
- config.rebatePassword = "rebate";
1029
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1030
- config.timeout = 5000;
1031
- config.channel = "ECOM";
1032
- src_1.ServicesContainer.configure(config);
1033
- saleResponse = src_1.Transaction.fromId(undefined);
1034
- error = t.throws(function () {
1035
- return saleResponse
1036
- .hold()
1037
- .withReasonCode(src_1.ReasonCode.Fraud)
1038
- .withDescription("SDK-JAVA-Query")
1039
- .execute();
1040
- }, src_1.BuilderError);
1041
- t.truthy(error.message);
1042
- return [2 /*return*/];
1043
- });
1044
- }); });
1045
- ava_1.default("JAVA_Hold_009e", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1046
- var config, saleResponse, error;
1047
- return __generator(this, function (_a) {
1048
- t.plan(2);
1049
- config = new src_1.ServicesConfig();
1050
- config.merchantId = "heartlandgpsandbox";
1051
- config.accountId = "api";
1052
- config.sharedSecret = "secret";
1053
- config.refundPassword = "refund";
1054
- config.rebatePassword = "rebate";
1055
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1056
- config.timeout = 5000;
1057
- config.channel = "ECOM";
1058
- src_1.ServicesContainer.configure(config);
1059
- saleResponse = src_1.Transaction.fromId(undefined);
1060
- error = t.throws(function () {
1061
- return saleResponse
1062
- .hold()
1063
- .withReasonCode(src_1.ReasonCode.Fraud)
1064
- .withDescription("SDK-JAVA-Query")
1065
- .execute();
1066
- }, src_1.BuilderError);
1067
- t.truthy(error.message);
1068
- return [2 /*return*/];
1069
- });
1070
- }); });
1071
- ava_1.default("JAVA_Hold_010a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1072
- var config, card, saleResponse, response;
1073
- return __generator(this, function (_a) {
1074
- switch (_a.label) {
1075
- case 0:
1076
- t.plan(2);
1077
- config = new src_1.ServicesConfig();
1078
- config.merchantId = "heartlandgpsandbox";
1079
- config.accountId = "api";
1080
- config.sharedSecret = "secret";
1081
- config.refundPassword = "refund";
1082
- config.rebatePassword = "rebate";
1083
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1084
- config.timeout = 5000;
1085
- config.channel = "ECOM";
1086
- src_1.ServicesContainer.configure(config);
1087
- card = new src_1.CreditCardData();
1088
- card.number = "4263970000005262";
1089
- card.expMonth = "12";
1090
- card.expYear = "2020";
1091
- card.cvn = "123";
1092
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1093
- card.cardHolderName = "James Mason";
1094
- return [4 /*yield*/, card
1095
- .charge(10)
1096
- .withCurrency("EUR")
1097
- .execute()];
1098
- case 1:
1099
- saleResponse = _a.sent();
1100
- t.truthy(saleResponse);
1101
- t.is("00", saleResponse.responseCode);
1102
- return [4 /*yield*/, throttle()];
1103
- case 2:
1104
- _a.sent();
1105
- return [4 /*yield*/, saleResponse
1106
- .hold()
1107
- .withReasonCode(src_1.ReasonCode.Fraud)
1108
- .withDescription("JAVA-Hold")
1109
- .execute()];
1110
- case 3:
1111
- response = _a.sent();
1112
- t.truthy(response);
1113
- t.is("00", response.responseCode);
1114
- return [2 /*return*/];
1115
- }
1116
- });
1117
- }); });
1118
- ava_1.default("JAVA_Hold_010b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1119
- var config, card, saleResponse, response;
1120
- return __generator(this, function (_a) {
1121
- switch (_a.label) {
1122
- case 0:
1123
- t.plan(2);
1124
- config = new src_1.ServicesConfig();
1125
- config.merchantId = "heartlandgpsandbox";
1126
- config.accountId = "api";
1127
- config.sharedSecret = "secret";
1128
- config.refundPassword = "refund";
1129
- config.rebatePassword = "rebate";
1130
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1131
- config.timeout = 5000;
1132
- config.channel = "ECOM";
1133
- src_1.ServicesContainer.configure(config);
1134
- card = new src_1.CreditCardData();
1135
- card.number = "4263970000005262";
1136
- card.expMonth = "12";
1137
- card.expYear = "2020";
1138
- card.cvn = "123";
1139
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1140
- card.cardHolderName = "James Mason";
1141
- return [4 /*yield*/, card
1142
- .charge(10)
1143
- .withCurrency("EUR")
1144
- .execute()];
1145
- case 1:
1146
- saleResponse = _a.sent();
1147
- t.truthy(saleResponse);
1148
- t.is("00", saleResponse.responseCode);
1149
- return [4 /*yield*/, throttle()];
1150
- case 2:
1151
- _a.sent();
1152
- return [4 /*yield*/, saleResponse
1153
- .hold()
1154
- .withReasonCode(src_1.ReasonCode.Fraud)
1155
- .withDescription("JAVA-Hold")
1156
- .execute()];
1157
- case 3:
1158
- response = _a.sent();
1159
- t.truthy(response);
1160
- t.is("00", response.responseCode);
1161
- return [2 /*return*/];
1162
- }
1163
- });
1164
- }); });
1165
- ava_1.default("JAVA_Hold_010c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1166
- var config, saleResponse, error;
1167
- return __generator(this, function (_a) {
1168
- t.plan(2);
1169
- config = new src_1.ServicesConfig();
1170
- config.merchantId = "heartlandgpsandbox";
1171
- config.accountId = "api";
1172
- config.sharedSecret = "secret";
1173
- config.refundPassword = "refund";
1174
- config.rebatePassword = "rebate";
1175
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1176
- config.timeout = 5000;
1177
- config.channel = "ECOM";
1178
- src_1.ServicesContainer.configure(config);
1179
- saleResponse = src_1.Transaction.fromId(undefined);
1180
- error = t.throws(function () {
1181
- return saleResponse
1182
- .hold()
1183
- .withReasonCode(src_1.ReasonCode.Fraud)
1184
- .withDescription("JAVA-Hold")
1185
- .execute();
1186
- }, src_1.BuilderError);
1187
- t.truthy(error.message);
1188
- return [2 /*return*/];
1189
- });
1190
- }); });
1191
- ava_1.default("JAVA_Hold_010d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1192
- var config, card, saleResponse, response;
1193
- return __generator(this, function (_a) {
1194
- switch (_a.label) {
1195
- case 0:
1196
- t.plan(2);
1197
- config = new src_1.ServicesConfig();
1198
- config.merchantId = "heartlandgpsandbox";
1199
- config.accountId = "api";
1200
- config.sharedSecret = "secret";
1201
- config.refundPassword = "refund";
1202
- config.rebatePassword = "rebate";
1203
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1204
- config.timeout = 5000;
1205
- config.channel = "ECOM";
1206
- src_1.ServicesContainer.configure(config);
1207
- card = new src_1.CreditCardData();
1208
- card.number = "4263970000005262";
1209
- card.expMonth = "12";
1210
- card.expYear = "2020";
1211
- card.cvn = "123";
1212
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1213
- card.cardHolderName = "James Mason";
1214
- return [4 /*yield*/, card
1215
- .charge(10)
1216
- .withCurrency("EUR")
1217
- .execute()];
1218
- case 1:
1219
- saleResponse = _a.sent();
1220
- t.truthy(saleResponse);
1221
- t.is("00", saleResponse.responseCode);
1222
- return [4 /*yield*/, throttle()];
1223
- case 2:
1224
- _a.sent();
1225
- return [4 /*yield*/, saleResponse
1226
- .hold()
1227
- .withReasonCode(src_1.ReasonCode.Fraud)
1228
- .withDescription("JAVA-Hold")
1229
- .execute()];
1230
- case 3:
1231
- response = _a.sent();
1232
- t.truthy(response);
1233
- t.is("00", response.responseCode);
1234
- return [2 /*return*/];
1235
- }
1236
- });
1237
- }); });
1238
- ava_1.default("JAVA_Hold_011a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1239
- var config, card, saleResponse, response;
1240
- return __generator(this, function (_a) {
1241
- switch (_a.label) {
1242
- case 0:
1243
- t.plan(2);
1244
- config = new src_1.ServicesConfig();
1245
- config.merchantId = "heartlandgpsandbox";
1246
- config.accountId = "api";
1247
- config.sharedSecret = "secret";
1248
- config.refundPassword = "refund";
1249
- config.rebatePassword = "rebate";
1250
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1251
- config.timeout = 5000;
1252
- config.channel = "ECOM";
1253
- src_1.ServicesContainer.configure(config);
1254
- card = new src_1.CreditCardData();
1255
- card.number = "4263970000005262";
1256
- card.expMonth = "12";
1257
- card.expYear = "2020";
1258
- card.cvn = "123";
1259
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1260
- card.cardHolderName = "James Mason";
1261
- return [4 /*yield*/, card
1262
- .charge(10)
1263
- .withCurrency("EUR")
1264
- .execute()];
1265
- case 1:
1266
- saleResponse = _a.sent();
1267
- t.truthy(saleResponse);
1268
- t.is("00", saleResponse.responseCode);
1269
- return [4 /*yield*/, throttle()];
1270
- case 2:
1271
- _a.sent();
1272
- return [4 /*yield*/, saleResponse
1273
- .hold()
1274
- .withReasonCode(src_1.ReasonCode.Fraud)
1275
- .withDescription("JAVA-Hold")
1276
- .execute()];
1277
- case 3:
1278
- response = _a.sent();
1279
- t.truthy(response);
1280
- t.is("00", response.responseCode);
1281
- return [2 /*return*/];
1282
- }
1283
- });
1284
- }); });
1285
- ava_1.default("JAVA_Hold_011b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1286
- var config, card, saleResponse, response;
1287
- return __generator(this, function (_a) {
1288
- switch (_a.label) {
1289
- case 0:
1290
- t.plan(2);
1291
- config = new src_1.ServicesConfig();
1292
- config.merchantId = "heartlandgpsandbox";
1293
- config.accountId = "api";
1294
- config.sharedSecret = "secret";
1295
- config.refundPassword = "refund";
1296
- config.rebatePassword = "rebate";
1297
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1298
- config.timeout = 5000;
1299
- config.channel = "ECOM";
1300
- src_1.ServicesContainer.configure(config);
1301
- card = new src_1.CreditCardData();
1302
- card.number = "4263970000005262";
1303
- card.expMonth = "12";
1304
- card.expYear = "2020";
1305
- card.cvn = "123";
1306
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1307
- card.cardHolderName = "James Mason";
1308
- return [4 /*yield*/, card
1309
- .charge(10)
1310
- .withCurrency("EUR")
1311
- .execute()];
1312
- case 1:
1313
- saleResponse = _a.sent();
1314
- t.truthy(saleResponse);
1315
- t.is("00", saleResponse.responseCode);
1316
- return [4 /*yield*/, throttle()];
1317
- case 2:
1318
- _a.sent();
1319
- return [4 /*yield*/, saleResponse
1320
- .hold()
1321
- .withReasonCode(undefined)
1322
- .withDescription("JAVA-Hold")
1323
- .execute()];
1324
- case 3:
1325
- response = _a.sent();
1326
- t.truthy(response);
1327
- t.is("00", response.responseCode);
1328
- return [2 /*return*/];
1329
- }
1330
- });
1331
- }); });
1332
- ava_1.default("JAVA_Hold_011c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1333
- var config, card, saleResponse, response;
1334
- return __generator(this, function (_a) {
1335
- switch (_a.label) {
1336
- case 0:
1337
- t.plan(2);
1338
- config = new src_1.ServicesConfig();
1339
- config.merchantId = "heartlandgpsandbox";
1340
- config.accountId = "api";
1341
- config.sharedSecret = "secret";
1342
- config.refundPassword = "refund";
1343
- config.rebatePassword = "rebate";
1344
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1345
- config.timeout = 5000;
1346
- config.channel = "ECOM";
1347
- src_1.ServicesContainer.configure(config);
1348
- card = new src_1.CreditCardData();
1349
- card.number = "4263970000005262";
1350
- card.expMonth = "12";
1351
- card.expYear = "2020";
1352
- card.cvn = "123";
1353
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1354
- card.cardHolderName = "James Mason";
1355
- return [4 /*yield*/, card
1356
- .charge(10)
1357
- .withCurrency("EUR")
1358
- .execute()];
1359
- case 1:
1360
- saleResponse = _a.sent();
1361
- t.truthy(saleResponse);
1362
- t.is("00", saleResponse.responseCode);
1363
- return [4 /*yield*/, throttle()];
1364
- case 2:
1365
- _a.sent();
1366
- return [4 /*yield*/, saleResponse
1367
- .hold()
1368
- .withDescription("JAVA-Hold")
1369
- .execute()];
1370
- case 3:
1371
- response = _a.sent();
1372
- t.truthy(response);
1373
- t.is("00", response.responseCode);
1374
- return [2 /*return*/];
1375
- }
1376
- });
1377
- }); });
1378
- ava_1.default("JAVA_Hold_011d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1379
- var config, card, saleResponse, response;
1380
- return __generator(this, function (_a) {
1381
- switch (_a.label) {
1382
- case 0:
1383
- t.plan(2);
1384
- config = new src_1.ServicesConfig();
1385
- config.merchantId = "heartlandgpsandbox";
1386
- config.accountId = "api";
1387
- config.sharedSecret = "secret";
1388
- config.refundPassword = "refund";
1389
- config.rebatePassword = "rebate";
1390
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1391
- config.timeout = 5000;
1392
- config.channel = "ECOM";
1393
- src_1.ServicesContainer.configure(config);
1394
- card = new src_1.CreditCardData();
1395
- card.number = "4263970000005262";
1396
- card.expMonth = "12";
1397
- card.expYear = "2020";
1398
- card.cvn = "123";
1399
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1400
- card.cardHolderName = "James Mason";
1401
- return [4 /*yield*/, card
1402
- .charge(10)
1403
- .withCurrency("EUR")
1404
- .execute()];
1405
- case 1:
1406
- saleResponse = _a.sent();
1407
- t.truthy(saleResponse);
1408
- t.is("00", saleResponse.responseCode);
1409
- return [4 /*yield*/, throttle()];
1410
- case 2:
1411
- _a.sent();
1412
- return [4 /*yield*/, saleResponse
1413
- .hold()
1414
- .withReasonCode(undefined)
1415
- .withDescription("JAVA-Hold")
1416
- .execute()];
1417
- case 3:
1418
- response = _a.sent();
1419
- t.truthy(response);
1420
- t.is("00", response.responseCode);
1421
- return [2 /*return*/];
1422
- }
1423
- });
1424
- }); });
1425
- ava_1.default("JAVA_Hold_012a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1426
- var config, card, saleResponse, response;
1427
- return __generator(this, function (_a) {
1428
- switch (_a.label) {
1429
- case 0:
1430
- t.plan(2);
1431
- config = new src_1.ServicesConfig();
1432
- config.merchantId = "heartlandgpsandbox";
1433
- config.accountId = "api";
1434
- config.sharedSecret = "secret";
1435
- config.refundPassword = "refund";
1436
- config.rebatePassword = "rebate";
1437
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1438
- config.timeout = 5000;
1439
- config.channel = "ECOM";
1440
- src_1.ServicesContainer.configure(config);
1441
- card = new src_1.CreditCardData();
1442
- card.number = "4263970000005262";
1443
- card.expMonth = "12";
1444
- card.expYear = "2020";
1445
- card.cvn = "123";
1446
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1447
- card.cardHolderName = "James Mason";
1448
- return [4 /*yield*/, card
1449
- .charge(10)
1450
- .withCurrency("EUR")
1451
- .execute()];
1452
- case 1:
1453
- saleResponse = _a.sent();
1454
- t.truthy(saleResponse);
1455
- t.is("00", saleResponse.responseCode);
1456
- return [4 /*yield*/, throttle()];
1457
- case 2:
1458
- _a.sent();
1459
- return [4 /*yield*/, saleResponse
1460
- .hold()
1461
- .withReasonCode(src_1.ReasonCode.Fraud)
1462
- .withDescription("JAVA-Hold")
1463
- .execute()];
1464
- case 3:
1465
- response = _a.sent();
1466
- t.truthy(response);
1467
- t.is("00", response.responseCode);
1468
- return [2 /*return*/];
1469
- }
1470
- });
1471
- }); });
1472
- ava_1.default("JAVA_Hold_012b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1473
- var config, card, saleResponse, error;
1474
- return __generator(this, function (_a) {
1475
- switch (_a.label) {
1476
- case 0:
1477
- t.plan(2);
1478
- config = new src_1.ServicesConfig();
1479
- config.merchantId = "heartlandgpsandbox";
1480
- config.accountId = "api";
1481
- config.sharedSecret = "secreto";
1482
- config.refundPassword = "refund";
1483
- config.rebatePassword = "rebate";
1484
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1485
- config.timeout = 5000;
1486
- config.channel = "ECOM";
1487
- src_1.ServicesContainer.configure(config);
1488
- card = new src_1.CreditCardData();
1489
- card.number = "4263970000005262";
1490
- card.expMonth = "12";
1491
- card.expYear = "2020";
1492
- card.cvn = "123";
1493
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1494
- card.cardHolderName = "James Mason";
1495
- return [4 /*yield*/, card
1496
- .charge(10)
1497
- .withCurrency("EUR")
1498
- .execute()];
1499
- case 1:
1500
- saleResponse = _a.sent();
1501
- t.truthy(saleResponse);
1502
- t.is("00", saleResponse.responseCode);
1503
- return [4 /*yield*/, throttle()];
1504
- case 2:
1505
- _a.sent();
1506
- return [4 /*yield*/, t.throws(saleResponse
1507
- .hold()
1508
- .withReasonCode(src_1.ReasonCode.Fraud)
1509
- .withDescription("SDK-JAVA-Query")
1510
- .execute(), src_1.GatewayError)];
1511
- case 3:
1512
- error = _a.sent();
1513
- t.truthy(error.message);
1514
- return [2 /*return*/];
1515
- }
1516
- });
1517
- }); });
1518
- ava_1.default("JAVA_Hold_013a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1519
- var config, card, saleResponse, response;
1520
- return __generator(this, function (_a) {
1521
- switch (_a.label) {
1522
- case 0:
1523
- t.plan(2);
1524
- config = new src_1.ServicesConfig();
1525
- config.merchantId = "heartlandgpsandbox";
1526
- config.accountId = "api";
1527
- config.sharedSecret = "secret";
1528
- config.refundPassword = "refund";
1529
- config.rebatePassword = "rebate";
1530
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1531
- config.timeout = 5000;
1532
- config.channel = "ECOM";
1533
- src_1.ServicesContainer.configure(config);
1534
- card = new src_1.CreditCardData();
1535
- card.number = "4263970000005262";
1536
- card.expMonth = "12";
1537
- card.expYear = "2020";
1538
- card.cvn = "123";
1539
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1540
- card.cardHolderName = "James Mason";
1541
- return [4 /*yield*/, card
1542
- .charge(10)
1543
- .withCurrency("EUR")
1544
- .execute()];
1545
- case 1:
1546
- saleResponse = _a.sent();
1547
- t.truthy(saleResponse);
1548
- t.is("00", saleResponse.responseCode);
1549
- return [4 /*yield*/, throttle()];
1550
- case 2:
1551
- _a.sent();
1552
- return [4 /*yield*/, saleResponse
1553
- .hold()
1554
- .withReasonCode(src_1.ReasonCode.Fraud)
1555
- .withDescription("JAVA-Hold")
1556
- .execute()];
1557
- case 3:
1558
- response = _a.sent();
1559
- t.truthy(response);
1560
- t.is("00", response.responseCode);
1561
- return [2 /*return*/];
1562
- }
1563
- });
1564
- }); });
1565
- ava_1.default("JAVA_Hold_013b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1566
- var config, card, saleResponse, error;
1567
- return __generator(this, function (_a) {
1568
- switch (_a.label) {
1569
- case 0:
1570
- t.plan(2);
1571
- config = new src_1.ServicesConfig();
1572
- config.merchantId = "heartlandgpsandbox";
1573
- config.accountId = "api";
1574
- config.sharedSecret = "secret";
1575
- config.refundPassword = "refund";
1576
- config.rebatePassword = "rebate";
1577
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1578
- config.timeout = 5000;
1579
- config.channel = "EC";
1580
- src_1.ServicesContainer.configure(config);
1581
- card = new src_1.CreditCardData();
1582
- card.number = "4263970000005262";
1583
- card.expMonth = "12";
1584
- card.expYear = "2020";
1585
- card.cvn = "123";
1586
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1587
- card.cardHolderName = "James Mason";
1588
- return [4 /*yield*/, card
1589
- .charge(10)
1590
- .withCurrency("EUR")
1591
- .execute()];
1592
- case 1:
1593
- saleResponse = _a.sent();
1594
- t.truthy(saleResponse);
1595
- t.is("00", saleResponse.responseCode);
1596
- return [4 /*yield*/, throttle()];
1597
- case 2:
1598
- _a.sent();
1599
- return [4 /*yield*/, t.throws(saleResponse
1600
- .hold()
1601
- .withReasonCode(src_1.ReasonCode.Fraud)
1602
- .withDescription("SDK-JAVA-Query")
1603
- .execute(), src_1.GatewayError)];
1604
- case 3:
1605
- error = _a.sent();
1606
- t.truthy(error.message);
1607
- return [2 /*return*/];
1608
- }
1609
- });
1610
- }); });
1611
- ava_1.default("JAVA_Hold_013c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1612
- var config, card, saleResponse, error;
1613
- return __generator(this, function (_a) {
1614
- switch (_a.label) {
1615
- case 0:
1616
- t.plan(2);
1617
- config = new src_1.ServicesConfig();
1618
- config.merchantId = "heartlandgpsandbox";
1619
- config.accountId = "api";
1620
- config.sharedSecret = "secret";
1621
- config.refundPassword = "refund";
1622
- config.rebatePassword = "rebate";
1623
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1624
- config.timeout = 5000;
1625
- config.channel = "ECOOOOOOOOM";
1626
- src_1.ServicesContainer.configure(config);
1627
- card = new src_1.CreditCardData();
1628
- card.number = "4263970000005262";
1629
- card.expMonth = "12";
1630
- card.expYear = "2020";
1631
- card.cvn = "123";
1632
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1633
- card.cardHolderName = "James Mason";
1634
- return [4 /*yield*/, card
1635
- .charge(10)
1636
- .withCurrency("EUR")
1637
- .execute()];
1638
- case 1:
1639
- saleResponse = _a.sent();
1640
- t.truthy(saleResponse);
1641
- t.is("00", saleResponse.responseCode);
1642
- return [4 /*yield*/, throttle()];
1643
- case 2:
1644
- _a.sent();
1645
- return [4 /*yield*/, t.throws(saleResponse
1646
- .hold()
1647
- .withReasonCode(src_1.ReasonCode.Fraud)
1648
- .withDescription("SDK-JAVA-Query")
1649
- .execute(), src_1.GatewayError)];
1650
- case 3:
1651
- error = _a.sent();
1652
- t.truthy(error.message);
1653
- return [2 /*return*/];
1654
- }
1655
- });
1656
- }); });