LitleOnline 8.12.0 → 8.12.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +28 -0
- data/Rakefile +2 -3
- data/lib/Communications.rb +14 -12
- data/lib/LitleOnline.rb +11 -2
- data/lib/LitleOnlineRequest.rb +435 -284
- data/lib/LitleXmlMapper.rb +1 -2
- data/lib/XMLFields.rb +900 -307
- data/lib/cacert.pem +3331 -0
- data/test/certification/certTest2_authenhanced.rb +7 -7
- data/test/certification/certTest5_token.rb +8 -8
- data/test/functional/test_auth.rb +106 -3
- data/test/functional/test_authReversal.rb +5 -6
- data/test/functional/test_capture.rb +12 -1
- data/test/functional/test_captureGivenAuth.rb +25 -5
- data/test/functional/test_credit.rb +1 -1
- data/test/functional/test_echeckRedeposit.rb +34 -0
- data/test/functional/test_echeckVerification.rb +33 -0
- data/test/functional/test_forceCapture.rb +35 -0
- data/test/functional/test_sale.rb +45 -13
- data/test/functional/test_xmlfields.rb +197 -10
- data/test/functional/ts_all.rb +2 -0
- data/test/unit/test_LitleOnlineRequest.rb +2 -59
- data/test/unit/test_auth.rb +2 -51
- data/test/unit/test_authReversal.rb +10 -5
- data/test/unit/test_capture.rb +5 -7
- data/test/unit/test_captureGivenAuth.rb +0 -19
- data/test/unit/test_credit.rb +1 -0
- data/test/unit/test_echeckCredit.rb +0 -2
- data/test/unit/test_echeckRedeposit.rb +0 -34
- data/test/unit/test_echeckSale.rb +0 -1
- data/test/unit/test_echeckVerification.rb +0 -33
- data/test/unit/test_forceCapture.rb +0 -35
- data/test/unit/test_sale.rb +20 -51
- data/test/unit/test_xmlfields.rb +44 -84
- data/test/unit/ts_unit.rb +1 -1
- metadata +13 -26
- data/index.html +0 -176
- data/index.html.1 +0 -176
- data/lib/Checker.rb +0 -56
- data/test/unit/test_Checker.rb +0 -58
data/test/unit/test_auth.rb
CHANGED
@@ -24,25 +24,10 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
24
24
|
=end
|
25
25
|
require 'lib/LitleOnline'
|
26
26
|
require 'test/unit'
|
27
|
+
require 'mocha'
|
27
28
|
|
28
29
|
#test Authorization Transaction
|
29
30
|
class TestAuth < Test::Unit::TestCase
|
30
|
-
def test_no_order_id
|
31
|
-
hash = {
|
32
|
-
'merchantId' => '101',
|
33
|
-
'version'=>'8.8',
|
34
|
-
'reportGroup'=>'Planets',
|
35
|
-
'amount'=>'106',
|
36
|
-
'orderSource'=>'ecommerce',
|
37
|
-
'card'=>{
|
38
|
-
'type'=>'VI',
|
39
|
-
'number' =>'4100000000000001',
|
40
|
-
'expDate' =>'1210'
|
41
|
-
}}
|
42
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
43
|
-
assert_match /Missing Required Field: orderId!!!!/, exception.message
|
44
|
-
end
|
45
|
-
|
46
31
|
def test_success_re_auth
|
47
32
|
hash = {
|
48
33
|
'merchantId' => '101',
|
@@ -51,44 +36,10 @@ class TestAuth < Test::Unit::TestCase
|
|
51
36
|
'litleTxnId'=>'123456'
|
52
37
|
}
|
53
38
|
|
54
|
-
|
55
|
-
Communications.expects(:http_post).with(regexp_matches(/.*litleTxnId.*/m),kind_of(Hash))
|
39
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>123456<\/litleTxnId>.*/m), is_a(Hash))
|
56
40
|
LitleOnlineRequest.new.authorization(hash)
|
57
41
|
end
|
58
42
|
|
59
|
-
def test_no_amount
|
60
|
-
hash = {
|
61
|
-
'merchantId' => '101',
|
62
|
-
'version'=>'8.8',
|
63
|
-
'reportGroup'=>'Planets',
|
64
|
-
# 'litleTxnId'=>'123456',
|
65
|
-
'orderId'=>'12344',
|
66
|
-
'orderSource'=>'ecommerce',
|
67
|
-
'card'=>{
|
68
|
-
'type'=>'VI',
|
69
|
-
'number' =>'4100000000000001',
|
70
|
-
'expDate' =>'1210'
|
71
|
-
}}
|
72
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
73
|
-
assert_match /Missing Required Field: amount!!!!/, exception.message
|
74
|
-
end
|
75
|
-
|
76
|
-
def test_no_order_source
|
77
|
-
hash = {
|
78
|
-
'merchantId' => '101',
|
79
|
-
'version'=>'8.8',
|
80
|
-
'reportGroup'=>'Planets',
|
81
|
-
# 'litleTxnId'=>'123456',
|
82
|
-
'orderId'=>'12344',
|
83
|
-
'amount'=>'106',
|
84
|
-
'card'=>{
|
85
|
-
'type'=>'VI',
|
86
|
-
'number' =>'4100000000000001',
|
87
|
-
'expDate' =>'1210'
|
88
|
-
}}
|
89
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
90
|
-
assert_match /Missing Required Field: orderSource!!!!/, exception.message
|
91
|
-
end
|
92
43
|
|
93
44
|
def test_both_choices_card_and_paypal
|
94
45
|
hash = {
|
@@ -24,18 +24,23 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
24
24
|
=end
|
25
25
|
require 'lib/LitleOnline'
|
26
26
|
require 'test/unit'
|
27
|
+
require 'mocha'
|
27
28
|
|
28
29
|
class TestAuthReversal < Test::Unit::TestCase
|
29
|
-
def
|
30
|
+
def test_invalid_field
|
30
31
|
hash = {
|
31
32
|
'merchantId' => '101',
|
32
33
|
'version'=>'8.8',
|
33
|
-
'
|
34
|
+
'litleTxnId'=>'12345678000',
|
35
|
+
'NonexistentField'=>'none',
|
36
|
+
'payPalNotes'=>'Notes',
|
34
37
|
'amount'=>'106',
|
35
|
-
'
|
38
|
+
'reportGroup'=>'Planets',
|
36
39
|
}
|
37
|
-
|
38
|
-
|
40
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>12345678000<\/litleTxnId>.*/m), is_a(Hash))
|
41
|
+
LitleOnlineRequest.new.auth_reversal(hash)
|
42
|
+
|
39
43
|
end
|
44
|
+
|
40
45
|
|
41
46
|
end
|
data/test/unit/test_capture.rb
CHANGED
@@ -26,15 +26,13 @@ require 'lib/LitleOnline'
|
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
28
|
class Test_capture < Test::Unit::TestCase
|
29
|
-
def
|
29
|
+
def test_success_capture
|
30
30
|
hash = {
|
31
|
-
'
|
32
|
-
'version'=>'8.8',
|
33
|
-
'reportGroup'=>'Planets',
|
34
|
-
'amount'=>'106',
|
31
|
+
'litleTxnId'=>'123456'
|
35
32
|
}
|
36
|
-
|
37
|
-
|
33
|
+
|
34
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>123456<\/litleTxnId>.*/m), is_a(Hash))
|
35
|
+
LitleOnlineRequest.new.capture(hash)
|
38
36
|
end
|
39
37
|
end
|
40
38
|
|
@@ -26,25 +26,6 @@ require 'lib/LitleOnline'
|
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
28
|
class TestcaptureGivenAuth < Test::Unit::TestCase
|
29
|
-
def test_no_amount
|
30
|
-
hash = {
|
31
|
-
'merchantId' => '101',
|
32
|
-
'version'=>'8.8',
|
33
|
-
'reportGroup'=>'Planets',
|
34
|
-
'orderId'=>'12344',
|
35
|
-
'authInformation' => {
|
36
|
-
'authDate'=>'2002-10-09','authCode'=>'543216',
|
37
|
-
'authAmount'=>'12345'
|
38
|
-
},
|
39
|
-
'orderSource'=>'ecommerce',
|
40
|
-
'card'=>{
|
41
|
-
'type'=>'VI',
|
42
|
-
'number' =>'4100000000000001',
|
43
|
-
'expDate' =>'1210'
|
44
|
-
}}
|
45
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture_given_auth(hash)}
|
46
|
-
assert_match /Missing Required Field: amount!!!!/, exception.message
|
47
|
-
end
|
48
29
|
|
49
30
|
def test_both_choices_card_and_token
|
50
31
|
hash = {
|
data/test/unit/test_credit.rb
CHANGED
@@ -26,40 +26,6 @@ require 'lib/LitleOnline'
|
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
28
|
class Test_echeckRedeposit < Test::Unit::TestCase
|
29
|
-
def test_no_txn_id
|
30
|
-
hash = {
|
31
|
-
'merchantId' => '101',
|
32
|
-
'version'=>'8.8',
|
33
|
-
'reportGroup'=>'Planets',
|
34
|
-
}
|
35
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_redeposit(hash)}
|
36
|
-
assert_match /Missing Required Field: litleTxnId!!!!/, exception.message
|
37
|
-
end
|
38
|
-
|
39
|
-
def test_echeck_redeposit_withecheckmissingfield
|
40
|
-
hash = {
|
41
|
-
'merchantId' => '101',
|
42
|
-
'version'=>'8.8',
|
43
|
-
'reportGroup'=>'Planets',
|
44
|
-
'litleTxnId'=>'123456',
|
45
|
-
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','checkNum'=>'123455'}
|
46
|
-
}
|
47
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_redeposit(hash)}
|
48
|
-
assert_match /Missing Required Field: routingNum!!!!/, exception.message
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_echeck_redeposit_with_echeck_token_missing_field
|
52
|
-
hash = {
|
53
|
-
'merchantId' => '101',
|
54
|
-
'version'=>'8.8',
|
55
|
-
'reportGroup'=>'Planets',
|
56
|
-
'litleTxnId'=>'123456',
|
57
|
-
'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','checkNum'=>'123455'}
|
58
|
-
}
|
59
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_redeposit(hash)}
|
60
|
-
assert_match /Missing Required Field: routingNum!!!!/, exception.message
|
61
|
-
end
|
62
|
-
|
63
29
|
def test_echeck_redeposit_with_both
|
64
30
|
hash = {
|
65
31
|
'merchantId' => '101',
|
@@ -26,39 +26,6 @@ require 'lib/LitleOnline'
|
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
28
|
class Test_echeckVerification < Test::Unit::TestCase
|
29
|
-
def test_no_amount
|
30
|
-
hash = {
|
31
|
-
'merchantId' => '101',
|
32
|
-
'version'=>'8.8',
|
33
|
-
'reportGroup'=>'Planets',
|
34
|
-
'orderId'=>'12345'
|
35
|
-
}
|
36
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_verification(hash)}
|
37
|
-
assert_match /Missing Required Field: amount!!!!/, exception.message
|
38
|
-
end
|
39
|
-
|
40
|
-
def test_no_order_id
|
41
|
-
hash = {
|
42
|
-
'merchantId' => '101',
|
43
|
-
'version'=>'8.8',
|
44
|
-
'reportGroup'=>'Planets',
|
45
|
-
}
|
46
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_verification(hash)}
|
47
|
-
assert_match /Missing Required Field: orderId!!!!/, exception.message
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_no_order_source
|
51
|
-
hash = {
|
52
|
-
'merchantId' => '101',
|
53
|
-
'version'=>'8.8',
|
54
|
-
'reportGroup'=>'Planets',
|
55
|
-
'amount'=>'123456',
|
56
|
-
'orderId'=>'12345'
|
57
|
-
}
|
58
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_verification(hash)}
|
59
|
-
assert_match /Missing Required Field: orderSource!!!/, exception.message
|
60
|
-
end
|
61
|
-
|
62
29
|
def test_echeck_verification_with_both
|
63
30
|
hash = {
|
64
31
|
'merchantId' => '101',
|
@@ -26,41 +26,6 @@ require 'lib/LitleOnline'
|
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
28
|
class TestForceCapture < Test::Unit::TestCase
|
29
|
-
def test_no_order_id
|
30
|
-
hash = {
|
31
|
-
'merchantId' => '101',
|
32
|
-
'version'=>'8.8',
|
33
|
-
'reportGroup'=>'Planets',
|
34
|
-
'litleTxnId'=>'123456',
|
35
|
-
'amount'=>'106',
|
36
|
-
'orderSource'=>'ecommerce',
|
37
|
-
'token'=> {
|
38
|
-
'litleToken'=>'123456789101112',
|
39
|
-
'expDate'=>'1210',
|
40
|
-
'cardValidationNum'=>'555',
|
41
|
-
'type'=>'VI'
|
42
|
-
}}
|
43
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.force_capture(hash)}
|
44
|
-
assert_match /Missing Required Field: orderId!!!!/, exception.message
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_no_order_source
|
48
|
-
hash = {
|
49
|
-
'merchantId' => '101',
|
50
|
-
'version'=>'8.8',
|
51
|
-
'reportGroup'=>'Planets',
|
52
|
-
'litleTxnId'=>'123456',
|
53
|
-
'orderId'=>'12344',
|
54
|
-
'amount'=>'106',
|
55
|
-
'card'=>{
|
56
|
-
'type'=>'VI',
|
57
|
-
'number' =>'4100000000000001',
|
58
|
-
'expDate' =>'1210'
|
59
|
-
}}
|
60
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.force_capture(hash)}
|
61
|
-
assert_match /Missing Required Field: orderSource!!!!/, exception.message
|
62
|
-
end
|
63
|
-
|
64
29
|
def test_both_choices_card_and_token
|
65
30
|
hash = {
|
66
31
|
'merchantId' => '101',
|
data/test/unit/test_sale.rb
CHANGED
@@ -24,60 +24,10 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
24
24
|
=end
|
25
25
|
require 'lib/LitleOnline'
|
26
26
|
require 'test/unit'
|
27
|
+
require 'mocha'
|
27
28
|
|
28
29
|
class TestSale < Test::Unit::TestCase
|
29
30
|
|
30
|
-
def test_no_order_id
|
31
|
-
hash = {
|
32
|
-
'merchantId' => '101',
|
33
|
-
'version'=>'8.8',
|
34
|
-
'reportGroup'=>'Planets',
|
35
|
-
'litleTxnId'=>'123456',
|
36
|
-
'amount'=>'106',
|
37
|
-
'orderSource'=>'ecommerce',
|
38
|
-
'card'=>{
|
39
|
-
'type'=>'VI',
|
40
|
-
'number' =>'4100000000000002',
|
41
|
-
'expDate' =>'1210'
|
42
|
-
}}
|
43
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
|
44
|
-
assert_match /Missing Required Field: orderId!!!!/, exception.message
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_no_amount
|
48
|
-
hash = {
|
49
|
-
'merchantId' => '101',
|
50
|
-
'version'=>'8.8',
|
51
|
-
'reportGroup'=>'Planets',
|
52
|
-
'litleTxnId'=>'123456',
|
53
|
-
'orderId'=>'12344',
|
54
|
-
'orderSource'=>'ecommerce',
|
55
|
-
'card'=>{
|
56
|
-
'type'=>'VI',
|
57
|
-
'number' =>'4100000000000002',
|
58
|
-
'expDate' =>'1210'
|
59
|
-
}}
|
60
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
|
61
|
-
assert_match /Missing Required Field: amount!!!!/, exception.message
|
62
|
-
end
|
63
|
-
|
64
|
-
def test_no_order_source
|
65
|
-
hash = {
|
66
|
-
'merchantId' => '101',
|
67
|
-
'version'=>'8.8',
|
68
|
-
'reportGroup'=>'Planets',
|
69
|
-
'litleTxnId'=>'123456',
|
70
|
-
'orderId'=>'12344',
|
71
|
-
'amount'=>'106',
|
72
|
-
'card'=>{
|
73
|
-
'type'=>'VI',
|
74
|
-
'number' =>'4100000000000002',
|
75
|
-
'expDate' =>'1210'
|
76
|
-
}}
|
77
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
|
78
|
-
assert_match /Missing Required Field: orderSource!!!!/, exception.message
|
79
|
-
end
|
80
|
-
|
81
31
|
def test_both_choices_fraud_check_and_card_holder
|
82
32
|
hash = {
|
83
33
|
'merchantId' => '101',
|
@@ -263,5 +213,24 @@ class TestSale < Test::Unit::TestCase
|
|
263
213
|
LitleOnlineRequest.new.sale(hash)
|
264
214
|
end
|
265
215
|
|
216
|
+
def test_invalid_embedded_field_values
|
217
|
+
#becasue there are sub fields under fraud check that are not specified
|
218
|
+
hash = {
|
219
|
+
'merchantId' => '101',
|
220
|
+
'version'=>'8.8',
|
221
|
+
'reportGroup'=>'Planets',
|
222
|
+
'litleTxnId'=>'123456',
|
223
|
+
'orderId'=>'12344',
|
224
|
+
'amount'=>'106',
|
225
|
+
'orderSource'=>'ecommerce',
|
226
|
+
'fraudCheck'=>'one',
|
227
|
+
'cardholderAuthentication'=>'two',
|
228
|
+
'card'=>{
|
229
|
+
'type'=>'VI',
|
230
|
+
'number' =>'4100000000000000',
|
231
|
+
}}
|
232
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
|
233
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
234
|
+
end
|
266
235
|
end
|
267
236
|
|
data/test/unit/test_xmlfields.rb
CHANGED
@@ -24,28 +24,9 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
24
24
|
=end
|
25
25
|
require 'lib/LitleOnline'
|
26
26
|
require 'test/unit'
|
27
|
+
require 'mocha'
|
27
28
|
|
28
29
|
class TestXmlfields < Test::Unit::TestCase
|
29
|
-
|
30
|
-
def test_cardbothtypeandtrack
|
31
|
-
hash = {
|
32
|
-
'merchantId' => '101',
|
33
|
-
'version'=>'8.8',
|
34
|
-
'reportGroup'=>'Planets',
|
35
|
-
'litleTxnId'=>'123456',
|
36
|
-
'orderId'=>'12344',
|
37
|
-
'amount'=>'106',
|
38
|
-
'orderSource'=>'ecommerce',
|
39
|
-
'card'=>{
|
40
|
-
'type'=>'VI',
|
41
|
-
'track'=>'1234',
|
42
|
-
'number' =>'4100000000000001',
|
43
|
-
'expDate' =>'1210'
|
44
|
-
}}
|
45
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
|
46
|
-
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
47
|
-
end
|
48
|
-
|
49
30
|
def test_custom_billing_with_two_choices
|
50
31
|
hash = {
|
51
32
|
'merchantId' => '101',
|
@@ -84,88 +65,67 @@ class TestXmlfields < Test::Unit::TestCase
|
|
84
65
|
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
85
66
|
end
|
86
67
|
|
87
|
-
def
|
68
|
+
def test_line_item_data
|
88
69
|
hash = {
|
89
70
|
'merchantId' => '101',
|
90
71
|
'version'=>'8.8',
|
91
72
|
'reportGroup'=>'Planets',
|
92
|
-
'
|
93
|
-
|
94
|
-
'
|
95
|
-
'
|
96
|
-
'
|
97
|
-
|
98
|
-
}
|
99
|
-
|
100
|
-
assert_match /Missing Required Field: payerId!!!!/, exception.message
|
101
|
-
end
|
73
|
+
'enhancedData'=>
|
74
|
+
{
|
75
|
+
'lineItemData'=>[
|
76
|
+
{'itemSequenceNumber'=>'1', 'itemDescription'=>'desc1'},
|
77
|
+
{'itemSequenceNumber'=>'2', 'itemDescription'=>'desc2'}
|
78
|
+
]
|
79
|
+
}
|
80
|
+
}
|
102
81
|
|
103
|
-
|
104
|
-
hash
|
105
|
-
'merchantId' => '101',
|
106
|
-
'version'=>'8.8',
|
107
|
-
'reportGroup'=>'Planets',
|
108
|
-
'orderId'=>'12344',
|
109
|
-
'amount'=>'106',
|
110
|
-
'orderSource'=>'ecommerce',
|
111
|
-
'paypal'=>{
|
112
|
-
'token'=>'1234',
|
113
|
-
'payerId'=>'123456'
|
114
|
-
}}
|
115
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
116
|
-
assert_match /Missing Required Field: transactionId!!!!/, exception.message
|
82
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<enhancedData>.*<lineItemData>.*<itemSequenceNumber>1<\/itemSequenceNumber>.*<itemDescription>desc1<\/itemDescription>.*<\/lineItemData>.*<lineItemData>.*<itemSequenceNumber>2<\/itemSequenceNumber>.*<itemDescription>desc2<\/itemDescription>.*<\/lineItemData>.*<\/enhancedData>.*/m), is_a(Hash))
|
83
|
+
LitleOnlineRequest.new.authorization(hash)
|
117
84
|
end
|
118
85
|
|
119
|
-
def
|
86
|
+
def test_detail_tax
|
120
87
|
hash = {
|
121
88
|
'merchantId' => '101',
|
122
89
|
'version'=>'8.8',
|
123
90
|
'reportGroup'=>'Planets',
|
124
|
-
'
|
125
|
-
|
126
|
-
'
|
127
|
-
|
128
|
-
'
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
}}
|
133
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
|
134
|
-
assert_match /Missing Required Field: capability!!!!/, exception.message
|
135
|
-
end
|
91
|
+
'enhancedData'=>
|
92
|
+
{
|
93
|
+
'detailTax'=>[
|
94
|
+
{'taxIncludedInTotal'=>'true', 'taxTypeIdentifier'=>'00'},
|
95
|
+
{'taxIncludedInTotal'=>'false', 'taxTypeIdentifier'=>'01'}
|
96
|
+
]
|
97
|
+
}
|
98
|
+
}
|
136
99
|
|
137
|
-
|
138
|
-
hash
|
139
|
-
'merchantId' => '101',
|
140
|
-
'version'=>'8.8',
|
141
|
-
'reportGroup'=>'Planets',
|
142
|
-
'orderId'=>'12344',
|
143
|
-
'amount'=>'106',
|
144
|
-
'orderSource'=>'ecommerce',
|
145
|
-
'token'=> {
|
146
|
-
'expDate'=>'1210',
|
147
|
-
'cardValidationNum'=>'555',
|
148
|
-
'type'=>'VI'
|
149
|
-
}}
|
150
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
151
|
-
assert_match /Missing Required Field: litleToken!!!!/, exception.message
|
100
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<enhancedData>.*<detailTax>.*<taxIncludedInTotal>true<\/taxIncludedInTotal>.*<taxTypeIdentifier>00<\/taxTypeIdentifier>.*<\/detailTax>.*<detailTax>.*<taxIncludedInTotal>false<\/taxIncludedInTotal>.*<taxTypeIdentifier>01<\/taxTypeIdentifier>.*<\/detailTax>.*<\/enhancedData>.*/m), is_a(Hash))
|
101
|
+
LitleOnlineRequest.new.authorization(hash)
|
152
102
|
end
|
153
103
|
|
154
|
-
def
|
104
|
+
def test_detail_tax_in_lineItem
|
155
105
|
hash = {
|
156
106
|
'merchantId' => '101',
|
157
107
|
'version'=>'8.8',
|
158
108
|
'reportGroup'=>'Planets',
|
159
|
-
'
|
160
|
-
|
161
|
-
'
|
162
|
-
'
|
163
|
-
'
|
164
|
-
'
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
109
|
+
'enhancedData'=>
|
110
|
+
{
|
111
|
+
'lineItemData'=>[
|
112
|
+
{'itemSequenceNumber'=>'1', 'itemDescription'=>'desc1','detailTax'=>[
|
113
|
+
{'taxAmount'=>'1'},
|
114
|
+
{'taxAmount'=>'2'}]
|
115
|
+
},
|
116
|
+
{'itemSequenceNumber'=>'2', 'itemDescription'=>'desc2','detailTax'=>[
|
117
|
+
{'taxAmount'=>'3'},
|
118
|
+
{'taxAmount'=>'4'}]
|
119
|
+
}],
|
120
|
+
'detailTax'=>[
|
121
|
+
{'taxAmount'=>'5'},
|
122
|
+
{'taxAmount'=>'6'}
|
123
|
+
]}
|
124
|
+
}
|
125
|
+
|
126
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<enhancedData>.*<detailTax>.*<taxAmount>5<\/taxAmount>.*<\/detailTax>.*<detailTax>.*<taxAmount>6<\/taxAmount>.*<\/detailTax>.*<lineItemData>.*<itemSequenceNumber>1<\/itemSequenceNumber>.*<itemDescription>desc1<\/itemDescription>.*<detailTax>.*<taxAmount>1<\/taxAmount>.*<\/detailTax>.*<detailTax>.*<taxAmount>2<\/taxAmount>.*<\/detailTax>.*<\/lineItemData>.*<lineItemData>.*<itemSequenceNumber>2<\/itemSequenceNumber>.*<itemDescription>desc2<\/itemDescription>.*<detailTax>.*<taxAmount>3<\/taxAmount>.*<\/detailTax>.*<detailTax>.*<taxAmount>4<\/taxAmount>.*<\/detailTax>.*<\/lineItemData>.*<\/enhancedData>.*/m), is_a(Hash))
|
127
|
+
LitleOnlineRequest.new.authorization(hash)
|
169
128
|
end
|
129
|
+
|
170
130
|
end
|
171
131
|
|