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,2369 +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
- ava_1.default("JAVA_Rebate_Sample", function (t) { return __awaiter(void 0, void 0, void 0, function () {
53
- var config, card, saleResponse, response;
54
- return __generator(this, function (_a) {
55
- switch (_a.label) {
56
- case 0:
57
- t.plan(4);
58
- config = new src_1.ServicesConfig();
59
- config.merchantId = "heartlandgpsandbox";
60
- config.accountId = "api";
61
- config.sharedSecret = "secret";
62
- config.refundPassword = "refund";
63
- config.rebatePassword = "rebate";
64
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
65
- config.timeout = 5000;
66
- config.channel = "ECOM";
67
- src_1.ServicesContainer.configure(config);
68
- card = new src_1.CreditCardData();
69
- card.number = "4263970000005262";
70
- card.expMonth = "12";
71
- card.expYear = "2020";
72
- card.cvn = "123";
73
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
74
- card.cardHolderName = "James Mason";
75
- return [4 /*yield*/, card
76
- .charge(1)
77
- .withCurrency("EUR")
78
- .execute()];
79
- case 1:
80
- saleResponse = _a.sent();
81
- t.truthy(saleResponse);
82
- t.is("00", saleResponse.responseCode);
83
- return [4 /*yield*/, throttle()];
84
- case 2:
85
- _a.sent();
86
- return [4 /*yield*/, saleResponse
87
- .refund(1)
88
- .withCurrency("EUR")
89
- .withDescription("JAVA-Rebate")
90
- .execute()];
91
- case 3:
92
- response = _a.sent();
93
- t.truthy(response);
94
- t.is("00", response.responseCode);
95
- return [2 /*return*/];
96
- }
97
- });
98
- }); });
99
- ava_1.default("JAVA_Rebate_006a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
100
- var config, card, saleResponse, response;
101
- return __generator(this, function (_a) {
102
- switch (_a.label) {
103
- case 0:
104
- t.plan(4);
105
- config = new src_1.ServicesConfig();
106
- config.merchantId = "heartlandgpsandbox";
107
- config.accountId = "api";
108
- config.sharedSecret = "secret";
109
- config.refundPassword = "refund";
110
- config.rebatePassword = "rebate";
111
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
112
- config.timeout = 5000;
113
- config.channel = "ECOM";
114
- src_1.ServicesContainer.configure(config);
115
- card = new src_1.CreditCardData();
116
- card.number = "4263970000005262";
117
- card.expMonth = "12";
118
- card.expYear = "2020";
119
- card.cvn = "123";
120
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
121
- card.cardHolderName = "James Mason";
122
- return [4 /*yield*/, card
123
- .charge(1)
124
- .withCurrency("EUR")
125
- .execute()];
126
- case 1:
127
- saleResponse = _a.sent();
128
- t.truthy(saleResponse);
129
- t.is("00", saleResponse.responseCode);
130
- return [4 /*yield*/, throttle()];
131
- case 2:
132
- _a.sent();
133
- return [4 /*yield*/, saleResponse
134
- .refund(1)
135
- .withCurrency("EUR")
136
- .withDescription("JAVA-Rebate")
137
- .execute()];
138
- case 3:
139
- response = _a.sent();
140
- t.truthy(response);
141
- t.is("00", response.responseCode);
142
- return [2 /*return*/];
143
- }
144
- });
145
- }); });
146
- ava_1.default("JAVA_Rebate_006b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
147
- var config, card, saleResponse, response;
148
- return __generator(this, function (_a) {
149
- switch (_a.label) {
150
- case 0:
151
- t.plan(4);
152
- config = new src_1.ServicesConfig();
153
- config.merchantId = "heartlandgpsandbox";
154
- config.accountId = "api";
155
- config.sharedSecret = "secret";
156
- config.refundPassword = "refund";
157
- config.rebatePassword = "rebate";
158
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
159
- config.timeout = 5000;
160
- config.channel = "ECOM";
161
- src_1.ServicesContainer.configure(config);
162
- card = new src_1.CreditCardData();
163
- card.number = "4263970000005262";
164
- card.expMonth = "12";
165
- card.expYear = "2020";
166
- card.cvn = "123";
167
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
168
- card.cardHolderName = "James Mason";
169
- return [4 /*yield*/, card
170
- .charge(1)
171
- .withCurrency("EUR")
172
- .execute()];
173
- case 1:
174
- saleResponse = _a.sent();
175
- t.truthy(saleResponse);
176
- t.is("00", saleResponse.responseCode);
177
- return [4 /*yield*/, throttle()];
178
- case 2:
179
- _a.sent();
180
- return [4 /*yield*/, saleResponse
181
- .refund(1)
182
- .withCurrency("EUR")
183
- .withDescription("JAVA-Rebate")
184
- .execute()];
185
- case 3:
186
- response = _a.sent();
187
- t.truthy(response);
188
- t.is("00", response.responseCode);
189
- return [2 /*return*/];
190
- }
191
- });
192
- }); });
193
- ava_1.default("JAVA_Rebate_006c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
194
- var config, card, saleResponse, response;
195
- return __generator(this, function (_a) {
196
- switch (_a.label) {
197
- case 0:
198
- t.plan(4);
199
- config = new src_1.ServicesConfig();
200
- config.merchantId = "heartlandgpsandbox";
201
- config.accountId = "api";
202
- config.sharedSecret = "secret";
203
- config.refundPassword = "refund";
204
- config.rebatePassword = "rebate";
205
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
206
- config.timeout = 5000;
207
- config.channel = "ECOM";
208
- src_1.ServicesContainer.configure(config);
209
- card = new src_1.CreditCardData();
210
- card.number = "4263970000005262";
211
- card.expMonth = "12";
212
- card.expYear = "2020";
213
- card.cvn = "123";
214
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
215
- card.cardHolderName = "James Mason";
216
- return [4 /*yield*/, card
217
- .charge(1)
218
- .withCurrency("EUR")
219
- .execute()];
220
- case 1:
221
- saleResponse = _a.sent();
222
- t.truthy(saleResponse);
223
- t.is("00", saleResponse.responseCode);
224
- return [4 /*yield*/, throttle()];
225
- case 2:
226
- _a.sent();
227
- return [4 /*yield*/, saleResponse
228
- .refund(1)
229
- .withCurrency("EUR")
230
- .withDescription("JAVA-Rebate")
231
- .execute()];
232
- case 3:
233
- response = _a.sent();
234
- t.truthy(response);
235
- t.is("00", response.responseCode);
236
- return [2 /*return*/];
237
- }
238
- });
239
- }); });
240
- ava_1.default("JAVA_Rebate_006d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
241
- var config, card, saleResponse, response;
242
- return __generator(this, function (_a) {
243
- switch (_a.label) {
244
- case 0:
245
- t.plan(4);
246
- config = new src_1.ServicesConfig();
247
- config.merchantId = "heartlandgpsandbox";
248
- config.accountId = "api";
249
- config.sharedSecret = "secret";
250
- config.refundPassword = "refund";
251
- config.rebatePassword = "rebate";
252
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
253
- config.timeout = 5000;
254
- config.channel = "ECOM";
255
- src_1.ServicesContainer.configure(config);
256
- card = new src_1.CreditCardData();
257
- card.number = "4263970000005262";
258
- card.expMonth = "12";
259
- card.expYear = "2020";
260
- card.cvn = "123";
261
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
262
- card.cardHolderName = "James Mason";
263
- return [4 /*yield*/, card
264
- .charge(1)
265
- .withCurrency("EUR")
266
- .execute()];
267
- case 1:
268
- saleResponse = _a.sent();
269
- t.truthy(saleResponse);
270
- t.is("00", saleResponse.responseCode);
271
- return [4 /*yield*/, throttle()];
272
- case 2:
273
- _a.sent();
274
- return [4 /*yield*/, saleResponse
275
- .refund(1)
276
- .withCurrency("EUR")
277
- .withDescription("JAVA-Rebate")
278
- .execute()];
279
- case 3:
280
- response = _a.sent();
281
- t.truthy(response);
282
- t.is("00", response.responseCode);
283
- return [2 /*return*/];
284
- }
285
- });
286
- }); });
287
- ava_1.default("JAVA_Rebate_006e", function (t) { return __awaiter(void 0, void 0, void 0, function () {
288
- var config, card, saleResponse, response;
289
- return __generator(this, function (_a) {
290
- switch (_a.label) {
291
- case 0:
292
- t.plan(4);
293
- config = new src_1.ServicesConfig();
294
- config.merchantId = "heartlandgpsandbox";
295
- config.accountId = "api";
296
- config.sharedSecret = "secret";
297
- config.refundPassword = "refund";
298
- config.rebatePassword = "rebate";
299
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
300
- config.timeout = 5000;
301
- config.channel = "ECOM";
302
- src_1.ServicesContainer.configure(config);
303
- card = new src_1.CreditCardData();
304
- card.number = "4263970000005262";
305
- card.expMonth = "12";
306
- card.expYear = "2020";
307
- card.cvn = "123";
308
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
309
- card.cardHolderName = "James Mason";
310
- return [4 /*yield*/, card
311
- .charge(1)
312
- .withCurrency("EUR")
313
- .execute()];
314
- case 1:
315
- saleResponse = _a.sent();
316
- t.truthy(saleResponse);
317
- t.is("00", saleResponse.responseCode);
318
- return [4 /*yield*/, throttle()];
319
- case 2:
320
- _a.sent();
321
- return [4 /*yield*/, saleResponse
322
- .refund(1)
323
- .withCurrency("EUR")
324
- .withDescription("JAVA-Rebate")
325
- .execute()];
326
- case 3:
327
- response = _a.sent();
328
- t.truthy(response);
329
- t.is("00", response.responseCode);
330
- return [2 /*return*/];
331
- }
332
- });
333
- }); });
334
- ava_1.default("JAVA_Rebate_006f", function (t) { return __awaiter(void 0, void 0, void 0, function () {
335
- var config, card, saleResponse, response;
336
- return __generator(this, function (_a) {
337
- switch (_a.label) {
338
- case 0:
339
- t.plan(4);
340
- config = new src_1.ServicesConfig();
341
- config.merchantId = "heartlandgpsandbox";
342
- config.accountId = "api";
343
- config.sharedSecret = "secret";
344
- config.refundPassword = "refund";
345
- config.rebatePassword = "rebate";
346
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
347
- config.timeout = 5000;
348
- config.channel = "ECOM";
349
- src_1.ServicesContainer.configure(config);
350
- card = new src_1.CreditCardData();
351
- card.number = "4263970000005262";
352
- card.expMonth = "12";
353
- card.expYear = "2020";
354
- card.cvn = "123";
355
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
356
- card.cardHolderName = "James Mason";
357
- return [4 /*yield*/, card
358
- .charge(1)
359
- .withCurrency("EUR")
360
- .execute()];
361
- case 1:
362
- saleResponse = _a.sent();
363
- t.truthy(saleResponse);
364
- t.is("00", saleResponse.responseCode);
365
- return [4 /*yield*/, throttle()];
366
- case 2:
367
- _a.sent();
368
- return [4 /*yield*/, saleResponse
369
- .refund(1)
370
- .withCurrency("EUR")
371
- .withDescription("JAVA-Rebate")
372
- .execute()];
373
- case 3:
374
- response = _a.sent();
375
- t.truthy(response);
376
- t.is("00", response.responseCode);
377
- return [2 /*return*/];
378
- }
379
- });
380
- }); });
381
- ava_1.default("JAVA_Rebate_006g", function (t) { return __awaiter(void 0, void 0, void 0, function () {
382
- var config, card, saleResponse, response;
383
- return __generator(this, function (_a) {
384
- switch (_a.label) {
385
- case 0:
386
- t.plan(4);
387
- config = new src_1.ServicesConfig();
388
- config.merchantId = "heartlandgpsandbox";
389
- config.accountId = "api";
390
- config.sharedSecret = "secret";
391
- config.refundPassword = "refund";
392
- config.rebatePassword = "rebate";
393
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
394
- config.timeout = 5000;
395
- config.channel = "ECOM";
396
- src_1.ServicesContainer.configure(config);
397
- card = new src_1.CreditCardData();
398
- card.number = "4263970000005262";
399
- card.expMonth = "12";
400
- card.expYear = "2020";
401
- card.cvn = "123";
402
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
403
- card.cardHolderName = "James Mason";
404
- return [4 /*yield*/, card
405
- .charge(1)
406
- .withCurrency("EUR")
407
- .execute()];
408
- case 1:
409
- saleResponse = _a.sent();
410
- t.truthy(saleResponse);
411
- t.is("00", saleResponse.responseCode);
412
- return [4 /*yield*/, throttle()];
413
- case 2:
414
- _a.sent();
415
- return [4 /*yield*/, saleResponse
416
- .refund(1)
417
- .withCurrency("EUR")
418
- .withDescription("JAVA-Rebate")
419
- .execute()];
420
- case 3:
421
- response = _a.sent();
422
- t.truthy(response);
423
- t.is("00", response.responseCode);
424
- return [2 /*return*/];
425
- }
426
- });
427
- }); });
428
- ava_1.default("JAVA_Rebate_006h", function (t) { return __awaiter(void 0, void 0, void 0, function () {
429
- var config, card, saleResponse, response;
430
- return __generator(this, function (_a) {
431
- switch (_a.label) {
432
- case 0:
433
- t.plan(4);
434
- config = new src_1.ServicesConfig();
435
- config.merchantId = "heartlandgpsandbox";
436
- config.accountId = "api";
437
- config.sharedSecret = "secret";
438
- config.refundPassword = "refund";
439
- config.rebatePassword = "rebate";
440
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
441
- config.timeout = 5000;
442
- config.channel = "ECOM";
443
- src_1.ServicesContainer.configure(config);
444
- card = new src_1.CreditCardData();
445
- card.number = "4263970000005262";
446
- card.expMonth = "12";
447
- card.expYear = "2020";
448
- card.cvn = "123";
449
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
450
- card.cardHolderName = "James Mason";
451
- return [4 /*yield*/, card
452
- .charge(1)
453
- .withCurrency("EUR")
454
- .execute()];
455
- case 1:
456
- saleResponse = _a.sent();
457
- t.truthy(saleResponse);
458
- t.is("00", saleResponse.responseCode);
459
- return [4 /*yield*/, throttle()];
460
- case 2:
461
- _a.sent();
462
- return [4 /*yield*/, saleResponse
463
- .refund(1)
464
- .withCurrency("EUR")
465
- .withDescription("JAVA-Rebate")
466
- .execute()];
467
- case 3:
468
- response = _a.sent();
469
- t.truthy(response);
470
- t.is("00", response.responseCode);
471
- return [2 /*return*/];
472
- }
473
- });
474
- }); });
475
- ava_1.default("JAVA_Rebate_007a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
476
- var config, card, saleResponse, response;
477
- return __generator(this, function (_a) {
478
- switch (_a.label) {
479
- case 0:
480
- t.plan(4);
481
- config = new src_1.ServicesConfig();
482
- config.merchantId = "heartlandgpsandbox";
483
- config.accountId = "api";
484
- config.sharedSecret = "secret";
485
- config.refundPassword = "refund";
486
- config.rebatePassword = "rebate";
487
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
488
- config.timeout = 5000;
489
- config.channel = "ECOM";
490
- src_1.ServicesContainer.configure(config);
491
- card = new src_1.CreditCardData();
492
- card.number = "4263970000005262";
493
- card.expMonth = "12";
494
- card.expYear = "2020";
495
- card.cvn = "123";
496
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
497
- card.cardHolderName = "James Mason";
498
- return [4 /*yield*/, card
499
- .charge(1)
500
- .withCurrency("EUR")
501
- .execute()];
502
- case 1:
503
- saleResponse = _a.sent();
504
- t.truthy(saleResponse);
505
- t.is("00", saleResponse.responseCode);
506
- return [4 /*yield*/, throttle()];
507
- case 2:
508
- _a.sent();
509
- return [4 /*yield*/, saleResponse
510
- .refund(1)
511
- .withCurrency("EUR")
512
- .withDescription("JAVA-Rebate")
513
- .execute()];
514
- case 3:
515
- response = _a.sent();
516
- t.truthy(response);
517
- t.is("00", response.responseCode);
518
- return [2 /*return*/];
519
- }
520
- });
521
- }); });
522
- ava_1.default("JAVA_Rebate_007b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
523
- var config, card, saleResponse, response;
524
- return __generator(this, function (_a) {
525
- switch (_a.label) {
526
- case 0:
527
- t.plan(4);
528
- config = new src_1.ServicesConfig();
529
- config.merchantId = "heartlandgpsandbox";
530
- config.accountId = "api";
531
- config.sharedSecret = "secret";
532
- config.refundPassword = "refund";
533
- config.rebatePassword = "rebate";
534
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
535
- config.timeout = 5000;
536
- config.channel = "ECOM";
537
- src_1.ServicesContainer.configure(config);
538
- card = new src_1.CreditCardData();
539
- card.number = "4263970000005262";
540
- card.expMonth = "12";
541
- card.expYear = "2020";
542
- card.cvn = "123";
543
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
544
- card.cardHolderName = "James Mason";
545
- return [4 /*yield*/, card
546
- .charge(1)
547
- .withCurrency("EUR")
548
- .execute()];
549
- case 1:
550
- saleResponse = _a.sent();
551
- t.truthy(saleResponse);
552
- t.is("00", saleResponse.responseCode);
553
- return [4 /*yield*/, throttle()];
554
- case 2:
555
- _a.sent();
556
- return [4 /*yield*/, saleResponse
557
- .refund(1)
558
- .withCurrency("EUR")
559
- .withDescription("JAVA-Rebate")
560
- .execute()];
561
- case 3:
562
- response = _a.sent();
563
- t.truthy(response);
564
- t.is("00", response.responseCode);
565
- return [2 /*return*/];
566
- }
567
- });
568
- }); });
569
- ava_1.default("JAVA_Rebate_007c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
570
- var config, card, saleResponse, response;
571
- return __generator(this, function (_a) {
572
- switch (_a.label) {
573
- case 0:
574
- t.plan(4);
575
- config = new src_1.ServicesConfig();
576
- config.merchantId = "heartlandgpsandbox";
577
- config.accountId = "api";
578
- config.sharedSecret = "secret";
579
- config.refundPassword = "refund";
580
- config.rebatePassword = "rebate";
581
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
582
- config.timeout = 5000;
583
- config.channel = "ECOM";
584
- src_1.ServicesContainer.configure(config);
585
- card = new src_1.CreditCardData();
586
- card.number = "4263970000005262";
587
- card.expMonth = "12";
588
- card.expYear = "2020";
589
- card.cvn = "123";
590
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
591
- card.cardHolderName = "James Mason";
592
- return [4 /*yield*/, card
593
- .charge(1)
594
- .withCurrency("EUR")
595
- .execute()];
596
- case 1:
597
- saleResponse = _a.sent();
598
- t.truthy(saleResponse);
599
- t.is("00", saleResponse.responseCode);
600
- return [4 /*yield*/, throttle()];
601
- case 2:
602
- _a.sent();
603
- return [4 /*yield*/, saleResponse
604
- .refund(1)
605
- .withCurrency("EUR")
606
- .withDescription("JAVA-Rebate")
607
- .execute()];
608
- case 3:
609
- response = _a.sent();
610
- t.truthy(response);
611
- t.is("00", response.responseCode);
612
- return [2 /*return*/];
613
- }
614
- });
615
- }); });
616
- ava_1.default("JAVA_Rebate_007d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
617
- var config, card, saleResponse, response;
618
- return __generator(this, function (_a) {
619
- switch (_a.label) {
620
- case 0:
621
- t.plan(4);
622
- config = new src_1.ServicesConfig();
623
- config.merchantId = "heartlandgpsandbox";
624
- config.accountId = "api";
625
- config.sharedSecret = "secret";
626
- config.refundPassword = "refund";
627
- config.rebatePassword = "rebate";
628
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
629
- config.timeout = 5000;
630
- config.channel = "ECOM";
631
- src_1.ServicesContainer.configure(config);
632
- card = new src_1.CreditCardData();
633
- card.number = "4263970000005262";
634
- card.expMonth = "12";
635
- card.expYear = "2020";
636
- card.cvn = "123";
637
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
638
- card.cardHolderName = "James Mason";
639
- return [4 /*yield*/, card
640
- .charge(1)
641
- .withCurrency("EUR")
642
- .execute()];
643
- case 1:
644
- saleResponse = _a.sent();
645
- t.truthy(saleResponse);
646
- t.is("00", saleResponse.responseCode);
647
- return [4 /*yield*/, throttle()];
648
- case 2:
649
- _a.sent();
650
- return [4 /*yield*/, saleResponse
651
- .refund(1)
652
- .withCurrency("EUR")
653
- .withDescription("JAVA-Rebate")
654
- .execute()];
655
- case 3:
656
- response = _a.sent();
657
- t.truthy(response);
658
- t.is("00", response.responseCode);
659
- return [2 /*return*/];
660
- }
661
- });
662
- }); });
663
- ava_1.default("JAVA_Rebate_007e", function (t) { return __awaiter(void 0, void 0, void 0, function () {
664
- var config, card, saleResponse, response;
665
- return __generator(this, function (_a) {
666
- switch (_a.label) {
667
- case 0:
668
- t.plan(4);
669
- config = new src_1.ServicesConfig();
670
- config.merchantId = "heartlandgpsandbox";
671
- config.accountId = "api";
672
- config.sharedSecret = "secret";
673
- config.refundPassword = "refund";
674
- config.rebatePassword = "rebate";
675
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
676
- config.timeout = 5000;
677
- config.channel = "ECOM";
678
- src_1.ServicesContainer.configure(config);
679
- card = new src_1.CreditCardData();
680
- card.number = "4263970000005262";
681
- card.expMonth = "12";
682
- card.expYear = "2020";
683
- card.cvn = "123";
684
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
685
- card.cardHolderName = "James Mason";
686
- return [4 /*yield*/, card
687
- .charge(1)
688
- .withCurrency("EUR")
689
- .execute()];
690
- case 1:
691
- saleResponse = _a.sent();
692
- t.truthy(saleResponse);
693
- t.is("00", saleResponse.responseCode);
694
- return [4 /*yield*/, throttle()];
695
- case 2:
696
- _a.sent();
697
- return [4 /*yield*/, saleResponse
698
- .refund(1)
699
- .withCurrency("EUR")
700
- .withDescription("JAVA-Rebate")
701
- .execute()];
702
- case 3:
703
- response = _a.sent();
704
- t.truthy(response);
705
- t.is("00", response.responseCode);
706
- return [2 /*return*/];
707
- }
708
- });
709
- }); });
710
- ava_1.default("JAVA_Rebate_008a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
711
- var config, card, saleResponse, response;
712
- return __generator(this, function (_a) {
713
- switch (_a.label) {
714
- case 0:
715
- t.plan(4);
716
- config = new src_1.ServicesConfig();
717
- config.merchantId = "heartlandgpsandbox";
718
- config.accountId = "api";
719
- config.sharedSecret = "secret";
720
- config.refundPassword = "refund";
721
- config.rebatePassword = "rebate";
722
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
723
- config.timeout = 5000;
724
- config.channel = "ECOM";
725
- src_1.ServicesContainer.configure(config);
726
- card = new src_1.CreditCardData();
727
- card.number = "4263970000005262";
728
- card.expMonth = "12";
729
- card.expYear = "2020";
730
- card.cvn = "123";
731
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
732
- card.cardHolderName = "James Mason";
733
- return [4 /*yield*/, card
734
- .charge(1)
735
- .withCurrency("EUR")
736
- .execute()];
737
- case 1:
738
- saleResponse = _a.sent();
739
- t.truthy(saleResponse);
740
- t.is("00", saleResponse.responseCode);
741
- return [4 /*yield*/, throttle()];
742
- case 2:
743
- _a.sent();
744
- return [4 /*yield*/, saleResponse
745
- .refund(1)
746
- .withCurrency("EUR")
747
- .withDescription("JAVA-Rebate")
748
- .execute()];
749
- case 3:
750
- response = _a.sent();
751
- t.truthy(response);
752
- t.is("00", response.responseCode);
753
- return [2 /*return*/];
754
- }
755
- });
756
- }); });
757
- ava_1.default("JAVA_Rebate_008b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
758
- var config, card, saleResponse, response;
759
- return __generator(this, function (_a) {
760
- switch (_a.label) {
761
- case 0:
762
- t.plan(4);
763
- config = new src_1.ServicesConfig();
764
- config.merchantId = "heartlandgpsandbox";
765
- config.accountId = "api";
766
- config.sharedSecret = "secret";
767
- config.refundPassword = "refund";
768
- config.rebatePassword = "rebate";
769
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
770
- config.timeout = 5000;
771
- config.channel = "ECOM";
772
- src_1.ServicesContainer.configure(config);
773
- card = new src_1.CreditCardData();
774
- card.number = "4263970000005262";
775
- card.expMonth = "12";
776
- card.expYear = "2020";
777
- card.cvn = "123";
778
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
779
- card.cardHolderName = "James Mason";
780
- return [4 /*yield*/, card
781
- .charge(1)
782
- .withCurrency("EUR")
783
- .execute()];
784
- case 1:
785
- saleResponse = _a.sent();
786
- t.truthy(saleResponse);
787
- t.is("00", saleResponse.responseCode);
788
- return [4 /*yield*/, throttle()];
789
- case 2:
790
- _a.sent();
791
- return [4 /*yield*/, saleResponse
792
- .refund(1)
793
- .withCurrency("EUR")
794
- .withDescription("JAVA-Rebate")
795
- .execute()];
796
- case 3:
797
- response = _a.sent();
798
- t.truthy(response);
799
- t.is("00", response.responseCode);
800
- return [2 /*return*/];
801
- }
802
- });
803
- }); });
804
- ava_1.default("JAVA_Rebate_008c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
805
- var config, card, saleResponse, response;
806
- return __generator(this, function (_a) {
807
- switch (_a.label) {
808
- case 0:
809
- t.plan(4);
810
- config = new src_1.ServicesConfig();
811
- config.merchantId = "heartlandgpsandbox";
812
- config.accountId = "api";
813
- config.sharedSecret = "secret";
814
- config.refundPassword = "refund";
815
- config.rebatePassword = "rebate";
816
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
817
- config.timeout = 5000;
818
- config.channel = "ECOM";
819
- src_1.ServicesContainer.configure(config);
820
- card = new src_1.CreditCardData();
821
- card.number = "4263970000005262";
822
- card.expMonth = "12";
823
- card.expYear = "2020";
824
- card.cvn = "123";
825
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
826
- card.cardHolderName = "James Mason";
827
- return [4 /*yield*/, card
828
- .charge(1)
829
- .withCurrency("EUR")
830
- .execute()];
831
- case 1:
832
- saleResponse = _a.sent();
833
- t.truthy(saleResponse);
834
- t.is("00", saleResponse.responseCode);
835
- return [4 /*yield*/, throttle()];
836
- case 2:
837
- _a.sent();
838
- return [4 /*yield*/, saleResponse
839
- .refund(1)
840
- .withCurrency("EUR")
841
- .withDescription("JAVA-Rebate")
842
- .execute()];
843
- case 3:
844
- response = _a.sent();
845
- t.truthy(response);
846
- t.is("00", response.responseCode);
847
- return [2 /*return*/];
848
- }
849
- });
850
- }); });
851
- ava_1.default("JAVA_Rebate_008d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
852
- var config, card, saleResponse, response;
853
- return __generator(this, function (_a) {
854
- switch (_a.label) {
855
- case 0:
856
- t.plan(4);
857
- config = new src_1.ServicesConfig();
858
- config.merchantId = "heartlandgpsandbox";
859
- config.accountId = "api";
860
- config.sharedSecret = "secret";
861
- config.refundPassword = "refund";
862
- config.rebatePassword = "rebate";
863
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
864
- config.timeout = 5000;
865
- config.channel = "ECOM";
866
- src_1.ServicesContainer.configure(config);
867
- card = new src_1.CreditCardData();
868
- card.number = "4263970000005262";
869
- card.expMonth = "12";
870
- card.expYear = "2020";
871
- card.cvn = "123";
872
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
873
- card.cardHolderName = "James Mason";
874
- return [4 /*yield*/, card
875
- .charge(1)
876
- .withCurrency("EUR")
877
- .execute()];
878
- case 1:
879
- saleResponse = _a.sent();
880
- t.truthy(saleResponse);
881
- t.is("00", saleResponse.responseCode);
882
- return [4 /*yield*/, throttle()];
883
- case 2:
884
- _a.sent();
885
- return [4 /*yield*/, saleResponse
886
- .refund(1)
887
- .withCurrency("EUR")
888
- .withDescription("JAVA-Rebate")
889
- .execute()];
890
- case 3:
891
- response = _a.sent();
892
- t.truthy(response);
893
- t.is("00", response.responseCode);
894
- return [2 /*return*/];
895
- }
896
- });
897
- }); });
898
- ava_1.default("JAVA_Rebate_008e", function (t) { return __awaiter(void 0, void 0, void 0, function () {
899
- var config, card, saleResponse, response;
900
- return __generator(this, function (_a) {
901
- switch (_a.label) {
902
- case 0:
903
- t.plan(4);
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
- config.channel = "ECOM";
913
- src_1.ServicesContainer.configure(config);
914
- card = new src_1.CreditCardData();
915
- card.number = "4263970000005262";
916
- card.expMonth = "12";
917
- card.expYear = "2020";
918
- card.cvn = "123";
919
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
920
- card.cardHolderName = "James Mason";
921
- return [4 /*yield*/, card
922
- .charge(1)
923
- .withCurrency("EUR")
924
- .execute()];
925
- case 1:
926
- saleResponse = _a.sent();
927
- t.truthy(saleResponse);
928
- t.is("00", saleResponse.responseCode);
929
- return [4 /*yield*/, throttle()];
930
- case 2:
931
- _a.sent();
932
- return [4 /*yield*/, saleResponse
933
- .refund(1)
934
- .withCurrency("EUR")
935
- .withDescription("JAVA-Rebate")
936
- .execute()];
937
- case 3:
938
- response = _a.sent();
939
- t.truthy(response);
940
- t.is("00", response.responseCode);
941
- return [2 /*return*/];
942
- }
943
- });
944
- }); });
945
- ava_1.default("JAVA_Rebate_009a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
946
- var config, card, saleResponse, response;
947
- return __generator(this, function (_a) {
948
- switch (_a.label) {
949
- case 0:
950
- t.plan(4);
951
- config = new src_1.ServicesConfig();
952
- config.merchantId = "heartlandgpsandbox";
953
- config.accountId = "api";
954
- config.sharedSecret = "secret";
955
- config.refundPassword = "refund";
956
- config.rebatePassword = "rebate";
957
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
958
- config.timeout = 5000;
959
- config.channel = "ECOM";
960
- src_1.ServicesContainer.configure(config);
961
- card = new src_1.CreditCardData();
962
- card.number = "4263970000005262";
963
- card.expMonth = "12";
964
- card.expYear = "2020";
965
- card.cvn = "123";
966
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
967
- card.cardHolderName = "James Mason";
968
- return [4 /*yield*/, card
969
- .charge(1)
970
- .withCurrency("EUR")
971
- .execute()];
972
- case 1:
973
- saleResponse = _a.sent();
974
- t.truthy(saleResponse);
975
- t.is("00", saleResponse.responseCode);
976
- return [4 /*yield*/, throttle()];
977
- case 2:
978
- _a.sent();
979
- return [4 /*yield*/, saleResponse
980
- .refund(1)
981
- .withCurrency("EUR")
982
- .withDescription("JAVA-Rebate")
983
- .execute()];
984
- case 3:
985
- response = _a.sent();
986
- t.truthy(response);
987
- t.is("00", response.responseCode);
988
- return [2 /*return*/];
989
- }
990
- });
991
- }); });
992
- ava_1.default("JAVA_Rebate_009b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
993
- var config, card, error;
994
- return __generator(this, function (_a) {
995
- switch (_a.label) {
996
- case 0:
997
- t.plan(2);
998
- config = new src_1.ServicesConfig();
999
- config.merchantId = "heartlandgpsandbox";
1000
- config.accountId = "api";
1001
- config.sharedSecret = "secret";
1002
- config.refundPassword = "refund";
1003
- config.rebatePassword = "rebate";
1004
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1005
- config.timeout = 5000;
1006
- config.channel = "EC";
1007
- src_1.ServicesContainer.configure(config);
1008
- card = new src_1.CreditCardData();
1009
- card.number = "4263970000005262";
1010
- card.expMonth = "12";
1011
- card.expYear = "2020";
1012
- card.cvn = "123";
1013
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1014
- card.cardHolderName = "James Mason";
1015
- return [4 /*yield*/, t.throws(card
1016
- .charge(1)
1017
- .withCurrency("EUR")
1018
- .execute(), src_1.GatewayError)];
1019
- case 1:
1020
- error = _a.sent();
1021
- t.truthy(error.message);
1022
- return [2 /*return*/];
1023
- }
1024
- });
1025
- }); });
1026
- ava_1.default("JAVA_Rebate_009c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1027
- var config, card, error;
1028
- return __generator(this, function (_a) {
1029
- switch (_a.label) {
1030
- case 0:
1031
- t.plan(2);
1032
- config = new src_1.ServicesConfig();
1033
- config.merchantId = "heartlandgpsandbox";
1034
- config.accountId = "api";
1035
- config.sharedSecret = "secret";
1036
- config.refundPassword = "refund";
1037
- config.rebatePassword = "rebate";
1038
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1039
- config.timeout = 5000;
1040
- // tslint:disable:max-line-length
1041
- config.channel =
1042
- "ECOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOm";
1043
- // tslint:enable:max-line-length
1044
- src_1.ServicesContainer.configure(config);
1045
- card = new src_1.CreditCardData();
1046
- card.number = "4263970000005262";
1047
- card.expMonth = "12";
1048
- card.expYear = "2020";
1049
- card.cvn = "123";
1050
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1051
- card.cardHolderName = "James Mason";
1052
- return [4 /*yield*/, t.throws(card
1053
- .charge(1)
1054
- .withCurrency("EUR")
1055
- .execute(), src_1.GatewayError)];
1056
- case 1:
1057
- error = _a.sent();
1058
- t.truthy(error.message);
1059
- return [2 /*return*/];
1060
- }
1061
- });
1062
- }); });
1063
- ava_1.default("JAVA_Rebate_009d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1064
- var config, card, error;
1065
- return __generator(this, function (_a) {
1066
- switch (_a.label) {
1067
- case 0:
1068
- t.plan(2);
1069
- config = new src_1.ServicesConfig();
1070
- config.merchantId = "heartlandgpsandbox";
1071
- config.accountId = "api";
1072
- config.sharedSecret = "secret";
1073
- config.refundPassword = "refund";
1074
- config.rebatePassword = "rebate";
1075
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1076
- config.timeout = 5000;
1077
- config.channel = "ECO#";
1078
- src_1.ServicesContainer.configure(config);
1079
- card = new src_1.CreditCardData();
1080
- card.number = "4263970000005262";
1081
- card.expMonth = "12";
1082
- card.expYear = "2020";
1083
- card.cvn = "123";
1084
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1085
- card.cardHolderName = "James Mason";
1086
- return [4 /*yield*/, t.throws(card
1087
- .charge(1)
1088
- .withCurrency("EUR")
1089
- .execute(), src_1.GatewayError)];
1090
- case 1:
1091
- error = _a.sent();
1092
- t.truthy(error.message);
1093
- return [2 /*return*/];
1094
- }
1095
- });
1096
- }); });
1097
- ava_1.default("JAVA_Rebate_010c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1098
- var config, card, saleResponse, response;
1099
- return __generator(this, function (_a) {
1100
- switch (_a.label) {
1101
- case 0:
1102
- t.plan(4);
1103
- config = new src_1.ServicesConfig();
1104
- config.merchantId = "heartlandgpsandbox";
1105
- config.accountId = "api";
1106
- config.sharedSecret = "secret";
1107
- config.refundPassword = "refund";
1108
- config.rebatePassword = "rebate";
1109
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1110
- config.timeout = 5000;
1111
- config.channel = "ECOM";
1112
- src_1.ServicesContainer.configure(config);
1113
- card = new src_1.CreditCardData();
1114
- card.number = "4263970000005262";
1115
- card.expMonth = "12";
1116
- card.expYear = "2020";
1117
- card.cvn = "123";
1118
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1119
- card.cardHolderName = "James Mason";
1120
- return [4 /*yield*/, card
1121
- .charge(1)
1122
- .withCurrency("EUR")
1123
- .execute()];
1124
- case 1:
1125
- saleResponse = _a.sent();
1126
- t.truthy(saleResponse);
1127
- t.is("00", saleResponse.responseCode);
1128
- return [4 /*yield*/, throttle()];
1129
- case 2:
1130
- _a.sent();
1131
- return [4 /*yield*/, saleResponse
1132
- .refund(1)
1133
- .withCurrency("EUR")
1134
- .withDescription("JAVA-Rebate")
1135
- .execute()];
1136
- case 3:
1137
- response = _a.sent();
1138
- t.truthy(response);
1139
- t.is("00", response.responseCode);
1140
- return [2 /*return*/];
1141
- }
1142
- });
1143
- }); });
1144
- ava_1.default("JAVA_Rebate_010d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1145
- var config, card, saleResponse, response;
1146
- return __generator(this, function (_a) {
1147
- switch (_a.label) {
1148
- case 0:
1149
- t.plan(4);
1150
- config = new src_1.ServicesConfig();
1151
- config.merchantId = "heartlandgpsandbox";
1152
- config.accountId = "api";
1153
- config.sharedSecret = "secret";
1154
- config.refundPassword = "refund";
1155
- config.rebatePassword = "rebate";
1156
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1157
- config.timeout = 5000;
1158
- config.channel = "ECOM";
1159
- src_1.ServicesContainer.configure(config);
1160
- card = new src_1.CreditCardData();
1161
- card.number = "4263970000005262";
1162
- card.expMonth = "12";
1163
- card.expYear = "2020";
1164
- card.cvn = "123";
1165
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1166
- card.cardHolderName = "James Mason";
1167
- return [4 /*yield*/, card
1168
- .charge(1)
1169
- .withCurrency("EUR")
1170
- .execute()];
1171
- case 1:
1172
- saleResponse = _a.sent();
1173
- t.truthy(saleResponse);
1174
- t.is("00", saleResponse.responseCode);
1175
- return [4 /*yield*/, throttle()];
1176
- case 2:
1177
- _a.sent();
1178
- return [4 /*yield*/, saleResponse
1179
- .refund(1)
1180
- .withCurrency("EUR")
1181
- .withDescription("JAVA-Rebate")
1182
- .execute()];
1183
- case 3:
1184
- response = _a.sent();
1185
- t.truthy(response);
1186
- t.is("00", response.responseCode);
1187
- return [2 /*return*/];
1188
- }
1189
- });
1190
- }); });
1191
- ava_1.default("JAVA_Rebate_010e", 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(4);
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(1)
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
- .refund(1)
1227
- .withCurrency("EUR")
1228
- .withDescription("JAVA-Rebate")
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_Rebate_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(4);
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(1)
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
- .refund(1)
1274
- .withCurrency("EUR")
1275
- .withDescription("JAVA-Rebate")
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_Rebate_011b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1286
- var config, card, error;
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*/, t.throws(card
1309
- .charge(1)
1310
- .withCurrency("EURO")
1311
- .execute(), src_1.GatewayError)];
1312
- case 1:
1313
- error = _a.sent();
1314
- t.truthy(error.message);
1315
- return [2 /*return*/];
1316
- }
1317
- });
1318
- }); });
1319
- ava_1.default("JAVA_Rebate_011c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1320
- var config, card, error;
1321
- return __generator(this, function (_a) {
1322
- switch (_a.label) {
1323
- case 0:
1324
- t.plan(2);
1325
- config = new src_1.ServicesConfig();
1326
- config.merchantId = "heartlandgpsandbox";
1327
- config.accountId = "api";
1328
- config.sharedSecret = "secret";
1329
- config.refundPassword = "refund";
1330
- config.rebatePassword = "rebate";
1331
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1332
- config.timeout = 5000;
1333
- config.channel = "ECOM";
1334
- src_1.ServicesContainer.configure(config);
1335
- card = new src_1.CreditCardData();
1336
- card.number = "4263970000005262";
1337
- card.expMonth = "12";
1338
- card.expYear = "2020";
1339
- card.cvn = "123";
1340
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1341
- card.cardHolderName = "James Mason";
1342
- return [4 /*yield*/, t.throws(card
1343
- .charge(1)
1344
- .withCurrency("EU##")
1345
- .execute(), src_1.GatewayError)];
1346
- case 1:
1347
- error = _a.sent();
1348
- t.truthy(error.message);
1349
- return [2 /*return*/];
1350
- }
1351
- });
1352
- }); });
1353
- ava_1.default("JAVA_Rebate_011d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1354
- var config, card, saleResponse, error;
1355
- return __generator(this, function (_a) {
1356
- switch (_a.label) {
1357
- case 0:
1358
- t.plan(4);
1359
- config = new src_1.ServicesConfig();
1360
- config.merchantId = "heartlandgpsandbox";
1361
- config.accountId = "api";
1362
- config.sharedSecret = "secret";
1363
- config.refundPassword = "refund";
1364
- config.rebatePassword = "rebate";
1365
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1366
- config.timeout = 5000;
1367
- config.channel = "ECOM";
1368
- src_1.ServicesContainer.configure(config);
1369
- card = new src_1.CreditCardData();
1370
- card.number = "4263970000005262";
1371
- card.expMonth = "12";
1372
- card.expYear = "2020";
1373
- card.cvn = "123";
1374
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1375
- card.cardHolderName = "James Mason";
1376
- return [4 /*yield*/, card
1377
- .charge(1)
1378
- .withCurrency("EUR")
1379
- .execute()];
1380
- case 1:
1381
- saleResponse = _a.sent();
1382
- t.truthy(saleResponse);
1383
- t.is("00", saleResponse.responseCode);
1384
- return [4 /*yield*/, throttle()];
1385
- case 2:
1386
- _a.sent();
1387
- error = t.throws(function () {
1388
- return saleResponse
1389
- .refund(1)
1390
- .withDescription("JAVA-Rebate")
1391
- .execute();
1392
- }, src_1.BuilderError);
1393
- t.truthy(error.message);
1394
- return [2 /*return*/];
1395
- }
1396
- });
1397
- }); });
1398
- ava_1.default("JAVA_Rebate_012a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1399
- var config, card, saleResponse, response;
1400
- return __generator(this, function (_a) {
1401
- switch (_a.label) {
1402
- case 0:
1403
- t.plan(4);
1404
- config = new src_1.ServicesConfig();
1405
- config.merchantId = "heartlandgpsandbox";
1406
- config.accountId = "api";
1407
- config.sharedSecret = "secret";
1408
- config.refundPassword = "refund";
1409
- config.rebatePassword = "rebate";
1410
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1411
- config.timeout = 5000;
1412
- config.channel = "ECOM";
1413
- src_1.ServicesContainer.configure(config);
1414
- card = new src_1.CreditCardData();
1415
- card.number = "4263970000005262";
1416
- card.expMonth = "12";
1417
- card.expYear = "2020";
1418
- card.cvn = "123";
1419
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1420
- card.cardHolderName = "James Mason";
1421
- return [4 /*yield*/, card
1422
- .charge(1)
1423
- .withCurrency("EUR")
1424
- .execute()];
1425
- case 1:
1426
- saleResponse = _a.sent();
1427
- t.truthy(saleResponse);
1428
- t.is("00", saleResponse.responseCode);
1429
- return [4 /*yield*/, throttle()];
1430
- case 2:
1431
- _a.sent();
1432
- return [4 /*yield*/, saleResponse
1433
- .refund(1)
1434
- .withCurrency("EUR")
1435
- .withDescription("JAVA-Rebate")
1436
- .execute()];
1437
- case 3:
1438
- response = _a.sent();
1439
- t.truthy(response);
1440
- t.is("00", response.responseCode);
1441
- return [2 /*return*/];
1442
- }
1443
- });
1444
- }); });
1445
- ava_1.default("JAVA_Rebate_012b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1446
- var config, card, saleResponse, response;
1447
- return __generator(this, function (_a) {
1448
- switch (_a.label) {
1449
- case 0:
1450
- t.plan(4);
1451
- config = new src_1.ServicesConfig();
1452
- config.merchantId = "heartlandgpsandbox";
1453
- config.accountId = "api";
1454
- config.sharedSecret = "secret";
1455
- config.refundPassword = "refund";
1456
- config.rebatePassword = "rebate";
1457
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1458
- config.timeout = 5000;
1459
- config.channel = "ECOM";
1460
- src_1.ServicesContainer.configure(config);
1461
- card = new src_1.CreditCardData();
1462
- card.number = "4263970000005262";
1463
- card.expMonth = "12";
1464
- card.expYear = "2020";
1465
- card.cvn = "123";
1466
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1467
- card.cardHolderName = "James Mason";
1468
- return [4 /*yield*/, card
1469
- .charge(1.005)
1470
- .withCurrency("EUR")
1471
- .execute()];
1472
- case 1:
1473
- saleResponse = _a.sent();
1474
- t.truthy(saleResponse);
1475
- t.is("00", saleResponse.responseCode);
1476
- return [4 /*yield*/, throttle()];
1477
- case 2:
1478
- _a.sent();
1479
- return [4 /*yield*/, saleResponse
1480
- .refund(1.005)
1481
- .withCurrency("EUR")
1482
- .withDescription("JAVA-Rebate")
1483
- .execute()];
1484
- case 3:
1485
- response = _a.sent();
1486
- t.truthy(response);
1487
- t.is("00", response.responseCode);
1488
- return [2 /*return*/];
1489
- }
1490
- });
1491
- }); });
1492
- ava_1.default("JAVA_Rebate_012c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1493
- var config, card, saleResponse, error;
1494
- return __generator(this, function (_a) {
1495
- switch (_a.label) {
1496
- case 0:
1497
- t.plan(4);
1498
- config = new src_1.ServicesConfig();
1499
- config.merchantId = "heartlandgpsandbox";
1500
- config.accountId = "api";
1501
- config.sharedSecret = "secret";
1502
- config.refundPassword = "refund";
1503
- config.rebatePassword = "rebate";
1504
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1505
- config.timeout = 5000;
1506
- config.channel = "ECOM";
1507
- src_1.ServicesContainer.configure(config);
1508
- card = new src_1.CreditCardData();
1509
- card.number = "4263970000005262";
1510
- card.expMonth = "12";
1511
- card.expYear = "2020";
1512
- card.cvn = "123";
1513
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1514
- card.cardHolderName = "James Mason";
1515
- return [4 /*yield*/, card
1516
- .charge(10)
1517
- .withCurrency("EUR")
1518
- .execute()];
1519
- case 1:
1520
- saleResponse = _a.sent();
1521
- t.truthy(saleResponse);
1522
- t.is("00", saleResponse.responseCode);
1523
- return [4 /*yield*/, throttle()];
1524
- case 2:
1525
- _a.sent();
1526
- return [4 /*yield*/, t.throws(saleResponse
1527
- .refund()
1528
- .withCurrency("EUR")
1529
- .withDescription("JAVA-Rebate")
1530
- .execute(), src_1.GatewayError)];
1531
- case 3:
1532
- error = _a.sent();
1533
- t.truthy(error.message);
1534
- return [2 /*return*/];
1535
- }
1536
- });
1537
- }); });
1538
- ava_1.default("JAVA_Rebate_012d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1539
- var config, card, saleResponse, error;
1540
- return __generator(this, function (_a) {
1541
- switch (_a.label) {
1542
- case 0:
1543
- t.plan(4);
1544
- config = new src_1.ServicesConfig();
1545
- config.merchantId = "heartlandgpsandbox";
1546
- config.accountId = "api";
1547
- config.sharedSecret = "secret";
1548
- config.refundPassword = "refund";
1549
- config.rebatePassword = "rebate";
1550
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1551
- config.timeout = 5000;
1552
- config.channel = "ECOM";
1553
- src_1.ServicesContainer.configure(config);
1554
- card = new src_1.CreditCardData();
1555
- card.number = "4263970000005262";
1556
- card.expMonth = "12";
1557
- card.expYear = "2020";
1558
- card.cvn = "123";
1559
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1560
- card.cardHolderName = "James Mason";
1561
- return [4 /*yield*/, card
1562
- .charge(10)
1563
- .withCurrency("EUR")
1564
- .execute()];
1565
- case 1:
1566
- saleResponse = _a.sent();
1567
- t.truthy(saleResponse);
1568
- t.is("00", saleResponse.responseCode);
1569
- return [4 /*yield*/, throttle()];
1570
- case 2:
1571
- _a.sent();
1572
- return [4 /*yield*/, t.throws(saleResponse
1573
- .refund()
1574
- .withCurrency("EUR")
1575
- .withDescription("JAVA-Rebate")
1576
- .execute(), src_1.GatewayError)];
1577
- case 3:
1578
- error = _a.sent();
1579
- t.truthy(error.message);
1580
- return [2 /*return*/];
1581
- }
1582
- });
1583
- }); });
1584
- ava_1.default("JAVA_Rebate_012e", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1585
- var config, card, saleResponse, response;
1586
- return __generator(this, function (_a) {
1587
- switch (_a.label) {
1588
- case 0:
1589
- t.plan(4);
1590
- config = new src_1.ServicesConfig();
1591
- config.merchantId = "heartlandgpsandbox";
1592
- config.accountId = "api";
1593
- config.sharedSecret = "secret";
1594
- config.refundPassword = "refund";
1595
- config.rebatePassword = "rebate";
1596
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1597
- config.timeout = 5000;
1598
- config.channel = "ECOM";
1599
- src_1.ServicesContainer.configure(config);
1600
- card = new src_1.CreditCardData();
1601
- card.number = "4263970000005262";
1602
- card.expMonth = "12";
1603
- card.expYear = "2020";
1604
- card.cvn = "123";
1605
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1606
- card.cardHolderName = "James Mason";
1607
- return [4 /*yield*/, card
1608
- .charge(100000)
1609
- .withCurrency("EUR")
1610
- .execute()];
1611
- case 1:
1612
- saleResponse = _a.sent();
1613
- t.truthy(saleResponse);
1614
- t.is("00", saleResponse.responseCode);
1615
- return [4 /*yield*/, throttle()];
1616
- case 2:
1617
- _a.sent();
1618
- return [4 /*yield*/, saleResponse
1619
- .refund(100000)
1620
- .withCurrency("EUR")
1621
- .withDescription("JAVA-Rebate")
1622
- .execute()];
1623
- case 3:
1624
- response = _a.sent();
1625
- t.truthy(response);
1626
- t.is("00", response.responseCode);
1627
- return [2 /*return*/];
1628
- }
1629
- });
1630
- }); });
1631
- ava_1.default("JAVA_Rebate_012f", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1632
- var config, card, saleResponse, error;
1633
- return __generator(this, function (_a) {
1634
- switch (_a.label) {
1635
- case 0:
1636
- t.plan(4);
1637
- config = new src_1.ServicesConfig();
1638
- config.merchantId = "heartlandgpsandbox";
1639
- config.accountId = "api";
1640
- config.sharedSecret = "secret";
1641
- config.refundPassword = "refund";
1642
- config.rebatePassword = "rebate";
1643
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1644
- config.timeout = 5000;
1645
- config.channel = "ECOM";
1646
- src_1.ServicesContainer.configure(config);
1647
- card = new src_1.CreditCardData();
1648
- card.number = "4263970000005262";
1649
- card.expMonth = "12";
1650
- card.expYear = "2020";
1651
- card.cvn = "123";
1652
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1653
- card.cardHolderName = "James Mason";
1654
- return [4 /*yield*/, card
1655
- .charge(10)
1656
- .withCurrency("EUR")
1657
- .execute()];
1658
- case 1:
1659
- saleResponse = _a.sent();
1660
- t.truthy(saleResponse);
1661
- t.is("00", saleResponse.responseCode);
1662
- return [4 /*yield*/, throttle()];
1663
- case 2:
1664
- _a.sent();
1665
- return [4 /*yield*/, t.throws(saleResponse
1666
- .refund()
1667
- .withCurrency("EUR")
1668
- .withDescription("JAVA-Rebate")
1669
- .execute(), src_1.GatewayError)];
1670
- case 3:
1671
- error = _a.sent();
1672
- t.truthy(error.message);
1673
- return [2 /*return*/];
1674
- }
1675
- });
1676
- }); });
1677
- ava_1.default("JAVA_Rebate_013a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1678
- var config, card, saleResponse, response;
1679
- return __generator(this, function (_a) {
1680
- switch (_a.label) {
1681
- case 0:
1682
- t.plan(4);
1683
- config = new src_1.ServicesConfig();
1684
- config.merchantId = "heartlandgpsandbox";
1685
- config.accountId = "api";
1686
- config.sharedSecret = "secret";
1687
- config.refundPassword = "refund";
1688
- config.rebatePassword = "rebate";
1689
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1690
- config.timeout = 5000;
1691
- config.channel = "ECOM";
1692
- src_1.ServicesContainer.configure(config);
1693
- card = new src_1.CreditCardData();
1694
- card.number = "4263970000005262";
1695
- card.expMonth = "12";
1696
- card.expYear = "2020";
1697
- card.cvn = "123";
1698
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1699
- card.cardHolderName = "James Mason";
1700
- return [4 /*yield*/, card
1701
- .charge(1)
1702
- .withCurrency("EUR")
1703
- .execute()];
1704
- case 1:
1705
- saleResponse = _a.sent();
1706
- t.truthy(saleResponse);
1707
- t.is("00", saleResponse.responseCode);
1708
- return [4 /*yield*/, throttle()];
1709
- case 2:
1710
- _a.sent();
1711
- return [4 /*yield*/, saleResponse
1712
- .refund(1)
1713
- .withCurrency("EUR")
1714
- .withDescription("JAVA-Rebate")
1715
- .execute()];
1716
- case 3:
1717
- response = _a.sent();
1718
- t.truthy(response);
1719
- t.is("00", response.responseCode);
1720
- return [2 /*return*/];
1721
- }
1722
- });
1723
- }); });
1724
- ava_1.default("JAVA_Rebate_013b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1725
- var config, card, saleResponse, response;
1726
- return __generator(this, function (_a) {
1727
- switch (_a.label) {
1728
- case 0:
1729
- t.plan(4);
1730
- config = new src_1.ServicesConfig();
1731
- config.merchantId = "heartlandgpsandbox";
1732
- config.accountId = "api";
1733
- config.sharedSecret = "secret";
1734
- config.refundPassword = "refund";
1735
- config.rebatePassword = "rebate";
1736
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1737
- config.timeout = 5000;
1738
- config.channel = "ECOM";
1739
- src_1.ServicesContainer.configure(config);
1740
- card = new src_1.CreditCardData();
1741
- card.number = "4263970000005262";
1742
- card.expMonth = "12";
1743
- card.expYear = "2020";
1744
- card.cvn = "123";
1745
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1746
- card.cardHolderName = "James Mason";
1747
- return [4 /*yield*/, card
1748
- .charge(1)
1749
- .withCurrency("EUR")
1750
- .execute()];
1751
- case 1:
1752
- saleResponse = _a.sent();
1753
- t.truthy(saleResponse);
1754
- t.is("00", saleResponse.responseCode);
1755
- return [4 /*yield*/, throttle()];
1756
- case 2:
1757
- _a.sent();
1758
- return [4 /*yield*/, saleResponse
1759
- .refund(1)
1760
- .withCurrency("EUR")
1761
- .withDescription("JAVA-Rebate")
1762
- .execute()];
1763
- case 3:
1764
- response = _a.sent();
1765
- t.truthy(response);
1766
- t.is("00", response.responseCode);
1767
- return [2 /*return*/];
1768
- }
1769
- });
1770
- }); });
1771
- ava_1.default("JAVA_Rebate_013c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1772
- var config, card, saleResponse, response;
1773
- return __generator(this, function (_a) {
1774
- switch (_a.label) {
1775
- case 0:
1776
- t.plan(4);
1777
- config = new src_1.ServicesConfig();
1778
- config.merchantId = "heartlandgpsandbox";
1779
- config.accountId = "api";
1780
- config.sharedSecret = "secret";
1781
- config.refundPassword = "refund";
1782
- config.rebatePassword = "rebate";
1783
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1784
- config.timeout = 5000;
1785
- config.channel = "ECOM";
1786
- src_1.ServicesContainer.configure(config);
1787
- card = new src_1.CreditCardData();
1788
- card.number = "4263970000005262";
1789
- card.expMonth = "12";
1790
- card.expYear = "2020";
1791
- card.cvn = "123";
1792
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1793
- card.cardHolderName = "James Mason";
1794
- return [4 /*yield*/, card
1795
- .charge(1)
1796
- .withCurrency("EUR")
1797
- .execute()];
1798
- case 1:
1799
- saleResponse = _a.sent();
1800
- t.truthy(saleResponse);
1801
- t.is("00", saleResponse.responseCode);
1802
- return [4 /*yield*/, throttle()];
1803
- case 2:
1804
- _a.sent();
1805
- return [4 /*yield*/, saleResponse
1806
- .refund(1)
1807
- .withCurrency("EUR")
1808
- .withDescription("JAVA-Rebate")
1809
- .execute()];
1810
- case 3:
1811
- response = _a.sent();
1812
- t.truthy(response);
1813
- t.is("00", response.responseCode);
1814
- return [2 /*return*/];
1815
- }
1816
- });
1817
- }); });
1818
- ava_1.default("JAVA_Rebate_013d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1819
- var config, card, saleResponse, response;
1820
- return __generator(this, function (_a) {
1821
- switch (_a.label) {
1822
- case 0:
1823
- t.plan(4);
1824
- config = new src_1.ServicesConfig();
1825
- config.merchantId = "heartlandgpsandbox";
1826
- config.accountId = "api";
1827
- config.sharedSecret = "secret";
1828
- config.refundPassword = "refund";
1829
- config.rebatePassword = "rebate";
1830
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1831
- config.timeout = 5000;
1832
- config.channel = "ECOM";
1833
- src_1.ServicesContainer.configure(config);
1834
- card = new src_1.CreditCardData();
1835
- card.number = "4263970000005262";
1836
- card.expMonth = "12";
1837
- card.expYear = "2020";
1838
- card.cvn = "123";
1839
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1840
- card.cardHolderName = "James Mason";
1841
- return [4 /*yield*/, card
1842
- .charge(1)
1843
- .withCurrency("EUR")
1844
- .execute()];
1845
- case 1:
1846
- saleResponse = _a.sent();
1847
- t.truthy(saleResponse);
1848
- t.is("00", saleResponse.responseCode);
1849
- return [4 /*yield*/, throttle()];
1850
- case 2:
1851
- _a.sent();
1852
- return [4 /*yield*/, saleResponse
1853
- .refund(1)
1854
- .withCurrency("EUR")
1855
- .withDescription("JAVA-Rebate")
1856
- .execute()];
1857
- case 3:
1858
- response = _a.sent();
1859
- t.truthy(response);
1860
- t.is("00", response.responseCode);
1861
- return [2 /*return*/];
1862
- }
1863
- });
1864
- }); });
1865
- ava_1.default("JAVA_Rebate_014a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1866
- var config, card, saleResponse, response;
1867
- return __generator(this, function (_a) {
1868
- switch (_a.label) {
1869
- case 0:
1870
- t.plan(4);
1871
- config = new src_1.ServicesConfig();
1872
- config.merchantId = "heartlandgpsandbox";
1873
- config.accountId = "api";
1874
- config.sharedSecret = "secret";
1875
- config.refundPassword = "refund";
1876
- config.rebatePassword = "rebate";
1877
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1878
- config.timeout = 5000;
1879
- config.channel = "ECOM";
1880
- src_1.ServicesContainer.configure(config);
1881
- card = new src_1.CreditCardData();
1882
- card.number = "4263970000005262";
1883
- card.expMonth = "12";
1884
- card.expYear = "2020";
1885
- card.cvn = "123";
1886
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1887
- card.cardHolderName = "James Mason";
1888
- return [4 /*yield*/, card
1889
- .charge(1)
1890
- .withCurrency("EUR")
1891
- .execute()];
1892
- case 1:
1893
- saleResponse = _a.sent();
1894
- t.truthy(saleResponse);
1895
- t.is("00", saleResponse.responseCode);
1896
- return [4 /*yield*/, throttle()];
1897
- case 2:
1898
- _a.sent();
1899
- return [4 /*yield*/, saleResponse
1900
- .refund(1)
1901
- .withCurrency("EUR")
1902
- .withDescription("JAVA-Rebate")
1903
- .execute()];
1904
- case 3:
1905
- response = _a.sent();
1906
- t.truthy(response);
1907
- t.is("00", response.responseCode);
1908
- return [2 /*return*/];
1909
- }
1910
- });
1911
- }); });
1912
- ava_1.default("JAVA_Rebate_014b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1913
- var config, card, saleResponse, response;
1914
- return __generator(this, function (_a) {
1915
- switch (_a.label) {
1916
- case 0:
1917
- t.plan(4);
1918
- config = new src_1.ServicesConfig();
1919
- config.merchantId = "heartlandgpsandbox";
1920
- config.accountId = "api";
1921
- config.sharedSecret = "secret";
1922
- config.refundPassword = "refund";
1923
- config.rebatePassword = "rebate";
1924
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1925
- config.timeout = 5000;
1926
- config.channel = "ECOM";
1927
- src_1.ServicesContainer.configure(config);
1928
- card = new src_1.CreditCardData();
1929
- card.number = "4263970000005262";
1930
- card.expMonth = "12";
1931
- card.expYear = "2020";
1932
- card.cvn = "123";
1933
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1934
- card.cardHolderName = "James Mason";
1935
- return [4 /*yield*/, card
1936
- .charge(1)
1937
- .withCurrency("EUR")
1938
- .execute()];
1939
- case 1:
1940
- saleResponse = _a.sent();
1941
- t.truthy(saleResponse);
1942
- t.is("00", saleResponse.responseCode);
1943
- return [4 /*yield*/, throttle()];
1944
- case 2:
1945
- _a.sent();
1946
- return [4 /*yield*/, saleResponse
1947
- .refund(1)
1948
- .withCurrency("EUR")
1949
- .withDescription("JAVA-Rebate")
1950
- .execute()];
1951
- case 3:
1952
- response = _a.sent();
1953
- t.truthy(response);
1954
- t.is("00", response.responseCode);
1955
- return [2 /*return*/];
1956
- }
1957
- });
1958
- }); });
1959
- ava_1.default("JAVA_Rebate_014c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
1960
- var config, card, saleResponse, response;
1961
- return __generator(this, function (_a) {
1962
- switch (_a.label) {
1963
- case 0:
1964
- t.plan(4);
1965
- config = new src_1.ServicesConfig();
1966
- config.merchantId = "heartlandgpsandbox";
1967
- config.accountId = "api";
1968
- config.sharedSecret = "secret";
1969
- config.refundPassword = "refund";
1970
- config.rebatePassword = "rebate";
1971
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
1972
- config.timeout = 5000;
1973
- config.channel = "ECOM";
1974
- src_1.ServicesContainer.configure(config);
1975
- card = new src_1.CreditCardData();
1976
- card.number = "4263970000005262";
1977
- card.expMonth = "12";
1978
- card.expYear = "2020";
1979
- card.cvn = "123";
1980
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
1981
- card.cardHolderName = "James Mason";
1982
- return [4 /*yield*/, card
1983
- .charge(1)
1984
- .withCurrency("EUR")
1985
- .execute()];
1986
- case 1:
1987
- saleResponse = _a.sent();
1988
- t.truthy(saleResponse);
1989
- t.is("00", saleResponse.responseCode);
1990
- return [4 /*yield*/, throttle()];
1991
- case 2:
1992
- _a.sent();
1993
- return [4 /*yield*/, saleResponse
1994
- .refund(1)
1995
- .withCurrency("EUR")
1996
- .withDescription("JAVA-Rebate")
1997
- .execute()];
1998
- case 3:
1999
- response = _a.sent();
2000
- t.truthy(response);
2001
- t.is("00", response.responseCode);
2002
- return [2 /*return*/];
2003
- }
2004
- });
2005
- }); });
2006
- ava_1.default("JAVA_Rebate_014d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
2007
- var config, card, saleResponse, response;
2008
- return __generator(this, function (_a) {
2009
- switch (_a.label) {
2010
- case 0:
2011
- t.plan(4);
2012
- config = new src_1.ServicesConfig();
2013
- config.merchantId = "heartlandgpsandbox";
2014
- config.accountId = "api";
2015
- config.sharedSecret = "secret";
2016
- config.refundPassword = "refund";
2017
- config.rebatePassword = "rebate";
2018
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
2019
- config.timeout = 5000;
2020
- config.channel = "ECOM";
2021
- src_1.ServicesContainer.configure(config);
2022
- card = new src_1.CreditCardData();
2023
- card.number = "4263970000005262";
2024
- card.expMonth = "12";
2025
- card.expYear = "2020";
2026
- card.cvn = "123";
2027
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
2028
- card.cardHolderName = "James Mason";
2029
- return [4 /*yield*/, card
2030
- .charge(1)
2031
- .withCurrency("EUR")
2032
- .execute()];
2033
- case 1:
2034
- saleResponse = _a.sent();
2035
- t.truthy(saleResponse);
2036
- t.is("00", saleResponse.responseCode);
2037
- return [4 /*yield*/, throttle()];
2038
- case 2:
2039
- _a.sent();
2040
- return [4 /*yield*/, saleResponse
2041
- .refund(1)
2042
- .withCurrency("EUR")
2043
- .withDescription("JAVA-Rebate")
2044
- .execute()];
2045
- case 3:
2046
- response = _a.sent();
2047
- t.truthy(response);
2048
- t.is("00", response.responseCode);
2049
- return [2 /*return*/];
2050
- }
2051
- });
2052
- }); });
2053
- ava_1.default("JAVA_Rebate_015a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
2054
- var config, card, saleResponse, response;
2055
- return __generator(this, function (_a) {
2056
- switch (_a.label) {
2057
- case 0:
2058
- t.plan(4);
2059
- config = new src_1.ServicesConfig();
2060
- config.merchantId = "heartlandgpsandbox";
2061
- config.accountId = "api";
2062
- config.sharedSecret = "secret";
2063
- config.refundPassword = "refund";
2064
- config.rebatePassword = "rebate";
2065
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
2066
- config.timeout = 5000;
2067
- config.channel = "ECOM";
2068
- src_1.ServicesContainer.configure(config);
2069
- card = new src_1.CreditCardData();
2070
- card.number = "4263970000005262";
2071
- card.expMonth = "12";
2072
- card.expYear = "2020";
2073
- card.cvn = "123";
2074
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
2075
- card.cardHolderName = "James Mason";
2076
- return [4 /*yield*/, card
2077
- .charge(1)
2078
- .withCurrency("EUR")
2079
- .execute()];
2080
- case 1:
2081
- saleResponse = _a.sent();
2082
- t.truthy(saleResponse);
2083
- t.is("00", saleResponse.responseCode);
2084
- return [4 /*yield*/, throttle()];
2085
- case 2:
2086
- _a.sent();
2087
- return [4 /*yield*/, saleResponse
2088
- .refund(1)
2089
- .withCurrency("EUR")
2090
- .withDescription("JAVA-Rebate")
2091
- .execute()];
2092
- case 3:
2093
- response = _a.sent();
2094
- t.truthy(response);
2095
- t.is("00", response.responseCode);
2096
- return [2 /*return*/];
2097
- }
2098
- });
2099
- }); });
2100
- ava_1.default("JAVA_Rebate_016a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
2101
- var config, card, saleResponse, response;
2102
- return __generator(this, function (_a) {
2103
- switch (_a.label) {
2104
- case 0:
2105
- t.plan(4);
2106
- config = new src_1.ServicesConfig();
2107
- config.merchantId = "heartlandgpsandbox";
2108
- config.accountId = "api";
2109
- config.sharedSecret = "secret";
2110
- config.refundPassword = "refund";
2111
- config.rebatePassword = "rebate";
2112
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
2113
- config.timeout = 5000;
2114
- config.channel = "ECOM";
2115
- src_1.ServicesContainer.configure(config);
2116
- card = new src_1.CreditCardData();
2117
- card.number = "4263970000005262";
2118
- card.expMonth = "12";
2119
- card.expYear = "2020";
2120
- card.cvn = "123";
2121
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
2122
- card.cardHolderName = "James Mason";
2123
- return [4 /*yield*/, card
2124
- .charge(1)
2125
- .withCurrency("EUR")
2126
- .execute()];
2127
- case 1:
2128
- saleResponse = _a.sent();
2129
- t.truthy(saleResponse);
2130
- t.is("00", saleResponse.responseCode);
2131
- return [4 /*yield*/, throttle()];
2132
- case 2:
2133
- _a.sent();
2134
- return [4 /*yield*/, saleResponse
2135
- .refund(1)
2136
- .withCurrency("EUR")
2137
- .withDescription("JAVA-Rebate")
2138
- .execute()];
2139
- case 3:
2140
- response = _a.sent();
2141
- t.truthy(response);
2142
- t.is("00", response.responseCode);
2143
- return [2 /*return*/];
2144
- }
2145
- });
2146
- }); });
2147
- ava_1.default("JAVA_Rebate_016b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
2148
- var config, card, saleResponse, response;
2149
- return __generator(this, function (_a) {
2150
- switch (_a.label) {
2151
- case 0:
2152
- t.plan(4);
2153
- config = new src_1.ServicesConfig();
2154
- config.merchantId = "heartlandgpsandbox";
2155
- config.accountId = "api";
2156
- config.sharedSecret = "secret";
2157
- config.refundPassword = "refund";
2158
- config.rebatePassword = "rebate";
2159
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
2160
- config.timeout = 5000;
2161
- config.channel = "ECOM";
2162
- src_1.ServicesContainer.configure(config);
2163
- card = new src_1.CreditCardData();
2164
- card.number = "4263970000005262";
2165
- card.expMonth = "12";
2166
- card.expYear = "2020";
2167
- card.cvn = "123";
2168
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
2169
- card.cardHolderName = "James Mason";
2170
- return [4 /*yield*/, card
2171
- .charge(1)
2172
- .withCurrency("EUR")
2173
- .execute()];
2174
- case 1:
2175
- saleResponse = _a.sent();
2176
- t.truthy(saleResponse);
2177
- t.is("00", saleResponse.responseCode);
2178
- return [4 /*yield*/, throttle()];
2179
- case 2:
2180
- _a.sent();
2181
- return [4 /*yield*/, saleResponse
2182
- .refund(1)
2183
- .withCurrency("EUR")
2184
- .execute()];
2185
- case 3:
2186
- response = _a.sent();
2187
- t.truthy(response);
2188
- t.is("00", response.responseCode);
2189
- return [2 /*return*/];
2190
- }
2191
- });
2192
- }); });
2193
- ava_1.default("JAVA_Rebate_016c", function (t) { return __awaiter(void 0, void 0, void 0, function () {
2194
- var config, card, saleResponse, response;
2195
- return __generator(this, function (_a) {
2196
- switch (_a.label) {
2197
- case 0:
2198
- t.plan(4);
2199
- config = new src_1.ServicesConfig();
2200
- config.merchantId = "heartlandgpsandbox";
2201
- config.accountId = "api";
2202
- config.sharedSecret = "secret";
2203
- config.refundPassword = "refund";
2204
- config.rebatePassword = "rebate";
2205
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
2206
- config.timeout = 5000;
2207
- config.channel = "ECOM";
2208
- src_1.ServicesContainer.configure(config);
2209
- card = new src_1.CreditCardData();
2210
- card.number = "4263970000005262";
2211
- card.expMonth = "12";
2212
- card.expYear = "2020";
2213
- card.cvn = "123";
2214
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
2215
- card.cardHolderName = "James Mason";
2216
- return [4 /*yield*/, card
2217
- .charge(1)
2218
- .withCurrency("EUR")
2219
- .execute()];
2220
- case 1:
2221
- saleResponse = _a.sent();
2222
- t.truthy(saleResponse);
2223
- t.is("00", saleResponse.responseCode);
2224
- return [4 /*yield*/, throttle()];
2225
- case 2:
2226
- _a.sent();
2227
- return [4 /*yield*/, saleResponse
2228
- .refund(1)
2229
- .withCurrency("EUR")
2230
- // tslint:disable:max-line-length
2231
- .withDescription("akshdfgakjdshfgjdshgfkjdsahgfjshagdfjshdagfkjdshgfjshdgfjdshgfkjhdsagfjdsgfdskjgfdsjkhgfdsjhgfkdsjgfkjdshgfkjdsahgfjdskhgfjhdsgfjkhsdgfjkhsdgfjhsdgfjhsdgfkjhgsadjfhgsakjdhgfsajdhgfkjsadgfjhsadgfjkhdsgafjhdsgfjhdsgfjhdsgfkjhdgsafjkhgsfjhsdagfkjsgdafjhsgdfjhgdskjfgdsjfhgjdskhgfjhdsgfjhdsgfkjhgdsfkjhgsdkjfgsdkjhgfkjsahgdfkjgdsajfhgdsjkgfjdshgfjkdsagfjkhdsgfjsdhgfjkdshgfkjhgdsfkjhgdskjfgdskjgfkjdsahgfjhgdsakjfgdsafjhgdsjkhgfkjdshgfakjadshgfjhdsagfjhgdsfjhgsdakjfgdsakjhgfjsdhgfjhdsgfjhdsgfkjgdsajkfhgjdshgfjdsahgfjkhdsagfjhdsgfjkgdsfjhdsgfjhgdsjfhgdsjhfgjdshgfkjdsgfkjsadgfjkgdsfkjhgdsajfkhgdsjkgfkjdsagfkjgdsakjfhgdsfjkhgdsafkjgsadkjgfdkjsahgfkjsagfkjdshgfkjshdgfjgdsfkjgsadkjhgfdsjhgfkjdsagfjhdsgfjhgdsakjfgdsakjhgfjsdahgfjkgdsfjhgdsajkhfgjhdsagfkjhsgdakjf")
2232
- // tslint:enable:max-line-length
2233
- .execute()];
2234
- case 3:
2235
- response = _a.sent();
2236
- t.truthy(response);
2237
- t.is("00", response.responseCode);
2238
- return [2 /*return*/];
2239
- }
2240
- });
2241
- }); });
2242
- ava_1.default("JAVA_Rebate_016d", function (t) { return __awaiter(void 0, void 0, void 0, function () {
2243
- var config, card, saleResponse, response;
2244
- return __generator(this, function (_a) {
2245
- switch (_a.label) {
2246
- case 0:
2247
- t.plan(4);
2248
- config = new src_1.ServicesConfig();
2249
- config.merchantId = "heartlandgpsandbox";
2250
- config.accountId = "api";
2251
- config.sharedSecret = "secret";
2252
- config.refundPassword = "refund";
2253
- config.rebatePassword = "rebate";
2254
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
2255
- config.timeout = 5000;
2256
- config.channel = "ECOM";
2257
- src_1.ServicesContainer.configure(config);
2258
- card = new src_1.CreditCardData();
2259
- card.number = "4263970000005262";
2260
- card.expMonth = "12";
2261
- card.expYear = "2020";
2262
- card.cvn = "123";
2263
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
2264
- card.cardHolderName = "James Mason";
2265
- return [4 /*yield*/, card
2266
- .charge(1)
2267
- .withCurrency("EUR")
2268
- .execute()];
2269
- case 1:
2270
- saleResponse = _a.sent();
2271
- t.truthy(saleResponse);
2272
- t.is("00", saleResponse.responseCode);
2273
- return [4 /*yield*/, throttle()];
2274
- case 2:
2275
- _a.sent();
2276
- return [4 /*yield*/, saleResponse
2277
- .refund(1)
2278
- .withCurrency("EUR")
2279
- .withDescription("SDK#####")
2280
- .execute()];
2281
- case 3:
2282
- response = _a.sent();
2283
- t.truthy(response);
2284
- t.is("00", response.responseCode);
2285
- return [2 /*return*/];
2286
- }
2287
- });
2288
- }); });
2289
- ava_1.default("JAVA_Rebate_017a", function (t) { return __awaiter(void 0, void 0, void 0, function () {
2290
- var config, card, saleResponse, response;
2291
- return __generator(this, function (_a) {
2292
- switch (_a.label) {
2293
- case 0:
2294
- t.plan(4);
2295
- config = new src_1.ServicesConfig();
2296
- config.merchantId = "heartlandgpsandbox";
2297
- config.accountId = "api";
2298
- config.sharedSecret = "secret";
2299
- config.refundPassword = "refund";
2300
- config.rebatePassword = "rebate";
2301
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
2302
- config.timeout = 5000;
2303
- config.channel = "ECOM";
2304
- src_1.ServicesContainer.configure(config);
2305
- card = new src_1.CreditCardData();
2306
- card.number = "4263970000005262";
2307
- card.expMonth = "12";
2308
- card.expYear = "2020";
2309
- card.cvn = "123";
2310
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
2311
- card.cardHolderName = "James Mason";
2312
- return [4 /*yield*/, card
2313
- .charge(1)
2314
- .withCurrency("EUR")
2315
- .execute()];
2316
- case 1:
2317
- saleResponse = _a.sent();
2318
- t.truthy(saleResponse);
2319
- t.is("00", saleResponse.responseCode);
2320
- return [4 /*yield*/, throttle()];
2321
- case 2:
2322
- _a.sent();
2323
- return [4 /*yield*/, saleResponse
2324
- .refund(1)
2325
- .withCurrency("EUR")
2326
- .withDescription("JAVA-Rebate")
2327
- .execute()];
2328
- case 3:
2329
- response = _a.sent();
2330
- t.truthy(response);
2331
- t.is("00", response.responseCode);
2332
- return [2 /*return*/];
2333
- }
2334
- });
2335
- }); });
2336
- ava_1.default("JAVA_Rebate_017b", function (t) { return __awaiter(void 0, void 0, void 0, function () {
2337
- var config, card, error;
2338
- return __generator(this, function (_a) {
2339
- switch (_a.label) {
2340
- case 0:
2341
- t.plan(2);
2342
- config = new src_1.ServicesConfig();
2343
- config.merchantId = "heartlandgpsandbox";
2344
- config.accountId = "api";
2345
- config.sharedSecret = "secreto";
2346
- config.refundPassword = "refund";
2347
- config.rebatePassword = "rebate";
2348
- config.serviceUrl = "https://api.sandbox.realexpayments.com/epage-remote.cgi";
2349
- config.timeout = 5000;
2350
- config.channel = "ECOM";
2351
- src_1.ServicesContainer.configure(config);
2352
- card = new src_1.CreditCardData();
2353
- card.number = "4263970000005262";
2354
- card.expMonth = "12";
2355
- card.expYear = "2020";
2356
- card.cvn = "123";
2357
- card.cvnPresenceIndicator = src_1.CvnPresenceIndicator.Present;
2358
- card.cardHolderName = "James Mason";
2359
- return [4 /*yield*/, t.throws(card
2360
- .charge(1)
2361
- .withCurrency("EUR")
2362
- .execute(), src_1.GatewayError)];
2363
- case 1:
2364
- error = _a.sent();
2365
- t.truthy(error.message);
2366
- return [2 /*return*/];
2367
- }
2368
- });
2369
- }); });