CnpOnline 8.31.1 → 9.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +29 -12
  3. data/DESCRIPTION +2 -2
  4. data/LICENSE +1 -1
  5. data/README.md +1 -1
  6. data/Rakefile +4 -4
  7. data/Rakefile~ +5 -5
  8. data/SETUP.md +3 -3
  9. data/bin/Setup.rb +9 -8
  10. data/bin/sample_batch_driver.rb +1 -1
  11. data/bin/sample_driver.rb +1 -1
  12. data/lib/Communications.rb +1 -1
  13. data/lib/Configuration.rb +16 -16
  14. data/lib/EnvironmentVariables.rb +1 -2
  15. data/lib/LitleBatchRequest.rb +283 -147
  16. data/lib/LitleListeners.rb +132 -33
  17. data/lib/LitleOnline.rb +5 -4
  18. data/lib/LitleOnlineRequest.rb +69 -59
  19. data/lib/LitleRequest.rb +178 -141
  20. data/lib/LitleTransaction.rb +279 -122
  21. data/lib/LitleXmlMapper.rb +9 -4
  22. data/lib/XMLFields.rb +345 -26
  23. data/test/certification/certTest1_base.rb +74 -73
  24. data/test/certification/certTest2_authenhanced.rb +1 -1
  25. data/test/certification/certTest3_authreversal.rb +1 -1
  26. data/test/certification/certTest4_echeck.rb +4 -1
  27. data/test/certification/certTest5_token.rb +4 -4
  28. data/test/certification/certTest_batchAll.rb +296 -55
  29. data/test/certification/ts_all.rb +1 -1
  30. data/test/functional/test_activate.rb +7 -3
  31. data/test/functional/test_activateReversal.rb +7 -3
  32. data/test/functional/test_auth.rb +119 -16
  33. data/test/functional/test_authReversal.rb +5 -3
  34. data/test/functional/test_balanceInquiry.rb +5 -3
  35. data/test/functional/test_batch.rb +3 -3
  36. data/test/functional/test_batchStream.rb +14 -4
  37. data/test/functional/test_cancelSubscription.rb +5 -3
  38. data/test/functional/test_capture.rb +34 -3
  39. data/test/functional/test_captureGivenAuth.rb +55 -4
  40. data/test/functional/test_configuration.rb +2 -2
  41. data/test/functional/test_createPlan.rb +5 -3
  42. data/test/functional/test_credit.rb +45 -16
  43. data/test/functional/test_deactivate.rb +5 -3
  44. data/test/functional/test_deactivateReversal.rb +5 -3
  45. data/test/functional/test_depositReversal.rb +5 -3
  46. data/test/functional/test_echeckCredit.rb +26 -9
  47. data/test/functional/test_echeckRedeposit.rb +5 -3
  48. data/test/functional/test_echeckSale.rb +49 -28
  49. data/test/functional/test_echeckVerification.rb +20 -12
  50. data/test/functional/test_echeckVoid.rb +1 -1
  51. data/test/functional/test_forceCapture.rb +44 -22
  52. data/test/functional/test_fraudCheck.rb +77 -0
  53. data/test/functional/test_litle_requests.rb +24 -24
  54. data/test/functional/test_load.rb +5 -3
  55. data/test/functional/test_loadReversal.rb +5 -3
  56. data/test/functional/test_refundReversal.rb +5 -3
  57. data/test/functional/test_sale.rb +214 -29
  58. data/test/functional/test_token.rb +19 -3
  59. data/test/functional/test_unload.rb +5 -3
  60. data/test/functional/test_unloadReversal.rb +6 -4
  61. data/test/functional/test_updateCardValidationNumOnToken.rb +1 -1
  62. data/test/functional/test_updatePlan.rb +5 -3
  63. data/test/functional/test_updateSubscription.rb +5 -3
  64. data/test/functional/test_utf8.rb +44 -0
  65. data/test/functional/test_xmlfields.rb +10 -6
  66. data/test/functional/ts_all.rb +2 -1
  67. data/test/unit/test_LitleAUBatch.rb +29 -1
  68. data/test/unit/test_LitleBatchRequest.rb +247 -113
  69. data/test/unit/test_LitleOnlineRequest.rb +37 -54
  70. data/test/unit/test_LitleRequest.rb +3 -3
  71. data/test/unit/test_LitleTransaction.rb +5 -5
  72. data/test/unit/test_LitleXmlMapper.rb +136 -0
  73. data/test/unit/test_activate.rb +1 -21
  74. data/test/unit/test_activateReversal.rb +1 -1
  75. data/test/unit/test_auth.rb +54 -14
  76. data/test/unit/test_authReversal.rb +1 -1
  77. data/test/unit/test_balanceInquiry.rb +1 -1
  78. data/test/unit/test_cancelSubscription.rb +1 -1
  79. data/test/unit/test_capture.rb +27 -1
  80. data/test/unit/test_captureGivenAuth.rb +44 -18
  81. data/test/unit/test_createPlan.rb +1 -1
  82. data/test/unit/test_credit.rb +16 -3
  83. data/test/unit/test_deactivate.rb +1 -1
  84. data/test/unit/test_deactivateReversal.rb +1 -1
  85. data/test/unit/test_depositReversal.rb +1 -1
  86. data/test/unit/test_echeckCredit.rb +15 -2
  87. data/test/unit/test_echeckRedeposit.rb +1 -1
  88. data/test/unit/test_echeckSale.rb +18 -1
  89. data/test/unit/test_echeckVerification.rb +1 -1
  90. data/test/unit/test_echeckVoid.rb +1 -1
  91. data/test/unit/test_forceCapture.rb +20 -2
  92. data/test/unit/test_fraudCheck.rb +45 -0
  93. data/test/unit/test_load.rb +1 -1
  94. data/test/unit/test_loadReversal.rb +1 -1
  95. data/test/unit/test_refundReversal.rb +1 -1
  96. data/test/unit/test_sale.rb +73 -7
  97. data/test/unit/test_token.rb +15 -4
  98. data/test/unit/test_unload.rb +1 -1
  99. data/test/unit/test_unloadReversal.rb +1 -1
  100. data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
  101. data/test/unit/test_updatePlan.rb +1 -1
  102. data/test/unit/test_updateSubscription.rb +1 -1
  103. data/test/unit/test_xmlfields.rb +1 -1
  104. data/test/unit/ts_unit.rb +2 -1
  105. metadata +10 -7
  106. data/CHANGELOG~ +0 -142
@@ -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
@@ -93,8 +93,12 @@ def test_simple_virtualGiftCard_happy
93
93
  'amount' =>'500',
94
94
  }
95
95
 
96
- response= LitleOnlineRequest.new.activate(hash)
97
- assert(response.message =~ /Error validating xml data against the schema/)
96
+ #Get exceptions
97
+ exception = assert_raise(RuntimeError){
98
+ LitleOnlineRequest.new.activate(hash)
99
+ }
100
+ #Test
101
+ assert(exception.message =~ /Error validating xml data against the schema/)
98
102
  end
99
103
  end
100
104
  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,12 @@ def test_simple
49
49
  'reportGroup'=>'Planets',
50
50
  }
51
51
 
52
- response= LitleOnlineRequest.new.activate_reversal(hash)
53
- assert(response.message =~ /Error validating xml data against the schema/)
52
+ #Get exceptions
53
+ exception = assert_raise(RuntimeError){
54
+ LitleOnlineRequest.new.activate_reversal(hash)
55
+ }
56
+ #Test
57
+ assert(exception.message =~ /Error validating xml data against the schema/)
54
58
  end
55
59
  end
56
60
  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
@@ -80,7 +80,7 @@ module LitleOnline
80
80
  'transactionId'=>'1234'
81
81
  },
82
82
  'signature' =>'1',
83
- 'version'=>'12345'
83
+ 'version'=>'1.0.0'
84
84
  }}
85
85
  response= LitleOnlineRequest.new.authorization(hash)
86
86
  assert_equal('Insufficient Funds', response.authorizationResponse.message)
@@ -100,8 +100,14 @@ module LitleOnline
100
100
  'number' =>'4100000000000001',
101
101
  'expDate' =>'1210'
102
102
  }}
103
- response= LitleOnlineRequest.new.authorization(hash)
104
- assert(response.message =~ /Error validating xml data against the schema/)
103
+
104
+ #Get exceptions
105
+ exception = assert_raise(RuntimeError){
106
+ LitleOnlineRequest.new.authorization(hash)
107
+ }
108
+ #Test
109
+ assert(exception.message =~ /Error validating xml data against the schema/)
110
+
105
111
  end
106
112
 
107
113
  def test_fields_out_of_order
@@ -152,8 +158,12 @@ module LitleOnline
152
158
  'number' =>'4100000000000001',
153
159
  'expDate' =>'1210'
154
160
  }}
155
- response= LitleOnlineRequest.new.authorization(hash)
156
- assert(response.message =~ /Error validating xml data against the schema/)
161
+ #Get exceptions
162
+ exception = assert_raise(RuntimeError){
163
+ LitleOnlineRequest.new.authorization(hash)
164
+ }
165
+ #Test
166
+ assert(exception.message =~ /Error validating xml data against the schema/)
157
167
  end
158
168
 
159
169
  def test_no_amount
@@ -168,8 +178,12 @@ module LitleOnline
168
178
  'number' =>'4100000000000001',
169
179
  'expDate' =>'1210'
170
180
  }}
171
- response= LitleOnlineRequest.new.authorization(hash)
172
- assert(response.message =~ /Error validating xml data against the schema/)
181
+ #Get exceptions
182
+ exception = assert_raise(RuntimeError){
183
+ LitleOnlineRequest.new.authorization(hash)
184
+ }
185
+ #Test
186
+ assert(exception.message =~ /Error validating xml data against the schema/)
173
187
  end
174
188
 
175
189
  def test_no_order_source
@@ -185,8 +199,12 @@ module LitleOnline
185
199
  'number' =>'4100000000000001',
186
200
  'expDate' =>'1210'
187
201
  }}
188
- response= LitleOnlineRequest.new.authorization(hash)
189
- assert(response.message =~ /Error validating xml data against the schema/)
202
+ #Get exceptions
203
+ exception = assert_raise(RuntimeError){
204
+ LitleOnlineRequest.new.authorization(hash)
205
+ }
206
+ #Test
207
+ assert(exception.message =~ /Error validating xml data against the schema/)
190
208
  end
191
209
 
192
210
  def test_authorization_missing_attributes
@@ -201,12 +219,16 @@ module LitleOnline
201
219
  'expDate' =>'1210'
202
220
  }}
203
221
 
204
- response= LitleOnlineRequest.new.authorization(hash)
205
- assert(response.message =~ /Error validating xml data against the schema/)
222
+ #Get exceptions
223
+ exception = assert_raise(RuntimeError){
224
+ LitleOnlineRequest.new.authorization(hash)
225
+ }
226
+ #Test
227
+ assert(exception.message =~ /Error validating xml data against the schema/)
206
228
  end
207
229
 
208
230
  def test_orderId_required
209
- start_hash = {
231
+ hash = {
210
232
  'merchantId'=>'101',
211
233
  'reportGroup'=>'Planets',
212
234
  'amount'=>'101',
@@ -216,10 +238,14 @@ module LitleOnline
216
238
  'number' => '1111222233334444'
217
239
  }
218
240
  }
219
- response= LitleOnlineRequest.new.authorization(start_hash)
220
- assert(response.message =~ /Error validating xml data against the schema/)
241
+ #Get exceptions
242
+ exception = assert_raise(RuntimeError){
243
+ LitleOnlineRequest.new.authorization(hash)
244
+ }
245
+ #Test
246
+ assert(exception.message =~ /Error validating xml data against the schema/)
221
247
 
222
- response = LitleOnlineRequest.new.authorization(start_hash.merge({'orderId'=>'1234'}))
248
+ response = LitleOnlineRequest.new.authorization(hash.merge({'orderId'=>'1234'}))
223
249
  assert_equal('000', response.authorizationResponse.response)
224
250
  end
225
251
 
@@ -294,5 +320,82 @@ module LitleOnline
294
320
  response= LitleOnlineRequest.new.authorization(hash)
295
321
  assert_equal('000', response.authorizationResponse.response)
296
322
  end
323
+
324
+ def test_simple_auth_with_processingType_originalNetworkTransactionId_originalTransactionAmount
325
+ hash = {
326
+ 'merchantId' => '101',
327
+ 'version'=>'8.8',
328
+ 'reportGroup'=>'Planets',
329
+ 'orderId'=>'12355',
330
+ 'amount'=>'106',
331
+ 'orderSource'=>'ecommerce',
332
+ 'card'=>{
333
+ 'type'=>'VI',
334
+ 'number' =>'4100000000000000',
335
+ 'expDate' =>'1210'
336
+ },
337
+ 'processingType' => 'initialInstallment',
338
+ 'originalNetworkTransactionId' => '9876543210',
339
+ 'originalTransactionAmount' => '536981'
340
+ }
341
+ response= LitleOnlineRequest.new.authorization(hash)
342
+ assert_equal('000', response.authorizationResponse.response)
343
+ assert_equal('63225578415568556365452427825', response.authorizationResponse.networkTransactionId)
344
+ end
345
+
346
+ def test_simple_auth_with_wallet
347
+ hash = {
348
+ 'merchantId' => '101',
349
+ 'version'=>'8.8',
350
+ 'reportGroup'=>'Planets',
351
+ 'id'=>'12345',
352
+ 'orderId'=>'67890',
353
+ 'amount'=>'10000',
354
+ 'orderSource'=>'ecommerce',
355
+ 'processingType' => 'initialInstallment',
356
+ 'originalNetworkTransactionId' => '9876543210',
357
+ 'originalTransactionAmount' => '536981',
358
+ 'card'=>{
359
+ 'type'=>'VI',
360
+ 'number' =>'4100000000000000',
361
+ 'expDate' =>'1215'
362
+ },
363
+ 'wallet'=>{
364
+ 'walletSourceType'=>'VisaCheckout',
365
+ 'walletSourceTypeId' => 'VCIND'
366
+ }
367
+ }
368
+ response= LitleOnlineRequest.new.authorization(hash)
369
+ assert_equal('000', response.authorizationResponse.response)
370
+ assert_equal('63225578415568556365452427825', response.authorizationResponse.networkTransactionId)
371
+ end
372
+
373
+ def test_simple_auth_with_wallet_CardSuffixResponse
374
+ hash = {
375
+ 'merchantId' => '101',
376
+ 'version'=>'8.8',
377
+ 'reportGroup'=>'Planets',
378
+ 'id'=>'12345',
379
+ 'orderId'=>'67890',
380
+ 'amount'=>'10000',
381
+ 'orderSource'=>'ecommerce',
382
+ 'processingType' => 'initialInstallment',
383
+ 'originalNetworkTransactionId' => '9876543210',
384
+ 'originalTransactionAmount' => '536981',
385
+ 'card'=>{
386
+ 'type'=>'MC',
387
+ 'number' =>'5400700000000000',
388
+ 'expDate' =>'1215'
389
+ },
390
+ 'wallet'=>{
391
+ 'walletSourceType'=>'MasterPass',
392
+ 'walletSourceTypeId' => 'MasterPass'
393
+ }
394
+ }
395
+ response= LitleOnlineRequest.new.authorization(hash)
396
+ assert_equal('000', response.authorizationResponse.response)
397
+ assert_equal('123456', response.authorizationResponse.cardSuffix)
398
+ end
399
+
297
400
  end
298
401
  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
@@ -61,8 +61,10 @@ module LitleOnline
61
61
  'amount'=>'106',
62
62
  'payPalNotes'=>'Notes'
63
63
  }
64
- response= LitleOnlineRequest.new.auth_reversal(hash)
65
- assert(response.message =~ /Error validating xml data against the schema/)
64
+ #Get exceptions
65
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.auth_reversal(hash)}
66
+ #Test
67
+ assert(exception.message =~ /Error validating xml data against the schema/)
66
68
  end
67
69
 
68
70
  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
@@ -73,8 +73,10 @@ def test_simple_happy
73
73
  'amount' =>'500',
74
74
  }
75
75
 
76
- response= LitleOnlineRequest.new.balance_inquiry(hash)
77
- assert(response.message =~ /Error validating xml data against the schema/)
76
+ #Get exceptions
77
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.balance_inquiry(hash)}
78
+ #Test
79
+ assert(exception.message =~ /Error validating xml data against the schema/)
78
80
  end
79
81
  end
80
82
  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
@@ -44,7 +44,7 @@ module LitleOnline
44
44
 
45
45
  entries = Dir.entries(dir + '/litle-sdk-for-ruby-test')
46
46
 
47
- assert_equal entries.length, 4
47
+ assert_equal 4,entries.length
48
48
  entries.sort!
49
49
  assert_not_nil entries[2] =~ /batch_\d+\z/
50
50
  assert_not_nil entries[3] =~ /batch_\d+_txns\z/
@@ -58,7 +58,7 @@ module LitleOnline
58
58
 
59
59
  entries = Dir.entries(dir + '/litle-sdk-for-ruby-test')
60
60
 
61
- assert_equal entries.length, 4
61
+ assert_equal 4,entries.length
62
62
  entries.sort!
63
63
  assert_not_nil entries[2] =~ /batch_\d+\z/
64
64
  assert_not_nil entries[3] =~ /batch_\d+_txns\z/
@@ -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
@@ -56,7 +56,7 @@ module LitleOnline
56
56
  entries = Dir.entries(dir + '/litle-sdk-for-ruby-test')
57
57
  entries.sort!
58
58
 
59
- assert_equal entries.size, 4
59
+ assert_equal 4,entries.size
60
60
  assert_not_nil entries[2] =~ /request_\d+\z/
61
61
  assert_not_nil entries[3] =~ /request_\d+_batches\z/
62
62
 
@@ -113,12 +113,22 @@ module LitleOnline
113
113
  #finish the Litle Request, indicating we plan to add no more batches
114
114
  request.finish_request
115
115
  entries = Dir.entries(dir + '/litle-sdk-for-ruby-test')
116
- assert_equal entries.length, 3
116
+ assert_equal 3, entries.length
117
117
  entries.sort!
118
118
  assert_not_nil entries[2] =~ /request_\d+.complete\z/
119
119
 
120
120
  #send the batch files at the given directory over sFTP
121
- request.send_to_litle_stream
121
+ count = 1
122
+ begin
123
+ request.send_to_litle_stream
124
+ rescue
125
+ if (count < 3) then
126
+ count = count + 1
127
+ retry
128
+ else
129
+ raise
130
+ end
131
+ end
122
132
  request.process_responses({:transaction_listener => LitleOnline::DefaultLitleListener.new do |transaction|
123
133
  type = transaction["type"]
124
134
 
@@ -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
@@ -47,8 +47,10 @@ module LitleOnline
47
47
  'reportGroup'=>'Planets',
48
48
  }
49
49
 
50
- response= LitleOnlineRequest.new.cancel_subscription(hash)
51
- assert(response.message =~ /Error validating xml data against the schema/)
50
+ #Get exceptions
51
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.cancel_subscription(hash)}
52
+ #Test
53
+ assert(exception.message =~ /Error validating xml data against the schema/)
52
54
  end
53
55
 
54
56
  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
@@ -76,9 +76,40 @@ module LitleOnline
76
76
  'reportGroup'=>'Planets',
77
77
  'amount'=>'106',
78
78
  }
79
+ #Get exceptions
80
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture(hash)}
81
+ #Test
82
+ assert(exception.message =~ /Error validating xml data against the schema/)
83
+ end
84
+
85
+ def test_custom_billing
86
+ hash = {
87
+ 'payPalNotes'=>'Notes',
88
+ 'litleTxnId'=>'123456000',
89
+ 'amount'=>'106',
90
+ 'customBilling'=>{
91
+ 'city' =>'boston',
92
+ 'descriptor' => 'card was present',
93
+ }}
79
94
  response= LitleOnlineRequest.new.capture(hash)
80
- assert(response.message =~ /Error validating xml data against the schema/)
95
+ assert_equal('Valid Format', response.message)
81
96
  end
82
-
97
+
98
+
99
+ def test_simple_capture_with_pin
100
+ hash = {
101
+ #'merchantId' => '101',
102
+ #'version'=>'8.8',
103
+ #'reportGroup'=>'Planets',
104
+ 'payPalNotes'=>'Notes',
105
+ 'litleTxnId'=>'123456000',
106
+ 'amount'=>'106',
107
+ 'pin'=>'1234'
108
+ }
109
+ response= LitleOnlineRequest.new.capture(hash)
110
+ assert_equal('Valid Format', response.message)
111
+ assert_equal('Approved', response.captureResponse.message)
112
+ end
113
+
83
114
  end
84
115
  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
@@ -125,7 +125,7 @@ module LitleOnline
125
125
  'authDate'=>'2002-10-09','authCode'=>'543216',
126
126
  'authAmount'=>'12345'
127
127
  },
128
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'},
128
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'},
129
129
  'processingInstructions'=>{'bypassVelocityCheck'=>'true'},
130
130
  'orderSource'=>'ecommerce',
131
131
  'card'=>{
@@ -180,8 +180,10 @@ module LitleOnline
180
180
  'number' =>'4100000000000001',
181
181
  'expDate' =>'1210'
182
182
  }}
183
- response= LitleOnlineRequest.new.capture_given_auth(hash)
184
- assert(response.message =~ /Error validating xml data against the schema/)
183
+ #Get exceptions
184
+ exception = assert_raise(RuntimeError){LitleOnlineRequest.new.capture_given_auth(hash)}
185
+ #Test
186
+ assert(exception.message =~ /Error validating xml data against the schema/)
185
187
  end
186
188
 
187
189
  def test_simple_captureGivenAuth_with_mpos
@@ -231,5 +233,54 @@ module LitleOnline
231
233
  response= LitleOnlineRequest.new.capture_given_auth(hash)
232
234
  assert_equal('Valid Format', response.message)
233
235
  end
236
+
237
+ def test_simple_capture_given_auth_with_processingType
238
+ hash = {
239
+ 'merchantId' => '101',
240
+ 'version'=>'8.8',
241
+ 'reportGroup'=>'Planets',
242
+ 'orderId'=>'12344',
243
+ 'amount'=>'106',
244
+ 'orderSource'=>'ecommerce',
245
+ 'authInformation' => {
246
+ 'authDate'=>'2002-10-09','authCode'=>'543216',
247
+ 'authAmount'=>'12345'
248
+ },
249
+ 'processingType'=>'initialRecurring',
250
+ 'card'=>{
251
+ 'type'=>'VI',
252
+ 'number' =>'4100000000000001',
253
+ 'expDate' =>'1210'
254
+ }}
255
+ response= LitleOnlineRequest.new.capture_given_auth(hash)
256
+ assert_equal('Valid Format', response.message)
257
+ #assert_equal('000', response.captureGivenAuthResponse.response)
258
+ end
259
+
260
+ def test_simple_capture_given_auth_with_originalNetworkTransactionId_originalTransactionAmount
261
+ hash = {
262
+ 'merchantId' => '101',
263
+ 'version'=>'8.8',
264
+ 'reportGroup'=>'Planets',
265
+ 'orderId'=>'12344',
266
+ 'amount'=>'106',
267
+ 'orderSource'=>'ecommerce',
268
+ 'authInformation' => {
269
+ 'authDate'=>'2002-10-09','authCode'=>'543216',
270
+ 'authAmount'=>'12345'
271
+ },
272
+ 'card'=>{
273
+ 'type'=>'VI',
274
+ 'number' =>'4100000000000001',
275
+ 'expDate' =>'1210'
276
+ },
277
+ 'originalNetworkTransactionId'=>'987654321098765432109876543210',
278
+ 'originalTransactionAmount'=>'10661'
279
+ }
280
+ response= LitleOnlineRequest.new.capture_given_auth(hash)
281
+ assert_equal('Valid Format', response.message)
282
+ #assert_equal('000', response.captureGivenAuthResponse.response)
283
+ end
284
+
234
285
  end
235
286
  end