globalpayments-api 3.10.1 → 3.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +184 -177
- package/LICENSE.md +257 -257
- package/README.md +141 -141
- package/appsec.properties +8 -0
- package/lib/src/Gateways/PorticoConnector.js +24 -0
- package/lib/src/Gateways/PorticoConnector.js.map +1 -1
- package/lib/src/Gateways/RealexConnector.d.ts +30 -0
- package/lib/src/Gateways/RealexConnector.js +523 -0
- package/lib/src/PaymentMethods/Credit.d.ts +2 -1
- package/lib/src/PaymentMethods/Credit.js +1 -0
- package/lib/src/PaymentMethods/Credit.js.map +1 -1
- package/lib/src/ServicesConfig.d.ts +27 -0
- package/lib/src/ServicesConfig.js +50 -0
- package/lib/test/Integration/Gateways/GpApiConnector/3DS2.test.js +15 -15
- package/lib/test/Integration/Gateways/GpApiConnector/3DSecure.test.js +5 -5
- package/lib/test/Integration/Gateways/GpEcomConnector/Credit.test.js +4 -4
- package/lib/test/Integration/Gateways/PorticoConnector/AchTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/AchTest.js +112 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/CheckTest.js +483 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceCheckTest.js +83 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/EcommerceTest.js +1720 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoCheckTest.js +83 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/MotoTest.js +1757 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RecurringTest.js +682 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Certifications/RetailTest.js +2218 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js +32 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Credit.test.js.map +1 -1
- package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/CreditTest.js +707 -0
- package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/DebitTest.js +151 -0
- package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/EbtTest.js +171 -0
- package/lib/test/Integration/Gateways/PorticoConnector/Ecommerce.test.js +8 -8
- package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/EcommerceTest.js +192 -0
- package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/GiftTest.js +377 -0
- package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/RecurringTest.js +196 -0
- package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/PorticoConnector/ReportingTest.js +53 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/GetInformationCertificationTests.js +100 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayAccountCertificationTests.js +352 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayFundCertificationTests.js +123 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/Certifications/ProPayInNetworkTransactionCertificationTests.js +142 -0
- package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/GetInformationTests.js +100 -0
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayAccountTests.js +535 -0
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayFundsTests.js +124 -0
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTests.d.ts +1 -0
- package/lib/test/Integration/Gateways/ProPayConnector/ProPayInNetworkTransactionTests.js +144 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/AuthTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/AuthTest.js +4373 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/AvsTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/AvsTest.js +758 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/CreditTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/CreditTest.js +2399 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/HoldTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/HoldTest.js +1656 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ManualTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ManualTest.js +5650 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/OtbTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/OtbTest.js +1985 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/RebateTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/RebateTest.js +2369 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ReleaseTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ReleaseTest.js +1703 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/SettleTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/SettleTest.js +2053 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ValidationTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/ValidationTest.js +2469 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/VerifyEnrolledTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/VerifyEnrolledTest.js +3116 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/VoidTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/Certification/VoidTest.js +2031 -0
- package/lib/test/Integration/Gateways/RealexConnector/CreditTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/CreditTest.js +322 -0
- package/lib/test/Integration/Gateways/RealexConnector/HppTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/HppTest.js +98 -0
- package/lib/test/Integration/Gateways/RealexConnector/RecurringTest.d.ts +1 -0
- package/lib/test/Integration/Gateways/RealexConnector/RecurringTest.js +263 -0
- package/lib/test/Integration/Services/CheckServiceTest.d.ts +1 -0
- package/lib/test/Integration/Services/CheckServiceTest.js +98 -0
- package/lib/test/Integration/Services/CreditServiceTest.d.ts +1 -0
- package/lib/test/Integration/Services/CreditServiceTest.js +313 -0
- package/lib/test/Integration/Services/DebitServiceTest.d.ts +1 -0
- package/lib/test/Integration/Services/DebitServiceTest.js +154 -0
- package/lib/test/Integration/Services/EBTServiceTest.d.ts +1 -0
- package/lib/test/Integration/Services/EBTServiceTest.js +135 -0
- package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.d.ts +1 -0
- package/lib/test/Unit/Builders/AuthorizationBuilder/ValidationTest.js +161 -0
- package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.d.ts +1 -0
- package/lib/test/Unit/Builders/ReportBuilder/ValidationTest.js +139 -0
- package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.d.ts +1 -0
- package/lib/test/Unit/Gateways/PorticoConnector/InputValidationTest.js +202 -0
- package/lib/test/Unit/Gateways/RealexConnector/CreditTest.d.ts +1 -0
- package/lib/test/Unit/Gateways/RealexConnector/CreditTest.js +29 -0
- package/package.json +62 -62
|
@@ -0,0 +1,2218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var ava_1 = require("ava");
|
|
4
|
+
var src_1 = require("../../../../../src/");
|
|
5
|
+
var Data_1 = require("../../../../Data/");
|
|
6
|
+
var config = new src_1.ServicesConfig();
|
|
7
|
+
config.secretApiKey = "skapi_cert_MaePAQBr-1QAqjfckFC8FTbRTT120bVQUlfVOjgCBw";
|
|
8
|
+
config.serviceUrl = "https://cert.api2-c.heartlandportico.com";
|
|
9
|
+
var BATCH_NOT_OPEN = "Transaction was rejected because it requires a batch to be open.";
|
|
10
|
+
var BATCH_EMPTY = "Batch close was rejected because no transactions are associated with the currently open batch";
|
|
11
|
+
var runSerially = false;
|
|
12
|
+
var test = runSerially ? ava_1.default.serial : ava_1.default;
|
|
13
|
+
var useTokens = false;
|
|
14
|
+
var visaToken = "";
|
|
15
|
+
var masterCardToken = "";
|
|
16
|
+
var discoverToken = "";
|
|
17
|
+
var amexToken = "";
|
|
18
|
+
ava_1.default.before(function (_t) {
|
|
19
|
+
src_1.ServicesContainer.configure(config);
|
|
20
|
+
});
|
|
21
|
+
test.before("000 - close batch", function (t) {
|
|
22
|
+
t.plan(1);
|
|
23
|
+
return new Promise(function (resolve, reject) {
|
|
24
|
+
src_1.BatchService.closeBatch()
|
|
25
|
+
.then(function (response) {
|
|
26
|
+
t.truthy(response);
|
|
27
|
+
resolve();
|
|
28
|
+
})
|
|
29
|
+
.catch(function (e) {
|
|
30
|
+
if (e.message.indexOf(BATCH_NOT_OPEN) !== -1 ||
|
|
31
|
+
e.message.indexOf(BATCH_EMPTY) !== -1) {
|
|
32
|
+
t.pass();
|
|
33
|
+
resolve();
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
reject(e);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
/// CREDIT CARD FUNCTIONS
|
|
41
|
+
/// CARD VERIFY
|
|
42
|
+
/// ACCOUNT VERIFICATION
|
|
43
|
+
test("001 - card verify visa", function (t) {
|
|
44
|
+
t.plan(5);
|
|
45
|
+
var card = Data_1.TestCards.visaSwipeEncrypted();
|
|
46
|
+
return card
|
|
47
|
+
.verify()
|
|
48
|
+
.withAllowDuplicates(true)
|
|
49
|
+
.withRequestMultiUseToken(useTokens)
|
|
50
|
+
.execute()
|
|
51
|
+
.then(function (response) {
|
|
52
|
+
t.truthy(response);
|
|
53
|
+
t.is(response.responseCode, "00");
|
|
54
|
+
return response;
|
|
55
|
+
})
|
|
56
|
+
.then(function (response) {
|
|
57
|
+
if (!useTokens) {
|
|
58
|
+
t.plan(2);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
t.truthy(response.token);
|
|
62
|
+
var token = new src_1.CreditCardData();
|
|
63
|
+
token.token = response.token;
|
|
64
|
+
return token
|
|
65
|
+
.charge(15.01)
|
|
66
|
+
.withAllowDuplicates(true)
|
|
67
|
+
.execute()
|
|
68
|
+
.then(function (chargeResponse) {
|
|
69
|
+
t.truthy(chargeResponse);
|
|
70
|
+
t.is(chargeResponse.responseCode, "00");
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
test("002 - card verify mastercard", function (t) {
|
|
75
|
+
t.plan(5);
|
|
76
|
+
var card = Data_1.TestCards.masterCardSwipeEncrypted();
|
|
77
|
+
return card
|
|
78
|
+
.verify()
|
|
79
|
+
.withAllowDuplicates(true)
|
|
80
|
+
.withRequestMultiUseToken(useTokens)
|
|
81
|
+
.execute()
|
|
82
|
+
.then(function (response) {
|
|
83
|
+
t.truthy(response);
|
|
84
|
+
t.is(response.responseCode, "00");
|
|
85
|
+
return response;
|
|
86
|
+
})
|
|
87
|
+
.then(function (response) {
|
|
88
|
+
if (!useTokens) {
|
|
89
|
+
t.plan(2);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
t.truthy(response.token);
|
|
93
|
+
var token = new src_1.CreditCardData();
|
|
94
|
+
token.token = response.token;
|
|
95
|
+
return token
|
|
96
|
+
.charge(15.02)
|
|
97
|
+
.withAllowDuplicates(true)
|
|
98
|
+
.execute()
|
|
99
|
+
.then(function (chargeResponse) {
|
|
100
|
+
t.truthy(chargeResponse);
|
|
101
|
+
t.is(chargeResponse.responseCode, "00");
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
test("003 - card verify discover", function (t) {
|
|
106
|
+
t.plan(5);
|
|
107
|
+
var card = Data_1.TestCards.discoverSwipeEncrypted();
|
|
108
|
+
return card
|
|
109
|
+
.verify()
|
|
110
|
+
.withAllowDuplicates(true)
|
|
111
|
+
.withRequestMultiUseToken(useTokens)
|
|
112
|
+
.execute()
|
|
113
|
+
.then(function (response) {
|
|
114
|
+
t.truthy(response);
|
|
115
|
+
t.is(response.responseCode, "00");
|
|
116
|
+
return response;
|
|
117
|
+
})
|
|
118
|
+
.then(function (response) {
|
|
119
|
+
if (!useTokens) {
|
|
120
|
+
t.plan(2);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
t.truthy(response.token);
|
|
124
|
+
var token = new src_1.CreditCardData();
|
|
125
|
+
token.token = response.token;
|
|
126
|
+
return token
|
|
127
|
+
.charge(15.03)
|
|
128
|
+
.withAllowDuplicates(true)
|
|
129
|
+
.execute()
|
|
130
|
+
.then(function (chargeResponse) {
|
|
131
|
+
t.truthy(chargeResponse);
|
|
132
|
+
t.is(chargeResponse.responseCode, "00");
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
/// Address Verification
|
|
137
|
+
test("004 - card verify amex", function (t) {
|
|
138
|
+
t.plan(5);
|
|
139
|
+
var address = new src_1.Address();
|
|
140
|
+
address.postalCode = "75024";
|
|
141
|
+
var card = Data_1.TestCards.amexManual(false, true);
|
|
142
|
+
return card
|
|
143
|
+
.verify()
|
|
144
|
+
.withAllowDuplicates(true)
|
|
145
|
+
.withAddress(address)
|
|
146
|
+
.withRequestMultiUseToken(useTokens)
|
|
147
|
+
.execute()
|
|
148
|
+
.then(function (response) {
|
|
149
|
+
t.truthy(response);
|
|
150
|
+
t.is(response.responseCode, "00");
|
|
151
|
+
return response;
|
|
152
|
+
})
|
|
153
|
+
.then(function (response) {
|
|
154
|
+
if (!useTokens) {
|
|
155
|
+
t.plan(2);
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
t.truthy(response.token);
|
|
159
|
+
var token = new src_1.CreditCardData();
|
|
160
|
+
token.token = response.token;
|
|
161
|
+
return token
|
|
162
|
+
.charge(15.04)
|
|
163
|
+
.withAllowDuplicates(true)
|
|
164
|
+
.execute()
|
|
165
|
+
.then(function (chargeResponse) {
|
|
166
|
+
t.truthy(chargeResponse);
|
|
167
|
+
t.is(chargeResponse.responseCode, "00");
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
/// Balance Inquiry (for Prepaid)
|
|
172
|
+
test("005 - balance inquiry visa", function (t) {
|
|
173
|
+
t.plan(2);
|
|
174
|
+
var card = Data_1.TestCards.visaSwipeEncrypted();
|
|
175
|
+
return card
|
|
176
|
+
.balanceInquiry()
|
|
177
|
+
.execute()
|
|
178
|
+
.then(function (response) {
|
|
179
|
+
t.truthy(response);
|
|
180
|
+
t.is(response.responseCode, "00");
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
/// CREDIT SALE (for multi-use token only)
|
|
184
|
+
test("006 - charge visa swipe token", function (t) {
|
|
185
|
+
t.plan(2);
|
|
186
|
+
var card = Data_1.TestCards.visaSwipe();
|
|
187
|
+
return card
|
|
188
|
+
.charge(15.01)
|
|
189
|
+
.withCurrency("USD")
|
|
190
|
+
.withRequestMultiUseToken(true)
|
|
191
|
+
.withAllowDuplicates(true)
|
|
192
|
+
.execute()
|
|
193
|
+
.then(function (response) {
|
|
194
|
+
t.truthy(response);
|
|
195
|
+
t.is(response.responseCode, "00");
|
|
196
|
+
visaToken = response.token;
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
test("007 - charge mastercard swipe token", function (t) {
|
|
200
|
+
t.plan(2);
|
|
201
|
+
var card = Data_1.TestCards.masterCardSwipe();
|
|
202
|
+
return card
|
|
203
|
+
.charge(15.02)
|
|
204
|
+
.withCurrency("USD")
|
|
205
|
+
.withRequestMultiUseToken(true)
|
|
206
|
+
.withAllowDuplicates(true)
|
|
207
|
+
.execute()
|
|
208
|
+
.then(function (response) {
|
|
209
|
+
t.truthy(response);
|
|
210
|
+
t.is(response.responseCode, "00");
|
|
211
|
+
masterCardToken = response.token;
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
test("008 - charge discover swipe token", function (t) {
|
|
215
|
+
t.plan(2);
|
|
216
|
+
var card = Data_1.TestCards.discoverSwipe();
|
|
217
|
+
return card
|
|
218
|
+
.charge(15.03)
|
|
219
|
+
.withCurrency("USD")
|
|
220
|
+
.withRequestMultiUseToken(true)
|
|
221
|
+
.withAllowDuplicates(true)
|
|
222
|
+
.execute()
|
|
223
|
+
.then(function (response) {
|
|
224
|
+
t.truthy(response);
|
|
225
|
+
t.is(response.responseCode, "00");
|
|
226
|
+
discoverToken = response.token;
|
|
227
|
+
});
|
|
228
|
+
});
|
|
229
|
+
test("009 - charge amex swipe token", function (t) {
|
|
230
|
+
t.plan(2);
|
|
231
|
+
var card = Data_1.TestCards.amexSwipe();
|
|
232
|
+
return card
|
|
233
|
+
.charge(15.04)
|
|
234
|
+
.withCurrency("USD")
|
|
235
|
+
.withRequestMultiUseToken(true)
|
|
236
|
+
.withAllowDuplicates(true)
|
|
237
|
+
.execute()
|
|
238
|
+
.then(function (response) {
|
|
239
|
+
t.truthy(response);
|
|
240
|
+
t.is(response.responseCode, "00");
|
|
241
|
+
amexToken = response.token;
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
/// CREDIT SALE
|
|
245
|
+
/// SWIPED
|
|
246
|
+
test("010 - charge visa swipe", function (t) {
|
|
247
|
+
t.plan(4);
|
|
248
|
+
var card = Data_1.TestCards.visaSwipe();
|
|
249
|
+
return card
|
|
250
|
+
.charge(15.01)
|
|
251
|
+
.withCurrency("USD")
|
|
252
|
+
.withAllowDuplicates(true)
|
|
253
|
+
.execute()
|
|
254
|
+
.then(function (response) {
|
|
255
|
+
t.truthy(response);
|
|
256
|
+
t.is(response.responseCode, "00");
|
|
257
|
+
return response;
|
|
258
|
+
})
|
|
259
|
+
.then(function (response) {
|
|
260
|
+
// test 059
|
|
261
|
+
return (response
|
|
262
|
+
.reverse(15.01)
|
|
263
|
+
// .withAllowDuplicates(true)
|
|
264
|
+
.execute()
|
|
265
|
+
.then(function (reverseResponse) {
|
|
266
|
+
t.truthy(reverseResponse);
|
|
267
|
+
t.is(reverseResponse.responseCode, "00");
|
|
268
|
+
}));
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
test("011 - charge mastercard swipe", function (t) {
|
|
272
|
+
t.plan(2);
|
|
273
|
+
var card = Data_1.TestCards.masterCardSwipe();
|
|
274
|
+
return card
|
|
275
|
+
.charge(15.02)
|
|
276
|
+
.withCurrency("USD")
|
|
277
|
+
.withAllowDuplicates(true)
|
|
278
|
+
.execute()
|
|
279
|
+
.then(function (response) {
|
|
280
|
+
t.truthy(response);
|
|
281
|
+
t.is(response.responseCode, "00");
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
test("012 - charge discover swipe", function (t) {
|
|
285
|
+
t.plan(2);
|
|
286
|
+
var card = Data_1.TestCards.discoverSwipe();
|
|
287
|
+
return card
|
|
288
|
+
.charge(15.02)
|
|
289
|
+
.withCurrency("USD")
|
|
290
|
+
.withAllowDuplicates(true)
|
|
291
|
+
.execute()
|
|
292
|
+
.then(function (response) {
|
|
293
|
+
t.truthy(response);
|
|
294
|
+
t.is(response.responseCode, "00");
|
|
295
|
+
});
|
|
296
|
+
});
|
|
297
|
+
test("013 - charge amex swipe", function (t) {
|
|
298
|
+
t.plan(2);
|
|
299
|
+
var card = Data_1.TestCards.amexSwipe();
|
|
300
|
+
return card
|
|
301
|
+
.charge(15.02)
|
|
302
|
+
.withCurrency("USD")
|
|
303
|
+
.withAllowDuplicates(true)
|
|
304
|
+
.execute()
|
|
305
|
+
.then(function (response) {
|
|
306
|
+
t.truthy(response);
|
|
307
|
+
t.is(response.responseCode, "00");
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
test("014 - charge jcb swipe", function (t) {
|
|
311
|
+
t.plan(4);
|
|
312
|
+
var card = Data_1.TestCards.visaSwipe();
|
|
313
|
+
return card
|
|
314
|
+
.charge(15.05)
|
|
315
|
+
.withCurrency("USD")
|
|
316
|
+
.withAllowDuplicates(true)
|
|
317
|
+
.execute()
|
|
318
|
+
.then(function (response) {
|
|
319
|
+
t.truthy(response);
|
|
320
|
+
t.is(response.responseCode, "00");
|
|
321
|
+
return response;
|
|
322
|
+
})
|
|
323
|
+
.then(function (response) {
|
|
324
|
+
// test 058
|
|
325
|
+
return (response
|
|
326
|
+
.refund(15.05)
|
|
327
|
+
// .withAllowDuplicates(true)
|
|
328
|
+
.withCurrency("USD")
|
|
329
|
+
.execute()
|
|
330
|
+
.then(function (refundResponse) {
|
|
331
|
+
t.truthy(refundResponse);
|
|
332
|
+
t.is(refundResponse.responseCode, "00");
|
|
333
|
+
}));
|
|
334
|
+
});
|
|
335
|
+
});
|
|
336
|
+
test("014a - charge mastercard 24 swipe", function (t) {
|
|
337
|
+
t.plan(2);
|
|
338
|
+
var card = Data_1.TestCards.masterCard24Swipe();
|
|
339
|
+
return card
|
|
340
|
+
.charge(15.34)
|
|
341
|
+
.withCurrency("USD")
|
|
342
|
+
.withAllowDuplicates(true)
|
|
343
|
+
.execute()
|
|
344
|
+
.then(function (response) {
|
|
345
|
+
t.truthy(response);
|
|
346
|
+
t.is(response.responseCode, "00");
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
test("014b - charge mastercard 25 swipe", function (t) {
|
|
350
|
+
t.plan(2);
|
|
351
|
+
var card = Data_1.TestCards.masterCard25Swipe();
|
|
352
|
+
return card
|
|
353
|
+
.charge(15.34)
|
|
354
|
+
.withCurrency("USD")
|
|
355
|
+
.withAllowDuplicates(true)
|
|
356
|
+
.execute()
|
|
357
|
+
.then(function (response) {
|
|
358
|
+
t.truthy(response);
|
|
359
|
+
t.is(response.responseCode, "00");
|
|
360
|
+
});
|
|
361
|
+
});
|
|
362
|
+
test("015 - charge visa swipe", function (t) {
|
|
363
|
+
t.plan(4);
|
|
364
|
+
var card = Data_1.TestCards.visaSwipe();
|
|
365
|
+
return card
|
|
366
|
+
.charge(15.06)
|
|
367
|
+
.withCurrency("USD")
|
|
368
|
+
.withAllowDuplicates(true)
|
|
369
|
+
.execute()
|
|
370
|
+
.then(function (response) {
|
|
371
|
+
t.truthy(response);
|
|
372
|
+
t.is(response.responseCode, "00");
|
|
373
|
+
return response;
|
|
374
|
+
})
|
|
375
|
+
.then(function (response) {
|
|
376
|
+
// test 063
|
|
377
|
+
return (response
|
|
378
|
+
.reverse(15.06)
|
|
379
|
+
// .withAllowDuplicates(true)
|
|
380
|
+
.withAuthAmount(5.06)
|
|
381
|
+
.execute()
|
|
382
|
+
.then(function (reverseResponse) {
|
|
383
|
+
t.truthy(reverseResponse);
|
|
384
|
+
t.is(reverseResponse.responseCode, "00");
|
|
385
|
+
}));
|
|
386
|
+
});
|
|
387
|
+
});
|
|
388
|
+
/// Manually Entered - Card Present
|
|
389
|
+
test("016 - charge visa manual card present", function (t) {
|
|
390
|
+
t.plan(2);
|
|
391
|
+
var address = new src_1.Address();
|
|
392
|
+
address.postalCode = "750241234";
|
|
393
|
+
address.streetAddress1 = "6860 Dallas Pkwy";
|
|
394
|
+
var card = Data_1.TestCards.visaManual(true, true);
|
|
395
|
+
return card
|
|
396
|
+
.charge(16.01)
|
|
397
|
+
.withAllowDuplicates(true)
|
|
398
|
+
.withCurrency("USD")
|
|
399
|
+
.withAddress(address)
|
|
400
|
+
.execute()
|
|
401
|
+
.then(function (response) {
|
|
402
|
+
t.truthy(response);
|
|
403
|
+
t.is(response.responseCode, "00");
|
|
404
|
+
});
|
|
405
|
+
});
|
|
406
|
+
test("017 - charge mastercard manual card present", function (t) {
|
|
407
|
+
t.plan(4);
|
|
408
|
+
var address = new src_1.Address();
|
|
409
|
+
address.postalCode = "75024";
|
|
410
|
+
address.streetAddress1 = "6860 Dallas Pkwy";
|
|
411
|
+
var card = Data_1.TestCards.masterCardManual(true, true);
|
|
412
|
+
return card
|
|
413
|
+
.charge(16.02)
|
|
414
|
+
.withAllowDuplicates(true)
|
|
415
|
+
.withCurrency("USD")
|
|
416
|
+
.withAddress(address)
|
|
417
|
+
.execute()
|
|
418
|
+
.then(function (response) {
|
|
419
|
+
t.truthy(response);
|
|
420
|
+
t.is(response.responseCode, "00");
|
|
421
|
+
return response;
|
|
422
|
+
})
|
|
423
|
+
.then(function (response) {
|
|
424
|
+
// test case 60
|
|
425
|
+
return (response
|
|
426
|
+
.reverse(16.02)
|
|
427
|
+
// .withAllowDuplicates(true)
|
|
428
|
+
.execute()
|
|
429
|
+
.then(function (reverseResponse) {
|
|
430
|
+
t.truthy(reverseResponse);
|
|
431
|
+
t.is(reverseResponse.responseCode, "00");
|
|
432
|
+
}));
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
test("018 - charge discover manual card present", function (t) {
|
|
436
|
+
t.plan(2);
|
|
437
|
+
var address = new src_1.Address();
|
|
438
|
+
address.postalCode = "750241234";
|
|
439
|
+
var card = Data_1.TestCards.discoverManual(true, true);
|
|
440
|
+
return card
|
|
441
|
+
.charge(16.03)
|
|
442
|
+
.withAllowDuplicates(true)
|
|
443
|
+
.withCurrency("USD")
|
|
444
|
+
.withAddress(address)
|
|
445
|
+
.execute()
|
|
446
|
+
.then(function (response) {
|
|
447
|
+
t.truthy(response);
|
|
448
|
+
t.is(response.responseCode, "00");
|
|
449
|
+
});
|
|
450
|
+
});
|
|
451
|
+
test("019 - charge amex manual card present", function (t) {
|
|
452
|
+
t.plan(2);
|
|
453
|
+
var address = new src_1.Address();
|
|
454
|
+
address.postalCode = "75024";
|
|
455
|
+
address.streetAddress1 = "6860";
|
|
456
|
+
var card = Data_1.TestCards.amexManual(true, true);
|
|
457
|
+
return card
|
|
458
|
+
.charge(16.04)
|
|
459
|
+
.withAllowDuplicates(true)
|
|
460
|
+
.withCurrency("USD")
|
|
461
|
+
.withAddress(address)
|
|
462
|
+
.execute()
|
|
463
|
+
.then(function (response) {
|
|
464
|
+
t.truthy(response);
|
|
465
|
+
t.is(response.responseCode, "00");
|
|
466
|
+
});
|
|
467
|
+
});
|
|
468
|
+
test("020 - charge jcb manual card present", function (t) {
|
|
469
|
+
t.plan(2);
|
|
470
|
+
var address = new src_1.Address();
|
|
471
|
+
address.postalCode = "75024";
|
|
472
|
+
var card = Data_1.TestCards.jcbManual(true, true);
|
|
473
|
+
return card
|
|
474
|
+
.charge(16.05)
|
|
475
|
+
.withAllowDuplicates(true)
|
|
476
|
+
.withCurrency("USD")
|
|
477
|
+
.withAddress(address)
|
|
478
|
+
.execute()
|
|
479
|
+
.then(function (response) {
|
|
480
|
+
t.truthy(response);
|
|
481
|
+
t.is(response.responseCode, "00");
|
|
482
|
+
});
|
|
483
|
+
});
|
|
484
|
+
test("021 - charge discover manual card present", function (t) {
|
|
485
|
+
t.plan(4);
|
|
486
|
+
var address = new src_1.Address();
|
|
487
|
+
address.postalCode = "750241234";
|
|
488
|
+
address.streetAddress1 = "6860 Dallas Pkwy";
|
|
489
|
+
var card = Data_1.TestCards.discoverManual(true, true);
|
|
490
|
+
return card
|
|
491
|
+
.charge(16.07)
|
|
492
|
+
.withAllowDuplicates(true)
|
|
493
|
+
.withCurrency("USD")
|
|
494
|
+
.withAddress(address)
|
|
495
|
+
.execute()
|
|
496
|
+
.then(function (response) {
|
|
497
|
+
t.truthy(response);
|
|
498
|
+
t.is(response.responseCode, "00");
|
|
499
|
+
return response;
|
|
500
|
+
})
|
|
501
|
+
.then(function (response) {
|
|
502
|
+
// test case 64
|
|
503
|
+
return (response
|
|
504
|
+
.reverse(16.07)
|
|
505
|
+
// .withAllowDuplicates(true)
|
|
506
|
+
.withAuthAmount(6.07)
|
|
507
|
+
.execute()
|
|
508
|
+
.then(function (reverseResponse) {
|
|
509
|
+
t.truthy(reverseResponse);
|
|
510
|
+
t.is(reverseResponse.responseCode, "00");
|
|
511
|
+
}));
|
|
512
|
+
});
|
|
513
|
+
});
|
|
514
|
+
/// Manually Entered - Card Not Present
|
|
515
|
+
test("022 - charge visa manual card not present", function (t) {
|
|
516
|
+
t.plan(2);
|
|
517
|
+
var address = new src_1.Address();
|
|
518
|
+
address.postalCode = "750241234";
|
|
519
|
+
address.streetAddress1 = "6860 Dallas Pkwy";
|
|
520
|
+
var card;
|
|
521
|
+
if (useTokens) {
|
|
522
|
+
card = new src_1.CreditCardData();
|
|
523
|
+
card.token = visaToken;
|
|
524
|
+
}
|
|
525
|
+
else {
|
|
526
|
+
card = Data_1.TestCards.visaManual(false, true);
|
|
527
|
+
}
|
|
528
|
+
return card
|
|
529
|
+
.charge(17.01)
|
|
530
|
+
.withAllowDuplicates(true)
|
|
531
|
+
.withCurrency("USD")
|
|
532
|
+
.withAddress(address)
|
|
533
|
+
.execute()
|
|
534
|
+
.then(function (response) {
|
|
535
|
+
t.truthy(response);
|
|
536
|
+
t.is(response.responseCode, "00");
|
|
537
|
+
});
|
|
538
|
+
});
|
|
539
|
+
test("023 - charge mastercard manual card not present", function (t) {
|
|
540
|
+
t.plan(4);
|
|
541
|
+
var address = new src_1.Address();
|
|
542
|
+
address.postalCode = "75024";
|
|
543
|
+
address.streetAddress1 = "6860 Dallas Pkwy";
|
|
544
|
+
var card;
|
|
545
|
+
if (useTokens) {
|
|
546
|
+
card = new src_1.CreditCardData();
|
|
547
|
+
card.token = masterCardToken;
|
|
548
|
+
}
|
|
549
|
+
else {
|
|
550
|
+
card = Data_1.TestCards.masterCardManual(false, true);
|
|
551
|
+
}
|
|
552
|
+
return card
|
|
553
|
+
.charge(17.02)
|
|
554
|
+
.withAllowDuplicates(true)
|
|
555
|
+
.withCurrency("USD")
|
|
556
|
+
.withAddress(address)
|
|
557
|
+
.execute()
|
|
558
|
+
.then(function (response) {
|
|
559
|
+
t.truthy(response);
|
|
560
|
+
t.is(response.responseCode, "00");
|
|
561
|
+
return response;
|
|
562
|
+
})
|
|
563
|
+
.then(function (response) {
|
|
564
|
+
// test case 61
|
|
565
|
+
return (response
|
|
566
|
+
.reverse(17.02)
|
|
567
|
+
// .withAllowDuplicates(true)
|
|
568
|
+
.execute()
|
|
569
|
+
.then(function (reverseResponse) {
|
|
570
|
+
t.truthy(reverseResponse);
|
|
571
|
+
t.is(reverseResponse.responseCode, "00");
|
|
572
|
+
}));
|
|
573
|
+
});
|
|
574
|
+
});
|
|
575
|
+
test("024 - charge discover manual card not present", function (t) {
|
|
576
|
+
t.plan(2);
|
|
577
|
+
var address = new src_1.Address();
|
|
578
|
+
address.postalCode = "750241234";
|
|
579
|
+
var card;
|
|
580
|
+
if (useTokens) {
|
|
581
|
+
card = new src_1.CreditCardData();
|
|
582
|
+
card.token = discoverToken;
|
|
583
|
+
}
|
|
584
|
+
else {
|
|
585
|
+
card = Data_1.TestCards.discoverManual(false, true);
|
|
586
|
+
}
|
|
587
|
+
return card
|
|
588
|
+
.charge(17.03)
|
|
589
|
+
.withAllowDuplicates(true)
|
|
590
|
+
.withCurrency("USD")
|
|
591
|
+
.withAddress(address)
|
|
592
|
+
.execute()
|
|
593
|
+
.then(function (response) {
|
|
594
|
+
t.truthy(response);
|
|
595
|
+
t.is(response.responseCode, "00");
|
|
596
|
+
});
|
|
597
|
+
});
|
|
598
|
+
test("025 - charge amex manual card not present", function (t) {
|
|
599
|
+
t.plan(2);
|
|
600
|
+
var address = new src_1.Address();
|
|
601
|
+
address.postalCode = "75024";
|
|
602
|
+
address.streetAddress1 = "6860";
|
|
603
|
+
var card;
|
|
604
|
+
if (useTokens) {
|
|
605
|
+
card = new src_1.CreditCardData();
|
|
606
|
+
card.token = amexToken;
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
card = Data_1.TestCards.amexManual(false, true);
|
|
610
|
+
}
|
|
611
|
+
return card
|
|
612
|
+
.charge(17.04)
|
|
613
|
+
.withAllowDuplicates(true)
|
|
614
|
+
.withCurrency("USD")
|
|
615
|
+
.withAddress(address)
|
|
616
|
+
.execute()
|
|
617
|
+
.then(function (response) {
|
|
618
|
+
t.truthy(response);
|
|
619
|
+
t.is(response.responseCode, "00");
|
|
620
|
+
});
|
|
621
|
+
});
|
|
622
|
+
test("026 - charge jcb manual card not present", function (t) {
|
|
623
|
+
t.plan(2);
|
|
624
|
+
var address = new src_1.Address();
|
|
625
|
+
address.postalCode = "75024";
|
|
626
|
+
var card = Data_1.TestCards.jcbManual(false, true);
|
|
627
|
+
return card
|
|
628
|
+
.charge(17.05)
|
|
629
|
+
.withAllowDuplicates(true)
|
|
630
|
+
.withCurrency("USD")
|
|
631
|
+
.withAddress(address)
|
|
632
|
+
.execute()
|
|
633
|
+
.then(function (response) {
|
|
634
|
+
t.truthy(response);
|
|
635
|
+
t.is(response.responseCode, "00");
|
|
636
|
+
});
|
|
637
|
+
});
|
|
638
|
+
/// Contactless
|
|
639
|
+
test("027 - charge visa contactless", function (t) {
|
|
640
|
+
t.plan(2);
|
|
641
|
+
var card = Data_1.TestCards.visaSwipe(src_1.EntryMethod.Proximity);
|
|
642
|
+
return card
|
|
643
|
+
.charge(18.01)
|
|
644
|
+
.withAllowDuplicates(true)
|
|
645
|
+
.withCurrency("USD")
|
|
646
|
+
.execute()
|
|
647
|
+
.then(function (response) {
|
|
648
|
+
t.truthy(response);
|
|
649
|
+
t.is(response.responseCode, "00");
|
|
650
|
+
});
|
|
651
|
+
});
|
|
652
|
+
test("028 - charge mastercard contactless", function (t) {
|
|
653
|
+
t.plan(2);
|
|
654
|
+
var card = Data_1.TestCards.masterCardSwipe(src_1.EntryMethod.Proximity);
|
|
655
|
+
return card
|
|
656
|
+
.charge(18.02)
|
|
657
|
+
.withAllowDuplicates(true)
|
|
658
|
+
.withCurrency("USD")
|
|
659
|
+
.execute()
|
|
660
|
+
.then(function (response) {
|
|
661
|
+
t.truthy(response);
|
|
662
|
+
t.is(response.responseCode, "00");
|
|
663
|
+
});
|
|
664
|
+
});
|
|
665
|
+
test("029 - charge discover contactless", function (t) {
|
|
666
|
+
t.plan(2);
|
|
667
|
+
var card = Data_1.TestCards.discoverSwipe(src_1.EntryMethod.Proximity);
|
|
668
|
+
return card
|
|
669
|
+
.charge(18.03)
|
|
670
|
+
.withAllowDuplicates(true)
|
|
671
|
+
.withCurrency("USD")
|
|
672
|
+
.execute()
|
|
673
|
+
.then(function (response) {
|
|
674
|
+
t.truthy(response);
|
|
675
|
+
t.is(response.responseCode, "00");
|
|
676
|
+
});
|
|
677
|
+
});
|
|
678
|
+
test("030 - charge amex contactless", function (t) {
|
|
679
|
+
t.plan(2);
|
|
680
|
+
var card = Data_1.TestCards.amexSwipe(src_1.EntryMethod.Proximity);
|
|
681
|
+
return card
|
|
682
|
+
.charge(18.04)
|
|
683
|
+
.withAllowDuplicates(true)
|
|
684
|
+
.withCurrency("USD")
|
|
685
|
+
.execute()
|
|
686
|
+
.then(function (response) {
|
|
687
|
+
t.truthy(response);
|
|
688
|
+
t.is(response.responseCode, "00");
|
|
689
|
+
});
|
|
690
|
+
});
|
|
691
|
+
/// AUTHORIZATION
|
|
692
|
+
test("031 - authorize visa swipe", function (t) {
|
|
693
|
+
t.plan(4);
|
|
694
|
+
var card = Data_1.TestCards.visaSwipe();
|
|
695
|
+
// 031a authorize
|
|
696
|
+
return (card
|
|
697
|
+
.authorize(15.08)
|
|
698
|
+
.withAllowDuplicates(true)
|
|
699
|
+
.withCurrency("USD")
|
|
700
|
+
.execute()
|
|
701
|
+
.then(function (response) {
|
|
702
|
+
t.truthy(response);
|
|
703
|
+
t.is(response.responseCode, "00");
|
|
704
|
+
return response;
|
|
705
|
+
})
|
|
706
|
+
// 031b capture
|
|
707
|
+
.then(function (response) {
|
|
708
|
+
return response
|
|
709
|
+
.capture()
|
|
710
|
+
.execute()
|
|
711
|
+
.then(function (captureResponse) {
|
|
712
|
+
t.truthy(captureResponse);
|
|
713
|
+
t.is(captureResponse.responseCode, "00");
|
|
714
|
+
});
|
|
715
|
+
}));
|
|
716
|
+
});
|
|
717
|
+
test("032 - authorize visa swipe additional auth", function (t) {
|
|
718
|
+
t.plan(4);
|
|
719
|
+
var card = Data_1.TestCards.visaSwipe();
|
|
720
|
+
// 032a authorize
|
|
721
|
+
return (card
|
|
722
|
+
.authorize(15.09)
|
|
723
|
+
.withAllowDuplicates(true)
|
|
724
|
+
.withCurrency("USD")
|
|
725
|
+
.execute()
|
|
726
|
+
.then(function (response) {
|
|
727
|
+
t.truthy(response);
|
|
728
|
+
t.is(response.responseCode, "00");
|
|
729
|
+
return response;
|
|
730
|
+
})
|
|
731
|
+
// 032b Additional Auth (restaurant only)
|
|
732
|
+
// 032c Add to batch
|
|
733
|
+
.then(function (response) {
|
|
734
|
+
return response
|
|
735
|
+
.capture()
|
|
736
|
+
.execute()
|
|
737
|
+
.then(function (captureResponse) {
|
|
738
|
+
t.truthy(captureResponse);
|
|
739
|
+
t.is(captureResponse.responseCode, "00");
|
|
740
|
+
});
|
|
741
|
+
}));
|
|
742
|
+
});
|
|
743
|
+
test("033 - authorize mastercard swipe", function (t) {
|
|
744
|
+
t.plan(4);
|
|
745
|
+
var card = Data_1.TestCards.masterCardSwipe();
|
|
746
|
+
// 033a authorize
|
|
747
|
+
return (card
|
|
748
|
+
.authorize(15.1)
|
|
749
|
+
.withAllowDuplicates(true)
|
|
750
|
+
.withCurrency("USD")
|
|
751
|
+
.execute()
|
|
752
|
+
.then(function (response) {
|
|
753
|
+
t.truthy(response);
|
|
754
|
+
t.is(response.responseCode, "00");
|
|
755
|
+
return response;
|
|
756
|
+
})
|
|
757
|
+
// 033b capture
|
|
758
|
+
.then(function (response) {
|
|
759
|
+
return response
|
|
760
|
+
.capture()
|
|
761
|
+
.execute()
|
|
762
|
+
.then(function (captureResponse) {
|
|
763
|
+
t.truthy(captureResponse);
|
|
764
|
+
t.is(captureResponse.responseCode, "00");
|
|
765
|
+
});
|
|
766
|
+
}));
|
|
767
|
+
});
|
|
768
|
+
test("033a - authorize discover swipe", function (t) {
|
|
769
|
+
t.plan(2);
|
|
770
|
+
var card = Data_1.TestCards.discoverSwipe();
|
|
771
|
+
return card
|
|
772
|
+
.authorize(15.1)
|
|
773
|
+
.withCurrency("USD")
|
|
774
|
+
.withAllowDuplicates(true)
|
|
775
|
+
.execute()
|
|
776
|
+
.then(function (response) {
|
|
777
|
+
t.truthy(response);
|
|
778
|
+
t.is(response.responseCode, "00");
|
|
779
|
+
});
|
|
780
|
+
});
|
|
781
|
+
/// AUTHORIZATION - Manually Entered, Card Present
|
|
782
|
+
test("034 - authorize visa manual card present", function (t) {
|
|
783
|
+
t.plan(4);
|
|
784
|
+
var address = new src_1.Address();
|
|
785
|
+
address.postalCode = "75024";
|
|
786
|
+
address.streetAddress1 = "6860 Dallas Pkwy";
|
|
787
|
+
var card = Data_1.TestCards.visaManual(true, true);
|
|
788
|
+
// 034a authorize
|
|
789
|
+
return (card
|
|
790
|
+
.authorize(16.08)
|
|
791
|
+
.withAllowDuplicates(true)
|
|
792
|
+
.withCurrency("USD")
|
|
793
|
+
.withAddress(address)
|
|
794
|
+
.execute()
|
|
795
|
+
.then(function (response) {
|
|
796
|
+
t.truthy(response);
|
|
797
|
+
t.is(response.responseCode, "00");
|
|
798
|
+
return response;
|
|
799
|
+
})
|
|
800
|
+
// 034b capture
|
|
801
|
+
.then(function (response) {
|
|
802
|
+
return response
|
|
803
|
+
.capture()
|
|
804
|
+
.execute()
|
|
805
|
+
.then(function (captureResponse) {
|
|
806
|
+
t.truthy(captureResponse);
|
|
807
|
+
t.is(captureResponse.responseCode, "00");
|
|
808
|
+
});
|
|
809
|
+
}));
|
|
810
|
+
});
|
|
811
|
+
test("035 - authorize visa manual card present additional auth", function (t) {
|
|
812
|
+
t.plan(4);
|
|
813
|
+
var address = new src_1.Address();
|
|
814
|
+
address.postalCode = "75024";
|
|
815
|
+
address.streetAddress1 = "6860 Dallas Pkwy";
|
|
816
|
+
var card = Data_1.TestCards.visaManual(true, true);
|
|
817
|
+
// 035a authorize
|
|
818
|
+
return (card
|
|
819
|
+
.authorize(16.09)
|
|
820
|
+
.withAllowDuplicates(true)
|
|
821
|
+
.withCurrency("USD")
|
|
822
|
+
.withAddress(address)
|
|
823
|
+
.execute()
|
|
824
|
+
.then(function (response) {
|
|
825
|
+
t.truthy(response);
|
|
826
|
+
t.is(response.responseCode, "00");
|
|
827
|
+
return response;
|
|
828
|
+
})
|
|
829
|
+
// 035b Additional Auth (restaurant only)
|
|
830
|
+
// 035c Add to batch
|
|
831
|
+
.then(function (response) {
|
|
832
|
+
return response
|
|
833
|
+
.capture()
|
|
834
|
+
.execute()
|
|
835
|
+
.then(function (captureResponse) {
|
|
836
|
+
t.truthy(captureResponse);
|
|
837
|
+
t.is(captureResponse.responseCode, "00");
|
|
838
|
+
});
|
|
839
|
+
}));
|
|
840
|
+
});
|
|
841
|
+
test("036 - authorize mastercard manual card present", function (t) {
|
|
842
|
+
t.plan(4);
|
|
843
|
+
var address = new src_1.Address();
|
|
844
|
+
address.postalCode = "75024";
|
|
845
|
+
address.streetAddress1 = "6860 Dallas Pkwy";
|
|
846
|
+
var card = Data_1.TestCards.masterCardManual(true, true);
|
|
847
|
+
// 036a authorize
|
|
848
|
+
return (card
|
|
849
|
+
.authorize(16.1)
|
|
850
|
+
.withAllowDuplicates(true)
|
|
851
|
+
.withCurrency("USD")
|
|
852
|
+
.withAddress(address)
|
|
853
|
+
.execute()
|
|
854
|
+
.then(function (response) {
|
|
855
|
+
t.truthy(response);
|
|
856
|
+
t.is(response.responseCode, "00");
|
|
857
|
+
return response;
|
|
858
|
+
})
|
|
859
|
+
// 036b capture
|
|
860
|
+
.then(function (response) {
|
|
861
|
+
return response
|
|
862
|
+
.capture()
|
|
863
|
+
.execute()
|
|
864
|
+
.then(function (captureResponse) {
|
|
865
|
+
t.truthy(captureResponse);
|
|
866
|
+
t.is(captureResponse.responseCode, "00");
|
|
867
|
+
});
|
|
868
|
+
}));
|
|
869
|
+
});
|
|
870
|
+
test("036a - authorize discover manual card present", function (t) {
|
|
871
|
+
t.plan(2);
|
|
872
|
+
var address = new src_1.Address();
|
|
873
|
+
address.postalCode = "750241234";
|
|
874
|
+
var card = Data_1.TestCards.discoverManual(true, true);
|
|
875
|
+
return card
|
|
876
|
+
.authorize(16.1)
|
|
877
|
+
.withAllowDuplicates(true)
|
|
878
|
+
.withCurrency("USD")
|
|
879
|
+
.withAddress(address)
|
|
880
|
+
.execute()
|
|
881
|
+
.then(function (response) {
|
|
882
|
+
t.truthy(response);
|
|
883
|
+
t.is(response.responseCode, "00");
|
|
884
|
+
});
|
|
885
|
+
});
|
|
886
|
+
/// AUTHORIZATION - Manually Entered, Card Not Present
|
|
887
|
+
test("037 - authorize visa manual", function (t) {
|
|
888
|
+
t.plan(4);
|
|
889
|
+
var address = new src_1.Address();
|
|
890
|
+
address.postalCode = "750241234";
|
|
891
|
+
address.streetAddress1 = "6860 Dallas Pkwy";
|
|
892
|
+
var card = Data_1.TestCards.visaManual(false, true);
|
|
893
|
+
// 034a authorize
|
|
894
|
+
return (card
|
|
895
|
+
.authorize(17.08)
|
|
896
|
+
.withAllowDuplicates(true)
|
|
897
|
+
.withCurrency("USD")
|
|
898
|
+
.withAddress(address)
|
|
899
|
+
.execute()
|
|
900
|
+
.then(function (response) {
|
|
901
|
+
t.truthy(response);
|
|
902
|
+
t.is(response.responseCode, "00");
|
|
903
|
+
return response;
|
|
904
|
+
})
|
|
905
|
+
// 034b capture
|
|
906
|
+
.then(function (response) {
|
|
907
|
+
return response
|
|
908
|
+
.capture()
|
|
909
|
+
.execute()
|
|
910
|
+
.then(function (captureResponse) {
|
|
911
|
+
t.truthy(captureResponse);
|
|
912
|
+
t.is(captureResponse.responseCode, "00");
|
|
913
|
+
});
|
|
914
|
+
}));
|
|
915
|
+
});
|
|
916
|
+
test("038 - authorize mastercard manual", function (t) {
|
|
917
|
+
t.plan(4);
|
|
918
|
+
var address = new src_1.Address();
|
|
919
|
+
address.postalCode = "750241234";
|
|
920
|
+
address.streetAddress1 = "6860";
|
|
921
|
+
var card = Data_1.TestCards.masterCardManual(false, true);
|
|
922
|
+
// 036a authorize
|
|
923
|
+
return (card
|
|
924
|
+
.authorize(17.09)
|
|
925
|
+
.withAllowDuplicates(true)
|
|
926
|
+
.withCurrency("USD")
|
|
927
|
+
.withAddress(address)
|
|
928
|
+
.execute()
|
|
929
|
+
.then(function (response) {
|
|
930
|
+
t.truthy(response);
|
|
931
|
+
t.is(response.responseCode, "00");
|
|
932
|
+
return response;
|
|
933
|
+
})
|
|
934
|
+
// 036b capture
|
|
935
|
+
.then(function (response) {
|
|
936
|
+
return response
|
|
937
|
+
.capture()
|
|
938
|
+
.execute()
|
|
939
|
+
.then(function (captureResponse) {
|
|
940
|
+
t.truthy(captureResponse);
|
|
941
|
+
t.is(captureResponse.responseCode, "00");
|
|
942
|
+
});
|
|
943
|
+
}));
|
|
944
|
+
});
|
|
945
|
+
test("038a - authorize discover manual", function (t) {
|
|
946
|
+
t.plan(2);
|
|
947
|
+
var address = new src_1.Address();
|
|
948
|
+
address.postalCode = "750241234";
|
|
949
|
+
var card = Data_1.TestCards.discoverManual(false, true);
|
|
950
|
+
return card
|
|
951
|
+
.authorize(17.1)
|
|
952
|
+
.withAllowDuplicates(true)
|
|
953
|
+
.withCurrency("USD")
|
|
954
|
+
.withAddress(address)
|
|
955
|
+
.execute()
|
|
956
|
+
.then(function (response) {
|
|
957
|
+
t.truthy(response);
|
|
958
|
+
t.is(response.responseCode, "00");
|
|
959
|
+
});
|
|
960
|
+
});
|
|
961
|
+
/// PARTIALLY APPROVED SALE (Required)
|
|
962
|
+
test("039 - charge discover swipe partial approval", function (t) {
|
|
963
|
+
t.plan(3);
|
|
964
|
+
var card = Data_1.TestCards.discoverSwipe();
|
|
965
|
+
return card
|
|
966
|
+
.charge(40.0)
|
|
967
|
+
.withAllowDuplicates(true)
|
|
968
|
+
.withCurrency("USD")
|
|
969
|
+
.withAllowPartialAuth(true)
|
|
970
|
+
.execute()
|
|
971
|
+
.then(function (response) {
|
|
972
|
+
t.truthy(response);
|
|
973
|
+
t.is(response.responseCode, "10");
|
|
974
|
+
t.is(response.authorizedAmount, "40.00");
|
|
975
|
+
});
|
|
976
|
+
});
|
|
977
|
+
test("040 - charge visa swipe partial approval", function (t) {
|
|
978
|
+
t.plan(3);
|
|
979
|
+
var card = Data_1.TestCards.visaSwipe();
|
|
980
|
+
return card
|
|
981
|
+
.charge(130.0)
|
|
982
|
+
.withAllowDuplicates(true)
|
|
983
|
+
.withCurrency("USD")
|
|
984
|
+
.withAllowPartialAuth(true)
|
|
985
|
+
.execute()
|
|
986
|
+
.then(function (response) {
|
|
987
|
+
t.truthy(response);
|
|
988
|
+
t.is(response.responseCode, "10");
|
|
989
|
+
t.is(response.authorizedAmount, "110.00");
|
|
990
|
+
});
|
|
991
|
+
});
|
|
992
|
+
test("041 - charge discover manual partial approval", function (t) {
|
|
993
|
+
t.plan(3);
|
|
994
|
+
var address = new src_1.Address();
|
|
995
|
+
address.postalCode = "75024";
|
|
996
|
+
var card = Data_1.TestCards.discoverManual(true, true);
|
|
997
|
+
return card
|
|
998
|
+
.charge(145.0)
|
|
999
|
+
.withAllowDuplicates(true)
|
|
1000
|
+
.withCurrency("USD")
|
|
1001
|
+
.withAllowPartialAuth(true)
|
|
1002
|
+
.withAddress(address)
|
|
1003
|
+
.execute()
|
|
1004
|
+
.then(function (response) {
|
|
1005
|
+
t.truthy(response);
|
|
1006
|
+
t.is(response.responseCode, "10");
|
|
1007
|
+
t.is(response.authorizedAmount, "65.00");
|
|
1008
|
+
});
|
|
1009
|
+
});
|
|
1010
|
+
test("042 - charge mastercard swipe partial approval", function (t) {
|
|
1011
|
+
t.plan(5);
|
|
1012
|
+
var card = Data_1.TestCards.masterCardSwipe();
|
|
1013
|
+
return (card
|
|
1014
|
+
.charge(155.0)
|
|
1015
|
+
.withAllowDuplicates(true)
|
|
1016
|
+
.withCurrency("USD")
|
|
1017
|
+
.withAllowPartialAuth(true)
|
|
1018
|
+
.execute()
|
|
1019
|
+
.then(function (response) {
|
|
1020
|
+
t.truthy(response);
|
|
1021
|
+
t.is(response.responseCode, "10");
|
|
1022
|
+
t.is(response.authorizedAmount, "100.00");
|
|
1023
|
+
return response;
|
|
1024
|
+
})
|
|
1025
|
+
// test case 62
|
|
1026
|
+
.then(function (response) {
|
|
1027
|
+
return (response
|
|
1028
|
+
.reverse(100.0)
|
|
1029
|
+
// .withAllowDuplicates(true)
|
|
1030
|
+
.execute()
|
|
1031
|
+
.then(function (reverseResponse) {
|
|
1032
|
+
t.truthy(reverseResponse);
|
|
1033
|
+
t.is(reverseResponse.responseCode, "00");
|
|
1034
|
+
}));
|
|
1035
|
+
}));
|
|
1036
|
+
});
|
|
1037
|
+
/// SALE WITH GRATUITY
|
|
1038
|
+
/// Tip Edit (Tip at Settlement)
|
|
1039
|
+
test("043 - charge visa swipe edit gratuity", function (t) {
|
|
1040
|
+
var card = Data_1.TestCards.visaSwipe();
|
|
1041
|
+
return card
|
|
1042
|
+
.charge(15.12)
|
|
1043
|
+
.withAllowDuplicates(true)
|
|
1044
|
+
.withCurrency("USD")
|
|
1045
|
+
.execute()
|
|
1046
|
+
.then(function (response) {
|
|
1047
|
+
t.truthy(response);
|
|
1048
|
+
t.is(response.responseCode, "00");
|
|
1049
|
+
return response;
|
|
1050
|
+
})
|
|
1051
|
+
.then(function (response) {
|
|
1052
|
+
return (response
|
|
1053
|
+
.edit()
|
|
1054
|
+
// .withAllowDuplicates(true)
|
|
1055
|
+
.withAmount(18.12)
|
|
1056
|
+
.withGratuity(3.0)
|
|
1057
|
+
.execute()
|
|
1058
|
+
.then(function (editResponse) {
|
|
1059
|
+
t.truthy(editResponse);
|
|
1060
|
+
t.is(editResponse.responseCode, "00");
|
|
1061
|
+
}));
|
|
1062
|
+
});
|
|
1063
|
+
});
|
|
1064
|
+
test("044 - charge mastercard manual edit gratuity", function (t) {
|
|
1065
|
+
t.plan(4);
|
|
1066
|
+
var address = new src_1.Address();
|
|
1067
|
+
address.postalCode = "75024";
|
|
1068
|
+
var card = Data_1.TestCards.masterCardManual(true, true);
|
|
1069
|
+
return card
|
|
1070
|
+
.charge(15.13)
|
|
1071
|
+
.withAllowDuplicates(true)
|
|
1072
|
+
.withCurrency("USD")
|
|
1073
|
+
.withAddress(address)
|
|
1074
|
+
.execute()
|
|
1075
|
+
.then(function (response) {
|
|
1076
|
+
t.truthy(response);
|
|
1077
|
+
t.is(response.responseCode, "00");
|
|
1078
|
+
return response;
|
|
1079
|
+
})
|
|
1080
|
+
.then(function (response) {
|
|
1081
|
+
return (response
|
|
1082
|
+
.edit()
|
|
1083
|
+
// .withAllowDuplicates(true)
|
|
1084
|
+
.withAmount(18.13)
|
|
1085
|
+
.withGratuity(3.0)
|
|
1086
|
+
.execute()
|
|
1087
|
+
.then(function (editResponse) {
|
|
1088
|
+
t.truthy(editResponse);
|
|
1089
|
+
t.is(editResponse.responseCode, "00");
|
|
1090
|
+
}));
|
|
1091
|
+
});
|
|
1092
|
+
});
|
|
1093
|
+
/// Tip on Purchase
|
|
1094
|
+
test("045 - charge visa manual gratuity", function (t) {
|
|
1095
|
+
t.plan(2);
|
|
1096
|
+
var address = new src_1.Address();
|
|
1097
|
+
address.postalCode = "75024";
|
|
1098
|
+
var card = Data_1.TestCards.visaManual(true, true);
|
|
1099
|
+
return card
|
|
1100
|
+
.charge(18.61)
|
|
1101
|
+
.withAllowDuplicates(true)
|
|
1102
|
+
.withCurrency("USD")
|
|
1103
|
+
.withAddress(address)
|
|
1104
|
+
.withGratuity(3.5)
|
|
1105
|
+
.execute()
|
|
1106
|
+
.then(function (response) {
|
|
1107
|
+
t.truthy(response);
|
|
1108
|
+
t.is(response.responseCode, "00");
|
|
1109
|
+
});
|
|
1110
|
+
});
|
|
1111
|
+
test("046 - charge mastercard swipe gratuity", function (t) {
|
|
1112
|
+
t.plan(4);
|
|
1113
|
+
var card = Data_1.TestCards.masterCardSwipe();
|
|
1114
|
+
return card
|
|
1115
|
+
.charge(18.62)
|
|
1116
|
+
.withAllowDuplicates(true)
|
|
1117
|
+
.withCurrency("USD")
|
|
1118
|
+
.withGratuity(3.5)
|
|
1119
|
+
.execute()
|
|
1120
|
+
.then(function (response) {
|
|
1121
|
+
t.truthy(response);
|
|
1122
|
+
t.is(response.responseCode, "00");
|
|
1123
|
+
return response;
|
|
1124
|
+
})
|
|
1125
|
+
.then(function (response) {
|
|
1126
|
+
return (response
|
|
1127
|
+
.edit()
|
|
1128
|
+
// .withAllowDuplicates(true)
|
|
1129
|
+
.withAmount(18.12)
|
|
1130
|
+
.withGratuity(3.0)
|
|
1131
|
+
.execute()
|
|
1132
|
+
.then(function (editResponse) {
|
|
1133
|
+
t.truthy(editResponse);
|
|
1134
|
+
t.is(editResponse.responseCode, "00");
|
|
1135
|
+
}));
|
|
1136
|
+
});
|
|
1137
|
+
});
|
|
1138
|
+
/// LEVEL II CORPORATE PURCHASE CARD
|
|
1139
|
+
test("047 - level ii visa swipe response b", function (t) {
|
|
1140
|
+
t.plan(5);
|
|
1141
|
+
var card = Data_1.TestCards.visaSwipe();
|
|
1142
|
+
return card
|
|
1143
|
+
.charge(112.34)
|
|
1144
|
+
.withAllowDuplicates(true)
|
|
1145
|
+
.withCurrency("USD")
|
|
1146
|
+
.withCommercialRequest(true)
|
|
1147
|
+
.execute()
|
|
1148
|
+
.then(function (response) {
|
|
1149
|
+
t.truthy(response);
|
|
1150
|
+
t.is(response.responseCode, "00");
|
|
1151
|
+
t.is(response.commercialIndicator, "B");
|
|
1152
|
+
return response;
|
|
1153
|
+
})
|
|
1154
|
+
.then(function (response) {
|
|
1155
|
+
return (response
|
|
1156
|
+
.edit()
|
|
1157
|
+
// .withAllowDuplicates(true)
|
|
1158
|
+
.withTaxType(src_1.TaxType.SalesTax)
|
|
1159
|
+
.withTaxAmount(1)
|
|
1160
|
+
.execute()
|
|
1161
|
+
.then(function (cpcResponse) {
|
|
1162
|
+
t.truthy(cpcResponse);
|
|
1163
|
+
t.is(cpcResponse.responseCode, "00");
|
|
1164
|
+
}));
|
|
1165
|
+
});
|
|
1166
|
+
});
|
|
1167
|
+
test("047a - level ii visa swipe response b", function (t) {
|
|
1168
|
+
t.plan(5);
|
|
1169
|
+
var card = Data_1.TestCards.visaSwipe();
|
|
1170
|
+
return card
|
|
1171
|
+
.charge(112.34)
|
|
1172
|
+
.withAllowDuplicates(true)
|
|
1173
|
+
.withCurrency("USD")
|
|
1174
|
+
.withCommercialRequest(true)
|
|
1175
|
+
.execute()
|
|
1176
|
+
.then(function (response) {
|
|
1177
|
+
t.truthy(response);
|
|
1178
|
+
t.is(response.responseCode, "00");
|
|
1179
|
+
t.is(response.commercialIndicator, "B");
|
|
1180
|
+
return response;
|
|
1181
|
+
})
|
|
1182
|
+
.then(function (response) {
|
|
1183
|
+
return (response
|
|
1184
|
+
.edit()
|
|
1185
|
+
// .withAllowDuplicates(true)
|
|
1186
|
+
.withTaxType(src_1.TaxType.NotUsed)
|
|
1187
|
+
.execute()
|
|
1188
|
+
.then(function (cpcResponse) {
|
|
1189
|
+
t.truthy(cpcResponse);
|
|
1190
|
+
t.is(cpcResponse.responseCode, "00");
|
|
1191
|
+
}));
|
|
1192
|
+
});
|
|
1193
|
+
});
|
|
1194
|
+
test("048 - level ii visa swipe response r", function (t) {
|
|
1195
|
+
t.plan(5);
|
|
1196
|
+
var card = Data_1.TestCards.visaSwipe();
|
|
1197
|
+
return card
|
|
1198
|
+
.charge(123.45)
|
|
1199
|
+
.withAllowDuplicates(true)
|
|
1200
|
+
.withCurrency("USD")
|
|
1201
|
+
.withCommercialRequest(true)
|
|
1202
|
+
.execute()
|
|
1203
|
+
.then(function (response) {
|
|
1204
|
+
t.truthy(response);
|
|
1205
|
+
t.is(response.responseCode, "00");
|
|
1206
|
+
t.is(response.commercialIndicator, "R");
|
|
1207
|
+
return response;
|
|
1208
|
+
})
|
|
1209
|
+
.then(function (response) {
|
|
1210
|
+
return (response
|
|
1211
|
+
.edit()
|
|
1212
|
+
// .withAllowDuplicates(true)
|
|
1213
|
+
.withTaxType(src_1.TaxType.TaxExempt)
|
|
1214
|
+
.execute()
|
|
1215
|
+
.then(function (cpcResponse) {
|
|
1216
|
+
t.truthy(cpcResponse);
|
|
1217
|
+
t.is(cpcResponse.responseCode, "00");
|
|
1218
|
+
}));
|
|
1219
|
+
});
|
|
1220
|
+
});
|
|
1221
|
+
test("049 - level ii visa manual response s", function (t) {
|
|
1222
|
+
t.plan(5);
|
|
1223
|
+
var address = new src_1.Address();
|
|
1224
|
+
address.postalCode = "75024";
|
|
1225
|
+
var card = Data_1.TestCards.visaManual(true, true);
|
|
1226
|
+
return card
|
|
1227
|
+
.charge(134.56)
|
|
1228
|
+
.withAllowDuplicates(true)
|
|
1229
|
+
.withCurrency("USD")
|
|
1230
|
+
.withAddress(address)
|
|
1231
|
+
.withCommercialRequest(true)
|
|
1232
|
+
.execute()
|
|
1233
|
+
.then(function (response) {
|
|
1234
|
+
t.truthy(response);
|
|
1235
|
+
t.is(response.responseCode, "00");
|
|
1236
|
+
t.is(response.commercialIndicator, "S");
|
|
1237
|
+
return response;
|
|
1238
|
+
})
|
|
1239
|
+
.then(function (response) {
|
|
1240
|
+
return (response
|
|
1241
|
+
.edit()
|
|
1242
|
+
// .withAllowDuplicates(true)
|
|
1243
|
+
.withPoNumber("9876543210")
|
|
1244
|
+
.withTaxType(src_1.TaxType.SalesTax)
|
|
1245
|
+
.withTaxAmount(1)
|
|
1246
|
+
.execute()
|
|
1247
|
+
.then(function (cpcResponse) {
|
|
1248
|
+
t.truthy(cpcResponse);
|
|
1249
|
+
t.is(cpcResponse.responseCode, "00");
|
|
1250
|
+
}));
|
|
1251
|
+
});
|
|
1252
|
+
});
|
|
1253
|
+
test("050 - level ii mastercard swipe response s", function (t) {
|
|
1254
|
+
t.plan(5);
|
|
1255
|
+
var card = Data_1.TestCards.masterCardSwipe();
|
|
1256
|
+
return card
|
|
1257
|
+
.charge(111.06)
|
|
1258
|
+
.withAllowDuplicates(true)
|
|
1259
|
+
.withCurrency("USD")
|
|
1260
|
+
.withCommercialRequest(true)
|
|
1261
|
+
.execute()
|
|
1262
|
+
.then(function (response) {
|
|
1263
|
+
t.truthy(response);
|
|
1264
|
+
t.is(response.responseCode, "00");
|
|
1265
|
+
t.is(response.commercialIndicator, "S");
|
|
1266
|
+
return response;
|
|
1267
|
+
})
|
|
1268
|
+
.then(function (response) {
|
|
1269
|
+
return (response
|
|
1270
|
+
.edit()
|
|
1271
|
+
// .withAllowDuplicates(true)
|
|
1272
|
+
.withPoNumber("9876543210")
|
|
1273
|
+
.withTaxType(src_1.TaxType.NotUsed)
|
|
1274
|
+
.execute()
|
|
1275
|
+
.then(function (cpcResponse) {
|
|
1276
|
+
t.truthy(cpcResponse);
|
|
1277
|
+
t.is(cpcResponse.responseCode, "00");
|
|
1278
|
+
}));
|
|
1279
|
+
});
|
|
1280
|
+
});
|
|
1281
|
+
test("051 - level ii mastercard manual response s", function (t) {
|
|
1282
|
+
t.plan(5);
|
|
1283
|
+
var address = new src_1.Address();
|
|
1284
|
+
address.postalCode = "75024";
|
|
1285
|
+
var card = Data_1.TestCards.masterCardManual(true, true);
|
|
1286
|
+
return card
|
|
1287
|
+
.charge(111.07)
|
|
1288
|
+
.withAllowDuplicates(true)
|
|
1289
|
+
.withCurrency("USD")
|
|
1290
|
+
.withAddress(address)
|
|
1291
|
+
.withCommercialRequest(true)
|
|
1292
|
+
.execute()
|
|
1293
|
+
.then(function (response) {
|
|
1294
|
+
t.truthy(response);
|
|
1295
|
+
t.is(response.responseCode, "00");
|
|
1296
|
+
t.is(response.commercialIndicator, "S");
|
|
1297
|
+
return response;
|
|
1298
|
+
})
|
|
1299
|
+
.then(function (response) {
|
|
1300
|
+
return (response
|
|
1301
|
+
.edit()
|
|
1302
|
+
// .withAllowDuplicates(true)
|
|
1303
|
+
.withPoNumber("9876543210")
|
|
1304
|
+
.withTaxType(src_1.TaxType.SalesTax)
|
|
1305
|
+
.withTaxAmount(1)
|
|
1306
|
+
.execute()
|
|
1307
|
+
.then(function (cpcResponse) {
|
|
1308
|
+
t.truthy(cpcResponse);
|
|
1309
|
+
t.is(cpcResponse.responseCode, "00");
|
|
1310
|
+
}));
|
|
1311
|
+
});
|
|
1312
|
+
});
|
|
1313
|
+
test("051a - level ii mastercard manual response s", function (t) {
|
|
1314
|
+
t.plan(5);
|
|
1315
|
+
var address = new src_1.Address();
|
|
1316
|
+
address.postalCode = "75024";
|
|
1317
|
+
var card = Data_1.TestCards.masterCardManual(true, true);
|
|
1318
|
+
return card
|
|
1319
|
+
.charge(111.08)
|
|
1320
|
+
.withAllowDuplicates(true)
|
|
1321
|
+
.withCurrency("USD")
|
|
1322
|
+
.withAddress(address)
|
|
1323
|
+
.withCommercialRequest(true)
|
|
1324
|
+
.execute()
|
|
1325
|
+
.then(function (response) {
|
|
1326
|
+
t.truthy(response);
|
|
1327
|
+
t.is(response.responseCode, "00");
|
|
1328
|
+
t.is(response.commercialIndicator, "S");
|
|
1329
|
+
return response;
|
|
1330
|
+
})
|
|
1331
|
+
.then(function (response) {
|
|
1332
|
+
return (response
|
|
1333
|
+
.edit()
|
|
1334
|
+
// .withAllowDuplicates(true)
|
|
1335
|
+
.withPoNumber("9876543210")
|
|
1336
|
+
.withTaxType(src_1.TaxType.SalesTax)
|
|
1337
|
+
.withTaxAmount(1)
|
|
1338
|
+
.execute()
|
|
1339
|
+
.then(function (cpcResponse) {
|
|
1340
|
+
t.truthy(cpcResponse);
|
|
1341
|
+
t.is(cpcResponse.responseCode, "00");
|
|
1342
|
+
}));
|
|
1343
|
+
});
|
|
1344
|
+
});
|
|
1345
|
+
test("052 - level ii mastercard manual response s", function (t) {
|
|
1346
|
+
t.plan(5);
|
|
1347
|
+
var address = new src_1.Address();
|
|
1348
|
+
address.postalCode = "75024";
|
|
1349
|
+
var card = Data_1.TestCards.masterCardManual(true, true);
|
|
1350
|
+
return card
|
|
1351
|
+
.charge(111.09)
|
|
1352
|
+
.withAllowDuplicates(true)
|
|
1353
|
+
.withCurrency("USD")
|
|
1354
|
+
.withAddress(address)
|
|
1355
|
+
.withCommercialRequest(true)
|
|
1356
|
+
.execute()
|
|
1357
|
+
.then(function (response) {
|
|
1358
|
+
t.truthy(response);
|
|
1359
|
+
t.is(response.responseCode, "00");
|
|
1360
|
+
t.is(response.commercialIndicator, "S");
|
|
1361
|
+
return response;
|
|
1362
|
+
})
|
|
1363
|
+
.then(function (response) {
|
|
1364
|
+
return (response
|
|
1365
|
+
.edit()
|
|
1366
|
+
// .withAllowDuplicates(true)
|
|
1367
|
+
.withPoNumber("9876543210")
|
|
1368
|
+
.withTaxType(src_1.TaxType.TaxExempt)
|
|
1369
|
+
.execute()
|
|
1370
|
+
.then(function (cpcResponse) {
|
|
1371
|
+
t.truthy(cpcResponse);
|
|
1372
|
+
t.is(cpcResponse.responseCode, "00");
|
|
1373
|
+
}));
|
|
1374
|
+
});
|
|
1375
|
+
});
|
|
1376
|
+
test("053 - level ii amex swipe no response", function (t) {
|
|
1377
|
+
t.plan(5);
|
|
1378
|
+
var card = Data_1.TestCards.amexSwipe();
|
|
1379
|
+
return card
|
|
1380
|
+
.charge(111.1)
|
|
1381
|
+
.withAllowDuplicates(true)
|
|
1382
|
+
.withCurrency("USD")
|
|
1383
|
+
.withCommercialRequest(true)
|
|
1384
|
+
.execute()
|
|
1385
|
+
.then(function (response) {
|
|
1386
|
+
t.truthy(response);
|
|
1387
|
+
t.is(response.responseCode, "00");
|
|
1388
|
+
t.is(response.commercialIndicator, "0");
|
|
1389
|
+
return response;
|
|
1390
|
+
})
|
|
1391
|
+
.then(function (response) {
|
|
1392
|
+
return (response
|
|
1393
|
+
.edit()
|
|
1394
|
+
// .withAllowDuplicates(true)
|
|
1395
|
+
.withTaxType(src_1.TaxType.SalesTax)
|
|
1396
|
+
.withTaxAmount(1)
|
|
1397
|
+
.execute()
|
|
1398
|
+
.then(function (cpcResponse) {
|
|
1399
|
+
t.truthy(cpcResponse);
|
|
1400
|
+
t.is(cpcResponse.responseCode, "00");
|
|
1401
|
+
}));
|
|
1402
|
+
});
|
|
1403
|
+
});
|
|
1404
|
+
test("054 - level ii amex manual no response", function (t) {
|
|
1405
|
+
t.plan(5);
|
|
1406
|
+
var address = new src_1.Address();
|
|
1407
|
+
address.postalCode = "75024";
|
|
1408
|
+
var card = Data_1.TestCards.amexManual(true, true);
|
|
1409
|
+
return card
|
|
1410
|
+
.charge(111.11)
|
|
1411
|
+
.withAllowDuplicates(true)
|
|
1412
|
+
.withCurrency("USD")
|
|
1413
|
+
.withAddress(address)
|
|
1414
|
+
.withCommercialRequest(true)
|
|
1415
|
+
.execute()
|
|
1416
|
+
.then(function (response) {
|
|
1417
|
+
t.truthy(response);
|
|
1418
|
+
t.is(response.responseCode, "00");
|
|
1419
|
+
t.is(response.commercialIndicator, "0");
|
|
1420
|
+
return response;
|
|
1421
|
+
})
|
|
1422
|
+
.then(function (response) {
|
|
1423
|
+
return (response
|
|
1424
|
+
.edit()
|
|
1425
|
+
// .withAllowDuplicates(true)
|
|
1426
|
+
.withPoNumber("9876543210")
|
|
1427
|
+
.withTaxType(src_1.TaxType.NotUsed)
|
|
1428
|
+
.execute()
|
|
1429
|
+
.then(function (cpcResponse) {
|
|
1430
|
+
t.truthy(cpcResponse);
|
|
1431
|
+
t.is(cpcResponse.responseCode, "00");
|
|
1432
|
+
}));
|
|
1433
|
+
});
|
|
1434
|
+
});
|
|
1435
|
+
test("055 - level ii amex manual no response", function (t) {
|
|
1436
|
+
t.plan(5);
|
|
1437
|
+
var address = new src_1.Address();
|
|
1438
|
+
address.postalCode = "75024";
|
|
1439
|
+
var card = Data_1.TestCards.amexManual(true, true);
|
|
1440
|
+
return card
|
|
1441
|
+
.charge(111.12)
|
|
1442
|
+
.withAllowDuplicates(true)
|
|
1443
|
+
.withCurrency("USD")
|
|
1444
|
+
.withAddress(address)
|
|
1445
|
+
.withCommercialRequest(true)
|
|
1446
|
+
.execute()
|
|
1447
|
+
.then(function (response) {
|
|
1448
|
+
t.truthy(response);
|
|
1449
|
+
t.is(response.responseCode, "00");
|
|
1450
|
+
t.is(response.commercialIndicator, "0");
|
|
1451
|
+
return response;
|
|
1452
|
+
})
|
|
1453
|
+
.then(function (response) {
|
|
1454
|
+
return (response
|
|
1455
|
+
.edit()
|
|
1456
|
+
// .withAllowDuplicates(true)
|
|
1457
|
+
.withPoNumber("9876543210")
|
|
1458
|
+
.withTaxType(src_1.TaxType.NotUsed)
|
|
1459
|
+
.execute()
|
|
1460
|
+
.then(function (cpcResponse) {
|
|
1461
|
+
t.truthy(cpcResponse);
|
|
1462
|
+
t.is(cpcResponse.responseCode, "00");
|
|
1463
|
+
}));
|
|
1464
|
+
});
|
|
1465
|
+
});
|
|
1466
|
+
test("055a - level ii amex manual no response", function (t) {
|
|
1467
|
+
t.plan(5);
|
|
1468
|
+
var address = new src_1.Address();
|
|
1469
|
+
address.postalCode = "75024";
|
|
1470
|
+
var card = Data_1.TestCards.amexManual(true, true);
|
|
1471
|
+
return card
|
|
1472
|
+
.charge(111.13)
|
|
1473
|
+
.withAllowDuplicates(true)
|
|
1474
|
+
.withCurrency("USD")
|
|
1475
|
+
.withAddress(address)
|
|
1476
|
+
.withCommercialRequest(true)
|
|
1477
|
+
.execute()
|
|
1478
|
+
.then(function (response) {
|
|
1479
|
+
t.truthy(response);
|
|
1480
|
+
t.is(response.responseCode, "00");
|
|
1481
|
+
t.is(response.commercialIndicator, "0");
|
|
1482
|
+
return response;
|
|
1483
|
+
})
|
|
1484
|
+
.then(function (response) {
|
|
1485
|
+
return (response
|
|
1486
|
+
.edit()
|
|
1487
|
+
// .withAllowDuplicates(true)
|
|
1488
|
+
.withPoNumber("9876543210")
|
|
1489
|
+
.withTaxType(src_1.TaxType.TaxExempt)
|
|
1490
|
+
.execute()
|
|
1491
|
+
.then(function (cpcResponse) {
|
|
1492
|
+
t.truthy(cpcResponse);
|
|
1493
|
+
t.is(cpcResponse.responseCode, "00");
|
|
1494
|
+
}));
|
|
1495
|
+
});
|
|
1496
|
+
});
|
|
1497
|
+
/// OFFLINE SALE / AUTHORIZATION
|
|
1498
|
+
test("056 - offline charge visa manual", function (t) {
|
|
1499
|
+
t.plan(2);
|
|
1500
|
+
var card = Data_1.TestCards.visaManual(false, true);
|
|
1501
|
+
return card
|
|
1502
|
+
.charge(15.12)
|
|
1503
|
+
.withAllowDuplicates(true)
|
|
1504
|
+
.withCurrency("USD")
|
|
1505
|
+
.withOfflineAuthCode("654321")
|
|
1506
|
+
.execute()
|
|
1507
|
+
.then(function (response) {
|
|
1508
|
+
t.truthy(response);
|
|
1509
|
+
t.is(response.responseCode, "00");
|
|
1510
|
+
});
|
|
1511
|
+
});
|
|
1512
|
+
test("056 - offline auth visa manual", function (t) {
|
|
1513
|
+
t.plan(2);
|
|
1514
|
+
var card = Data_1.TestCards.visaManual(false, true);
|
|
1515
|
+
return card
|
|
1516
|
+
.authorize(15.11)
|
|
1517
|
+
.withAllowDuplicates(true)
|
|
1518
|
+
.withCurrency("USD")
|
|
1519
|
+
.withOfflineAuthCode("654321")
|
|
1520
|
+
.execute()
|
|
1521
|
+
.then(function (response) {
|
|
1522
|
+
t.truthy(response);
|
|
1523
|
+
t.is(response.responseCode, "00");
|
|
1524
|
+
});
|
|
1525
|
+
});
|
|
1526
|
+
/// RETURN
|
|
1527
|
+
test("057 - return mastercard", function (t) {
|
|
1528
|
+
t.plan(2);
|
|
1529
|
+
var card = Data_1.TestCards.masterCardManual(false, true);
|
|
1530
|
+
return card
|
|
1531
|
+
.refund(15.11)
|
|
1532
|
+
.withAllowDuplicates(true)
|
|
1533
|
+
.withCurrency("USD")
|
|
1534
|
+
.execute()
|
|
1535
|
+
.then(function (response) {
|
|
1536
|
+
t.truthy(response);
|
|
1537
|
+
t.is(response.responseCode, "00");
|
|
1538
|
+
});
|
|
1539
|
+
});
|
|
1540
|
+
test("057a - return mastercard swipe", function (t) {
|
|
1541
|
+
t.plan(2);
|
|
1542
|
+
var card = Data_1.TestCards.masterCardSwipe();
|
|
1543
|
+
return card
|
|
1544
|
+
.refund(15.15)
|
|
1545
|
+
.withAllowDuplicates(true)
|
|
1546
|
+
.withCurrency("USD")
|
|
1547
|
+
.execute()
|
|
1548
|
+
.then(function (response) {
|
|
1549
|
+
t.truthy(response);
|
|
1550
|
+
t.is(response.responseCode, "00");
|
|
1551
|
+
});
|
|
1552
|
+
});
|
|
1553
|
+
test("058 - return jcb transaction id", function (_t) {
|
|
1554
|
+
// see test 14
|
|
1555
|
+
});
|
|
1556
|
+
/// ONLINE VOID / REVERSAL (Required)
|
|
1557
|
+
test("059 - reversal visa", function (_t) {
|
|
1558
|
+
// see test 10
|
|
1559
|
+
});
|
|
1560
|
+
test("060 - reversal mastercard", function (_t) {
|
|
1561
|
+
// see test case 17
|
|
1562
|
+
});
|
|
1563
|
+
test("061 - reversal mastercard", function (_t) {
|
|
1564
|
+
// see test case 23
|
|
1565
|
+
});
|
|
1566
|
+
test("062 - reversal mastercard", function (_t) {
|
|
1567
|
+
// see test case 42
|
|
1568
|
+
});
|
|
1569
|
+
test("063 - reversal visa partial", function (_t) {
|
|
1570
|
+
// see test case 15
|
|
1571
|
+
});
|
|
1572
|
+
test("064 - reversal discover partial", function (_t) {
|
|
1573
|
+
// see test 21
|
|
1574
|
+
});
|
|
1575
|
+
/// PIN DEBIT CARD FUNCTIONS
|
|
1576
|
+
test("065 - debit sale visa swipe", function (t) {
|
|
1577
|
+
t.plan(2);
|
|
1578
|
+
var card = Data_1.TestCards.asDebit(Data_1.TestCards.visaSwipe(), "32539F50C245A6A93D123412324000AA");
|
|
1579
|
+
return card
|
|
1580
|
+
.charge(14.01)
|
|
1581
|
+
.withAllowDuplicates(true)
|
|
1582
|
+
.withCurrency("USD")
|
|
1583
|
+
.execute()
|
|
1584
|
+
.then(function (response) {
|
|
1585
|
+
t.truthy(response);
|
|
1586
|
+
t.is(response.responseCode, "00");
|
|
1587
|
+
});
|
|
1588
|
+
});
|
|
1589
|
+
test("066 - debit sale mastercard swipe", function (t) {
|
|
1590
|
+
t.plan(4);
|
|
1591
|
+
var card = Data_1.TestCards.asDebit(Data_1.TestCards.masterCardSwipe(), "F505AD81659AA42A3D123412324000AB");
|
|
1592
|
+
return card
|
|
1593
|
+
.charge(14.02)
|
|
1594
|
+
.withAllowDuplicates(true)
|
|
1595
|
+
.withCurrency("USD")
|
|
1596
|
+
.execute()
|
|
1597
|
+
.then(function (response) {
|
|
1598
|
+
t.truthy(response);
|
|
1599
|
+
t.is(response.responseCode, "00");
|
|
1600
|
+
return response;
|
|
1601
|
+
})
|
|
1602
|
+
.then(function (_response) {
|
|
1603
|
+
// test case 71
|
|
1604
|
+
return (card
|
|
1605
|
+
.reverse(14.02)
|
|
1606
|
+
// .withAllowDuplicates(true)
|
|
1607
|
+
.execute()
|
|
1608
|
+
.then(function (reverseResponse) {
|
|
1609
|
+
t.truthy(reverseResponse);
|
|
1610
|
+
t.is(reverseResponse.responseCode, "00");
|
|
1611
|
+
}));
|
|
1612
|
+
});
|
|
1613
|
+
});
|
|
1614
|
+
test("067 - debit sale visa swipe cashback", function (t) {
|
|
1615
|
+
t.plan(2);
|
|
1616
|
+
var card = Data_1.TestCards.asDebit(Data_1.TestCards.visaSwipe(), "32539F50C245A6A93D123412324000AA");
|
|
1617
|
+
return card
|
|
1618
|
+
.charge(14.03)
|
|
1619
|
+
.withAllowDuplicates(true)
|
|
1620
|
+
.withCurrency("USD")
|
|
1621
|
+
.withCashBack(5.0)
|
|
1622
|
+
.execute()
|
|
1623
|
+
.then(function (response) {
|
|
1624
|
+
t.truthy(response);
|
|
1625
|
+
t.is(response.responseCode, "00");
|
|
1626
|
+
});
|
|
1627
|
+
});
|
|
1628
|
+
test("067a - debit sale mastercard", function (t) {
|
|
1629
|
+
t.plan(2);
|
|
1630
|
+
var card = Data_1.TestCards.asDebit(Data_1.TestCards.masterCardSwipe(), "F505AD81659AA42A3D123412324000AB");
|
|
1631
|
+
return card
|
|
1632
|
+
.charge(14.04)
|
|
1633
|
+
.withAllowDuplicates(true)
|
|
1634
|
+
.withCurrency("USD")
|
|
1635
|
+
.execute()
|
|
1636
|
+
.then(function (response) {
|
|
1637
|
+
t.truthy(response);
|
|
1638
|
+
t.is(response.responseCode, "00");
|
|
1639
|
+
});
|
|
1640
|
+
});
|
|
1641
|
+
/// PARTIALLY APPROVED PURCHASE
|
|
1642
|
+
test("068 - debit sale mastercard partial approval", function (t) {
|
|
1643
|
+
t.plan(3);
|
|
1644
|
+
var card = Data_1.TestCards.asDebit(Data_1.TestCards.masterCardSwipe(), "F505AD81659AA42A3D123412324000AB");
|
|
1645
|
+
return card
|
|
1646
|
+
.charge(33.0)
|
|
1647
|
+
.withAllowDuplicates(true)
|
|
1648
|
+
.withCurrency("USD")
|
|
1649
|
+
.withAllowPartialAuth(true)
|
|
1650
|
+
.execute()
|
|
1651
|
+
.then(function (response) {
|
|
1652
|
+
t.truthy(response);
|
|
1653
|
+
t.is(response.responseCode, "10");
|
|
1654
|
+
t.is(response.authorizedAmount, "22.00");
|
|
1655
|
+
});
|
|
1656
|
+
});
|
|
1657
|
+
test("069 - debit sale visa partial approval", function (t) {
|
|
1658
|
+
t.plan(5);
|
|
1659
|
+
var card = Data_1.TestCards.asDebit(Data_1.TestCards.visaSwipe(), "32539F50C245A6A93D123412324000AA");
|
|
1660
|
+
return card
|
|
1661
|
+
.charge(44.0)
|
|
1662
|
+
.withAllowDuplicates(true)
|
|
1663
|
+
.withCurrency("USD")
|
|
1664
|
+
.withAllowPartialAuth(true)
|
|
1665
|
+
.execute()
|
|
1666
|
+
.then(function (response) {
|
|
1667
|
+
t.truthy(response);
|
|
1668
|
+
t.is(response.responseCode, "10");
|
|
1669
|
+
t.is(response.authorizedAmount, "33.00");
|
|
1670
|
+
return response;
|
|
1671
|
+
})
|
|
1672
|
+
.then(function (_response) {
|
|
1673
|
+
// test case 72
|
|
1674
|
+
return (card
|
|
1675
|
+
.reverse(33.0)
|
|
1676
|
+
// .withAllowDuplicates(true)
|
|
1677
|
+
.execute()
|
|
1678
|
+
.then(function (reverseResponse) {
|
|
1679
|
+
t.truthy(reverseResponse);
|
|
1680
|
+
t.is(reverseResponse.responseCode, "00");
|
|
1681
|
+
}));
|
|
1682
|
+
});
|
|
1683
|
+
});
|
|
1684
|
+
/// RETURN
|
|
1685
|
+
test("070 - debit return visa swipe", function (t) {
|
|
1686
|
+
t.plan(2);
|
|
1687
|
+
var card = Data_1.TestCards.asDebit(Data_1.TestCards.visaSwipe(), "32539F50C245A6A93D123412324000AA");
|
|
1688
|
+
return card
|
|
1689
|
+
.refund(14.07)
|
|
1690
|
+
.withAllowDuplicates(true)
|
|
1691
|
+
.withCurrency("USD")
|
|
1692
|
+
.execute()
|
|
1693
|
+
.then(function (response) {
|
|
1694
|
+
t.truthy(response);
|
|
1695
|
+
t.is(response.responseCode, "00");
|
|
1696
|
+
});
|
|
1697
|
+
});
|
|
1698
|
+
test("070a - debit return visa swipe", function (t) {
|
|
1699
|
+
t.plan(4);
|
|
1700
|
+
var card = Data_1.TestCards.asDebit(Data_1.TestCards.visaSwipe(), "32539F50C245A6A93D123412324000AA");
|
|
1701
|
+
return card
|
|
1702
|
+
.refund(14.08)
|
|
1703
|
+
.withAllowDuplicates(true)
|
|
1704
|
+
.withCurrency("USD")
|
|
1705
|
+
.execute()
|
|
1706
|
+
.then(function (response) {
|
|
1707
|
+
t.truthy(response);
|
|
1708
|
+
t.is(response.responseCode, "00");
|
|
1709
|
+
return response;
|
|
1710
|
+
})
|
|
1711
|
+
.then(function (_response) {
|
|
1712
|
+
return (card
|
|
1713
|
+
.reverse(14.08)
|
|
1714
|
+
// .withAllowDuplicates(true)
|
|
1715
|
+
.execute()
|
|
1716
|
+
.then(function (reverseResponse) {
|
|
1717
|
+
t.truthy(reverseResponse);
|
|
1718
|
+
t.is(reverseResponse.responseCode, "00");
|
|
1719
|
+
}));
|
|
1720
|
+
});
|
|
1721
|
+
});
|
|
1722
|
+
/// REVERSAL
|
|
1723
|
+
test("071 - debit reversal mastercard", function (_t) {
|
|
1724
|
+
// see test case 66
|
|
1725
|
+
});
|
|
1726
|
+
test("072 - debit reversal visa", function (_t) {
|
|
1727
|
+
// see test case 96
|
|
1728
|
+
});
|
|
1729
|
+
/// EBT FUNCTIONS
|
|
1730
|
+
/// Food Stamp Purchase
|
|
1731
|
+
test("080 - ebt fs purchase visa swipe", function (t) {
|
|
1732
|
+
t.plan(2);
|
|
1733
|
+
var card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipe(), "32539F50C245A6A93D123412324000AA");
|
|
1734
|
+
return card
|
|
1735
|
+
.charge(101.01)
|
|
1736
|
+
.withAllowDuplicates(true)
|
|
1737
|
+
.withCurrency("USD")
|
|
1738
|
+
.execute()
|
|
1739
|
+
.then(function (response) {
|
|
1740
|
+
t.truthy(response);
|
|
1741
|
+
t.is(response.responseCode, "00");
|
|
1742
|
+
});
|
|
1743
|
+
});
|
|
1744
|
+
test("081 - ebt fs purchase visa manual", function (t) {
|
|
1745
|
+
t.plan(2);
|
|
1746
|
+
var card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(false, true), "32539F50C245A6A93D123412324000AA");
|
|
1747
|
+
return card
|
|
1748
|
+
.charge(102.01)
|
|
1749
|
+
.withAllowDuplicates(true)
|
|
1750
|
+
.withCurrency("USD")
|
|
1751
|
+
.execute()
|
|
1752
|
+
.then(function (response) {
|
|
1753
|
+
t.truthy(response);
|
|
1754
|
+
t.is(response.responseCode, "00");
|
|
1755
|
+
});
|
|
1756
|
+
});
|
|
1757
|
+
/// Food Stamp Electronic Voucher (Manual Entry Only)
|
|
1758
|
+
test("082 - ebt voucher purchase visa", function (t) {
|
|
1759
|
+
t.plan(2);
|
|
1760
|
+
var card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(false, true), "32539F50C245A6A93D123412324000AA");
|
|
1761
|
+
card.serialNumber = "123456789012345";
|
|
1762
|
+
card.approvalCode = "123456";
|
|
1763
|
+
return card
|
|
1764
|
+
.charge(103.01)
|
|
1765
|
+
.withAllowDuplicates(true)
|
|
1766
|
+
.withCurrency("USD")
|
|
1767
|
+
.execute()
|
|
1768
|
+
.then(function (response) {
|
|
1769
|
+
t.truthy(response);
|
|
1770
|
+
t.is(response.responseCode, "00");
|
|
1771
|
+
});
|
|
1772
|
+
});
|
|
1773
|
+
/// Food Stamp Balance Inquiry
|
|
1774
|
+
test("083 - ebt fs return visa swipe", function (t) {
|
|
1775
|
+
t.plan(2);
|
|
1776
|
+
var card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipeEncrypted(), "32539F50C245A6A93D123412324000AA");
|
|
1777
|
+
return card
|
|
1778
|
+
.refund(104.01)
|
|
1779
|
+
.withAllowDuplicates(true)
|
|
1780
|
+
.withCurrency("USD")
|
|
1781
|
+
.execute()
|
|
1782
|
+
.then(function (response) {
|
|
1783
|
+
t.truthy(response);
|
|
1784
|
+
t.is(response.responseCode, "00");
|
|
1785
|
+
});
|
|
1786
|
+
});
|
|
1787
|
+
test("084 - ebt fs return visa manual", function (t) {
|
|
1788
|
+
t.plan(2);
|
|
1789
|
+
var card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(false, true), "32539F50C245A6A93D123412324000AA");
|
|
1790
|
+
return card
|
|
1791
|
+
.refund(105.01)
|
|
1792
|
+
.withAllowDuplicates(true)
|
|
1793
|
+
.withCurrency("USD")
|
|
1794
|
+
.execute()
|
|
1795
|
+
.then(function (response) {
|
|
1796
|
+
t.truthy(response);
|
|
1797
|
+
t.is(response.responseCode, "00");
|
|
1798
|
+
});
|
|
1799
|
+
});
|
|
1800
|
+
/// Food Stamp Balance Inquiry
|
|
1801
|
+
test("085 - ebt balance inquiry visa swipe", function (t) {
|
|
1802
|
+
t.plan(2);
|
|
1803
|
+
var card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipeEncrypted(), "32539F50C245A6A93D123412324000AA");
|
|
1804
|
+
return card
|
|
1805
|
+
.balanceInquiry()
|
|
1806
|
+
.execute()
|
|
1807
|
+
.then(function (response) {
|
|
1808
|
+
t.truthy(response);
|
|
1809
|
+
t.is(response.responseCode, "00");
|
|
1810
|
+
});
|
|
1811
|
+
});
|
|
1812
|
+
test("086 - ebt balance inquiry visa manual", function (t) {
|
|
1813
|
+
t.plan(2);
|
|
1814
|
+
var card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(true, true), "32539F50C245A6A93D123412324000AA");
|
|
1815
|
+
return card
|
|
1816
|
+
.balanceInquiry()
|
|
1817
|
+
.execute()
|
|
1818
|
+
.then(function (response) {
|
|
1819
|
+
t.truthy(response);
|
|
1820
|
+
t.is(response.responseCode, "00");
|
|
1821
|
+
});
|
|
1822
|
+
});
|
|
1823
|
+
/// EBT CASH BENEFITS
|
|
1824
|
+
/// Cash Back Purchase
|
|
1825
|
+
test("087 - ebt cash back purchase visa swipe", function (t) {
|
|
1826
|
+
t.plan(2);
|
|
1827
|
+
var card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipeEncrypted(), "32539F50C245A6A93D123412324000AA");
|
|
1828
|
+
return card
|
|
1829
|
+
.charge(106.01)
|
|
1830
|
+
.withAllowDuplicates(true)
|
|
1831
|
+
.withCurrency("USD")
|
|
1832
|
+
.withCashBack(5.0)
|
|
1833
|
+
.execute()
|
|
1834
|
+
.then(function (response) {
|
|
1835
|
+
t.truthy(response);
|
|
1836
|
+
t.is(response.responseCode, "00");
|
|
1837
|
+
});
|
|
1838
|
+
});
|
|
1839
|
+
test("088 - ebt cash back purchase visa manual", function (t) {
|
|
1840
|
+
t.plan(2);
|
|
1841
|
+
var card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(false, true), "32539F50C245A6A93D123412324000AA");
|
|
1842
|
+
return card
|
|
1843
|
+
.charge(107.01)
|
|
1844
|
+
.withAllowDuplicates(true)
|
|
1845
|
+
.withCurrency("USD")
|
|
1846
|
+
.withCashBack(5.0)
|
|
1847
|
+
.execute()
|
|
1848
|
+
.then(function (response) {
|
|
1849
|
+
t.truthy(response);
|
|
1850
|
+
t.is(response.responseCode, "00");
|
|
1851
|
+
});
|
|
1852
|
+
});
|
|
1853
|
+
/// No Cash Back Purchase
|
|
1854
|
+
test("089 - ebt cash back purchase visa swipe no cash back", function (t) {
|
|
1855
|
+
t.plan(2);
|
|
1856
|
+
var card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipeEncrypted(), "32539F50C245A6A93D123412324000AA");
|
|
1857
|
+
return card
|
|
1858
|
+
.charge(108.01)
|
|
1859
|
+
.withAllowDuplicates(true)
|
|
1860
|
+
.withCurrency("USD")
|
|
1861
|
+
.withCashBack(0)
|
|
1862
|
+
.execute()
|
|
1863
|
+
.then(function (response) {
|
|
1864
|
+
t.truthy(response);
|
|
1865
|
+
t.is(response.responseCode, "00");
|
|
1866
|
+
});
|
|
1867
|
+
});
|
|
1868
|
+
test("090 - ebt cash back purchase visa manual no cash back", function (t) {
|
|
1869
|
+
t.plan(2);
|
|
1870
|
+
var card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(false, true), "32539F50C245A6A93D123412324000AA");
|
|
1871
|
+
return card
|
|
1872
|
+
.charge(109.01)
|
|
1873
|
+
.withAllowDuplicates(true)
|
|
1874
|
+
.withCurrency("USD")
|
|
1875
|
+
.withCashBack(0)
|
|
1876
|
+
.execute()
|
|
1877
|
+
.then(function (response) {
|
|
1878
|
+
t.truthy(response);
|
|
1879
|
+
t.is(response.responseCode, "00");
|
|
1880
|
+
});
|
|
1881
|
+
});
|
|
1882
|
+
/// Cash Back Balance Inquiry
|
|
1883
|
+
test("091 - ebt balance inquiry visa swipe cash", function (t) {
|
|
1884
|
+
t.plan(2);
|
|
1885
|
+
var card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipeEncrypted(), "32539F50C245A6A93D123412324000AA");
|
|
1886
|
+
return card
|
|
1887
|
+
.balanceInquiry(src_1.InquiryType.Cash)
|
|
1888
|
+
.execute()
|
|
1889
|
+
.then(function (response) {
|
|
1890
|
+
t.truthy(response);
|
|
1891
|
+
t.is(response.responseCode, "00");
|
|
1892
|
+
});
|
|
1893
|
+
});
|
|
1894
|
+
test("092 - ebt balance inquiry visa manual cash", function (t) {
|
|
1895
|
+
t.plan(2);
|
|
1896
|
+
var card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(true, true), "32539F50C245A6A93D123412324000AA");
|
|
1897
|
+
return card
|
|
1898
|
+
.balanceInquiry(src_1.InquiryType.Cash)
|
|
1899
|
+
.execute()
|
|
1900
|
+
.then(function (response) {
|
|
1901
|
+
t.truthy(response);
|
|
1902
|
+
t.is(response.responseCode, "00");
|
|
1903
|
+
});
|
|
1904
|
+
});
|
|
1905
|
+
/// Cash Benefits Withdrawal
|
|
1906
|
+
test("093 - ebt benefit withdrawal visa swipe", function (t) {
|
|
1907
|
+
t.plan(2);
|
|
1908
|
+
var card = Data_1.TestCards.asEBTTrack(Data_1.TestCards.visaSwipeEncrypted(), "32539F50C245A6A93D123412324000AA");
|
|
1909
|
+
return card
|
|
1910
|
+
.charge(110.01)
|
|
1911
|
+
.withAllowDuplicates(true)
|
|
1912
|
+
.withCurrency("USD")
|
|
1913
|
+
.execute()
|
|
1914
|
+
.then(function (response) {
|
|
1915
|
+
t.truthy(response);
|
|
1916
|
+
t.is(response.responseCode, "00");
|
|
1917
|
+
});
|
|
1918
|
+
});
|
|
1919
|
+
test("094 - ebt benefit withdrawal visa manual", function (t) {
|
|
1920
|
+
t.plan(2);
|
|
1921
|
+
var card = Data_1.TestCards.asEBTManual(Data_1.TestCards.visaManual(false, true), "32539F50C245A6A93D123412324000AA");
|
|
1922
|
+
return card
|
|
1923
|
+
.charge(111.01)
|
|
1924
|
+
.withAllowDuplicates(true)
|
|
1925
|
+
.withCurrency("USD")
|
|
1926
|
+
.withCashBack(0)
|
|
1927
|
+
.execute()
|
|
1928
|
+
.then(function (response) {
|
|
1929
|
+
t.truthy(response);
|
|
1930
|
+
t.is(response.responseCode, "00");
|
|
1931
|
+
});
|
|
1932
|
+
});
|
|
1933
|
+
/// HMS GIFT - REWARDS
|
|
1934
|
+
/// GIFT
|
|
1935
|
+
/// ACTIVATE
|
|
1936
|
+
test("095 - activate gift 1 swipe", function (t) {
|
|
1937
|
+
t.plan(2);
|
|
1938
|
+
var card = Data_1.TestCards.giftCard1Swipe();
|
|
1939
|
+
return card
|
|
1940
|
+
.activate(6.0)
|
|
1941
|
+
.execute()
|
|
1942
|
+
.then(function (response) {
|
|
1943
|
+
t.truthy(response);
|
|
1944
|
+
t.is(response.responseCode, "00");
|
|
1945
|
+
});
|
|
1946
|
+
});
|
|
1947
|
+
test("096 - activate gift 2 manual", function (t) {
|
|
1948
|
+
t.plan(2);
|
|
1949
|
+
var card = Data_1.TestCards.giftCard2Manual();
|
|
1950
|
+
return card
|
|
1951
|
+
.activate(7.0)
|
|
1952
|
+
.execute()
|
|
1953
|
+
.then(function (response) {
|
|
1954
|
+
t.truthy(response);
|
|
1955
|
+
t.is(response.responseCode, "00");
|
|
1956
|
+
});
|
|
1957
|
+
});
|
|
1958
|
+
/// ADD VALUE
|
|
1959
|
+
test("097 - add value gift 1 swipe", function (t) {
|
|
1960
|
+
t.plan(2);
|
|
1961
|
+
var card = Data_1.TestCards.giftCard1Swipe();
|
|
1962
|
+
return card
|
|
1963
|
+
.addValue(8.0)
|
|
1964
|
+
.withCurrency("USD")
|
|
1965
|
+
.execute()
|
|
1966
|
+
.then(function (response) {
|
|
1967
|
+
t.truthy(response);
|
|
1968
|
+
t.is(response.responseCode, "00");
|
|
1969
|
+
});
|
|
1970
|
+
});
|
|
1971
|
+
test("098 - add value gift 2 manual", function (t) {
|
|
1972
|
+
t.plan(2);
|
|
1973
|
+
var card = Data_1.TestCards.giftCard2Manual();
|
|
1974
|
+
return card
|
|
1975
|
+
.addValue(9.0)
|
|
1976
|
+
.withCurrency("USD")
|
|
1977
|
+
.execute()
|
|
1978
|
+
.then(function (response) {
|
|
1979
|
+
t.truthy(response);
|
|
1980
|
+
t.is(response.responseCode, "00");
|
|
1981
|
+
});
|
|
1982
|
+
});
|
|
1983
|
+
/// BALANCE INQUIRY
|
|
1984
|
+
test("099 - balance inquiry gift 1 swipe", function (t) {
|
|
1985
|
+
t.plan(3);
|
|
1986
|
+
var card = Data_1.TestCards.giftCard1Swipe();
|
|
1987
|
+
return card
|
|
1988
|
+
.balanceInquiry()
|
|
1989
|
+
.execute()
|
|
1990
|
+
.then(function (response) {
|
|
1991
|
+
t.truthy(response);
|
|
1992
|
+
t.is(response.responseCode, "00");
|
|
1993
|
+
t.is(response.balanceAmount, "10.00");
|
|
1994
|
+
});
|
|
1995
|
+
});
|
|
1996
|
+
test("100 - balance inquiry gift 2 manual", function (t) {
|
|
1997
|
+
t.plan(3);
|
|
1998
|
+
var card = Data_1.TestCards.giftCard2Manual();
|
|
1999
|
+
return card
|
|
2000
|
+
.balanceInquiry()
|
|
2001
|
+
.execute()
|
|
2002
|
+
.then(function (response) {
|
|
2003
|
+
t.truthy(response);
|
|
2004
|
+
t.is(response.responseCode, "00");
|
|
2005
|
+
t.is(response.balanceAmount, "10.00");
|
|
2006
|
+
});
|
|
2007
|
+
});
|
|
2008
|
+
/// REPLACE / TRANSFER
|
|
2009
|
+
test("101 - replace gift 1 swipe", function (t) {
|
|
2010
|
+
t.plan(2);
|
|
2011
|
+
var oldCard = Data_1.TestCards.giftCard1Swipe();
|
|
2012
|
+
var newCard = Data_1.TestCards.giftCard2Manual();
|
|
2013
|
+
return oldCard
|
|
2014
|
+
.replaceWith(newCard)
|
|
2015
|
+
.execute()
|
|
2016
|
+
.then(function (response) {
|
|
2017
|
+
t.truthy(response);
|
|
2018
|
+
t.is(response.responseCode, "00");
|
|
2019
|
+
});
|
|
2020
|
+
});
|
|
2021
|
+
test("102 - replace gift 2 manual", function (t) {
|
|
2022
|
+
t.plan(2);
|
|
2023
|
+
var newCard = Data_1.TestCards.giftCard1Swipe();
|
|
2024
|
+
var oldCard = Data_1.TestCards.giftCard2Manual();
|
|
2025
|
+
return oldCard
|
|
2026
|
+
.replaceWith(newCard)
|
|
2027
|
+
.execute()
|
|
2028
|
+
.then(function (response) {
|
|
2029
|
+
t.truthy(response);
|
|
2030
|
+
t.is(response.responseCode, "00");
|
|
2031
|
+
});
|
|
2032
|
+
});
|
|
2033
|
+
/// SALE / REDEEM
|
|
2034
|
+
test("103 - sale gift 1 swipe", function (t) {
|
|
2035
|
+
t.plan(2);
|
|
2036
|
+
var card = Data_1.TestCards.giftCard1Swipe();
|
|
2037
|
+
return card
|
|
2038
|
+
.charge(1.0)
|
|
2039
|
+
.withCurrency("USD")
|
|
2040
|
+
.execute()
|
|
2041
|
+
.then(function (response) {
|
|
2042
|
+
t.truthy(response);
|
|
2043
|
+
t.is(response.responseCode, "00");
|
|
2044
|
+
});
|
|
2045
|
+
});
|
|
2046
|
+
test("104 - sale gift 2 manual", function (t) {
|
|
2047
|
+
t.plan(2);
|
|
2048
|
+
var card = Data_1.TestCards.giftCard2Manual();
|
|
2049
|
+
return card
|
|
2050
|
+
.charge(2.0)
|
|
2051
|
+
.withCurrency("USD")
|
|
2052
|
+
.execute()
|
|
2053
|
+
.then(function (response) {
|
|
2054
|
+
t.truthy(response);
|
|
2055
|
+
t.is(response.responseCode, "00");
|
|
2056
|
+
});
|
|
2057
|
+
});
|
|
2058
|
+
test("105 - sale gift 1 void swipe", function (t) {
|
|
2059
|
+
t.plan(4);
|
|
2060
|
+
var card = Data_1.TestCards.giftCard1Swipe();
|
|
2061
|
+
return card
|
|
2062
|
+
.charge(3.0)
|
|
2063
|
+
.withCurrency("USD")
|
|
2064
|
+
.execute()
|
|
2065
|
+
.then(function (response) {
|
|
2066
|
+
t.truthy(response);
|
|
2067
|
+
t.is(response.responseCode, "00");
|
|
2068
|
+
return response;
|
|
2069
|
+
})
|
|
2070
|
+
.then(function (response) {
|
|
2071
|
+
// test case 107
|
|
2072
|
+
return response
|
|
2073
|
+
.void()
|
|
2074
|
+
.execute()
|
|
2075
|
+
.then(function (voidResponse) {
|
|
2076
|
+
t.truthy(voidResponse);
|
|
2077
|
+
t.is(voidResponse.responseCode, "00");
|
|
2078
|
+
});
|
|
2079
|
+
});
|
|
2080
|
+
});
|
|
2081
|
+
test("106 - sale gift 2 reversal manual", function (t) {
|
|
2082
|
+
t.plan(4);
|
|
2083
|
+
var card = Data_1.TestCards.giftCard2Manual();
|
|
2084
|
+
return card
|
|
2085
|
+
.charge(4.0)
|
|
2086
|
+
.withCurrency("USD")
|
|
2087
|
+
.execute()
|
|
2088
|
+
.then(function (response) {
|
|
2089
|
+
t.truthy(response);
|
|
2090
|
+
t.is(response.responseCode, "00");
|
|
2091
|
+
return response;
|
|
2092
|
+
})
|
|
2093
|
+
.then(function (response) {
|
|
2094
|
+
// test case 108
|
|
2095
|
+
return response
|
|
2096
|
+
.reverse(4.0)
|
|
2097
|
+
.execute()
|
|
2098
|
+
.then(function (voidResponse) {
|
|
2099
|
+
t.truthy(voidResponse);
|
|
2100
|
+
t.is(voidResponse.responseCode, "00");
|
|
2101
|
+
});
|
|
2102
|
+
});
|
|
2103
|
+
});
|
|
2104
|
+
/// VOID
|
|
2105
|
+
test("107 - void gift", function (_t) {
|
|
2106
|
+
// see test case 105
|
|
2107
|
+
});
|
|
2108
|
+
/// REVERSAL
|
|
2109
|
+
test("108 - reversal gift", function (_t) {
|
|
2110
|
+
// see test case 106
|
|
2111
|
+
});
|
|
2112
|
+
/// DEACTIVATE
|
|
2113
|
+
test("109 - deactivate gift 1", function (t) {
|
|
2114
|
+
t.plan(2);
|
|
2115
|
+
var card = Data_1.TestCards.giftCard1Swipe();
|
|
2116
|
+
return card
|
|
2117
|
+
.deactivate()
|
|
2118
|
+
.execute()
|
|
2119
|
+
.then(function (response) {
|
|
2120
|
+
t.truthy(response);
|
|
2121
|
+
t.is(response.responseCode, "00");
|
|
2122
|
+
});
|
|
2123
|
+
});
|
|
2124
|
+
/// RECEIPTS MESSAGING
|
|
2125
|
+
test("110 - receipts messaging", function (_t) {
|
|
2126
|
+
/// PRINT AND SCAN RECEIPT FOR TEST 107
|
|
2127
|
+
});
|
|
2128
|
+
/// REWARDS
|
|
2129
|
+
/// BALANCE INQUIRY
|
|
2130
|
+
test("111 - balance inquiry rewards 1", function (t) {
|
|
2131
|
+
t.plan(3);
|
|
2132
|
+
var card = Data_1.TestCards.giftCard1Swipe();
|
|
2133
|
+
return card
|
|
2134
|
+
.balanceInquiry()
|
|
2135
|
+
.execute()
|
|
2136
|
+
.then(function (response) {
|
|
2137
|
+
t.truthy(response);
|
|
2138
|
+
t.is(response.responseCode, "00");
|
|
2139
|
+
t.is(response.pointsBalanceAmount, "0");
|
|
2140
|
+
});
|
|
2141
|
+
});
|
|
2142
|
+
test("112 - balance inquiry rewards 2", function (t) {
|
|
2143
|
+
t.plan(3);
|
|
2144
|
+
var card = Data_1.TestCards.giftCard2Manual();
|
|
2145
|
+
return card
|
|
2146
|
+
.balanceInquiry()
|
|
2147
|
+
.execute()
|
|
2148
|
+
.then(function (response) {
|
|
2149
|
+
t.truthy(response);
|
|
2150
|
+
t.is(response.responseCode, "00");
|
|
2151
|
+
t.is(response.pointsBalanceAmount, "0");
|
|
2152
|
+
});
|
|
2153
|
+
});
|
|
2154
|
+
/// ALIAS
|
|
2155
|
+
test("113 - create alias gift 1", function (t) {
|
|
2156
|
+
t.plan(1);
|
|
2157
|
+
return src_1.GiftCard.create("9725550100").then(function (card) {
|
|
2158
|
+
t.truthy(card);
|
|
2159
|
+
});
|
|
2160
|
+
});
|
|
2161
|
+
test("114 - create alias gift 2", function (t) {
|
|
2162
|
+
t.plan(1);
|
|
2163
|
+
return src_1.GiftCard.create("9725550100").then(function (card) {
|
|
2164
|
+
t.truthy(card);
|
|
2165
|
+
});
|
|
2166
|
+
});
|
|
2167
|
+
test("115 - add alias gift 1", function (t) {
|
|
2168
|
+
t.plan(2);
|
|
2169
|
+
var card = Data_1.TestCards.giftCard1Swipe();
|
|
2170
|
+
return card
|
|
2171
|
+
.addAlias("2145550199")
|
|
2172
|
+
.execute()
|
|
2173
|
+
.then(function (response) {
|
|
2174
|
+
t.truthy(response);
|
|
2175
|
+
t.is(response.responseCode, "00");
|
|
2176
|
+
});
|
|
2177
|
+
});
|
|
2178
|
+
test("116 - add alias gift 2", function (t) {
|
|
2179
|
+
t.plan(2);
|
|
2180
|
+
var card = Data_1.TestCards.giftCard2Manual();
|
|
2181
|
+
return card
|
|
2182
|
+
.addAlias("2145550199")
|
|
2183
|
+
.execute()
|
|
2184
|
+
.then(function (response) {
|
|
2185
|
+
t.truthy(response);
|
|
2186
|
+
t.is(response.responseCode, "00");
|
|
2187
|
+
});
|
|
2188
|
+
});
|
|
2189
|
+
test("117 - delete alias gift 1", function (t) {
|
|
2190
|
+
t.plan(2);
|
|
2191
|
+
var card = Data_1.TestCards.giftCard1Swipe();
|
|
2192
|
+
return card
|
|
2193
|
+
.removeAlias("2145550199")
|
|
2194
|
+
.execute()
|
|
2195
|
+
.then(function (response) {
|
|
2196
|
+
t.truthy(response);
|
|
2197
|
+
t.is(response.responseCode, "00");
|
|
2198
|
+
});
|
|
2199
|
+
});
|
|
2200
|
+
test.after("999 - close batch", function (t) {
|
|
2201
|
+
t.plan(1);
|
|
2202
|
+
return new Promise(function (resolve, reject) {
|
|
2203
|
+
src_1.BatchService.closeBatch()
|
|
2204
|
+
.then(function (response) {
|
|
2205
|
+
t.truthy(response);
|
|
2206
|
+
resolve();
|
|
2207
|
+
})
|
|
2208
|
+
.catch(function (e) {
|
|
2209
|
+
if (e.message.indexOf(BATCH_NOT_OPEN) !== -1 ||
|
|
2210
|
+
e.message.indexOf(BATCH_EMPTY) !== -1) {
|
|
2211
|
+
t.pass();
|
|
2212
|
+
resolve();
|
|
2213
|
+
return;
|
|
2214
|
+
}
|
|
2215
|
+
reject(e);
|
|
2216
|
+
});
|
|
2217
|
+
});
|
|
2218
|
+
});
|