LitleOnline 9.3.3 → 9.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +15 -2
  3. data/DESCRIPTION +2 -2
  4. data/LICENSE +1 -1
  5. data/README.md +9 -9
  6. data/Rakefile +8 -8
  7. data/SETUP.md +3 -3
  8. data/bin/Setup.rb +4 -4
  9. data/bin/sample_batch_driver.rb +1 -1
  10. data/bin/sample_driver.rb +1 -1
  11. data/lib/Communications.rb +7 -7
  12. data/lib/Configuration.rb +1 -1
  13. data/lib/LitleBatchRequest.rb +3 -3
  14. data/lib/LitleListeners.rb +1 -1
  15. data/lib/LitleOnline.rb +2 -2
  16. data/lib/LitleOnlineRequest.rb +4 -4
  17. data/lib/LitleRequest.rb +3 -3
  18. data/lib/LitleTransaction.rb +45 -21
  19. data/lib/LitleXmlMapper.rb +9 -4
  20. data/lib/XMLFields.rb +100 -15
  21. data/temp.xml +21 -0
  22. data/test/certification/certTest_batchAll.rb +15 -10
  23. data/test/certification/ts_all.rb +1 -1
  24. data/test/functional/test_activate.rb +7 -3
  25. data/test/functional/test_activateReversal.rb +7 -3
  26. data/test/functional/test_auth.rb +119 -16
  27. data/test/functional/test_authReversal.rb +5 -3
  28. data/test/functional/test_balanceInquiry.rb +5 -3
  29. data/test/functional/test_batch.rb +1 -1
  30. data/test/functional/test_batchStream.rb +1 -1
  31. data/test/functional/test_cancelSubscription.rb +5 -3
  32. data/test/functional/test_capture.rb +34 -3
  33. data/test/functional/test_captureGivenAuth.rb +55 -4
  34. data/test/functional/test_configuration.rb +1 -1
  35. data/test/functional/test_createPlan.rb +5 -3
  36. data/test/functional/test_credit.rb +17 -1
  37. data/test/functional/test_deactivate.rb +5 -3
  38. data/test/functional/test_deactivateReversal.rb +5 -3
  39. data/test/functional/test_depositReversal.rb +5 -3
  40. data/test/functional/test_echeckCredit.rb +13 -9
  41. data/test/functional/test_echeckRedeposit.rb +5 -3
  42. data/test/functional/test_echeckSale.rb +20 -29
  43. data/test/functional/test_echeckVerification.rb +20 -12
  44. data/test/functional/test_echeckVoid.rb +1 -1
  45. data/test/functional/test_forceCapture.rb +27 -5
  46. data/test/functional/test_fraudCheck.rb +10 -10
  47. data/test/functional/test_litle_requests.rb +1 -1
  48. data/test/functional/test_load.rb +5 -3
  49. data/test/functional/test_loadReversal.rb +5 -3
  50. data/test/functional/test_refundReversal.rb +5 -3
  51. data/test/functional/test_sale.rb +176 -29
  52. data/test/functional/test_token.rb +18 -3
  53. data/test/functional/test_unload.rb +5 -3
  54. data/test/functional/test_unloadReversal.rb +6 -4
  55. data/test/functional/test_updateCardValidationNumOnToken.rb +1 -1
  56. data/test/functional/test_updatePlan.rb +5 -3
  57. data/test/functional/test_updateSubscription.rb +5 -3
  58. data/test/functional/test_utf8.rb +44 -0
  59. data/test/functional/test_xmlfields.rb +10 -6
  60. data/test/functional/ts_all.rb +1 -1
  61. data/test/unit/test_LitleAUBatch.rb +1 -1
  62. data/test/unit/test_LitleBatchRequest.rb +4 -4
  63. data/test/unit/test_LitleOnlineRequest.rb +37 -54
  64. data/test/unit/test_LitleRequest.rb +1 -1
  65. data/test/unit/test_LitleTransaction.rb +5 -5
  66. data/test/unit/test_LitleXmlMapper.rb +136 -0
  67. data/test/unit/test_activate.rb +1 -21
  68. data/test/unit/test_activateReversal.rb +1 -1
  69. data/test/unit/test_auth.rb +51 -11
  70. data/test/unit/test_authReversal.rb +1 -1
  71. data/test/unit/test_balanceInquiry.rb +1 -1
  72. data/test/unit/test_cancelSubscription.rb +1 -1
  73. data/test/unit/test_capture.rb +27 -1
  74. data/test/unit/test_captureGivenAuth.rb +44 -18
  75. data/test/unit/test_createPlan.rb +1 -1
  76. data/test/unit/test_credit.rb +16 -3
  77. data/test/unit/test_deactivate.rb +1 -1
  78. data/test/unit/test_deactivateReversal.rb +1 -1
  79. data/test/unit/test_depositReversal.rb +1 -1
  80. data/test/unit/test_echeckCredit.rb +1 -1
  81. data/test/unit/test_echeckRedeposit.rb +1 -1
  82. data/test/unit/test_echeckSale.rb +2 -2
  83. data/test/unit/test_echeckVerification.rb +1 -1
  84. data/test/unit/test_echeckVoid.rb +1 -1
  85. data/test/unit/test_forceCapture.rb +20 -2
  86. data/test/unit/test_fraudCheck.rb +1 -1
  87. data/test/unit/test_load.rb +1 -1
  88. data/test/unit/test_loadReversal.rb +1 -1
  89. data/test/unit/test_refundReversal.rb +1 -1
  90. data/test/unit/test_sale.rb +72 -6
  91. data/test/unit/test_token.rb +15 -4
  92. data/test/unit/test_unload.rb +1 -1
  93. data/test/unit/test_unloadReversal.rb +1 -1
  94. data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
  95. data/test/unit/test_updatePlan.rb +1 -1
  96. data/test/unit/test_updateSubscription.rb +1 -1
  97. data/test/unit/test_xmlfields.rb +1 -1
  98. data/test/unit/ts_unit.rb +1 -1
  99. metadata +14 -11
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
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
@@ -37,7 +37,7 @@ module LitleOnline
37
37
  'orderId'=>'12345',
38
38
  'orderSource'=>'ecommerce',
39
39
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
40
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
40
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
41
41
  }
42
42
  response= LitleOnlineRequest.new.echeck_verification(hash)
43
43
  assert_equal('Valid Format', response.message)
@@ -52,7 +52,7 @@ module LitleOnline
52
52
  'orderId'=>'12345',
53
53
  'orderSource'=>'ecommerce',
54
54
  'echeckToken' => {'accType'=>'Checking','litleToken'=>'1234565789012','routingNum'=>'123456789','checkNum'=>'123455'},
55
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
55
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
56
56
  }
57
57
  response= LitleOnlineRequest.new.echeck_verification(hash)
58
58
  assert_equal('Valid Format', response.message)
@@ -68,7 +68,7 @@ module LitleOnline
68
68
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
69
69
  'orderId'=>'12345',
70
70
  'orderSource'=>'ecommerce',
71
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
71
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
72
72
  }
73
73
  response= LitleOnlineRequest.new.echeck_verification(hash)
74
74
  assert_equal('Valid Format', response.message)
@@ -85,8 +85,10 @@ module LitleOnline
85
85
  'orderId'=>'12345',
86
86
  'orderSource'=>'ecommerce',
87
87
  }
88
- response= LitleOnlineRequest.new.echeck_verification(hash)
89
- assert(response.message =~ /Error validating xml data against the schema/)
88
+ #Get exceptions
89
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_verification(hash)}
90
+ #Test
91
+ assert(exception.message =~ /Error validating xml data against the schema/)
90
92
  end
91
93
 
92
94
  def test_no_amount
@@ -96,8 +98,10 @@ module LitleOnline
96
98
  'reportGroup'=>'Planets',
97
99
  'orderId'=>'12345'
98
100
  }
99
- response= LitleOnlineRequest.new.echeck_verification(hash)
100
- assert(response.message =~ /Error validating xml data against the schema/)
101
+ #Get exceptions
102
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_verification(hash)}
103
+ #Test
104
+ assert(exception.message =~ /Error validating xml data against the schema/)
101
105
  end
102
106
 
103
107
  def test_no_order_id
@@ -106,8 +110,10 @@ module LitleOnline
106
110
  'version'=>'8.8',
107
111
  'reportGroup'=>'Planets',
108
112
  }
109
- response= LitleOnlineRequest.new.echeck_verification(hash)
110
- assert(response.message =~ /Error validating xml data against the schema/)
113
+ #Get exceptions
114
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_verification(hash)}
115
+ #Test
116
+ assert(exception.message =~ /Error validating xml data against the schema/)
111
117
  end
112
118
 
113
119
  def test_no_order_source
@@ -118,8 +124,10 @@ module LitleOnline
118
124
  'amount'=>'123456',
119
125
  'orderId'=>'12345'
120
126
  }
121
- response= LitleOnlineRequest.new.echeck_verification(hash)
122
- assert(response.message =~ /Error validating xml data against the schema/)
127
+ #Get exceptions
128
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.echeck_verification(hash)}
129
+ #Test
130
+ assert(exception.message =~ /Error validating xml data against the schema/)
123
131
  end
124
132
 
125
133
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
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
@@ -116,8 +116,10 @@ module LitleOnline
116
116
  'cardValidationNum'=>'555',
117
117
  'type'=>'VI'
118
118
  }}
119
- response= LitleOnlineRequest.new.force_capture(hash)
120
- assert(response.message =~ /Error validating xml data against the schema/)
119
+ #Get exceptions
120
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.force_capture(hash)}
121
+ #Test
122
+ assert(exception.message =~ /Error validating xml data against the schema/)
121
123
  end
122
124
 
123
125
  def test_no_order_source
@@ -133,8 +135,10 @@ module LitleOnline
133
135
  'number' =>'4100000000000001',
134
136
  'expDate' =>'1210'
135
137
  }}
136
- response= LitleOnlineRequest.new.force_capture(hash)
137
- assert(response.message =~ /Error validating xml data against the schema/)
138
+ #Get exceptions
139
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.force_capture(hash)}
140
+ #Test
141
+ assert(exception.message =~ /Error validating xml data against the schema/)
138
142
  end
139
143
 
140
144
  def test_simple_forceCapture_with_mpos
@@ -177,6 +181,24 @@ module LitleOnline
177
181
  response= LitleOnlineRequest.new.force_capture(hash)
178
182
  assert_equal('000', response.forceCaptureResponse.response)
179
183
  end
184
+
185
+ def test_simple_force_capture_with_processing_type
186
+ hash = {
187
+ 'merchantId' => '101',
188
+ 'version'=>'8.8',
189
+ 'reportGroup'=>'Planets',
190
+ 'orderId'=>'12344',
191
+ 'amount'=>'106',
192
+ 'orderSource'=>'ecommerce',
193
+ 'processingType'=>'accountFunding',
194
+ 'card'=>{
195
+ 'type'=>'VI',
196
+ 'number' =>'4100000000000001',
197
+ 'expDate' =>'1210'
198
+ }}
199
+ response= LitleOnlineRequest.new.force_capture(hash)
200
+ assert_equal('000', response.forceCaptureResponse.response)
201
+ end
180
202
 
181
203
  end
182
204
 
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
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
@@ -43,10 +43,10 @@ module LitleOnline
43
43
  response = LitleOnlineRequest.new.fraud_check_request(hash)
44
44
  assert_equal('000', response.fraudCheckResponse.response)
45
45
  assert_equal('Approved', response.fraudCheckResponse.message)
46
- assert_equal('pass', response.fraudCheckResponse.advancedFraudResult.deviceReviewStatus)
47
- assert_equal('55', response.fraudCheckResponse.advancedFraudResult.deviceReputationScore)
48
- assert_equal('triggered_rule_1', response.fraudCheckResponse.advancedFraudResult.triggeredRule[0])
49
- assert_equal(5, response.fraudCheckResponse.advancedFraudResult.triggeredRule.size())
46
+ assert_equal('pass', response.fraudCheckResponse.advancedFraudResults.deviceReviewStatus)
47
+ assert_equal('55', response.fraudCheckResponse.advancedFraudResults.deviceReputationScore)
48
+ assert_equal('triggered_rule_1', response.fraudCheckResponse.advancedFraudResults.triggeredRule[0])
49
+ assert_equal(5, response.fraudCheckResponse.advancedFraudResults.triggeredRule.size())
50
50
  end
51
51
 
52
52
  def test_fraud_check_session_id
@@ -62,14 +62,14 @@ module LitleOnline
62
62
  response = LitleOnlineRequest.new.fraud_check_request(hash)
63
63
  assert_equal('000', response.fraudCheckResponse.response)
64
64
  assert_equal('Approved', response.fraudCheckResponse.message)
65
- assert_equal('pass', response.fraudCheckResponse.advancedFraudResult.deviceReviewStatus)
66
- assert_equal('42', response.fraudCheckResponse.advancedFraudResult.deviceReputationScore)
65
+ assert_equal('pass', response.fraudCheckResponse.advancedFraudResults.deviceReviewStatus)
66
+ assert_equal('42', response.fraudCheckResponse.advancedFraudResults.deviceReputationScore)
67
67
  # kind of a hack to get around the variable # of triggered rule elements. ie. 1 element is added as a string not
68
68
  # an Array. Fix is to write an unmarshaller or custom node class in XMLFields.rb
69
- if(response.fraudCheckResponse.advancedFraudResult.triggeredRule.is_a?(Array))
70
- assert_equal('triggered_rule_default', response.fraudCheckResponse.advancedFraudResult.triggeredRule[0])
69
+ if(response.fraudCheckResponse.advancedFraudResults.triggeredRule.is_a?(Array))
70
+ assert_equal('triggered_rule_default', response.fraudCheckResponse.advancedFraudResults.triggeredRule[0])
71
71
  elsif
72
- assert_equal('triggered_rule_default', response.fraudCheckResponse.advancedFraudResult.triggeredRule)
72
+ assert_equal('triggered_rule_default', response.fraudCheckResponse.advancedFraudResults.triggeredRule)
73
73
  end
74
74
  end
75
75
 
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
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
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
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
@@ -75,8 +75,10 @@ def test_simple_happy
75
75
  'amount' =>'500',
76
76
  }
77
77
 
78
- response= LitleOnlineRequest.new.load_request(hash)
79
- assert(response.message =~ /Error validating xml data against the schema/)
78
+ #Get exceptions
79
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.load_request(hash)}
80
+ #Test
81
+ assert(exception.message =~ /Error validating xml data against the schema/)
80
82
  end
81
83
  end
82
84
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
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
@@ -49,8 +49,10 @@ def test_simple
49
49
  'reportGroup'=>'Planets',
50
50
  }
51
51
 
52
- response= LitleOnlineRequest.new.load_reversal(hash)
53
- assert(response.message =~ /Error validating xml data against the schema/)
52
+ #Get exceptions
53
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.load_reversal(hash)}
54
+ #Test
55
+ assert(exception.message =~ /Error validating xml data against the schema/)
54
56
  end
55
57
  end
56
58
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
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
@@ -49,8 +49,10 @@ def test_simple
49
49
  'reportGroup'=>'Planets',
50
50
  }
51
51
 
52
- response= LitleOnlineRequest.new.refund_reversal(hash)
53
- assert(response.message =~ /Error validating xml data against the schema/)
52
+ #Get exceptions
53
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.refund_reversal(hash)}
54
+ #Test
55
+ assert(exception.message =~ /Error validating xml data against the schema/)
54
56
  end
55
57
  end
56
58
  end
@@ -1,5 +1,5 @@
1
1
  =begin
2
- Copyright (c) 2012 Litle & Co.
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
@@ -27,24 +27,6 @@ require 'test/unit'
27
27
 
28
28
  module LitleOnline
29
29
  class TestSale < Test::Unit::TestCase
30
- def test_simple_sale_with_card
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
- 'number' =>'4100000000000002',
42
- 'expDate' =>'1210'
43
- }}
44
- response= LitleOnlineRequest.new.sale(hash)
45
- assert_equal('000', response.saleResponse.response)
46
- end
47
-
48
30
  def test_simple_sale_with_paypal
49
31
  hash = {
50
32
  'merchantId' => '101',
@@ -82,7 +64,7 @@ module LitleOnline
82
64
  'transactionId'=>'1234'
83
65
  },
84
66
  'signature' =>'1',
85
- 'version'=>'1'
67
+ 'version'=>'1.0.0'
86
68
  }}
87
69
  response= LitleOnlineRequest.new.sale(hash)
88
70
  assert_equal('Insufficient Funds', response.saleResponse.message)
@@ -103,8 +85,10 @@ module LitleOnline
103
85
  'number' =>'4100000000000002',
104
86
  'expDate' =>'1210'
105
87
  }}
106
- response= LitleOnlineRequest.new.sale(hash)
107
- assert(response.message =~ /Error validating xml data against the schema/)
88
+ #Get exceptions
89
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
90
+ #Test
91
+ assert(exception.message =~ /Error validating xml data against the schema/)
108
92
  end
109
93
 
110
94
  def test_no_report_group
@@ -194,8 +178,10 @@ module LitleOnline
194
178
  'number' =>'4100000000000002',
195
179
  'expDate' =>'1210'
196
180
  }}
197
- response= LitleOnlineRequest.new.sale(hash)
198
- assert(response.message =~ /Error validating xml data against the schema/)
181
+ #Get exceptions
182
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
183
+ #Test
184
+ assert(exception.message =~ /Error validating xml data against the schema/)
199
185
  end
200
186
 
201
187
  def test_no_amount
@@ -211,8 +197,10 @@ module LitleOnline
211
197
  'number' =>'4100000000000002',
212
198
  'expDate' =>'1210'
213
199
  }}
214
- response= LitleOnlineRequest.new.sale(hash)
215
- assert(response.message =~ /Error validating xml data against the schema/)
200
+ #Get exceptions
201
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
202
+ #Test
203
+ assert(exception.message =~ /Error validating xml data against the schema/)
216
204
  end
217
205
 
218
206
  def test_no_order_source
@@ -228,8 +216,10 @@ module LitleOnline
228
216
  'number' =>'4100000000000002',
229
217
  'expDate' =>'1210'
230
218
  }}
231
- response= LitleOnlineRequest.new.sale(hash)
232
- assert(response.message =~ /Error validating xml data against the schema/)
219
+ #Get exceptions
220
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
221
+ #Test
222
+ assert(exception.message =~ /Error validating xml data against the schema/)
233
223
  end
234
224
 
235
225
  def test_simple_sale_with_mpos
@@ -254,6 +244,163 @@ module LitleOnline
254
244
  assert_equal('000', response.saleResponse.response)
255
245
  end
256
246
 
257
- end
247
+ def test_simple_sale_with_processingType
248
+ hash = {
249
+ 'merchantId' => '101',
250
+ 'version'=>'8.8',
251
+ 'reportGroup'=>'Planets',
252
+ 'litleTxnId'=>'123456',
253
+ 'orderId'=>'12344',
254
+ 'amount'=>'106',
255
+ 'orderSource'=>'ecommerce',
256
+ 'card'=>
257
+ {
258
+ 'type'=>'MC',
259
+ 'number' =>'5400000000000000',
260
+ 'expDate' =>'1210'
261
+ },
262
+ 'processingType'=>'initialInstallment'
263
+ }
264
+ response= LitleOnlineRequest.new.sale(hash)
265
+ assert_equal('000', response.saleResponse.response)
266
+ end
267
+
268
+ def test_simple_sale_with_originalNetworkTransactionId_originalTransactionAmount
269
+ hash = {
270
+ 'merchantId' => '101',
271
+ 'version'=>'8.8',
272
+ 'reportGroup'=>'Planets',
273
+ 'litleTxnId'=>'123456',
274
+ 'orderId'=>'12344',
275
+ 'amount'=>'106',
276
+ 'orderSource'=>'ecommerce',
277
+ 'card'=>
278
+ {
279
+ 'type'=>'MC',
280
+ 'number' =>'5400700000000000',
281
+ 'expDate' =>'1210'
282
+ },
283
+ 'originalNetworkTransactionId'=>'98765432109876543210',
284
+ 'originalTransactionAmount'=>'7001'
285
+ }
286
+ response= LitleOnlineRequest.new.sale(hash)
287
+ assert_equal('000', response.saleResponse.response)
288
+ end
289
+
290
+ def test_simple_sale_with_networkTxnId_response_cardSuffix_response
291
+ hash = {
292
+ 'merchantId' => '101',
293
+ 'version'=>'8.8',
294
+ 'reportGroup'=>'Planets',
295
+ 'litleTxnId'=>'123456',
296
+ 'orderId'=>'12344',
297
+ 'amount'=>'106',
298
+ 'orderSource'=>'ecommerce',
299
+ 'card'=>
300
+ {
301
+ 'type'=>'VI',
302
+ 'number' =>'4100700000000000',
303
+ 'expDate' =>'1210',
304
+ 'pin'=>'1111'
305
+ },
306
+ 'originalNetworkTransactionId'=>'98765432109876543210',
307
+ 'originalTransactionAmount'=>'7001'
308
+ }
309
+ response= LitleOnlineRequest.new.sale(hash)
310
+ assert_equal('000', response.saleResponse.response)
311
+ assert_equal('123456', response.saleResponse.cardSuffix)
312
+ assert_equal('63225578415568556365452427825', response.saleResponse.networkTransactionId)
313
+ end
314
+
315
+ def test_simple_sale_with_Wallet_Visa
316
+ hash = {
317
+ 'merchantId' => '101',
318
+ 'version'=>'8.8',
319
+ 'reportGroup'=>'Planets',
320
+ 'litleTxnId'=>'123456',
321
+ 'orderId'=>'12344',
322
+ 'amount'=>'106',
323
+ 'orderSource'=>'ecommerce',
324
+ 'card'=>
325
+ {
326
+ 'type'=>'VI',
327
+ 'number' =>'4100700000000000',
328
+ 'expDate' =>'1210',
329
+ },
330
+ 'wallet'=>{
331
+ 'walletSourceType'=>'VisaCheckout',
332
+ 'walletSourceTypeId'=>'VCIND'
333
+ }
334
+ }
335
+ response= LitleOnlineRequest.new.sale(hash)
336
+ assert_equal('000', response.saleResponse.response)
337
+ assert_equal('123456', response.saleResponse.cardSuffix)
338
+ assert_equal('63225578415568556365452427825', response.saleResponse.networkTransactionId)
339
+ end
340
+
341
+ def test_simple_sale_with_Wallet_Mastercard
342
+ hash = {
343
+ 'merchantId' => '101',
344
+ 'version'=>'8.8',
345
+ 'reportGroup'=>'Planets',
346
+ 'litleTxnId'=>'123456',
347
+ 'orderId'=>'12344',
348
+ 'amount'=>'106',
349
+ 'orderSource'=>'ecommerce',
350
+ 'card'=>
351
+ {
352
+ 'type'=>'MC',
353
+ 'number' =>'5400000000000000',
354
+ 'expDate' =>'1210',
355
+ },
356
+ 'wallet'=>{
357
+ 'walletSourceType'=>'MasterPass',
358
+ 'walletSourceTypeId'=>'MasterPass'
359
+ }
360
+ }
361
+ response= LitleOnlineRequest.new.sale(hash)
362
+ assert_equal('000', response.saleResponse.response)
363
+ end
364
+
365
+ def test_simple_sale_with_sepaDirectDebit
366
+ hash = {
367
+ 'merchantId' => '101',
368
+ 'version'=>'8.8',
369
+ 'reportGroup'=>'Planets',
370
+ 'litleTxnId'=>'123456',
371
+ 'orderId'=>'12344',
372
+ 'amount'=>'106',
373
+ 'orderSource'=>'ecommerce',
374
+ 'sepaDirectDebit'=>
375
+ {
376
+ 'iban'=>'SepaDirectDebit Iban',
377
+ 'mandateProvider' =>'Merchant',
378
+ 'sequenceType' =>'OneTime',
379
+ },
380
+ }
381
+ response= LitleOnlineRequest.new.sale(hash)
382
+ assert_equal('000', response.saleResponse.response)
383
+ assert_equal('http://redirect.url.vantiv.com', response.saleResponse.sepaDirectDebitResponse.redirectUrl)
384
+ end
258
385
 
386
+ def test_simple_sale_with_ideal
387
+ hash = {
388
+ 'merchantId' => '101',
389
+ 'version'=>'8.8',
390
+ 'reportGroup'=>'Planets',
391
+ 'litleTxnId'=>'123456',
392
+ 'orderId'=>'12344',
393
+ 'amount'=>'106',
394
+ 'orderSource'=>'ecommerce',
395
+ 'ideal'=>
396
+ {
397
+ 'preferredLanguage'=>'AD',
398
+ },
399
+ }
400
+ response= LitleOnlineRequest.new.sale(hash)
401
+ assert_equal('000', response.saleResponse.response)
402
+ assert_equal('http://redirect.url.vantiv.com', response.saleResponse.idealResponse.redirectUrl)
403
+ end
404
+
405
+ end
259
406
  end