LitleOnline 10.1.1 → 11.0.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG +13 -6
- data/DESCRIPTION +2 -2
- data/LICENSE +1 -1
- data/README.md +8 -8
- data/Rakefile +6 -7
- data/SETUP.md +4 -4
- data/bin/Setup.rb +4 -4
- data/bin/sample_batch_driver.rb +1 -1
- data/bin/sample_driver.rb +1 -1
- data/lib/Communications.rb +5 -5
- data/lib/Configuration.rb +1 -1
- data/lib/LitleBatchRequest.rb +39 -1
- data/lib/LitleListeners.rb +2 -2
- data/lib/LitleOnline.rb +1 -1
- data/lib/LitleOnlineRequest.rb +22 -3
- data/lib/LitleRequest.rb +4 -4
- data/lib/LitleTransaction.rb +156 -47
- data/lib/LitleXmlMapper.rb +8 -1
- data/lib/XMLFields.rb +252 -51
- data/temp.xml +21 -0
- data/test/certification/certTest1_base.rb +52 -52
- data/test/certification/certTest2_authenhanced.rb +20 -20
- data/test/certification/certTest3_authreversal.rb +16 -16
- data/test/certification/certTest4_echeck.rb +18 -12
- data/test/certification/certTest5_token.rb +3 -3
- data/test/certification/certTest_batchAll.rb +9 -1
- data/test/certification/ts_all.rb +1 -1
- data/test/functional/test_activate.rb +34 -5
- data/test/functional/test_activateReversal.rb +23 -7
- data/test/functional/test_auth.rb +126 -17
- data/test/functional/test_authReversal.rb +5 -3
- data/test/functional/test_balanceInquiry.rb +30 -5
- data/test/functional/test_batch.rb +1 -1
- data/test/functional/test_batchStream.rb +1 -1
- data/test/functional/test_cancelSubscription.rb +5 -3
- data/test/functional/test_capture.rb +37 -2
- data/test/functional/test_captureGivenAuth.rb +54 -3
- data/test/functional/test_configuration.rb +1 -1
- data/test/functional/test_createPlan.rb +5 -3
- data/test/functional/test_credit.rb +17 -1
- data/test/functional/test_deactivate.rb +28 -5
- data/test/functional/test_deactivateReversal.rb +21 -7
- data/test/functional/test_depositReversal.rb +30 -18
- data/test/functional/test_echeckCredit.rb +29 -5
- data/test/functional/test_echeckRedeposit.rb +28 -3
- data/test/functional/test_echeckSale.rb +43 -7
- data/test/functional/test_echeckVerification.rb +34 -8
- data/test/functional/test_echeckVoid.rb +2 -2
- data/test/functional/test_forceCapture.rb +36 -8
- data/test/functional/test_fraudCheck.rb +12 -14
- 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 +1 -1
- data/test/functional/test_load.rb +29 -5
- data/test/functional/test_loadReversal.rb +21 -7
- data/test/functional/test_override.rb +4 -3
- data/test/functional/test_queryTransaction.rb +24 -18
- data/test/functional/test_refundReversal.rb +21 -7
- data/test/functional/test_sale.rb +86 -9
- data/test/functional/test_token.rb +26 -11
- data/test/functional/test_unload.rb +29 -5
- data/test/functional/test_unloadReversal.rb +21 -7
- data/test/functional/test_updateCardValidationNumOnToken.rb +1 -1
- data/test/functional/test_updatePlan.rb +5 -3
- data/test/functional/test_updateSubscription.rb +5 -3
- data/test/functional/test_wallet.rb +1 -1
- data/test/functional/test_xmlfields.rb +9 -5
- data/test/functional/ts_all.rb +1 -1
- data/test/unit/test_LitleAUBatch.rb +1 -1
- data/test/unit/test_LitleBatchRequest.rb +1 -1
- data/test/unit/test_LitleOnlineRequest.rb +15 -57
- data/test/unit/test_LitleRequest.rb +1 -1
- data/test/unit/test_LitleTransaction.rb +3 -3
- data/test/unit/test_LitleXmlMapper.rb +139 -0
- data/test/unit/test_activate.rb +5 -5
- data/test/unit/test_activateReversal.rb +16 -4
- data/test/unit/test_auth.rb +50 -9
- data/test/unit/test_authReversal.rb +1 -1
- data/test/unit/test_balanceInquiry.rb +3 -3
- data/test/unit/test_cancelSubscription.rb +1 -1
- data/test/unit/test_capture.rb +27 -1
- data/test/unit/test_captureGivenAuth.rb +47 -1
- data/test/unit/test_createPlan.rb +1 -1
- data/test/unit/test_credit.rb +16 -3
- data/test/unit/test_deactivate.rb +20 -1
- data/test/unit/test_deactivateReversal.rb +16 -4
- data/test/unit/test_depositReversal.rb +18 -6
- data/test/unit/test_echeckCredit.rb +20 -1
- data/test/unit/test_echeckRedeposit.rb +16 -1
- data/test/unit/test_echeckSale.rb +20 -1
- data/test/unit/test_echeckVerification.rb +7 -4
- data/test/unit/test_echeckVoid.rb +1 -1
- data/test/unit/test_forceCapture.rb +19 -1
- data/test/unit/test_fraudCheck.rb +1 -1
- data/test/unit/test_giftCardAuthReversal.rb +58 -0
- data/test/unit/test_giftCardCapture.rb +57 -0
- data/test/unit/test_giftCardCredit.rb +57 -0
- data/test/unit/test_load.rb +3 -3
- data/test/unit/test_loadReversal.rb +16 -4
- data/test/unit/test_queryTransaction.rb +5 -22
- data/test/unit/test_refundReversal.rb +16 -4
- data/test/unit/test_sale.rb +90 -5
- data/test/unit/test_token.rb +35 -24
- data/test/unit/test_unload.rb +3 -3
- data/test/unit/test_unloadReversal.rb +16 -4
- data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
- data/test/unit/test_updatePlan.rb +1 -1
- data/test/unit/test_updateSubscription.rb +1 -1
- data/test/unit/test_wallet.rb +1 -1
- data/test/unit/test_xmlfields.rb +1 -1
- data/test/unit/ts_unit.rb +1 -1
- metadata +18 -10
data/test/unit/test_credit.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -129,8 +129,7 @@ module LitleOnline
|
|
129
129
|
'reportGroup'=>'Planets',
|
130
130
|
'actionReason'=> 'SUSPECT_FRAUD'
|
131
131
|
}
|
132
|
-
|
133
|
-
Communications.expects(:http_post).with(regexp_matches(/.*<actionReason>SUSPECT_FRAUD<\/actionReason>.*/m),kind_of(Hash))
|
132
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<actionReason>SUSPECT_FRAUD<\/actionReason>.*/m), is_a(Hash))
|
134
133
|
LitleOnlineRequest.new.credit(hash)
|
135
134
|
end
|
136
135
|
|
@@ -338,5 +337,19 @@ module LitleOnline
|
|
338
337
|
LitleOnlineRequest.new.credit(hash)
|
339
338
|
end
|
340
339
|
|
340
|
+
def test_pin
|
341
|
+
hash = {
|
342
|
+
'merchantId' => '101',
|
343
|
+
'version'=>'8.8',
|
344
|
+
'reportGroup'=>'Planets',
|
345
|
+
'amount'=>'106',
|
346
|
+
'secondaryAmount'=>'20',
|
347
|
+
'litleTxnId'=>'1234',
|
348
|
+
'pin'=>'3333'
|
349
|
+
}
|
350
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<pin>3333<\/pin>.*/m), is_a(Hash))
|
351
|
+
LitleOnlineRequest.new.credit(hash)
|
352
|
+
end
|
353
|
+
|
341
354
|
end
|
342
355
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -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',
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -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
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -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
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -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
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -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
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -84,5 +84,24 @@ module LitleOnline
|
|
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
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -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))
|
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
2
|
+
Copyright (c) 2017 Vantiv eCommerce
|
3
3
|
|
4
4
|
Permission is hereby granted, free of charge, to any person
|
5
5
|
obtaining a copy of this software and associated documentation
|
@@ -140,6 +140,24 @@ def test_secondary_amount
|
|
140
140
|
LitleOnlineRequest.new.force_capture(hash)
|
141
141
|
end
|
142
142
|
|
143
|
+
def test_processing_type
|
144
|
+
hash = {
|
145
|
+
'merchantId' => '101',
|
146
|
+
'version'=>'8.8',
|
147
|
+
'reportGroup'=>'Planets',
|
148
|
+
'orderId'=>'12344',
|
149
|
+
'amount'=>'106',
|
150
|
+
'orderSource'=>'ecommerce',
|
151
|
+
'processingType'=>'accountFunding',
|
152
|
+
'card'=>{
|
153
|
+
'type'=>'VI',
|
154
|
+
'number' =>'4100000000000001',
|
155
|
+
'expDate' =>'1210'
|
156
|
+
}}
|
157
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>accountFunding<\/processingType>.*/m), is_a(Hash))
|
158
|
+
LitleOnlineRequest.new.force_capture(hash)
|
159
|
+
end
|
160
|
+
|
143
161
|
end
|
144
162
|
|
145
163
|
end
|
@@ -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
|
@@ -0,0 +1,57 @@
|
|
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 TestGiftCardCapture < Test::Unit::TestCase
|
31
|
+
def test_simple
|
32
|
+
hash = {
|
33
|
+
'merchantId' => '101',
|
34
|
+
'version'=>'8.8',
|
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
|
+
}
|
51
|
+
|
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
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
@@ -0,0 +1,57 @@
|
|
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 TestGiftCardCredit < Test::Unit::TestCase
|
31
|
+
def test_simple
|
32
|
+
hash = {
|
33
|
+
'merchantId' => '101',
|
34
|
+
'version'=>'8.8',
|
35
|
+
'reportGroup'=>'Planets',
|
36
|
+
'originalRefCode' => '101',
|
37
|
+
'originalAmount' => '34561',
|
38
|
+
'originalTxnTime' => '2017-01-24T09:00:00',
|
39
|
+
'originalSystemTraceId' => '33',
|
40
|
+
'originalSequenceNumber' => '111111',
|
41
|
+
'litleTxnId' => '5000',
|
42
|
+
'creditAmount' =>'1000',
|
43
|
+
'card'=>{
|
44
|
+
'type'=>'GC',
|
45
|
+
'number' =>'400000000000001',
|
46
|
+
'expDate' =>'0150',
|
47
|
+
'pin' => '1234',
|
48
|
+
'cardValidationNum' => '411'
|
49
|
+
},
|
50
|
+
}
|
51
|
+
|
52
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<creditAmount>1000<\/creditAmount><card><type>GC<\/type><number>400000000000001<\/number><expDate>0150<\/expDate><cardValidationNum>411<\/cardValidationNum><pin>1234<\/pin><\/card>.*/m), is_a(Hash))
|
53
|
+
LitleOnlineRequest.new.giftCardCredit(hash)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|