CnpOnline 9.14.0 → 11.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/CHANGELOG +23 -17
- data/CONTRIBUTORS +0 -0
- data/DESCRIPTION +1 -1
- data/LICENSE +1 -1
- data/README.md +5 -3
- data/Rakefile +5 -5
- data/Rakefile~ +5 -5
- data/SETUP.md +3 -3
- data/bin/Setup.rb +59 -41
- data/lib/Communications.rb +3 -3
- data/lib/Configuration.rb +52 -45
- data/lib/EnvironmentVariables.rb +5 -1
- data/lib/LitleBatchRequest.rb +72 -7
- data/lib/LitleListeners.rb +17 -1
- data/lib/LitleOnline.rb +3 -4
- data/lib/LitleOnlineRequest.rb +37 -7
- data/lib/LitleRequest.rb +315 -186
- data/lib/LitleTransaction.rb +212 -85
- data/lib/LitleXmlMapper.rb +4 -2
- data/lib/XMLFields.rb +384 -171
- data/lib/cacert.pem +0 -0
- data/samples/Auth/LitleAuthReversalTransaction.rb +2 -2
- data/samples/Auth/LitleAuthorizationTransaction.rb +1 -0
- data/samples/Auth/LitlePaymentFullLifeCycle.rb +12 -6
- data/samples/Batch/AccountUpdate.rb +1 -0
- data/samples/Batch/SampleBatchDriver.rb +2 -1
- data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +2 -1
- data/samples/Capture/LitleCaptureTransaction.rb +2 -2
- data/samples/Capture/LitleForceCaptureTransaction.rb +2 -1
- data/samples/Capture/LitlePartialCapture.rb +3 -3
- data/samples/Credit/LitleCreditTransaction.rb +2 -2
- data/samples/Credit/LitleRefundTransaction.rb +2 -1
- data/samples/Other/LitleAvsTransaction.rb +2 -1
- data/samples/Other/LitleVoidTransaction.rb +2 -1
- data/samples/Paypage/FullPaypageLifeCycle.rb +7 -2
- data/samples/Run_all.rb +0 -0
- data/samples/Sale/LitleSaleTransaction.rb +2 -1
- data/samples/Sale/SampleSaleTransaction.rb +2 -1
- data/test/certification/certTest1_base.rb +52 -53
- data/test/certification/certTest2_authenhanced.rb +24 -25
- data/test/certification/certTest3_authreversal.rb +23 -26
- data/test/certification/certTest4_echeck.rb +18 -32
- data/test/certification/certTest5_token.rb +105 -106
- data/test/certification/certTest_batchAll.rb +47 -15
- data/test/functional/test_activate.rb +32 -4
- data/test/functional/test_activateReversal.rb +18 -5
- data/test/functional/test_auth.rb +94 -48
- data/test/functional/test_authReversal.rb +4 -1
- data/test/functional/test_balanceInquiry.rb +28 -3
- data/test/functional/test_batchStream.rb +2 -4
- data/test/functional/test_cancelSubscription.rb +2 -2
- data/test/functional/test_capture.rb +21 -14
- data/test/functional/test_captureGivenAuth.rb +15 -6
- data/test/functional/test_createPlan.rb +1 -1
- data/test/functional/test_credit.rb +14 -5
- data/test/functional/test_deactivate.rb +26 -3
- data/test/functional/test_deactivateReversal.rb +18 -5
- data/test/functional/test_depositReversal.rb +31 -19
- data/test/functional/test_echeckCredit.rb +34 -6
- data/test/functional/test_echeckRedeposit.rb +29 -2
- data/test/functional/test_echeckSale.rb +68 -11
- data/test/functional/test_echeckVerification.rb +32 -7
- data/test/functional/test_echeckVoid.rb +2 -1
- data/test/functional/test_forceCapture.rb +20 -6
- data/test/functional/test_fraudCheck.rb +3 -5
- data/test/functional/test_giftCardAuthReversal.rb +72 -0
- data/test/functional/test_giftCardCapture.rb +72 -0
- data/test/functional/test_giftCardCredit.rb +69 -0
- data/test/functional/test_litle_requests.rb +3 -6
- data/test/functional/test_load.rb +27 -3
- data/test/functional/test_loadReversal.rb +18 -5
- data/test/functional/test_override.rb +7 -3
- data/test/functional/test_pgp_litle_requests.rb +294 -0
- data/test/functional/test_queryTransaction.rb +152 -0
- data/test/functional/test_refundReversal.rb +18 -5
- data/test/functional/test_sale.rb +122 -159
- data/test/functional/test_token.rb +17 -11
- data/test/functional/test_unload.rb +27 -3
- data/test/functional/test_unloadReversal.rb +18 -5
- data/test/functional/test_updateCardValidationNumOnToken.rb +1 -0
- data/test/functional/test_updatePlan.rb +2 -1
- data/test/functional/test_updateSubscription.rb +3 -1
- data/test/functional/test_wallet.rb +74 -0
- data/test/functional/test_xmlfields.rb +22 -3
- data/test/functional/ts_all.rb +2 -0
- data/test/unit/test_LitleBatchRequest.rb +53 -5
- data/test/unit/test_LitleOnlineRequest.rb +5 -30
- data/test/unit/test_LitleRequest.rb +7 -6
- data/test/unit/test_LitleTransaction.rb +34 -5
- data/test/unit/test_LitleXmlMapper.rb +3 -0
- data/test/unit/test_activate.rb +22 -2
- data/test/unit/test_activateReversal.rb +15 -3
- data/test/unit/test_auth.rb +11 -9
- data/test/unit/test_balanceInquiry.rb +2 -2
- data/test/unit/test_capture.rb +2 -2
- data/test/unit/test_captureGivenAuth.rb +21 -1
- data/test/unit/test_credit.rb +1 -1
- data/test/unit/test_deactivate.rb +19 -0
- data/test/unit/test_deactivateReversal.rb +15 -3
- data/test/unit/test_depositReversal.rb +17 -5
- data/test/unit/test_echeckCredit.rb +19 -0
- data/test/unit/test_echeckRedeposit.rb +15 -0
- data/test/unit/test_echeckSale.rb +20 -1
- data/test/unit/test_echeckVerification.rb +6 -3
- data/test/unit/test_forceCapture.rb +1 -1
- data/test/unit/test_giftCardAuthReversal.rb +58 -0
- data/test/{functional/test_utf8.rb → unit/test_giftCardCapture.rb} +25 -12
- data/test/unit/test_giftCardCredit.rb +57 -0
- data/test/unit/test_load.rb +2 -2
- data/test/unit/test_loadReversal.rb +15 -3
- data/test/unit/test_pgp_LitleRequest +139 -0
- data/test/unit/test_queryTransaction.rb +105 -0
- data/test/unit/test_refundReversal.rb +15 -3
- data/test/unit/test_sale.rb +23 -3
- data/test/unit/test_token.rb +24 -20
- data/test/unit/test_unload.rb +2 -2
- data/test/unit/test_unloadReversal.rb +15 -3
- data/test/unit/test_wallet.rb +262 -0
- data/test/unit/ts_unit.rb +2 -1
- metadata +81 -100
data/test/unit/test_auth.rb
CHANGED
@@ -28,7 +28,7 @@ require 'mocha/setup'
|
|
28
28
|
|
29
29
|
#test Authorization Transaction
|
30
30
|
module LitleOnline
|
31
|
-
|
31
|
+
class TestAuth < Test::Unit::TestCase
|
32
32
|
def test_success_re_auth
|
33
33
|
hash = {
|
34
34
|
'merchantId' => '101',
|
@@ -58,7 +58,7 @@ module LitleOnline
|
|
58
58
|
'transactionId'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
|
59
59
|
},
|
60
60
|
'signature' =>'sign',
|
61
|
-
'version' =>'
|
61
|
+
'version' =>'10000'
|
62
62
|
}
|
63
63
|
}
|
64
64
|
|
@@ -88,7 +88,7 @@ module LitleOnline
|
|
88
88
|
'transactionId'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
|
89
89
|
},
|
90
90
|
'signature' =>'sign',
|
91
|
-
'version' =>'
|
91
|
+
'version' =>'10000'
|
92
92
|
}}
|
93
93
|
|
94
94
|
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
@@ -150,7 +150,6 @@ module LitleOnline
|
|
150
150
|
'merchantId' => '101',
|
151
151
|
'version'=>'8.8',
|
152
152
|
'reportGroup'=>'Planets',
|
153
|
-
# 'litleTxnId'=>'123456',
|
154
153
|
'orderId'=>'12344',
|
155
154
|
'amount'=>'106',
|
156
155
|
'orderSource'=>'ecommerce',
|
@@ -212,6 +211,9 @@ module LitleOnline
|
|
212
211
|
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<authorization.*?<fraudFilterOverride>true<\/fraudFilterOverride>.*?<\/authorization>.*/m), is_a(Hash))
|
213
212
|
LitleOnlineRequest.new.authorization(hash)
|
214
213
|
end
|
214
|
+
|
215
|
+
|
216
|
+
|
215
217
|
|
216
218
|
def test_pos_without_capability
|
217
219
|
hash = {
|
@@ -244,7 +246,7 @@ module LitleOnline
|
|
244
246
|
'transactionId'=>'123456'
|
245
247
|
}}
|
246
248
|
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
247
|
-
|
249
|
+
assert_match /If paypal is specified, it must have a payerId/, exception.message
|
248
250
|
end
|
249
251
|
|
250
252
|
def test_paypal_missing_transaction_id
|
@@ -412,7 +414,7 @@ module LitleOnline
|
|
412
414
|
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<mpos><ksn>ksnString<\/ksn><formatId>30<\/formatId><encryptedTrack>encryptedTrackString<\/encryptedTrack><track1Status>0<\/track1Status><track2Status>0<\/track2Status><\/mpos>.*/m), is_a(Hash))
|
413
415
|
LitleOnlineRequest.new.authorization(hash)
|
414
416
|
end
|
415
|
-
|
417
|
+
|
416
418
|
def test_processingType_originalNetworkTransactionId_originalTransactionAmount
|
417
419
|
hash = {
|
418
420
|
'orderId' => '12344',
|
@@ -430,8 +432,8 @@ module LitleOnline
|
|
430
432
|
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>initialInstallment<\/processingType><originalNetworkTransactionId>9876543210<\/originalNetworkTransactionId><originalTransactionAmount>536981<\/originalTransactionAmount>.*/m), is_a(Hash))
|
431
433
|
LitleOnlineRequest.new.authorization(hash)
|
432
434
|
end
|
433
|
-
|
434
|
-
|
435
|
+
|
436
|
+
def test_processingType_wallet
|
435
437
|
hash = {
|
436
438
|
'merchantId' => '101',
|
437
439
|
'version'=>'8.8',
|
@@ -456,6 +458,6 @@ module LitleOnline
|
|
456
458
|
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<wallet><walletSourceType>VisaCheckout<\/walletSourceType><walletSourceTypeId>VCIND<\/walletSourceTypeId><\/wallet>.*/m), is_a(Hash))
|
457
459
|
LitleOnlineRequest.new.authorization(hash)
|
458
460
|
end
|
459
|
-
|
461
|
+
|
460
462
|
end
|
461
463
|
end
|
@@ -37,13 +37,13 @@ module LitleOnline
|
|
37
37
|
'orderSource'=>'ecommerce',
|
38
38
|
'card'=>
|
39
39
|
{
|
40
|
-
'type'=>'
|
40
|
+
'type'=>'GC',
|
41
41
|
'number' =>'4100000000000001',
|
42
42
|
'expDate' =>'1210'
|
43
43
|
}
|
44
44
|
}
|
45
45
|
|
46
|
-
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<balanceInquiry reportGroup="Planets"><orderId>11<\/orderId><orderSource>ecommerce<\/orderSource><card><type>
|
46
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<balanceInquiry reportGroup="Planets"><orderId>11<\/orderId><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/balanceInquiry>.*/m), is_a(Hash))
|
47
47
|
LitleOnlineRequest.new.balance_inquiry(hash)
|
48
48
|
end
|
49
49
|
|
data/test/unit/test_capture.rb
CHANGED
@@ -69,7 +69,7 @@ module LitleOnline
|
|
69
69
|
LitleOnlineRequest.new.capture(hash)
|
70
70
|
end
|
71
71
|
|
72
|
-
|
72
|
+
def test_pin
|
73
73
|
hash = {
|
74
74
|
'litleTxnId' => '123456000',
|
75
75
|
'amount' => '2',
|
@@ -93,7 +93,7 @@ module LitleOnline
|
|
93
93
|
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<customBilling><city>boston<\/city><descriptor>card was present<\/descriptor><\/customBilling>.*/m), is_a(Hash))
|
94
94
|
LitleOnlineRequest.new.capture(hash)
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
@@ -144,6 +144,26 @@ module LitleOnline
|
|
144
144
|
end
|
145
145
|
|
146
146
|
def test_fraudResult
|
147
|
+
hash = {
|
148
|
+
'amount' => '2',
|
149
|
+
'orderSource' => 'ecommerce',
|
150
|
+
'reportGroup' => 'Planets',
|
151
|
+
'authInformation' => {
|
152
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
153
|
+
'authAmount'=>'12345',
|
154
|
+
'fraudResult' => {
|
155
|
+
'advancedFraudResults' =>
|
156
|
+
{'deviceReviewStatus' => 'deviceReviewStatusString',
|
157
|
+
'deviceReputationScore' => '100'
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}
|
161
|
+
}
|
162
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<advancedFraudResults><deviceReviewStatus>deviceReviewStatusString<\/deviceReviewStatus><deviceReputationScore>100<\/deviceReputationScore><\/advancedFraudResults>.*/m), is_a(Hash))
|
163
|
+
LitleOnlineRequest.new.capture_given_auth(hash)
|
164
|
+
end
|
165
|
+
|
166
|
+
def test_fraudResult1
|
147
167
|
hash = {
|
148
168
|
'amount' => '2',
|
149
169
|
'orderSource' => 'ecommerce',
|
@@ -164,7 +184,7 @@ module LitleOnline
|
|
164
184
|
LitleOnlineRequest.new.capture_given_auth(hash)
|
165
185
|
end
|
166
186
|
|
167
|
-
|
187
|
+
def test_processingType
|
168
188
|
hash = {
|
169
189
|
'merchantId' => '101',
|
170
190
|
'version'=>'8.8',
|
data/test/unit/test_credit.rb
CHANGED
@@ -28,6 +28,25 @@ require 'mocha/setup'
|
|
28
28
|
module LitleOnline
|
29
29
|
class TestDeactivate < Test::Unit::TestCase
|
30
30
|
|
31
|
+
def test_simple
|
32
|
+
hash = {
|
33
|
+
'merchantId' => '101',
|
34
|
+
'version'=>'8.8',
|
35
|
+
'reportGroup'=>'Planets',
|
36
|
+
'orderId' => '11',
|
37
|
+
'orderSource'=>'ecommerce',
|
38
|
+
'card'=>
|
39
|
+
{
|
40
|
+
'type'=>'GC',
|
41
|
+
'number' =>'4100000000000001',
|
42
|
+
'expDate' =>'1210'
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<deactivate reportGroup="Planets"><orderId>11<\/orderId><orderSource>ecommerce<\/orderSource><card><type>GC<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/deactivate>.*/m), is_a(Hash))
|
47
|
+
LitleOnlineRequest.new.deactivate(hash)
|
48
|
+
end
|
49
|
+
|
31
50
|
def test_simple
|
32
51
|
hash = {
|
33
52
|
'merchantId' => '101',
|
@@ -33,11 +33,23 @@ module LitleOnline
|
|
33
33
|
'merchantId' => '101',
|
34
34
|
'version'=>'8.8',
|
35
35
|
'reportGroup'=>'Planets',
|
36
|
-
'litleTxnId' => '5000'
|
36
|
+
'litleTxnId' => '5000',
|
37
|
+
'card'=>{
|
38
|
+
'type'=>'GC',
|
39
|
+
'number' =>'400000000000001',
|
40
|
+
'expDate' =>'0150',
|
41
|
+
'pin' => '1234',
|
42
|
+
'cardValidationNum' => '411'
|
43
|
+
},
|
44
|
+
'originalRefCode' => '101',
|
45
|
+
'originalAmount' => '34561',
|
46
|
+
'originalTxnTime' => '2017-01-24T09:00:00',
|
47
|
+
'originalSystemTraceId' => '33',
|
48
|
+
'originalSequenceNumber' => '111111',
|
37
49
|
}
|
38
50
|
|
39
|
-
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<
|
40
|
-
LitleOnlineRequest.new.
|
51
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>5000<\/litleTxnId><card><type>GC<\/type><number>400000000000001<\/number><expDate>0150<\/expDate><cardValidationNum>411<\/cardValidationNum><pin>1234<\/pin><\/card>.*/m), is_a(Hash))
|
52
|
+
LitleOnlineRequest.new.deposit_reversal(hash)
|
41
53
|
end
|
42
54
|
end
|
43
55
|
|
@@ -22,23 +22,35 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
22
22
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
23
|
OTHER DEALINGS IN THE SOFTWARE.
|
24
24
|
=end
|
25
|
-
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
25
|
+
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
26
26
|
require 'test/unit'
|
27
27
|
require 'mocha/setup'
|
28
|
+
|
28
29
|
module LitleOnline
|
29
30
|
class TestDepositReversal < Test::Unit::TestCase
|
30
|
-
|
31
31
|
def test_simple
|
32
32
|
hash = {
|
33
33
|
'merchantId' => '101',
|
34
34
|
'version'=>'8.8',
|
35
35
|
'reportGroup'=>'Planets',
|
36
|
-
'litleTxnId' => '5000'
|
36
|
+
'litleTxnId' => '5000',
|
37
|
+
'card'=>{
|
38
|
+
'type'=>'GC',
|
39
|
+
'number' =>'400000000000001',
|
40
|
+
'expDate' =>'0150',
|
41
|
+
'pin' => '1234',
|
42
|
+
'cardValidationNum' => '411'
|
43
|
+
},
|
44
|
+
'originalRefCode' => '101',
|
45
|
+
'originalAmount' => '34561',
|
46
|
+
'originalTxnTime' => '2017-01-24T09:00:00',
|
47
|
+
'originalSystemTraceId' => '33',
|
48
|
+
'originalSequenceNumber' => '111111',
|
37
49
|
}
|
38
50
|
|
39
|
-
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<
|
51
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>5000<\/litleTxnId><card><type>GC<\/type><number>400000000000001<\/number><expDate>0150<\/expDate><cardValidationNum>411<\/cardValidationNum><pin>1234<\/pin><\/card>.*/m), is_a(Hash))
|
40
52
|
LitleOnlineRequest.new.deposit_reversal(hash)
|
41
53
|
end
|
42
|
-
|
54
|
+
end
|
43
55
|
|
44
56
|
end
|
@@ -79,6 +79,25 @@ module LitleOnline
|
|
79
79
|
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>123456789101112<\/litleTxnId>.*?<amount>12<\/amount><secondaryAmount>1<\/secondaryAmount>.*/m), is_a(Hash))
|
80
80
|
LitleOnlineRequest.new.echeck_credit(hash)
|
81
81
|
end
|
82
|
+
|
83
|
+
def test_echeck_credit_with_customIdentifier
|
84
|
+
hash = {
|
85
|
+
'merchantId' => '101',
|
86
|
+
'version'=>'8.8',
|
87
|
+
'reportGroup'=>'Planets',
|
88
|
+
'amount'=>'123',
|
89
|
+
'secondaryAmount'=>'1',
|
90
|
+
'verify'=>'true',
|
91
|
+
'orderId'=>'12345',
|
92
|
+
'orderSource'=>'ecommerce',
|
93
|
+
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
|
94
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
|
95
|
+
'merchantData'=>{'campaign'=>'camping'},
|
96
|
+
'customIdentifier' =>'identifier',
|
97
|
+
}
|
98
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<customIdentifier>identifier<\/customIdentifier>.*/m), is_a(Hash))
|
99
|
+
LitleOnlineRequest.new.echeck_credit(hash)
|
100
|
+
end
|
82
101
|
|
83
102
|
end
|
84
103
|
end
|
@@ -90,5 +90,20 @@ module LitleOnline
|
|
90
90
|
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<\/echeck>.*<merchantData>.*<campaign>camping<\/campaign>.*<\/merchantData>/m), is_a(Hash))
|
91
91
|
LitleOnlineRequest.new.echeck_redeposit(hash)
|
92
92
|
end
|
93
|
+
|
94
|
+
def test_customIdentifier
|
95
|
+
hash = {
|
96
|
+
'merchantData' => {'campaign'=>'camping'},
|
97
|
+
'customIdentifier' =>'identifier',
|
98
|
+
'merchantId' => '101',
|
99
|
+
'version'=>'8.8',
|
100
|
+
'reportGroup'=>'Planets',
|
101
|
+
'litleTxnId'=>'123456',
|
102
|
+
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
103
|
+
}
|
104
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<customIdentifier>identifier<\/customIdentifier>.*/m), is_a(Hash))
|
105
|
+
LitleOnlineRequest.new.echeck_redeposit(hash)
|
106
|
+
end
|
107
|
+
|
93
108
|
end
|
94
109
|
end
|
@@ -78,11 +78,30 @@ module LitleOnline
|
|
78
78
|
'orderId'=>'12345',
|
79
79
|
'orderSource'=>'ecommerce',
|
80
80
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
|
81
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'
|
81
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
|
82
82
|
}
|
83
83
|
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>123<\/amount><secondaryAmount>1<\/secondaryAmount>.*?<echeck>.*?<ccdPaymentInformation>.*<\/ccdPaymentInformation><\/echeck>.*/m), is_a(Hash))
|
84
84
|
LitleOnlineRequest.new.echeck_sale(hash)
|
85
85
|
end
|
86
86
|
|
87
|
+
def test_echeck_sale_with_customIdentifier
|
88
|
+
hash = {
|
89
|
+
'merchantId' => '101',
|
90
|
+
'version'=>'8.8',
|
91
|
+
'reportGroup'=>'Planets',
|
92
|
+
'amount'=>'123',
|
93
|
+
'secondaryAmount'=>'1',
|
94
|
+
'verify'=>'true',
|
95
|
+
'orderId'=>'12345',
|
96
|
+
'orderSource'=>'ecommerce',
|
97
|
+
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
|
98
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
|
99
|
+
'merchantData'=>{'campaign'=>'camping'},
|
100
|
+
'customIdentifier' =>'identifier',
|
101
|
+
}
|
102
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<customIdentifier>identifier<\/customIdentifier>.*/m), is_a(Hash))
|
103
|
+
LitleOnlineRequest.new.echeck_sale(hash)
|
104
|
+
end
|
105
|
+
|
87
106
|
end
|
88
107
|
end
|
@@ -32,7 +32,8 @@ module LitleOnline
|
|
32
32
|
'merchantId' => '101',
|
33
33
|
'version'=>'8.8',
|
34
34
|
'reportGroup'=>'Planets',
|
35
|
-
'
|
35
|
+
'id'=>'12345',
|
36
|
+
#'litleTxnId'=>'123456',
|
36
37
|
'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
37
38
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
38
39
|
}
|
@@ -47,7 +48,8 @@ module LitleOnline
|
|
47
48
|
'merchantId' => '101',
|
48
49
|
'version'=>'8.8',
|
49
50
|
'reportGroup'=>'Planets',
|
50
|
-
'
|
51
|
+
'id'=>'12345',
|
52
|
+
#'litleTxnId'=>'123456',
|
51
53
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
52
54
|
}
|
53
55
|
LitleXmlMapper.expects(:request).with(regexp_matches(/.*(loggedInUser="gdake".*merchantSdk="Ruby;8.14.0")|(merchantSdk="Ruby;8.14.0".*loggedInUser="gdake").*/m), is_a(Hash))
|
@@ -60,7 +62,8 @@ module LitleOnline
|
|
60
62
|
'merchantId' => '101',
|
61
63
|
'version'=>'8.8',
|
62
64
|
'reportGroup'=>'Planets',
|
63
|
-
'
|
65
|
+
'id'=>'12345',
|
66
|
+
#'litleTxnId'=>'123456',
|
64
67
|
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
65
68
|
}
|
66
69
|
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<\/echeck>.*<merchantData>.*<campaign>camping<\/campaign>.*<\/merchantData>/m), is_a(Hash))
|
@@ -0,0 +1,58 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person
|
5
|
+
obtaining a copy of this software and associated documentation
|
6
|
+
files (the "Software"), to deal in the Software without
|
7
|
+
restriction, including without limitation the rights to use,
|
8
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the
|
10
|
+
Software is furnished to do so, subject to the following
|
11
|
+
conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
18
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
20
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
21
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
22
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
24
|
+
=end
|
25
|
+
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
26
|
+
require 'test/unit'
|
27
|
+
require 'mocha/setup'
|
28
|
+
|
29
|
+
module LitleOnline
|
30
|
+
class TestGiftCardAuthReversal < Test::Unit::TestCase
|
31
|
+
def test_simple
|
32
|
+
hash = {
|
33
|
+
'merchantId' => '101',
|
34
|
+
'version'=>'8.8',
|
35
|
+
|
36
|
+
'litleTxnId' => '5000',
|
37
|
+
'card'=>{
|
38
|
+
'type'=>'GC',
|
39
|
+
'number' =>'400000000000001',
|
40
|
+
'expDate' =>'0150',
|
41
|
+
'pin' => '1234',
|
42
|
+
'cardValidationNum' => '411'
|
43
|
+
},
|
44
|
+
'originalRefCode' => '101',
|
45
|
+
'originalAmount' => '34561',
|
46
|
+
'originalTxnTime' => '2017-01-24T09:00:00',
|
47
|
+
'originalSystemTraceId' => '33',
|
48
|
+
'originalSequenceNumber' => '111111',
|
49
|
+
'reportGroup'=>'Planets',
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>5000<\/litleTxnId><card><type>GC<\/type><number>400000000000001<\/number><expDate>0150<\/expDate><cardValidationNum>411<\/cardValidationNum><pin>1234<\/pin><\/card>.*/m), is_a(Hash))
|
54
|
+
LitleOnlineRequest.new.giftCardAuth_reversal(hash)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
@@ -22,23 +22,36 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
22
22
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
23
|
OTHER DEALINGS IN THE SOFTWARE.
|
24
24
|
=end
|
25
|
-
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
25
|
+
require File.expand_path("../../../lib/LitleOnline",__FILE__)
|
26
26
|
require 'test/unit'
|
27
|
+
require 'mocha/setup'
|
27
28
|
|
28
|
-
#test ActivateReversal Transaction
|
29
29
|
module LitleOnline
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
hash = {
|
30
|
+
class TestGiftCardCapture < Test::Unit::TestCase
|
31
|
+
def test_simple
|
32
|
+
hash = {
|
34
33
|
'merchantId' => '101',
|
35
34
|
'version'=>'8.8',
|
36
|
-
'
|
37
|
-
'
|
38
|
-
|
35
|
+
'litleTxnId' => '5000',
|
36
|
+
'card'=>{
|
37
|
+
'type'=>'GC',
|
38
|
+
'number' =>'400000000000001',
|
39
|
+
'expDate' =>'0150',
|
40
|
+
'pin' => '1234',
|
41
|
+
'cardValidationNum' => '411'
|
42
|
+
},
|
43
|
+
'originalRefCode' => '101',
|
44
|
+
'originalAmount' => '34561',
|
45
|
+
'originalTxnTime' => '2017-01-24T09:00:00',
|
46
|
+
'originalSystemTraceId' => '33',
|
47
|
+
'originalSequenceNumber' => '111111',
|
48
|
+
'reportGroup'=>'Planets',
|
49
|
+
|
50
|
+
}
|
39
51
|
|
40
|
-
|
41
|
-
|
52
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>5000<\/litleTxnId><card><type>GC<\/type><number>400000000000001<\/number><expDate>0150<\/expDate><cardValidationNum>411<\/cardValidationNum><pin>1234<\/pin><\/card>.*/m), is_a(Hash))
|
53
|
+
LitleOnlineRequest.new.giftCardCapture(hash)
|
54
|
+
end
|
42
55
|
end
|
43
|
-
|
56
|
+
|
44
57
|
end
|