LitleOnline 8.12.3 → 8.12.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/Rakefile +1 -1
- data/lib/Communications.rb +34 -32
- data/lib/Configuration.rb +13 -11
- data/lib/LitleOnline.rb +0 -1
- data/lib/LitleOnlineRequest.rb +546 -543
- data/lib/LitleXmlMapper.rb +17 -15
- data/lib/XMLFields.rb +903 -901
- data/test/certification/certTest1_base.rb +935 -933
- data/test/certification/certTest2_authenhanced.rb +548 -546
- data/test/certification/certTest3_authreversal.rb +179 -177
- data/test/certification/certTest4_echeck.rb +245 -243
- data/test/certification/certTest5_token.rb +198 -196
- data/test/functional/test_auth.rb +205 -204
- data/test/functional/test_authReversal.rb +41 -39
- data/test/functional/test_capture.rb +54 -52
- data/test/functional/test_captureGivenAuth.rb +153 -152
- data/test/functional/test_credit.rb +126 -126
- data/test/functional/test_echeckCredit.rb +88 -87
- data/test/functional/test_echeckRedeposit.rb +85 -84
- data/test/functional/test_echeckSale.rb +132 -131
- data/test/functional/test_echeckVerification.rb +97 -95
- data/test/functional/test_forceCapture.rb +113 -111
- data/test/functional/test_sale.rb +200 -198
- data/test/functional/test_token.rb +75 -73
- data/test/functional/test_xmlfields.rb +558 -558
- data/test/unit/test_LitleOnlineRequest.rb +210 -207
- data/test/unit/test_auth.rb +119 -116
- data/test/unit/test_authReversal.rb +16 -16
- data/test/unit/test_capture.rb +10 -8
- data/test/unit/test_captureGivenAuth.rb +62 -59
- data/test/unit/test_credit.rb +103 -100
- data/test/unit/test_echeckCredit.rb +15 -14
- data/test/unit/test_echeckRedeposit.rb +14 -13
- data/test/unit/test_echeckSale.rb +16 -15
- data/test/unit/test_echeckVerification.rb +14 -13
- data/test/unit/test_forceCapture.rb +61 -58
- data/test/unit/test_sale.rb +206 -205
- data/test/unit/test_token.rb +43 -41
- data/test/unit/test_xmlfields.rb +101 -99
- metadata +58 -77
- data/lib/Obj2xml.rb +0 -37
@@ -26,21 +26,21 @@ require 'lib/LitleOnline'
|
|
26
26
|
require 'test/unit'
|
27
27
|
require 'mocha'
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
end
|
29
|
+
module LitleOnline
|
30
|
+
class TestAuthReversal < Test::Unit::TestCase
|
31
|
+
def test_invalid_field
|
32
|
+
hash = {
|
33
|
+
'merchantId' => '101',
|
34
|
+
'version'=>'8.8',
|
35
|
+
'litleTxnId'=>'12345678000',
|
36
|
+
'NonexistentField'=>'none',
|
37
|
+
'payPalNotes'=>'Notes',
|
38
|
+
'amount'=>'106',
|
39
|
+
'reportGroup'=>'Planets',
|
40
|
+
}
|
41
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>12345678000<\/litleTxnId>.*/m), is_a(Hash))
|
42
|
+
LitleOnlineRequest.new.auth_reversal(hash)
|
44
43
|
|
45
|
-
|
44
|
+
end
|
45
|
+
end
|
46
46
|
end
|
data/test/unit/test_capture.rb
CHANGED
@@ -25,14 +25,16 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
25
25
|
require 'lib/LitleOnline'
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
28
|
+
module LitleOnline
|
29
|
+
class Test_capture < Test::Unit::TestCase
|
30
|
+
def test_success_capture
|
31
|
+
hash = {
|
32
|
+
'litleTxnId'=>'123456'
|
33
|
+
}
|
34
|
+
|
35
|
+
LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>123456<\/litleTxnId>.*/m), is_a(Hash))
|
36
|
+
LitleOnlineRequest.new.capture(hash)
|
37
|
+
end
|
36
38
|
end
|
37
39
|
end
|
38
40
|
|
@@ -25,65 +25,68 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
25
25
|
require 'lib/LitleOnline'
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
|
-
|
28
|
+
module LitleOnline
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
30
|
+
class TestcaptureGivenAuth < Test::Unit::TestCase
|
31
|
+
|
32
|
+
def test_both_choices_card_and_token
|
33
|
+
hash = {
|
34
|
+
'merchantId' => '101',
|
35
|
+
'version'=>'8.8',
|
36
|
+
'reportGroup'=>'Planets',
|
37
|
+
'orderId'=>'12344',
|
38
|
+
'amount'=>'106',
|
39
|
+
'orderSource'=>'ecommerce',
|
40
|
+
'authInformation' => {
|
41
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
42
|
+
'authAmount'=>'12345'
|
43
|
+
},
|
44
|
+
'token'=> {
|
45
|
+
'litleToken'=>'123456789101112',
|
46
|
+
'expDate'=>'1210',
|
47
|
+
'cardValidationNum'=>'555',
|
48
|
+
'type'=>'VI'},
|
49
|
+
'card'=>{
|
50
|
+
'type'=>'VI',
|
51
|
+
'number' =>'4100000000000001',
|
52
|
+
'expDate' =>'1210'
|
53
|
+
}}
|
54
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture_given_auth(hash)}
|
55
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
56
|
+
end
|
57
|
+
|
58
|
+
def test_all_three_choices
|
59
|
+
hash = {
|
60
|
+
'merchantId' => '101',
|
61
|
+
'version'=>'8.8',
|
62
|
+
'reportGroup'=>'Planets',
|
63
|
+
'orderId'=>'12344',
|
64
|
+
'amount'=>'106',
|
65
|
+
'orderSource'=>'ecommerce',
|
66
|
+
'authInformation' => {
|
67
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
68
|
+
'authAmount'=>'12345'
|
69
|
+
},
|
70
|
+
'card'=>{
|
71
|
+
'type'=>'VI',
|
72
|
+
'number' =>'4100000000000001',
|
73
|
+
'expDate' =>'1210'
|
74
|
+
},
|
75
|
+
'paypage'=> {
|
76
|
+
'paypageRegistrationId'=>'1234',
|
77
|
+
'expDate'=>'1210',
|
78
|
+
'cardValidationNum'=>'555',
|
79
|
+
'type'=>'VI'},
|
80
|
+
'token'=> {
|
81
|
+
'litleToken'=>'1234',
|
82
|
+
'expDate'=>'1210',
|
83
|
+
'cardValidationNum'=>'555',
|
84
|
+
'type'=>'VI'
|
85
|
+
}}
|
86
|
+
|
87
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture_given_auth(hash)}
|
88
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
89
|
+
end
|
54
90
|
end
|
55
91
|
|
56
|
-
|
57
|
-
hash = {
|
58
|
-
'merchantId' => '101',
|
59
|
-
'version'=>'8.8',
|
60
|
-
'reportGroup'=>'Planets',
|
61
|
-
'orderId'=>'12344',
|
62
|
-
'amount'=>'106',
|
63
|
-
'orderSource'=>'ecommerce',
|
64
|
-
'authInformation' => {
|
65
|
-
'authDate'=>'2002-10-09','authCode'=>'543216',
|
66
|
-
'authAmount'=>'12345'
|
67
|
-
},
|
68
|
-
'card'=>{
|
69
|
-
'type'=>'VI',
|
70
|
-
'number' =>'4100000000000001',
|
71
|
-
'expDate' =>'1210'
|
72
|
-
},
|
73
|
-
'paypage'=> {
|
74
|
-
'paypageRegistrationId'=>'1234',
|
75
|
-
'expDate'=>'1210',
|
76
|
-
'cardValidationNum'=>'555',
|
77
|
-
'type'=>'VI'},
|
78
|
-
'token'=> {
|
79
|
-
'litleToken'=>'1234',
|
80
|
-
'expDate'=>'1210',
|
81
|
-
'cardValidationNum'=>'555',
|
82
|
-
'type'=>'VI'
|
83
|
-
}}
|
84
|
-
|
85
|
-
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture_given_auth(hash)}
|
86
|
-
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
92
|
+
end
|
data/test/unit/test_credit.rb
CHANGED
@@ -26,106 +26,109 @@ require 'lib/LitleOnline'
|
|
26
26
|
require 'test/unit'
|
27
27
|
require 'mocha'
|
28
28
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
29
|
+
module LitleOnline
|
30
|
+
|
31
|
+
class TestCredit < Test::Unit::TestCase
|
32
|
+
def test_both_choices_card_and_paypal
|
33
|
+
hash = {
|
34
|
+
'merchantId' => '101',
|
35
|
+
'version'=>'8.8',
|
36
|
+
'reportGroup'=>'Planets',
|
37
|
+
'orderId'=>'12344',
|
38
|
+
'amount'=>'106',
|
39
|
+
'orderSource'=>'ecommerce',
|
40
|
+
'card'=>{
|
41
|
+
'type'=>'VI',
|
42
|
+
'number' =>'4100000000000001',
|
43
|
+
'expDate' =>'1210'
|
44
|
+
},
|
45
|
+
'paypal'=>{
|
46
|
+
'payerId'=>'1234',
|
47
|
+
'token'=>'1234',
|
48
|
+
'transactionId'=>'123456'
|
49
|
+
}}
|
50
|
+
|
51
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
52
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_three_choices_card_and_paypage_and_paypal
|
56
|
+
hash = {
|
57
|
+
'merchantId' => '101',
|
58
|
+
'version'=>'8.8',
|
59
|
+
'reportGroup'=>'Planets',
|
60
|
+
'orderId'=>'12344',
|
61
|
+
'amount'=>'106',
|
62
|
+
'orderSource'=>'ecommerce',
|
63
|
+
'card'=>{
|
64
|
+
'type'=>'VI',
|
65
|
+
'number' =>'4100000000000001',
|
66
|
+
'expDate' =>'1210'
|
67
|
+
},
|
68
|
+
'paypage'=> {
|
69
|
+
'paypageRegistrationId'=>'1234',
|
70
|
+
'expDate'=>'1210',
|
71
|
+
'cardValidationNum'=>'555',
|
72
|
+
'type'=>'VI'},
|
73
|
+
'paypal'=>{
|
74
|
+
'payerId'=>'1234',
|
75
|
+
'token'=>'1234',
|
76
|
+
'transactionId'=>'123456'
|
77
|
+
}}
|
78
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
79
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
80
|
+
end
|
81
|
+
|
82
|
+
def test_all_choices_card_and_paypage_and_paypal_and_token
|
83
|
+
hash = {
|
84
|
+
'merchantId' => '101',
|
85
|
+
'version'=>'8.8',
|
86
|
+
'reportGroup'=>'Planets',
|
87
|
+
'litleTxnId'=>'123456',
|
88
|
+
'orderId'=>'12344',
|
89
|
+
'amount'=>'106',
|
90
|
+
'orderSource'=>'ecommerce',
|
91
|
+
'fraudCheck'=>{'authenticationTransactionId'=>'123'},
|
92
|
+
'bypassVelocityCheckcardholderAuthentication'=>{'authenticationTransactionId'=>'123'},
|
93
|
+
'card'=>{
|
94
|
+
'type'=>'VI',
|
95
|
+
'number' =>'4100000000000001',
|
96
|
+
'expDate' =>'1210'
|
97
|
+
},
|
98
|
+
'paypage'=> {
|
99
|
+
'paypageRegistrationId'=>'1234',
|
100
|
+
'expDate'=>'1210',
|
101
|
+
'cardValidationNum'=>'555',
|
102
|
+
'type'=>'VI'},
|
103
|
+
'paypal'=>{
|
104
|
+
'payerId'=>'1234',
|
105
|
+
'token'=>'1234',
|
106
|
+
'transactionId'=>'123456'},
|
107
|
+
'token'=> {
|
108
|
+
'litleToken'=>'1234',
|
109
|
+
'expDate'=>'1210',
|
110
|
+
'cardValidationNum'=>'555',
|
111
|
+
'type'=>'VI'
|
112
|
+
}}
|
113
|
+
|
114
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.credit(hash)}
|
115
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
116
|
+
end
|
117
|
+
|
118
|
+
def test_action_reason_on_orphaned_refund
|
119
|
+
hash = {
|
120
|
+
'merchantId' => '101',
|
121
|
+
'version'=>'8.12',
|
122
|
+
'orderId'=>'1',
|
123
|
+
'amount'=>'2',
|
124
|
+
'orderSource'=>'ecommerce',
|
125
|
+
'reportGroup'=>'Planets',
|
126
|
+
'actionReason'=> 'SUSPECT_FRAUD'
|
127
|
+
}
|
128
|
+
XMLObject.expects(:new)
|
129
|
+
Communications.expects(:http_post).with(regexp_matches(/.*<actionReason>SUSPECT_FRAUD<\/actionReason>.*/m),kind_of(Hash))
|
130
|
+
LitleOnlineRequest.new.credit(hash)
|
131
|
+
end
|
115
132
|
|
116
|
-
def test_action_reason_on_orphaned_refund
|
117
|
-
hash = {
|
118
|
-
'merchantId' => '101',
|
119
|
-
'version'=>'8.12',
|
120
|
-
'orderId'=>'1',
|
121
|
-
'amount'=>'2',
|
122
|
-
'orderSource'=>'ecommerce',
|
123
|
-
'reportGroup'=>'Planets',
|
124
|
-
'actionReason'=> 'SUSPECT_FRAUD'
|
125
|
-
}
|
126
|
-
XMLObject.expects(:new)
|
127
|
-
Communications.expects(:http_post).with(regexp_matches(/.*<actionReason>SUSPECT_FRAUD<\/actionReason>.*/m),kind_of(Hash))
|
128
|
-
LitleOnlineRequest.new.credit(hash)
|
129
133
|
end
|
130
|
-
|
131
134
|
end
|
@@ -25,19 +25,20 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
25
25
|
require 'lib/LitleOnline'
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
28
|
+
module LitleOnline
|
29
|
+
class Test_echeckCredit < Test::Unit::TestCase
|
30
|
+
def test_echeck_credit_with_both
|
31
|
+
hash = {
|
32
|
+
'merchantId' => '101',
|
33
|
+
'version'=>'8.8',
|
34
|
+
'reportGroup'=>'Planets',
|
35
|
+
'litleTxnId'=>'123456',
|
36
|
+
'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
37
|
+
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
38
|
+
}
|
39
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_credit(hash)}
|
40
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
41
|
+
end
|
42
|
+
|
40
43
|
end
|
41
|
-
|
42
44
|
end
|
43
|
-
|
@@ -25,18 +25,19 @@ OTHER DEALINGS IN THE SOFTWARE.
|
|
25
25
|
require 'lib/LitleOnline'
|
26
26
|
require 'test/unit'
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
28
|
+
module LitleOnline
|
29
|
+
class Test_echeckRedeposit < Test::Unit::TestCase
|
30
|
+
def test_echeck_redeposit_with_both
|
31
|
+
hash = {
|
32
|
+
'merchantId' => '101',
|
33
|
+
'version'=>'8.8',
|
34
|
+
'reportGroup'=>'Planets',
|
35
|
+
'litleTxnId'=>'123456',
|
36
|
+
'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
|
37
|
+
'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'}
|
38
|
+
}
|
39
|
+
exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_redeposit(hash)}
|
40
|
+
assert_match /Entered an Invalid Amount of Choices for a Field, please only fill out one Choice!!!!/, exception.message
|
41
|
+
end
|
40
42
|
end
|
41
43
|
end
|
42
|
-
|