LitleOnline 8.25.1 → 8.29.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +10 -2
  3. data/README.md +2 -22
  4. data/Rakefile +2 -2
  5. data/accurev_plugin.log +1037 -0
  6. data/bin/sample_batch_driver.rb +1 -0
  7. data/bin/sample_driver.rb +4 -4
  8. data/lib/Configuration.rb +2 -2
  9. data/lib/EnvironmentVariables.rb +2 -1
  10. data/lib/LitleBatchRequest.rb +16 -3
  11. data/lib/LitleOnlineRequest.rb +2 -2
  12. data/lib/LitleRequest.rb +8 -4
  13. data/lib/LitleTransaction.rb +10 -6
  14. data/lib/XMLFields.rb +203 -159
  15. data/samples/Auth/LitleAuthReversalTransaction.rb +15 -0
  16. data/samples/Auth/LitleAuthorizationTransaction.rb +31 -0
  17. data/samples/Auth/LitlePaymentFullLifeCycle.rb +47 -0
  18. data/samples/Batch/AccountUpdate.rb +64 -0
  19. data/samples/Batch/SampleBatchDriver.rb +94 -0
  20. data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +30 -0
  21. data/samples/Capture/LitleCaptureTransaction.rb +14 -0
  22. data/samples/Capture/LitleForceCaptureTransaction.rb +26 -0
  23. data/samples/Capture/LitlePartialCapture.rb +16 -0
  24. data/samples/Credit/LitleCreditTransaction.rb +16 -0
  25. data/samples/Credit/LitleRefundTransaction.rb +29 -0
  26. data/samples/Other/LitleAvsTransaction.rb +34 -0
  27. data/samples/Other/LitleVoidTransaction.rb +18 -0
  28. data/samples/Paypage/FullPaypageLifeCycle.rb +74 -0
  29. data/samples/Run_all.rb +17 -0
  30. data/samples/Sale/LitleSaleTransaction.rb +29 -0
  31. data/samples/Sale/SampleSaleTransaction.rb +24 -0
  32. data/test/functional/test_auth.rb +54 -30
  33. data/test/functional/test_captureGivenAuth.rb +41 -18
  34. data/test/functional/test_credit.rb +17 -0
  35. data/test/functional/test_echeckCredit.rb +23 -6
  36. data/test/functional/test_echeckSale.rb +27 -10
  37. data/test/functional/test_forceCapture.rb +19 -0
  38. data/test/functional/test_sale.rb +44 -19
  39. data/test/functional/test_token.rb +27 -5
  40. data/test/unit/test_LitleOnlineRequest.rb +2 -2
  41. data/test/unit/test_activate.rb +1 -1
  42. data/test/unit/test_activateReversal.rb +1 -1
  43. data/test/unit/test_auth.rb +104 -41
  44. data/test/unit/test_balanceInquiry.rb +1 -1
  45. data/test/unit/test_cancelSubscription.rb +1 -1
  46. data/test/unit/test_captureGivenAuth.rb +31 -22
  47. data/test/unit/test_createPlan.rb +1 -1
  48. data/test/unit/test_credit.rb +61 -39
  49. data/test/unit/test_deactivate.rb +1 -1
  50. data/test/unit/test_deactivateReversal.rb +1 -1
  51. data/test/unit/test_depositReversal.rb +1 -1
  52. data/test/unit/test_echeckCredit.rb +18 -5
  53. data/test/unit/test_echeckRedeposit.rb +1 -1
  54. data/test/unit/test_echeckSale.rb +14 -1
  55. data/test/unit/test_echeckVerification.rb +1 -1
  56. data/test/unit/test_echeckVoid.rb +1 -1
  57. data/test/unit/test_forceCapture.rb +11 -0
  58. data/test/unit/test_load.rb +1 -1
  59. data/test/unit/test_loadReversal.rb +1 -1
  60. data/test/unit/test_refundReversal.rb +1 -1
  61. data/test/unit/test_sale.rb +113 -55
  62. data/test/unit/test_token.rb +53 -7
  63. data/test/unit/test_unload.rb +1 -1
  64. data/test/unit/test_unloadReversal.rb +1 -1
  65. data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
  66. data/test/unit/test_updatePlan.rb +1 -1
  67. data/test/unit/test_xmlfields.rb +2 -2
  68. metadata +22 -4
@@ -59,6 +59,23 @@ module LitleOnline
59
59
  response= LitleOnlineRequest.new.credit(hash)
60
60
  assert_equal('Valid Format', response.message)
61
61
  end
62
+
63
+ def test_simple_credit_with_secondaryAmount
64
+ hash = {
65
+ 'merchantId' => '101',
66
+ 'version'=>'8.8',
67
+ 'reportGroup'=>'Planets',
68
+ 'amount'=>'106',
69
+ 'secondaryAmount'=>'50',
70
+ 'orderId'=>'123456',
71
+ 'orderSource'=>'ecommerce',
72
+ 'paypal'=>{
73
+ 'payerId'=>'1234',
74
+ 'transactionId'=>'1234',
75
+ }}
76
+ response= LitleOnlineRequest.new.credit(hash)
77
+ assert_equal('Valid Format', response.message)
78
+ end
62
79
 
63
80
  def test_fields_out_of_order
64
81
  hash = {
@@ -22,7 +22,7 @@ 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
 
28
28
  module LitleOnline
@@ -38,7 +38,7 @@ module LitleOnline
38
38
  response= LitleOnlineRequest.new.echeck_credit(hash)
39
39
  assert_equal('Valid Format', response.message)
40
40
  end
41
-
41
+
42
42
  def test_no_amount
43
43
  hash = {
44
44
  'merchantId' => '101',
@@ -48,7 +48,7 @@ module LitleOnline
48
48
  response = LitleOnlineRequest.new.echeck_credit(hash)
49
49
  assert_match /The content of element 'echeckCredit' is not complete/, response.message
50
50
  end
51
-
51
+
52
52
  def test_echeck_credit_with_echeck
53
53
  hash = {
54
54
  'merchantId' => '101',
@@ -64,7 +64,7 @@ module LitleOnline
64
64
  response= LitleOnlineRequest.new.echeck_credit(hash)
65
65
  assert_equal('Valid Format', response.message)
66
66
  end
67
-
67
+
68
68
  def test_echeck_credit_with_echeck_token
69
69
  hash = {
70
70
  'merchantId' => '101',
@@ -80,7 +80,7 @@ module LitleOnline
80
80
  response= LitleOnlineRequest.new.echeck_credit(hash)
81
81
  assert_equal('Valid Format', response.message)
82
82
  end
83
-
83
+
84
84
  def test_extra_field_and_incorrect_order
85
85
  hash = {
86
86
  'merchantId' => '101',
@@ -97,7 +97,7 @@ module LitleOnline
97
97
  response= LitleOnlineRequest.new.echeck_credit(hash)
98
98
  assert_equal('Valid Format', response.message)
99
99
  end
100
-
100
+
101
101
  def test_extra_field_and_missing_billing
102
102
  hash = {
103
103
  'merchantId' => '101',
@@ -113,5 +113,22 @@ module LitleOnline
113
113
  response= LitleOnlineRequest.new.echeck_credit(hash)
114
114
  assert(response.message =~ /Error validating xml data against the schema/)
115
115
  end
116
+
117
+ def test_echeck_credit_with_secondaryAmount
118
+ hash = {
119
+ 'merchantId' => '101',
120
+ 'version'=>'8.8',
121
+ 'reportGroup'=>'Planets',
122
+ 'amount'=>'123456',
123
+ 'secondaryAmount'=>'50',
124
+ 'verify'=>'true',
125
+ 'orderId'=>'12345',
126
+ 'orderSource'=>'ecommerce',
127
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
128
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
129
+ }
130
+ response= LitleOnlineRequest.new.echeck_credit(hash)
131
+ assert_equal('Valid Format', response.message)
132
+ end
116
133
  end
117
134
  end
@@ -22,7 +22,7 @@ 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
 
28
28
  module LitleOnline
@@ -42,7 +42,7 @@ module LitleOnline
42
42
  response= LitleOnlineRequest.new.echeck_sale(hash)
43
43
  assert_equal('Valid Format', response.message)
44
44
  end
45
-
45
+
46
46
  def test_no_amount
47
47
  hash = {
48
48
  'merchantId' => '101',
@@ -52,7 +52,7 @@ module LitleOnline
52
52
  response = LitleOnlineRequest.new.echeck_sale(hash)
53
53
  assert_match /The content of element 'echeckSale' is not complete/, response.message
54
54
  end
55
-
55
+
56
56
  def test_echeck_sale_with_echeck
57
57
  hash = {
58
58
  'merchantId' => '101',
@@ -68,7 +68,7 @@ module LitleOnline
68
68
  response= LitleOnlineRequest.new.echeck_sale(hash)
69
69
  assert_equal('Valid Format', response.message)
70
70
  end
71
-
71
+
72
72
  def test_echeck_sale_with_ship_to
73
73
  hash = {
74
74
  'merchantId' => '101',
@@ -85,7 +85,7 @@ module LitleOnline
85
85
  response= LitleOnlineRequest.new.echeck_sale(hash)
86
86
  assert_equal('Valid Format', response.message)
87
87
  end
88
-
88
+
89
89
  def test_echeck_sale_with_echeck_token
90
90
  hash = {
91
91
  'merchantId' => '101',
@@ -102,7 +102,7 @@ module LitleOnline
102
102
  response= LitleOnlineRequest.new.echeck_sale(hash)
103
103
  assert_equal('Valid Format', response.message)
104
104
  end
105
-
105
+
106
106
  def test_extra_field_and_incorrect_order
107
107
  hash = {
108
108
  'merchantId' => '101',
@@ -119,7 +119,7 @@ module LitleOnline
119
119
  response= LitleOnlineRequest.new.echeck_sale(hash)
120
120
  assert_equal('Valid Format', response.message)
121
121
  end
122
-
122
+
123
123
  def test_extra_field_and_missing_billing
124
124
  hash = {
125
125
  'merchantId' => '101',
@@ -135,7 +135,7 @@ module LitleOnline
135
135
  response= LitleOnlineRequest.new.echeck_sale(hash)
136
136
  assert(response.message =~ /Error validating xml data against the schema/)
137
137
  end
138
-
138
+
139
139
  def test_simple_echeck_sale
140
140
  hash = {
141
141
  'reportGroup'=>'Planets',
@@ -145,7 +145,7 @@ module LitleOnline
145
145
  response= LitleOnlineRequest.new.echeck_sale(hash)
146
146
  assert_equal('Valid Format', response.message)
147
147
  end
148
-
148
+
149
149
  def test_simple_echeck_sale_with_custom_billing
150
150
  hash = {
151
151
  'reportGroup'=>'Planets',
@@ -155,6 +155,23 @@ module LitleOnline
155
155
  response= LitleOnlineRequest.new.echeck_sale(hash)
156
156
  assert_equal('Valid Format', response.message)
157
157
  end
158
-
158
+
159
+ def test_echeck_sale_with_secondaryAmount
160
+ hash = {
161
+ 'merchantId' => '101',
162
+ 'version'=>'8.8',
163
+ 'reportGroup'=>'Planets',
164
+ 'amount'=>'123456',
165
+ 'secondaryAmount'=>'50',
166
+ 'verify'=>'true',
167
+ 'orderId'=>'12345',
168
+ 'orderSource'=>'ecommerce',
169
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
170
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
171
+ }
172
+ response= LitleOnlineRequest.new.echeck_sale(hash)
173
+ assert_equal('Valid Format', response.message)
174
+ end
175
+
159
176
  end
160
177
  end
@@ -158,6 +158,25 @@ module LitleOnline
158
158
  response= LitleOnlineRequest.new.force_capture(hash)
159
159
  assert_equal('000', response.forceCaptureResponse.response)
160
160
  end
161
+
162
+ def test_simple_force_capture_with_secondaryAmount
163
+ hash = {
164
+ 'merchantId' => '101',
165
+ 'version'=>'8.8',
166
+ 'reportGroup'=>'Planets',
167
+ 'litleTxnId'=>'123456',
168
+ 'orderId'=>'12344',
169
+ 'amount'=>'106',
170
+ 'secondaryAmount'=>'20',
171
+ 'orderSource'=>'ecommerce',
172
+ 'card'=>{
173
+ 'type'=>'VI',
174
+ 'number' =>'4100000000000001',
175
+ 'expDate' =>'1210'
176
+ }}
177
+ response= LitleOnlineRequest.new.force_capture(hash)
178
+ assert_equal('000', response.forceCaptureResponse.response)
179
+ end
161
180
 
162
181
  end
163
182
 
@@ -22,7 +22,7 @@ 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
 
28
28
  module LitleOnline
@@ -44,7 +44,7 @@ module LitleOnline
44
44
  response= LitleOnlineRequest.new.sale(hash)
45
45
  assert_equal('000', response.saleResponse.response)
46
46
  end
47
-
47
+
48
48
  def test_simple_sale_with_paypal
49
49
  hash = {
50
50
  'merchantId' => '101',
@@ -62,7 +62,33 @@ module LitleOnline
62
62
  response= LitleOnlineRequest.new.sale(hash)
63
63
  assert_equal 'Valid Format', response.message
64
64
  end
65
-
65
+
66
+ def test_simple_sale_with_applepay_and_secondaryAmount
67
+ hash = {
68
+ 'merchantId' => '101',
69
+ 'version'=>'8.8',
70
+ 'reportGroup'=>'Planets',
71
+ 'litleTxnId'=>'123456',
72
+ 'orderId'=>'12344',
73
+ 'amount'=>'110',
74
+ 'secondaryAmount'=>'50',
75
+ 'orderSource'=>'ecommerce',
76
+ 'applepay'=>{
77
+ 'data'=>'1234',
78
+ 'header'=>{
79
+ 'applicationData'=>'454657413164',
80
+ 'ephemeralPublicKey'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
81
+ 'publicKeyHash'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
82
+ 'transactionId'=>'1234'
83
+ },
84
+ 'signature' =>'1',
85
+ 'version'=>'1'
86
+ }}
87
+ response= LitleOnlineRequest.new.sale(hash)
88
+ assert_equal('Insufficient Funds', response.saleResponse.message)
89
+ assert_equal('110', response.saleResponse.applepayResponse.transactionAmount)
90
+ end
91
+
66
92
  def test_illegal_order_source
67
93
  hash = {
68
94
  'merchantId' => '101',
@@ -80,7 +106,7 @@ module LitleOnline
80
106
  response= LitleOnlineRequest.new.sale(hash)
81
107
  assert(response.message =~ /Error validating xml data against the schema/)
82
108
  end
83
-
109
+
84
110
  def test_no_report_group
85
111
  hash = {
86
112
  'merchantId' => '101',
@@ -98,7 +124,7 @@ module LitleOnline
98
124
  response= LitleOnlineRequest.new.sale(hash)
99
125
  assert_equal('000', response.saleResponse.response)
100
126
  end
101
-
127
+
102
128
  def test_fields_out_of_order
103
129
  hash = {
104
130
  'merchantId' => '101',
@@ -117,7 +143,7 @@ module LitleOnline
117
143
  response= LitleOnlineRequest.new.sale(hash)
118
144
  assert_equal('000', response.saleResponse.response)
119
145
  end
120
-
146
+
121
147
  def test_invalid_field
122
148
  hash = {
123
149
  'merchantId' => '101',
@@ -136,7 +162,7 @@ module LitleOnline
136
162
  response= LitleOnlineRequest.new.sale(hash)
137
163
  assert_equal('000', response.saleResponse.response)
138
164
  end
139
-
165
+
140
166
  def test_simple_sale_with_card
141
167
  hash = {
142
168
  'merchantId'=>'101',
@@ -154,8 +180,7 @@ module LitleOnline
154
180
  response= LitleOnlineRequest.new.sale(hash)
155
181
  assert_equal('000', response.saleResponse.response)
156
182
  end
157
-
158
-
183
+
159
184
  def test_no_order_id
160
185
  hash = {
161
186
  'merchantId' => '101',
@@ -172,7 +197,7 @@ module LitleOnline
172
197
  response= LitleOnlineRequest.new.sale(hash)
173
198
  assert(response.message =~ /Error validating xml data against the schema/)
174
199
  end
175
-
200
+
176
201
  def test_no_amount
177
202
  hash = {
178
203
  'merchantId' => '101',
@@ -189,7 +214,7 @@ module LitleOnline
189
214
  response= LitleOnlineRequest.new.sale(hash)
190
215
  assert(response.message =~ /Error validating xml data against the schema/)
191
216
  end
192
-
217
+
193
218
  def test_no_order_source
194
219
  hash = {
195
220
  'merchantId' => '101',
@@ -217,18 +242,18 @@ module LitleOnline
217
242
  'amount'=>'106',
218
243
  'orderSource'=>'ecommerce',
219
244
  'mpos'=>
220
- {
221
- 'ksn'=>'ksnString',
222
- 'formatId'=>'30',
223
- 'encryptedTrack'=>'encryptedTrackString',
224
- 'track1Status'=>'0',
225
- 'track2Status'=>'0'
226
- }
245
+ {
246
+ 'ksn'=>'ksnString',
247
+ 'formatId'=>'30',
248
+ 'encryptedTrack'=>'encryptedTrackString',
249
+ 'track1Status'=>'0',
250
+ 'track2Status'=>'0'
251
+ }
227
252
  }
228
253
  response= LitleOnlineRequest.new.sale(hash)
229
254
  assert_equal('000', response.saleResponse.response)
230
255
  end
231
-
256
+
232
257
  end
233
258
 
234
259
  end
@@ -22,7 +22,7 @@ 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
 
28
28
  module LitleOnline
@@ -38,7 +38,7 @@ module LitleOnline
38
38
  response= LitleOnlineRequest.new.register_token_request(hash)
39
39
  assert_equal('Valid Format', response.message)
40
40
  end
41
-
41
+
42
42
  def test_simple_token_with_paypage
43
43
  hash = {
44
44
  'merchantId' => '101',
@@ -51,7 +51,29 @@ module LitleOnline
51
51
  assert_equal('Valid Format', response.message)
52
52
  assert_equal('1111222233334444', response.registerTokenResponse.litleToken)
53
53
  end
54
-
54
+
55
+ def test_simple_token_with_applepay
56
+ hash = {
57
+ 'merchantId' => '101',
58
+ 'version'=>'8.8',
59
+ 'reportGroup'=>'Planets',
60
+ 'orderId'=>'12344',
61
+ 'applepay'=>{
62
+ 'data'=>'1234',
63
+ 'header'=>{
64
+ 'applicationData'=>'454657413164',
65
+ 'ephemeralPublicKey'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
66
+ 'publicKeyHash'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
67
+ 'transactionId'=>'1234'
68
+ },
69
+ 'signature' =>'1',
70
+ 'version'=>'1'
71
+ }
72
+ }
73
+ response= LitleOnlineRequest.new.register_token_request(hash)
74
+ assert_equal('Valid Format', response.message)
75
+ end
76
+
55
77
  def test_simple_token_echeck
56
78
  hash = {
57
79
  'reportGroup'=>'Planets',
@@ -63,7 +85,7 @@ module LitleOnline
63
85
  response= LitleOnlineRequest.new.register_token_request(hash)
64
86
  assert_equal('Valid Format', response.message)
65
87
  end
66
-
88
+
67
89
  def test_fields_out_of_order
68
90
  hash = {
69
91
  'merchantId' => '101',
@@ -75,7 +97,7 @@ module LitleOnline
75
97
  response= LitleOnlineRequest.new.register_token_request(hash)
76
98
  assert_equal('Valid Format', response.message)
77
99
  end
78
-
100
+
79
101
  def test_invalid_field
80
102
  hash = {
81
103
  'merchantId' => '101',
@@ -243,7 +243,7 @@ module LitleOnline
243
243
  #Explicit - used for integrations
244
244
  assert_equal 'ActiveMerchant;3.2', litle.send(:get_merchant_sdk, {'merchantSdk'=>'ActiveMerchant;3.2'})
245
245
  #Implicit - used raw when nothing is specified
246
- assert_equal 'Ruby;8.25.0', litle.send(:get_merchant_sdk, {'NotMerchantSdk'=>'ActiveMerchant;3.2'})
246
+ assert_equal 'Ruby;8.29.0', litle.send(:get_merchant_sdk, {'NotMerchantSdk'=>'ActiveMerchant;3.2'})
247
247
  end
248
248
 
249
249
  def test_sale_paypal_order_complete_typo
@@ -273,7 +273,7 @@ module LitleOnline
273
273
  'litleTxnId' => '006'
274
274
  }
275
275
 
276
- Communications.expects(:http_post).with(regexp_matches(/<litleOnlineRequest.*version="8\.25".*/m),kind_of(Hash))
276
+ Communications.expects(:http_post).with(regexp_matches(/<litleOnlineRequest.*version="8\.29".*/m),kind_of(Hash))
277
277
  XMLObject.expects(:new)
278
278
 
279
279
  response = LitleOnlineRequest.new.void(hash)