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) 2011 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) 2011 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
@@ -281,7 +281,7 @@ module LitleOnline
281
281
  'billToAddress'=>{'name'=>'Bob',
282
282
  'city'=>'lowell',
283
283
  'state'=>'MA',
284
- 'email'=>'litle.com'}
284
+ 'email'=>'vantiv.com'}
285
285
  }
286
286
 
287
287
  result = ltlTxn.echeck_verification(echeckVerificationHash)
@@ -298,7 +298,7 @@ module LitleOnline
298
298
  assert_equal 'Bob', result.billToAddress.name
299
299
  assert_equal 'lowell', result.billToAddress.city
300
300
  assert_equal 'MA', result.billToAddress.state
301
- assert_equal 'litle.com', result.billToAddress.email
301
+ assert_equal 'vantiv.com', result.billToAddress.email
302
302
  end
303
303
 
304
304
  def test_echeck_credit
@@ -352,7 +352,7 @@ module LitleOnline
352
352
  'orderId'=>'12345',
353
353
  'orderSource'=>'ecommerce',
354
354
  'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455'},
355
- 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'litle.com'}
355
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
356
356
  }
357
357
 
358
358
  result = ltlTxn.echeck_sale(echeckSaleHash)
@@ -370,7 +370,7 @@ module LitleOnline
370
370
  assert_equal 'Bob', result.billToAddress.name
371
371
  assert_equal 'lowell', result.billToAddress.city
372
372
  assert_equal 'MA', result.billToAddress.state
373
- assert_equal 'litle.com', result.billToAddress.email
373
+ assert_equal 'vantiv.com', result.billToAddress.email
374
374
  end
375
375
 
376
376
  def test_account_update
@@ -0,0 +1,136 @@
1
+ =begin
2
+ Copyright (c) 2017 Vantiv eCommerce
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
14
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
15
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
16
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
+ OTHER DEALINGS IN THE SOFTWARE.
21
+ =end
22
+
23
+
24
+ require File.expand_path("../../../lib/LitleOnline",__FILE__)
25
+ require 'test/unit'
26
+ require 'mocha/setup'
27
+
28
+ module LitleOnline
29
+ class TestLitleXmlMapper < Test::Unit::TestCase
30
+
31
+ def test_LitleXmlMapper_request_xml_response_0
32
+ hash =
33
+ {
34
+ 'merchantId' => '101',
35
+ 'id' => 'test',
36
+ 'version'=>'8.8',
37
+ 'reportGroup'=>'Planets',
38
+ 'litleTxnId'=>'123456',
39
+ }
40
+ Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"0\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
41
+ response = LitleXmlMapper.request("","")
42
+ assert_equal('0',response.response)
43
+ end
44
+
45
+ def test_LitleXmlMapper_request_xml_response_1
46
+ hash =
47
+ {
48
+ 'merchantId' => '101',
49
+ 'id' => 'test',
50
+ 'version'=>'8.8',
51
+ 'reportGroup'=>'Planets',
52
+ 'litleTxnId'=>'123456',
53
+ }
54
+ Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"1\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
55
+ #Get exceptions
56
+ exception = assert_raise(RuntimeError){
57
+ LitleXmlMapper.request("","")
58
+ }
59
+ #Test
60
+ assert(exception.message =~ /Error with http response, code: 1/)
61
+ end
62
+
63
+ def test_LitleXmlMapper_request_xml_response_2
64
+ hash =
65
+ {
66
+ 'merchantId' => '101',
67
+ 'id' => 'test',
68
+ 'version'=>'8.8',
69
+ 'reportGroup'=>'Planets',
70
+ 'litleTxnId'=>'123456',
71
+ }
72
+ Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"2\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
73
+ #Get exceptions
74
+ exception = assert_raise(RuntimeError){
75
+ LitleXmlMapper.request("","")
76
+ }
77
+ #Test
78
+ assert(exception.message =~ /Error with http response, code: 2/)
79
+ end
80
+
81
+ def test_LitleXmlMapper_request_xml_response_3
82
+ hash =
83
+ {
84
+ 'merchantId' => '101',
85
+ 'id' => 'test',
86
+ 'version'=>'8.8',
87
+ 'reportGroup'=>'Planets',
88
+ 'litleTxnId'=>'123456',
89
+ }
90
+ Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"3\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
91
+ #Get exceptions
92
+ exception = assert_raise(RuntimeError){
93
+ LitleXmlMapper.request("","")
94
+ }
95
+ #Test
96
+ assert(exception.message =~ /Error with http response, code: 3/)
97
+ end
98
+
99
+ def test_LitleXmlMapper_request_xml_response_4
100
+ hash =
101
+ {
102
+ 'merchantId' => '101',
103
+ 'id' => 'test',
104
+ 'version'=>'8.8',
105
+ 'reportGroup'=>'Planets',
106
+ 'litleTxnId'=>'123456',
107
+ }
108
+ Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"4\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
109
+ #Get exceptions
110
+ exception = assert_raise(RuntimeError){
111
+ LitleXmlMapper.request("","")
112
+ }
113
+ #Test
114
+ assert(exception.message =~ /Error with http response, code: 4/)
115
+ end
116
+
117
+ def test_LitleXmlMapper_request_xml_response_5
118
+ hash =
119
+ {
120
+ 'merchantId' => '101',
121
+ 'id' => 'test',
122
+ 'version'=>'8.8',
123
+ 'reportGroup'=>'Planets',
124
+ 'litleTxnId'=>'123456',
125
+ }
126
+ Communications.expects(:http_post).returns("<litleOnlineResponse version=\"1.0\" xmlns=\"http://www.litle.com/schema/online\" response=\"5\" message=\"Invalid credentials. Contact support@litle.com.\"></litleOnlineResponse>")
127
+ #Get exceptions
128
+ exception = assert_raise(RuntimeError){
129
+ LitleXmlMapper.request("","")
130
+ }
131
+ #Test
132
+ assert(exception.message =~ /Error with http response, code: 5/)
133
+ end
134
+
135
+ end
136
+ 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
@@ -48,26 +48,6 @@ module LitleOnline
48
48
  LitleOnlineRequest.new.activate(hash)
49
49
  end
50
50
 
51
- def test_simple_card
52
- hash = {
53
- 'merchantId' => '101',
54
- 'version'=>'8.8',
55
- 'reportGroup'=>'Planets',
56
- 'orderId' => '11',
57
- 'amount' => '500',
58
- 'orderSource'=>'ecommerce',
59
- 'card'=>
60
- {
61
- 'type'=>'VI',
62
- 'number' =>'4100000000000001',
63
- 'expDate' =>'1210'
64
- }
65
- }
66
-
67
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<activate reportGroup="Planets"><orderId>11<\/orderId><amount>500<\/amount><orderSource>ecommerce<\/orderSource><card><type>VI<\/type><number>4100000000000001<\/number><expDate>1210<\/expDate><\/card><\/activate>.*/m), is_a(Hash))
68
- LitleOnlineRequest.new.activate(hash)
69
- end
70
-
71
51
  def test_simple_virtualGiftcard
72
52
  hash = {
73
53
  'merchantId' => '101',
@@ -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
@@ -58,7 +58,7 @@ module LitleOnline
58
58
  'transactionId'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
59
59
  },
60
60
  'signature' =>'sign',
61
- 'version' =>'1'
61
+ 'version' =>'1.0.0'
62
62
  }
63
63
  }
64
64
 
@@ -88,7 +88,7 @@ module LitleOnline
88
88
  'transactionId'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
89
89
  },
90
90
  'signature' =>'sign',
91
- 'version' =>'1'
91
+ 'version' =>'1.0.0'
92
92
  }}
93
93
 
94
94
  exception = assert_raise(RuntimeError){LitleOnlineRequest.new.authorization(hash)}
@@ -194,8 +194,7 @@ module LitleOnline
194
194
  }
195
195
  }
196
196
 
197
- XMLObject.expects(:new)
198
- Communications.expects(:http_post).with(regexp_matches(/.*<merchantData>.*?<campaign>foo<\/campaign>.*?<\/merchantData>.*/m),kind_of(Hash))
197
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<merchantData>.*?<campaign>foo<\/campaign>.*?<\/merchantData>.*/m), is_a(Hash))
199
198
  LitleOnlineRequest.new.authorization(hash)
200
199
  end
201
200
 
@@ -210,8 +209,7 @@ module LitleOnline
210
209
  'fraudFilterOverride'=> 'true'
211
210
  }
212
211
 
213
- XMLObject.expects(:new)
214
- Communications.expects(:http_post).with(regexp_matches(/.*<authorization.*?<fraudFilterOverride>true<\/fraudFilterOverride>.*?<\/authorization>.*/m),kind_of(Hash))
212
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<authorization.*?<fraudFilterOverride>true<\/fraudFilterOverride>.*?<\/authorization>.*/m), is_a(Hash))
215
213
  LitleOnlineRequest.new.authorization(hash)
216
214
  end
217
215
 
@@ -296,8 +294,7 @@ module LitleOnline
296
294
  'fraudFilterOverride'=> 'true'
297
295
  }
298
296
 
299
- XMLObject.expects(:new)
300
- Communications.expects(:http_post).with(regexp_matches(/.*<authentication.*?<user>UNIT<\/user>.*?<\/authentication>.*/m),kind_of(Hash))
297
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<authentication.*?<user>UNIT<\/user>.*?<\/authentication>.*/m), is_a(Hash))
301
298
  LitleOnlineRequest.new.authorization(hash)
302
299
  end
303
300
 
@@ -314,8 +311,7 @@ module LitleOnline
314
311
  'fraudFilterOverride'=> 'true'
315
312
  }
316
313
 
317
- XMLObject.expects(:new)
318
- Communications.expects(:http_post).with(regexp_matches(/.*<authentication.*?<password>TEST<\/password>.*?<\/authentication>.*/m),kind_of(Hash))
314
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<authentication.*?<password>TEST<\/password>.*?<\/authentication>.*/m), is_a(Hash))
319
315
  LitleOnlineRequest.new.authorization(hash)
320
316
  end
321
317
 
@@ -417,5 +413,49 @@ module LitleOnline
417
413
  LitleOnlineRequest.new.authorization(hash)
418
414
  end
419
415
 
416
+ def test_processingType_originalNetworkTransactionId_originalTransactionAmount
417
+ hash = {
418
+ 'orderId' => '12344',
419
+ 'amount' => '2',
420
+ 'orderSource' => 'ecommerce',
421
+ 'card' => {
422
+ 'number' => '4141000000000000',
423
+ 'expDate' => '1210',
424
+ 'type' => 'GC'
425
+ },
426
+ 'processingType' => 'initialInstallment',
427
+ 'originalNetworkTransactionId' => '9876543210',
428
+ 'originalTransactionAmount' => '536981'
429
+ }
430
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>initialInstallment<\/processingType><originalNetworkTransactionId>9876543210<\/originalNetworkTransactionId><originalTransactionAmount>536981<\/originalTransactionAmount>.*/m), is_a(Hash))
431
+ LitleOnlineRequest.new.authorization(hash)
432
+ end
433
+
434
+ def test_processingType_wallet
435
+ hash = {
436
+ 'merchantId' => '101',
437
+ 'version'=>'8.8',
438
+ 'reportGroup'=>'Planets',
439
+ 'id'=>'12345',
440
+ 'orderId'=>'67890',
441
+ 'amount'=>'10000',
442
+ 'orderSource'=>'ecommerce',
443
+ 'processingType' => 'initialInstallment',
444
+ 'originalNetworkTransactionId' => '9876543210',
445
+ 'originalTransactionAmount' => '536981',
446
+ 'card'=>{
447
+ 'type'=>'VI',
448
+ 'number' =>'4100000000000000',
449
+ 'expDate' =>'1215'
450
+ },
451
+ 'wallet'=>{
452
+ 'walletSourceType'=>'VisaCheckout',
453
+ 'walletSourceTypeId' => 'VCIND'
454
+ }
455
+ }
456
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<wallet><walletSourceType>VisaCheckout<\/walletSourceType><walletSourceTypeId>VCIND<\/walletSourceTypeId><\/wallet>.*/m), is_a(Hash))
457
+ LitleOnlineRequest.new.authorization(hash)
458
+ end
459
+
420
460
  end
421
461
  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
@@ -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
@@ -68,6 +68,32 @@ module LitleOnline
68
68
  LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><payPalNotes>note<\/payPalNotes>.*/m), is_a(Hash))
69
69
  LitleOnlineRequest.new.capture(hash)
70
70
  end
71
+
72
+ def test_pin
73
+ hash = {
74
+ 'litleTxnId' => '123456000',
75
+ 'amount' => '2',
76
+ 'payPalNotes' => 'note',
77
+ 'pin' => '1234'
78
+ }
79
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<pin>1234<\/pin>.*/m), is_a(Hash))
80
+ LitleOnlineRequest.new.capture(hash)
81
+ end
82
+
83
+ def test_custom_billing
84
+ hash = {
85
+ 'payPalNotes'=>'Notes',
86
+ 'litleTxnId'=>'123456000',
87
+ 'amount'=>'106',
88
+ 'customBilling'=>{
89
+ 'city' =>'boston',
90
+ 'descriptor' => 'card was present',
91
+ }
92
+ }
93
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<customBilling><city>boston<\/city><descriptor>card was present<\/descriptor><\/customBilling>.*/m), is_a(Hash))
94
+ LitleOnlineRequest.new.capture(hash)
95
+ end
96
+
71
97
  end
72
98
  end
73
99
 
@@ -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
@@ -154,35 +154,61 @@ module LitleOnline
154
154
  'fraudResult' => {
155
155
  'advancedFraudResults' =>
156
156
  {'deviceReviewStatus' => 'deviceReviewStatusString',
157
- 'deviceReputationScore' => '100'
157
+ 'deviceReputationScore' => '100',
158
+ 'triggeredRule' => ['rule1','rule2']
158
159
  }
159
160
  }
160
161
  }
161
162
  }
162
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<advancedFraudResults><deviceReviewStatus>deviceReviewStatusString<\/deviceReviewStatus><deviceReputationScore>100<\/deviceReputationScore><\/advancedFraudResults>.*/m), is_a(Hash))
163
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<advancedFraudResults><deviceReviewStatus>deviceReviewStatusString<\/deviceReviewStatus><deviceReputationScore>100<\/deviceReputationScore><triggeredRule>rule1<\/triggeredRule><triggeredRule>rule2<\/triggeredRule><\/advancedFraudResults>.*/m), is_a(Hash))
163
164
  LitleOnlineRequest.new.capture_given_auth(hash)
164
165
  end
166
+
167
+ def test_processingType
168
+ hash = {
169
+ 'merchantId' => '101',
170
+ 'version'=>'8.8',
171
+ 'reportGroup'=>'Planets',
172
+ 'orderId'=>'12344',
173
+ 'amount'=>'106',
174
+ 'orderSource'=>'ecommerce',
175
+ 'authInformation' => {
176
+ 'authDate'=>'2002-10-09','authCode'=>'543216',
177
+ 'authAmount'=>'12345'
178
+ },
179
+ 'processingType'=>'initialRecurring',
180
+ 'card'=>{
181
+ 'type'=>'VI',
182
+ 'number' =>'4100000000000001',
183
+ 'expDate' =>'1210'
184
+ }}
185
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>initialRecurring<\/processingType>.*/m), is_a(Hash))
186
+ LitleOnlineRequest.new.capture_given_auth(hash)
187
+ end
165
188
 
166
- def test_fraudResult
189
+ def test_originalNetworkTransactionId_originalTransactionAmount
167
190
  hash = {
168
- 'amount' => '2',
169
- 'orderSource' => 'ecommerce',
170
- 'reportGroup' => 'Planets',
191
+ 'merchantId' => '101',
192
+ 'version'=>'8.8',
193
+ 'reportGroup'=>'Planets',
194
+ 'orderId'=>'12344',
195
+ 'amount'=>'106',
196
+ 'orderSource'=>'ecommerce',
171
197
  'authInformation' => {
172
198
  'authDate'=>'2002-10-09','authCode'=>'543216',
173
- 'authAmount'=>'12345',
174
- 'fraudResult' => {
175
- 'advancedFraudResults' =>
176
- {'deviceReviewStatus' => 'deviceReviewStatusString',
177
- 'deviceReputationScore' => '100',
178
- 'triggeredRule' => ['rule1','rule2']
179
- }
180
- }
199
+ 'authAmount'=>'12345'
200
+ },
201
+ 'card'=>{
202
+ 'type'=>'VI',
203
+ 'number' =>'4100000000000001',
204
+ 'expDate' =>'1210'
205
+ },
206
+ 'originalNetworkTransactionId'=>'987654321098765432109876543210',
207
+ 'originalTransactionAmount'=>'10661'
181
208
  }
182
- }
183
- LitleXmlMapper.expects(:request).with(regexp_matches(/.*<advancedFraudResults><deviceReviewStatus>deviceReviewStatusString<\/deviceReviewStatus><deviceReputationScore>100<\/deviceReputationScore><triggeredRule>rule1<\/triggeredRule><triggeredRule>rule2<\/triggeredRule><\/advancedFraudResults>.*/m), is_a(Hash))
209
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<originalNetworkTransactionId>987654321098765432109876543210<\/originalNetworkTransactionId><originalTransactionAmount>10661<\/originalTransactionAmount>.*/m), is_a(Hash))
184
210
  LitleOnlineRequest.new.capture_given_auth(hash)
185
- end
211
+ end
186
212
 
187
213
  end
188
214
  end