CnpOnline 9.14.0 → 11.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +7 -7
  2. data/CHANGELOG +23 -17
  3. data/CONTRIBUTORS +0 -0
  4. data/DESCRIPTION +1 -1
  5. data/LICENSE +1 -1
  6. data/README.md +5 -3
  7. data/Rakefile +5 -5
  8. data/Rakefile~ +5 -5
  9. data/SETUP.md +3 -3
  10. data/bin/Setup.rb +59 -41
  11. data/lib/Communications.rb +3 -3
  12. data/lib/Configuration.rb +52 -45
  13. data/lib/EnvironmentVariables.rb +5 -1
  14. data/lib/LitleBatchRequest.rb +72 -7
  15. data/lib/LitleListeners.rb +17 -1
  16. data/lib/LitleOnline.rb +3 -4
  17. data/lib/LitleOnlineRequest.rb +37 -7
  18. data/lib/LitleRequest.rb +315 -186
  19. data/lib/LitleTransaction.rb +212 -85
  20. data/lib/LitleXmlMapper.rb +4 -2
  21. data/lib/XMLFields.rb +384 -171
  22. data/lib/cacert.pem +0 -0
  23. data/samples/Auth/LitleAuthReversalTransaction.rb +2 -2
  24. data/samples/Auth/LitleAuthorizationTransaction.rb +1 -0
  25. data/samples/Auth/LitlePaymentFullLifeCycle.rb +12 -6
  26. data/samples/Batch/AccountUpdate.rb +1 -0
  27. data/samples/Batch/SampleBatchDriver.rb +2 -1
  28. data/samples/Capture/LitleCaptureGivenAuthTransaction.rb +2 -1
  29. data/samples/Capture/LitleCaptureTransaction.rb +2 -2
  30. data/samples/Capture/LitleForceCaptureTransaction.rb +2 -1
  31. data/samples/Capture/LitlePartialCapture.rb +3 -3
  32. data/samples/Credit/LitleCreditTransaction.rb +2 -2
  33. data/samples/Credit/LitleRefundTransaction.rb +2 -1
  34. data/samples/Other/LitleAvsTransaction.rb +2 -1
  35. data/samples/Other/LitleVoidTransaction.rb +2 -1
  36. data/samples/Paypage/FullPaypageLifeCycle.rb +7 -2
  37. data/samples/Run_all.rb +0 -0
  38. data/samples/Sale/LitleSaleTransaction.rb +2 -1
  39. data/samples/Sale/SampleSaleTransaction.rb +2 -1
  40. data/test/certification/certTest1_base.rb +52 -53
  41. data/test/certification/certTest2_authenhanced.rb +24 -25
  42. data/test/certification/certTest3_authreversal.rb +23 -26
  43. data/test/certification/certTest4_echeck.rb +18 -32
  44. data/test/certification/certTest5_token.rb +105 -106
  45. data/test/certification/certTest_batchAll.rb +47 -15
  46. data/test/functional/test_activate.rb +32 -4
  47. data/test/functional/test_activateReversal.rb +18 -5
  48. data/test/functional/test_auth.rb +94 -48
  49. data/test/functional/test_authReversal.rb +4 -1
  50. data/test/functional/test_balanceInquiry.rb +28 -3
  51. data/test/functional/test_batchStream.rb +2 -4
  52. data/test/functional/test_cancelSubscription.rb +2 -2
  53. data/test/functional/test_capture.rb +21 -14
  54. data/test/functional/test_captureGivenAuth.rb +15 -6
  55. data/test/functional/test_createPlan.rb +1 -1
  56. data/test/functional/test_credit.rb +14 -5
  57. data/test/functional/test_deactivate.rb +26 -3
  58. data/test/functional/test_deactivateReversal.rb +18 -5
  59. data/test/functional/test_depositReversal.rb +31 -19
  60. data/test/functional/test_echeckCredit.rb +34 -6
  61. data/test/functional/test_echeckRedeposit.rb +29 -2
  62. data/test/functional/test_echeckSale.rb +68 -11
  63. data/test/functional/test_echeckVerification.rb +32 -7
  64. data/test/functional/test_echeckVoid.rb +2 -1
  65. data/test/functional/test_forceCapture.rb +20 -6
  66. data/test/functional/test_fraudCheck.rb +3 -5
  67. data/test/functional/test_giftCardAuthReversal.rb +72 -0
  68. data/test/functional/test_giftCardCapture.rb +72 -0
  69. data/test/functional/test_giftCardCredit.rb +69 -0
  70. data/test/functional/test_litle_requests.rb +3 -6
  71. data/test/functional/test_load.rb +27 -3
  72. data/test/functional/test_loadReversal.rb +18 -5
  73. data/test/functional/test_override.rb +7 -3
  74. data/test/functional/test_pgp_litle_requests.rb +294 -0
  75. data/test/functional/test_queryTransaction.rb +152 -0
  76. data/test/functional/test_refundReversal.rb +18 -5
  77. data/test/functional/test_sale.rb +122 -159
  78. data/test/functional/test_token.rb +17 -11
  79. data/test/functional/test_unload.rb +27 -3
  80. data/test/functional/test_unloadReversal.rb +18 -5
  81. data/test/functional/test_updateCardValidationNumOnToken.rb +1 -0
  82. data/test/functional/test_updatePlan.rb +2 -1
  83. data/test/functional/test_updateSubscription.rb +3 -1
  84. data/test/functional/test_wallet.rb +74 -0
  85. data/test/functional/test_xmlfields.rb +22 -3
  86. data/test/functional/ts_all.rb +2 -0
  87. data/test/unit/test_LitleBatchRequest.rb +53 -5
  88. data/test/unit/test_LitleOnlineRequest.rb +5 -30
  89. data/test/unit/test_LitleRequest.rb +7 -6
  90. data/test/unit/test_LitleTransaction.rb +34 -5
  91. data/test/unit/test_LitleXmlMapper.rb +3 -0
  92. data/test/unit/test_activate.rb +22 -2
  93. data/test/unit/test_activateReversal.rb +15 -3
  94. data/test/unit/test_auth.rb +11 -9
  95. data/test/unit/test_balanceInquiry.rb +2 -2
  96. data/test/unit/test_capture.rb +2 -2
  97. data/test/unit/test_captureGivenAuth.rb +21 -1
  98. data/test/unit/test_credit.rb +1 -1
  99. data/test/unit/test_deactivate.rb +19 -0
  100. data/test/unit/test_deactivateReversal.rb +15 -3
  101. data/test/unit/test_depositReversal.rb +17 -5
  102. data/test/unit/test_echeckCredit.rb +19 -0
  103. data/test/unit/test_echeckRedeposit.rb +15 -0
  104. data/test/unit/test_echeckSale.rb +20 -1
  105. data/test/unit/test_echeckVerification.rb +6 -3
  106. data/test/unit/test_forceCapture.rb +1 -1
  107. data/test/unit/test_giftCardAuthReversal.rb +58 -0
  108. data/test/{functional/test_utf8.rb → unit/test_giftCardCapture.rb} +25 -12
  109. data/test/unit/test_giftCardCredit.rb +57 -0
  110. data/test/unit/test_load.rb +2 -2
  111. data/test/unit/test_loadReversal.rb +15 -3
  112. data/test/unit/test_pgp_LitleRequest +139 -0
  113. data/test/unit/test_queryTransaction.rb +105 -0
  114. data/test/unit/test_refundReversal.rb +15 -3
  115. data/test/unit/test_sale.rb +23 -3
  116. data/test/unit/test_token.rb +24 -20
  117. data/test/unit/test_unload.rb +2 -2
  118. data/test/unit/test_unloadReversal.rb +15 -3
  119. data/test/unit/test_wallet.rb +262 -0
  120. data/test/unit/ts_unit.rb +2 -1
  121. metadata +81 -100
@@ -0,0 +1,152 @@
1
+ =begin
2
+ Copyright (c) 2017 Vantiv eCommerce
3
+
4
+ Permission is hereby granted, free of charge, to any person
5
+ obtaining a copy of this software and associated documentation
6
+ files (the "Software"), to deal in the Software without
7
+ restriction, including without limitation the rights to use,
8
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the
10
+ Software is furnished to do so, subject to the following
11
+ conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
+ OTHER DEALINGS IN THE SOFTWARE.
24
+ =end
25
+
26
+ require File.expand_path("../../../lib/LitleOnline",__FILE__)
27
+ require 'test/unit'
28
+ module LitleOnline
29
+ class TestqueryTransaction < Test::Unit::TestCase
30
+ def test_queryTransaction
31
+ hash = {
32
+ 'merchantId' => '101',
33
+ 'id' => 'test',
34
+ 'version'=>'10.0',
35
+ 'reportGroup'=>'Some RG',
36
+ 'customerId' => '038945',
37
+ 'origId' => '834262',
38
+ 'origActionType' => 'A',
39
+ 'transactionId'=>'123456',
40
+ 'orderId'=>'65347567',
41
+ #'origAccountNumber' => '4000000000000001'
42
+ }
43
+ response= LitleOnlineRequest.new.query_Transaction(hash)
44
+ assert_equal('000', response.queryTransactionResponse.response)
45
+ end
46
+
47
+ def test_queryTransaction_valid_enum
48
+ hash = {
49
+ 'merchantId' => '101',
50
+ 'id' => 'test',
51
+ 'version'=>'10.0',
52
+ 'reportGroup'=>'Some RG',
53
+ 'customerId' => '038945',
54
+ 'origId' => '834262',
55
+ 'origActionType' => '',
56
+ 'transactionId'=>'123456',
57
+ 'orderId'=>'65347567',
58
+ #'origAccountNumber' => '4000000000000001'
59
+ }
60
+ response= LitleOnlineRequest.new.query_Transaction(hash)
61
+ assert('000', response.queryTransactionResponse.response)
62
+ end
63
+
64
+ def test_queryTransaction_no_origid
65
+ hash = {
66
+ 'merchantId' => '101',
67
+ 'id' => 'test',
68
+ 'version'=>'10.0',
69
+ 'reportGroup'=>'Some RG',
70
+ 'customerId' => '038945',
71
+ 'origActionType' => 'A',
72
+ 'transactionId'=>'123456',
73
+ 'orderId'=>'65347567',
74
+ #'origAccountNumber' => '4000000000000001'
75
+ }
76
+ #Get exceptions
77
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.query_Transaction(hash)}
78
+ #Test
79
+ assert(exception.message =~ /Error validating xml data against the schema/)
80
+ end
81
+
82
+ def test_queryTransaction_no_accttype
83
+ hash = {
84
+ 'merchantId' => '101',
85
+ 'id' => 'test',
86
+ 'version'=>'10.0',
87
+ 'reportGroup'=>'Some RG',
88
+ 'customerId' => '038945',
89
+ 'origId' => '834262',
90
+ 'transactionId'=>'123456',
91
+ 'orderId'=>'65347567',
92
+ #'origAccountNumber' => '4000000000000001'
93
+ }
94
+ #Get exceptions
95
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.query_Transaction(hash)}
96
+ #Test
97
+ assert(exception.message =~ /Error validating xml data against the schema/)
98
+ end
99
+
100
+ def test_queryTransaction_invalid_values
101
+ hash = {
102
+ 'merchantId' => '101',
103
+ 'id' => 'test',
104
+ 'version'=>'10.0',
105
+ 'reportGroup'=>'Some RG',
106
+ 'customerId' => '038945',
107
+ 'origId' => '834262',
108
+ 'origActionType' => 'AAA',
109
+ 'transactionId'=>'123456',
110
+ 'orderId'=>'65347567',
111
+ #'origAccountNumber' => '4000000000000001'
112
+ }
113
+ #Get exceptions
114
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.query_Transaction(hash)}
115
+ #Test
116
+ assert(exception.message =~ /Error validating xml data against the schema/)
117
+ end
118
+
119
+ def test_queryTransaction_missing_attributes
120
+ hash = {
121
+ 'merchantId' => '101',
122
+ 'id' => 'test',
123
+ 'version'=>'10.0',
124
+ 'customerId' => '038945',
125
+ 'origActionType' => 'A',
126
+ 'transactionId'=>'123456',
127
+ #'origAccountNumber' => '4000000000000001'
128
+ }
129
+ #Get exceptions
130
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.query_Transaction(hash)}
131
+ #Test
132
+ assert(exception.message =~ /Error validating xml data against the schema/)
133
+ end
134
+
135
+ def test_queryTransaction_unavailable_response
136
+ hash = {
137
+ 'merchantId' => '101',
138
+ 'id' => 'test',
139
+ 'version'=>'10.0',
140
+ 'reportGroup'=>'Some RG',
141
+ 'customerId' => '038945',
142
+ 'origId' => 'aaa',
143
+ 'origActionType' => 'A',
144
+ 'transactionId'=>'123456',
145
+ 'orderId'=>'65347567',
146
+ #'origAccountNumber' => '4000000000000001'
147
+ }
148
+ response= LitleOnlineRequest.new.query_Transaction(hash)
149
+ assert_equal('152', response.queryTransactionUnavailableResponse.response)
150
+ end
151
+ end
152
+ end
@@ -33,12 +33,25 @@ def test_simple
33
33
  hash = {
34
34
  'merchantId' => '101',
35
35
  'version'=>'8.8',
36
+ 'id'=>'test',
36
37
  'reportGroup'=>'Planets',
37
- 'litleTxnId' =>'5000'
38
- }
38
+ 'litleTxnId' =>'5000',
39
+ 'card'=>{
40
+ 'type'=>'GC',
41
+ 'number' =>'400000000000001',
42
+ 'expDate' =>'0150',
43
+ 'pin' => '1234',
44
+ 'cardValidationNum' => '411'
45
+ },
46
+ 'originalRefCode' => '101',
47
+ 'originalAmount' => '34561',
48
+ 'originalTxnTime' => '2017-01-24T09:00:00',
49
+ 'originalSystemTraceId' => '33',
50
+ 'originalSequenceNumber' => '111111',
51
+ }
39
52
 
40
- response= LitleOnlineRequest.new.refund_reversal(hash)
41
- assert_equal('Valid Format', response.message)
53
+ response= LitleOnlineRequest.new.deposit_reversal(hash)
54
+ assert_equal('000', response.depositReversalResponse.response)
42
55
  end
43
56
 
44
57
 
@@ -52,7 +65,7 @@ def test_simple
52
65
  #Get exceptions
53
66
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.refund_reversal(hash)}
54
67
  #Test
55
- assert(exception.message =~ /Error validating xml data against the schema/)
68
+ assert(exception.message =~ /Error validating xml data against the schema/)
56
69
  end
57
70
  end
58
71
  end
@@ -27,9 +27,30 @@ 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
+ 'id' => 'test',
34
+ 'version'=>'8.8',
35
+ 'reportGroup'=>'Planets',
36
+ 'litleTxnId'=>'123456',
37
+ 'orderId'=>'12344',
38
+ 'amount'=>'106',
39
+ 'orderSource'=>'ecommerce',
40
+ 'card'=>{
41
+ 'type'=>'VI',
42
+ 'number' =>'4100000000000002',
43
+ 'expDate' =>'1210'
44
+ }}
45
+
46
+ response= LitleOnlineRequest.new.sale(hash)
47
+ assert_equal('000', response.saleResponse.response)
48
+ end
49
+
30
50
  def test_simple_sale_with_paypal
31
51
  hash = {
32
52
  'merchantId' => '101',
53
+ 'id' => 'test',
33
54
  'version'=>'8.8',
34
55
  'reportGroup'=>'Planets',
35
56
  'litleTxnId'=>'123456',
@@ -41,13 +62,15 @@ module LitleOnline
41
62
  'token'=>'1234',
42
63
  'transactionId'=>'123456'
43
64
  }}
65
+
44
66
  response= LitleOnlineRequest.new.sale(hash)
45
67
  assert_equal 'Valid Format', response.message
46
68
  end
47
69
 
48
- def test_simple_sale_with_applepay_and_secondaryAmount
70
+ def test_simple_sale_with_applepay_and_secondaryAmount1
49
71
  hash = {
50
72
  'merchantId' => '101',
73
+ 'id' => 'test',
51
74
  'version'=>'8.8',
52
75
  'reportGroup'=>'Planets',
53
76
  'litleTxnId'=>'123456',
@@ -64,7 +87,8 @@ module LitleOnline
64
87
  'transactionId'=>'1234'
65
88
  },
66
89
  'signature' =>'1',
67
- 'version'=>'1.0.0'
90
+ #'version'=>'1'
91
+ 'version'=>'10000'
68
92
  }}
69
93
  response= LitleOnlineRequest.new.sale(hash)
70
94
  assert_equal('Insufficient Funds', response.saleResponse.message)
@@ -74,6 +98,7 @@ module LitleOnline
74
98
  def test_illegal_order_source
75
99
  hash = {
76
100
  'merchantId' => '101',
101
+ 'id' => 'test',
77
102
  'version'=>'8.8',
78
103
  'reportGroup'=>'Planets',
79
104
  'litleTxnId'=>'123456',
@@ -88,12 +113,13 @@ module LitleOnline
88
113
  #Get exceptions
89
114
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
90
115
  #Test
91
- assert(exception.message =~ /Error validating xml data against the schema/)
116
+ assert(exception.message =~ /Error validating xml data against the schema/)
92
117
  end
93
118
 
94
119
  def test_no_report_group
95
120
  hash = {
96
121
  'merchantId' => '101',
122
+ 'id' => 'test',
97
123
  'version'=>'8.8',
98
124
  'reportGroup'=>'Planets',
99
125
  'litleTxnId'=>'123456',
@@ -112,6 +138,7 @@ module LitleOnline
112
138
  def test_fields_out_of_order
113
139
  hash = {
114
140
  'merchantId' => '101',
141
+ 'id' => 'test',
115
142
  'version'=>'8.8',
116
143
  'orderSource'=>'ecommerce',
117
144
  'litleTxnId'=>'123456',
@@ -131,6 +158,7 @@ module LitleOnline
131
158
  def test_invalid_field
132
159
  hash = {
133
160
  'merchantId' => '101',
161
+ 'id' => 'test',
134
162
  'version'=>'8.8',
135
163
  'reportGroup'=>'Planets',
136
164
  'litleTxnId'=>'123456',
@@ -147,9 +175,10 @@ module LitleOnline
147
175
  assert_equal('000', response.saleResponse.response)
148
176
  end
149
177
 
150
- def test_simple_sale_with_card
178
+ def test_simple_sale_with_card1
151
179
  hash = {
152
180
  'merchantId'=>'101',
181
+ 'id' => 'test',
153
182
  'version'=>'8.8',
154
183
  'reportGroup'=>'Planets',
155
184
  'litleTxnId'=>'123456',
@@ -168,6 +197,7 @@ module LitleOnline
168
197
  def test_no_order_id
169
198
  hash = {
170
199
  'merchantId' => '101',
200
+ 'id' => 'test',
171
201
  'version'=>'8.8',
172
202
  'reportGroup'=>'Planets',
173
203
  'litleTxnId'=>'123456',
@@ -181,12 +211,13 @@ module LitleOnline
181
211
  #Get exceptions
182
212
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
183
213
  #Test
184
- assert(exception.message =~ /Error validating xml data against the schema/)
214
+ assert(exception.message =~ /Error validating xml data against the schema/)
185
215
  end
186
216
 
187
217
  def test_no_amount
188
218
  hash = {
189
219
  'merchantId' => '101',
220
+ 'id' => 'test',
190
221
  'version'=>'8.8',
191
222
  'reportGroup'=>'Planets',
192
223
  'litleTxnId'=>'123456',
@@ -200,12 +231,13 @@ module LitleOnline
200
231
  #Get exceptions
201
232
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
202
233
  #Test
203
- assert(exception.message =~ /Error validating xml data against the schema/)
234
+ assert(exception.message =~ /Error validating xml data against the schema/)
204
235
  end
205
236
 
206
237
  def test_no_order_source
207
238
  hash = {
208
239
  'merchantId' => '101',
240
+ 'id' => 'test',
209
241
  'version'=>'8.8',
210
242
  'reportGroup'=>'Planets',
211
243
  'litleTxnId'=>'123456',
@@ -219,12 +251,13 @@ module LitleOnline
219
251
  #Get exceptions
220
252
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.sale(hash)}
221
253
  #Test
222
- assert(exception.message =~ /Error validating xml data against the schema/)
254
+ assert(exception.message =~ /Error validating xml data against the schema/)
223
255
  end
224
256
 
225
257
  def test_simple_sale_with_mpos
226
258
  hash = {
227
259
  'merchantId' => '101',
260
+ 'id' => 'test',
228
261
  'version'=>'8.8',
229
262
  'reportGroup'=>'Planets',
230
263
  'litleTxnId'=>'123456',
@@ -243,202 +276,132 @@ module LitleOnline
243
276
  response= LitleOnlineRequest.new.sale(hash)
244
277
  assert_equal('000', response.saleResponse.response)
245
278
  end
246
-
247
- def test_simple_sale_with_processingType
248
- hash = {
279
+
280
+ def test_simple_sale_with_applepay_and_secondaryAmount
281
+ hash =
282
+ {
283
+ 'merchantId' => '101',
284
+ 'id' => 'test',
285
+ 'version'=>'8.8',
286
+ 'reportGroup'=>'Planets',
287
+ 'litleTxnId'=>'123456',
288
+ 'orderId'=>'12344',
289
+ 'amount'=>'110',
290
+ 'secondaryAmount'=>'50',
291
+ 'orderSource'=>'ecommerce',
292
+ 'applepay'=>
293
+ {
294
+ 'data'=>'1234',
295
+ 'header'=>
296
+ {
297
+ 'applicationData'=>'454657413164',
298
+ 'ephemeralPublicKey'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
299
+ 'publicKeyHash'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855',
300
+ 'transactionId'=>'1234'
301
+ },
302
+
303
+ 'signature' =>'1',
304
+ 'version'=>'100000'
305
+ }}
306
+ response= LitleOnlineRequest.new.sale(hash)
307
+ assert_equal('Insufficient Funds', response.saleResponse.message)
308
+ assert_equal('110', response.saleResponse.applepayResponse.transactionAmount)
309
+ end
310
+
311
+ #SDK Ruby XML 10
312
+ def test_simple_sale_with_wallet1
313
+ hash =
314
+ {
249
315
  'merchantId' => '101',
316
+ 'id' => 'test',
250
317
  'version'=>'8.8',
251
318
  'reportGroup'=>'Planets',
252
319
  'litleTxnId'=>'123456',
253
320
  'orderId'=>'12344',
254
321
  'amount'=>'106',
255
322
  '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
323
+ 'paypal'=>
324
+ {
325
+ 'payerId'=>'1234',
326
+ 'token'=>'1234',
327
+ 'transactionId'=>'123456'
328
+ },
329
+ 'wallet'=>
330
+ {
331
+ 'walletSourceType' => 'MasterPass',
332
+ 'walletSourceTypeId' => '102'
333
+ }}
334
+ response= LitleOnlineRequest.new.sale(hash)
335
+ assert_equal 'Valid Format', response.message
336
+ end
337
+
338
+ def test_simple_sale_with_processingType
269
339
  hash = {
270
- 'merchantId' => '101',
340
+ 'merchantId' => '101',
341
+ 'id' => 'test',
271
342
  'version'=>'8.8',
272
343
  'reportGroup'=>'Planets',
273
344
  'litleTxnId'=>'123456',
274
345
  'orderId'=>'12344',
275
346
  'amount'=>'106',
276
347
  'orderSource'=>'ecommerce',
277
- 'card'=>
278
- {
279
- 'type'=>'MC',
280
- 'number' =>'5400700000000000',
348
+ 'processingType'=>'initialInstallment',
349
+ 'card'=>{
350
+ 'type'=>'VI',
351
+ 'number' =>'4100000000000002',
281
352
  'expDate' =>'1210'
282
- },
283
- 'originalNetworkTransactionId'=>'98765432109876543210',
284
- 'originalTransactionAmount'=>'7001'
353
+ }
285
354
  }
286
355
  response= LitleOnlineRequest.new.sale(hash)
287
- assert_equal('000', response.saleResponse.response)
356
+ assert_equal 'Valid Format', response.message
288
357
  end
289
-
290
- def test_simple_sale_with_networkTxnId_response_cardSuffix_response
358
+
359
+ def test_simple_sale_with_originalNetworkTransactionId_originalTransactionAmount
291
360
  hash = {
292
361
  'merchantId' => '101',
362
+ 'id' => 'test',
293
363
  'version'=>'8.8',
294
364
  'reportGroup'=>'Planets',
295
365
  'litleTxnId'=>'123456',
296
366
  'orderId'=>'12344',
297
367
  'amount'=>'106',
298
368
  'orderSource'=>'ecommerce',
299
- 'card'=>
300
- {
369
+ 'card'=>{
301
370
  'type'=>'VI',
302
- 'number' =>'4100700000000000',
303
- 'expDate' =>'1210',
304
- 'pin'=>'1111'
371
+ 'number' =>'4100000000000002',
372
+ 'expDate' =>'1210'
305
373
  },
306
374
  'originalNetworkTransactionId'=>'98765432109876543210',
307
375
  'originalTransactionAmount'=>'7001'
308
376
  }
309
377
  response= LitleOnlineRequest.new.sale(hash)
310
- assert_equal('000', response.saleResponse.response)
311
- assert_equal('123456', response.saleResponse.cardSuffix)
378
+ assert_equal 'Valid Format', response.message
312
379
  assert_equal('63225578415568556365452427825', response.saleResponse.networkTransactionId)
313
380
  end
314
381
 
315
- def test_simple_sale_with_Wallet_Visa
382
+ def test_simple_sale_with_sepaDirectDebit
316
383
  hash = {
317
384
  'merchantId' => '101',
385
+ 'id' => 'test',
318
386
  'version'=>'8.8',
319
387
  'reportGroup'=>'Planets',
320
388
  'litleTxnId'=>'123456',
321
389
  'orderId'=>'12344',
322
390
  'amount'=>'106',
323
391
  '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
- }
392
+ 'sepaDirectDebit'=> {
393
+ 'mandateProvider'=>'Merchant',
394
+ 'sequenceType'=>'FirstRecurring',
395
+ 'iban'=>'123456789123456789'
396
+ }}
381
397
  response= LitleOnlineRequest.new.sale(hash)
382
- assert_equal('000', response.saleResponse.response)
398
+ assert_equal 'Valid Format', response.message
383
399
  assert_equal('http://redirect.url.vantiv.com', response.saleResponse.sepaDirectDebitResponse.redirectUrl)
400
+ assert_equal('jj2d1d372osmmt7tb8epm0a99q', response.saleResponse.sepaDirectDebitResponse.redirectToken)
401
+ assert_equal('1BADA58', response.saleResponse.sepaDirectDebitResponse.mandateReference)
384
402
  end
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
- # def test_simple_sale_with_giropay
406
- # hash = {
407
- # 'merchantId' => '101',
408
- # 'version'=>'9.14',
409
- # 'reportGroup'=>'Planets',
410
- # 'litleTxnId'=>'123456',
411
- # 'orderId'=>'12344',
412
- # 'amount'=>'106',
413
- # 'orderSource'=>'ecommerce',
414
- # 'giropay'=>
415
- # {
416
- # 'preferredLanguage'=>'AD',
417
- # }
418
- # }
419
- # response= LitleOnlineRequest.new.sale(hash)
420
- # assert_equal('000', response.saleResponse.response)
421
- # assert_equal('http://redirect.url.vantiv.com', response.saleResponse.giropayResponse.redirectUrl)
422
- # end
423
- #
424
- # def test_simple_sale_with_sofort
425
- # hash = {
426
- # 'merchantId' => '101',
427
- # 'version'=>'8.8',
428
- # 'reportGroup'=>'Planets',
429
- # 'litleTxnId'=>'123456',
430
- # 'orderId'=>'12344',
431
- # 'amount'=>'106',
432
- # 'orderSource'=>'ecommerce',
433
- # 'sofort'=>
434
- # {
435
- # 'preferredLanguage'=>'AD',
436
- # },
437
- # }
438
- # response= LitleOnlineRequest.new.sale(hash)
439
- # assert_equal('000', response.saleResponse.response)
440
- # assert_equal('http://redirect.url.vantiv.com', response.saleResponse.sofortResponse.redirectUrl)
441
- # end
442
-
443
- end
403
+
404
+
405
+
406
+ end
444
407
  end