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
@@ -25,43 +25,45 @@ 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 TestAuthReversal < Test::Unit::TestCase
|
30
|
+
def test_simple_auth_reversal
|
31
|
+
hash = {
|
32
|
+
'merchantId' => '101',
|
33
|
+
'version'=>'8.8',
|
34
|
+
'reportGroup'=>'Planets',
|
35
|
+
'litleTxnId'=>'12345678000',
|
36
|
+
'amount'=>'106',
|
37
|
+
'payPalNotes'=>'Notes'
|
38
|
+
}
|
39
|
+
response= LitleOnlineRequest.new.auth_reversal(hash)
|
40
|
+
assert_equal('Valid Format', response.message)
|
41
|
+
end
|
42
|
+
|
43
|
+
def test_fields_out_of_order
|
44
|
+
hash = {
|
45
|
+
'merchantId' => '101',
|
46
|
+
'version'=>'8.8',
|
47
|
+
'litleTxnId'=>'12345000',
|
48
|
+
'payPalNotes'=>'Notes',
|
49
|
+
'amount'=>'106',
|
50
|
+
'reportGroup'=>'Planets',
|
51
|
+
}
|
52
|
+
response= LitleOnlineRequest.new.auth_reversal(hash)
|
53
|
+
assert_equal('Valid Format', response.message)
|
54
|
+
end
|
55
|
+
|
56
|
+
def test_no_litle_txn_id
|
57
|
+
hash = {
|
58
|
+
'merchantId' => '101',
|
59
|
+
'version'=>'8.8',
|
60
|
+
'reportGroup'=>'12345678',
|
61
|
+
'amount'=>'106',
|
62
|
+
'payPalNotes'=>'Notes'
|
63
|
+
}
|
64
|
+
response= LitleOnlineRequest.new.auth_reversal(hash)
|
65
|
+
assert(response.message =~ /Error validating xml data against the schema/)
|
66
|
+
end
|
67
|
+
|
40
68
|
end
|
41
|
-
|
42
|
-
def test_fields_out_of_order
|
43
|
-
hash = {
|
44
|
-
'merchantId' => '101',
|
45
|
-
'version'=>'8.8',
|
46
|
-
'litleTxnId'=>'12345000',
|
47
|
-
'payPalNotes'=>'Notes',
|
48
|
-
'amount'=>'106',
|
49
|
-
'reportGroup'=>'Planets',
|
50
|
-
}
|
51
|
-
response= LitleOnlineRequest.new.auth_reversal(hash)
|
52
|
-
assert_equal('Valid Format', response.message)
|
53
|
-
end
|
54
|
-
|
55
|
-
def test_no_litle_txn_id
|
56
|
-
hash = {
|
57
|
-
'merchantId' => '101',
|
58
|
-
'version'=>'8.8',
|
59
|
-
'reportGroup'=>'12345678',
|
60
|
-
'amount'=>'106',
|
61
|
-
'payPalNotes'=>'Notes'
|
62
|
-
}
|
63
|
-
response= LitleOnlineRequest.new.auth_reversal(hash)
|
64
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
65
|
-
end
|
66
|
-
|
67
|
-
end
|
69
|
+
end
|
@@ -25,58 +25,60 @@ 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
|
-
|
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
|
-
|
28
|
+
module LitleOnline
|
29
|
+
class Test_capture < Test::Unit::TestCase
|
30
|
+
def test_simple_capture
|
31
|
+
hash = {
|
32
|
+
'merchantId' => '101',
|
33
|
+
'version'=>'8.8',
|
34
|
+
'reportGroup'=>'Planets',
|
35
|
+
'litleTxnId'=>'123456000',
|
36
|
+
'amount'=>'106',
|
37
|
+
}
|
38
|
+
response= LitleOnlineRequest.new.capture(hash)
|
39
|
+
assert_equal('Valid Format', response.message)
|
40
|
+
end
|
41
|
+
|
42
|
+
def test_simple_capture_with_partial
|
43
|
+
hash = {
|
44
|
+
'merchantId' => '101',
|
45
|
+
'version'=>'8.8',
|
46
|
+
'reportGroup'=>'Planets',
|
47
|
+
'partial'=>'true',
|
48
|
+
'litleTxnId'=>'123456000',
|
49
|
+
'amount'=>'106',
|
50
|
+
}
|
51
|
+
response= LitleOnlineRequest.new.capture(hash)
|
52
|
+
assert_equal('Valid Format', response.message)
|
53
|
+
end
|
54
|
+
|
55
|
+
def test_complex_capture
|
56
|
+
hash = {
|
57
|
+
'merchantId' => '101',
|
58
|
+
'version'=>'8.8',
|
59
|
+
'reportGroup'=>'Planets',
|
60
|
+
'litleTxnId'=>'123456000',
|
61
|
+
'amount'=>'106',
|
62
|
+
'enhancedData'=>{
|
63
|
+
'customerReference'=>'Litle',
|
64
|
+
'salesTax'=>'50',
|
65
|
+
'deliveryType'=>'TBD'},
|
66
|
+
'payPalOrderComplete'=>'true'
|
67
|
+
}
|
68
|
+
response= LitleOnlineRequest.new.capture(hash)
|
69
|
+
assert_equal('Valid Format', response.message)
|
70
|
+
end
|
71
|
+
|
72
|
+
def test_no_txn_id
|
73
|
+
hash = {
|
74
|
+
'merchantId' => '101',
|
75
|
+
'version'=>'8.8',
|
76
|
+
'reportGroup'=>'Planets',
|
77
|
+
'amount'=>'106',
|
78
|
+
}
|
79
|
+
response= LitleOnlineRequest.new.capture(hash)
|
80
|
+
assert(response.message =~ /Error validating xml data against the schema/)
|
81
|
+
end
|
70
82
|
|
71
|
-
def test_no_txn_id
|
72
|
-
hash = {
|
73
|
-
'merchantId' => '101',
|
74
|
-
'version'=>'8.8',
|
75
|
-
'reportGroup'=>'Planets',
|
76
|
-
'amount'=>'106',
|
77
|
-
}
|
78
|
-
response= LitleOnlineRequest.new.capture(hash)
|
79
|
-
assert(response.message =~ /Error validating xml data against the schema/)
|
80
83
|
end
|
81
|
-
|
82
84
|
end
|
@@ -25,157 +25,158 @@ 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
|
-
|
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
|
-
def test_fields_out_of_order
|
73
|
-
hash = {
|
74
|
-
'merchantId' => '101',
|
75
|
-
'version'=>'8.8',
|
76
|
-
'orderSource'=>'ecommerce',
|
77
|
-
'authInformation' => {
|
78
|
-
'authDate'=>'2002-10-09','authCode'=>'543216',
|
79
|
-
'authAmount'=>'12345'
|
80
|
-
},
|
81
|
-
'amount'=>'106',
|
82
|
-
'card'=>{
|
83
|
-
'type'=>'VI',
|
84
|
-
'number' =>'4100000000000000',
|
85
|
-
'expDate' =>'1210'
|
86
|
-
},
|
87
|
-
'reportGroup'=>'Planets',
|
88
|
-
'orderId'=>'12344'
|
89
|
-
}
|
90
|
-
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
91
|
-
assert_equal('Valid Format', response.message)
|
92
|
-
end
|
93
|
-
|
94
|
-
def test_invalid_field
|
95
|
-
hash = {
|
96
|
-
'merchantId' => '101',
|
97
|
-
'version'=>'8.8',
|
98
|
-
'reportGroup'=>'Planets',
|
99
|
-
'authInformation' => {
|
100
|
-
'authDate'=>'2002-10-09','authCode'=>'543216',
|
101
|
-
'authAmount'=>'12345'
|
102
|
-
},
|
103
|
-
'orderId'=>'12344',
|
104
|
-
'amount'=>'106',
|
105
|
-
'orderSource'=>'ecommerce',
|
106
|
-
'card'=>{
|
107
|
-
'NOexistantField' => 'ShouldNotCauseError',
|
108
|
-
'type'=>'VI',
|
109
|
-
'number' =>'4100000000000000',
|
110
|
-
'expDate' =>'1210'
|
111
|
-
}}
|
112
|
-
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
113
|
-
assert_equal('Valid Format', response.message)
|
114
|
-
end
|
115
|
-
|
116
|
-
def test_complex_capture_given_auth
|
117
|
-
hash = {
|
118
|
-
'merchantId' => '101',
|
119
|
-
'version'=>'8.8',
|
120
|
-
'reportGroup'=>'Planets',
|
121
|
-
'orderId'=>'12344',
|
122
|
-
'amount'=>'106',
|
123
|
-
'authInformation' => {
|
124
|
-
'authDate'=>'2002-10-09','authCode'=>'543216',
|
125
|
-
'authAmount'=>'12345'
|
126
|
-
},
|
127
|
-
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
|
128
|
-
'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
|
129
|
-
'orderSource'=>'ecommerce',
|
130
|
-
'card'=>{
|
131
|
-
'type'=>'VI',
|
132
|
-
'number' =>'4100000000000000',
|
133
|
-
'expDate' =>'1210'
|
134
|
-
}}
|
135
|
-
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
136
|
-
assert_equal('Valid Format', response.message)
|
137
|
-
end
|
138
|
-
|
139
|
-
def test_auth_info
|
140
|
-
hash = {
|
141
|
-
'merchantId' => '101',
|
142
|
-
'version'=>'8.8',
|
143
|
-
'reportGroup'=>'Planets',
|
144
|
-
'orderId'=>'12344',
|
145
|
-
'amount'=>'106',
|
146
|
-
'authInformation' => {
|
147
|
-
'authDate'=>'2002-10-09','authCode'=>'543216',
|
148
|
-
'authAmount'=>'12345','fraudResult'=>{'avsResult'=>'12','cardValidationResult'=>'123','authenticationResult'=>'1',
|
149
|
-
'advancedAVSResult'=>'123'}
|
150
|
-
},
|
151
|
-
'orderSource'=>'ecommerce',
|
152
|
-
'card'=>{
|
153
|
-
'type'=>'VI',
|
154
|
-
'number' =>'4100000000000000',
|
155
|
-
'expDate' =>'1210'
|
156
|
-
}}
|
157
|
-
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
158
|
-
assert_equal('Valid Format', response.message)
|
159
|
-
end
|
28
|
+
module LitleOnline
|
29
|
+
class TestcaptureGivenAuth < Test::Unit::TestCase
|
30
|
+
def test_simple_capture_given_auth_with_card
|
31
|
+
hash = {
|
32
|
+
'merchantId' => '101',
|
33
|
+
'version'=>'8.8',
|
34
|
+
'reportGroup'=>'Planets',
|
35
|
+
'orderId'=>'12344',
|
36
|
+
'amount'=>'106',
|
37
|
+
'authInformation' => {
|
38
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
39
|
+
'authAmount'=>'12345'
|
40
|
+
},
|
41
|
+
'orderSource'=>'ecommerce',
|
42
|
+
'card'=>{
|
43
|
+
'type'=>'VI',
|
44
|
+
'number' =>'4100000000000000',
|
45
|
+
'expDate' =>'1210'
|
46
|
+
}}
|
47
|
+
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
48
|
+
assert_equal('Valid Format', response.message)
|
49
|
+
end
|
50
|
+
|
51
|
+
def test_simple_capture_given_auth_with_token
|
52
|
+
hash = {
|
53
|
+
'merchantId' => '101',
|
54
|
+
'version'=>'8.8',
|
55
|
+
'reportGroup'=>'Planets',
|
56
|
+
'orderId'=>'12344',
|
57
|
+
'authInformation' => {
|
58
|
+
'authDate'=>'2002-10-09','authCode'=>'543216', 'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
|
59
|
+
'authAmount'=>'12345'
|
60
|
+
},
|
61
|
+
'amount'=>'106',
|
62
|
+
'orderSource'=>'ecommerce',
|
63
|
+
'token'=> {
|
64
|
+
'litleToken'=>'123456789101112',
|
65
|
+
'expDate'=>'1210',
|
66
|
+
'cardValidationNum'=>'555',
|
67
|
+
'type'=>'VI'
|
68
|
+
}}
|
69
|
+
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
70
|
+
assert_equal('Valid Format', response.message)
|
71
|
+
end
|
160
72
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
73
|
+
def test_fields_out_of_order
|
74
|
+
hash = {
|
75
|
+
'merchantId' => '101',
|
76
|
+
'version'=>'8.8',
|
77
|
+
'orderSource'=>'ecommerce',
|
78
|
+
'authInformation' => {
|
79
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
80
|
+
'authAmount'=>'12345'
|
81
|
+
},
|
82
|
+
'amount'=>'106',
|
83
|
+
'card'=>{
|
84
|
+
'type'=>'VI',
|
85
|
+
'number' =>'4100000000000000',
|
86
|
+
'expDate' =>'1210'
|
87
|
+
},
|
88
|
+
'reportGroup'=>'Planets',
|
89
|
+
'orderId'=>'12344'
|
90
|
+
}
|
91
|
+
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
92
|
+
assert_equal('Valid Format', response.message)
|
93
|
+
end
|
94
|
+
|
95
|
+
def test_invalid_field
|
96
|
+
hash = {
|
97
|
+
'merchantId' => '101',
|
98
|
+
'version'=>'8.8',
|
99
|
+
'reportGroup'=>'Planets',
|
100
|
+
'authInformation' => {
|
101
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
102
|
+
'authAmount'=>'12345'
|
103
|
+
},
|
104
|
+
'orderId'=>'12344',
|
105
|
+
'amount'=>'106',
|
106
|
+
'orderSource'=>'ecommerce',
|
107
|
+
'card'=>{
|
108
|
+
'NOexistantField' => 'ShouldNotCauseError',
|
109
|
+
'type'=>'VI',
|
110
|
+
'number' =>'4100000000000000',
|
111
|
+
'expDate' =>'1210'
|
112
|
+
}}
|
113
|
+
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
114
|
+
assert_equal('Valid Format', response.message)
|
115
|
+
end
|
116
|
+
|
117
|
+
def test_complex_capture_given_auth
|
118
|
+
hash = {
|
119
|
+
'merchantId' => '101',
|
120
|
+
'version'=>'8.8',
|
121
|
+
'reportGroup'=>'Planets',
|
122
|
+
'orderId'=>'12344',
|
123
|
+
'amount'=>'106',
|
124
|
+
'authInformation' => {
|
125
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
126
|
+
'authAmount'=>'12345'
|
127
|
+
},
|
128
|
+
'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
|
129
|
+
'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
|
130
|
+
'orderSource'=>'ecommerce',
|
131
|
+
'card'=>{
|
132
|
+
'type'=>'VI',
|
133
|
+
'number' =>'4100000000000000',
|
134
|
+
'expDate' =>'1210'
|
135
|
+
}}
|
136
|
+
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
137
|
+
assert_equal('Valid Format', response.message)
|
138
|
+
end
|
139
|
+
|
140
|
+
def test_auth_info
|
141
|
+
hash = {
|
142
|
+
'merchantId' => '101',
|
143
|
+
'version'=>'8.8',
|
144
|
+
'reportGroup'=>'Planets',
|
145
|
+
'orderId'=>'12344',
|
146
|
+
'amount'=>'106',
|
147
|
+
'authInformation' => {
|
148
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
149
|
+
'authAmount'=>'12345','fraudResult'=>{'avsResult'=>'12','cardValidationResult'=>'123','authenticationResult'=>'1',
|
150
|
+
'advancedAVSResult'=>'123'}
|
151
|
+
},
|
152
|
+
'orderSource'=>'ecommerce',
|
153
|
+
'card'=>{
|
154
|
+
'type'=>'VI',
|
155
|
+
'number' =>'4100000000000000',
|
156
|
+
'expDate' =>'1210'
|
157
|
+
}}
|
158
|
+
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
159
|
+
assert_equal('Valid Format', response.message)
|
160
|
+
end
|
161
|
+
|
162
|
+
def test_no_amount
|
163
|
+
hash = {
|
164
|
+
'merchantId' => '101',
|
165
|
+
'version'=>'8.8',
|
166
|
+
'reportGroup'=>'Planets',
|
167
|
+
'orderId'=>'12344',
|
168
|
+
'authInformation' => {
|
169
|
+
'authDate'=>'2002-10-09','authCode'=>'543216',
|
170
|
+
'authAmount'=>'12345'
|
171
|
+
},
|
172
|
+
'orderSource'=>'ecommerce',
|
173
|
+
'card'=>{
|
174
|
+
'type'=>'VI',
|
175
|
+
'number' =>'4100000000000001',
|
176
|
+
'expDate' =>'1210'
|
177
|
+
}}
|
178
|
+
response= LitleOnlineRequest.new.capture_given_auth(hash)
|
179
|
+
assert(response.message =~ /Error validating xml data against the schema/)
|
180
|
+
end
|
179
181
|
end
|
180
|
-
end
|
181
|
-
|
182
|
+
end
|