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
@@ -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
@@ -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
@@ -129,8 +129,7 @@ module LitleOnline
129
129
  'reportGroup'=>'Planets',
130
130
  'actionReason'=> 'SUSPECT_FRAUD'
131
131
  }
132
- XMLObject.expects(:new)
133
- Communications.expects(:http_post).with(regexp_matches(/.*<actionReason>SUSPECT_FRAUD<\/actionReason>.*/m),kind_of(Hash))
132
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<actionReason>SUSPECT_FRAUD<\/actionReason>.*/m), is_a(Hash))
134
133
  LitleOnlineRequest.new.credit(hash)
135
134
  end
136
135
 
@@ -338,5 +337,19 @@ module LitleOnline
338
337
  LitleOnlineRequest.new.credit(hash)
339
338
  end
340
339
 
340
+ def test_pin
341
+ hash = {
342
+ 'merchantId' => '101',
343
+ 'version'=>'8.8',
344
+ 'reportGroup'=>'Planets',
345
+ 'amount'=>'106',
346
+ 'secondaryAmount'=>'20',
347
+ 'litleTxnId'=>'1234',
348
+ 'pin'=>'3333'
349
+ }
350
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<pin>3333<\/pin>.*/m), is_a(Hash))
351
+ LitleOnlineRequest.new.credit(hash)
352
+ end
353
+
341
354
  end
342
355
  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
@@ -55,7 +55,7 @@ module LitleOnline
55
55
  LitleOnlineRequest.new.echeck_credit(hash)
56
56
  end
57
57
 
58
- def test_secondary_amount
58
+ def test_echeck_credit_with_orderId_secondary_amount
59
59
  hash = {
60
60
  'orderId' => '12344',
61
61
  'amount' => '2',
@@ -66,6 +66,19 @@ module LitleOnline
66
66
  LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>2<\/amount><secondaryAmount>1<\/secondaryAmount><orderSource>ecommerce<\/orderSource>.*/m), is_a(Hash))
67
67
  LitleOnlineRequest.new.echeck_credit(hash)
68
68
  end
69
+
70
+ def test_echeck_credit_with_txnId_secondaryAmount
71
+ hash = {
72
+ 'merchantId' => '101',
73
+ 'version'=>'8.8',
74
+ 'reportGroup'=>'Planets',
75
+ 'litleTxnId'=>'123456789101112',
76
+ 'amount'=>'12',
77
+ 'secondaryAmount'=>'1'
78
+ }
79
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<litleTxnId>123456789101112<\/litleTxnId>.*?<amount>12<\/amount><secondaryAmount>1<\/secondaryAmount>.*/m), is_a(Hash))
80
+ LitleOnlineRequest.new.echeck_credit(hash)
81
+ end
69
82
 
70
83
  end
71
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
@@ -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
@@ -67,5 +67,22 @@ module LitleOnline
67
67
  LitleOnlineRequest.new.echeck_sale(hash)
68
68
  end
69
69
 
70
+ def test_echeck_sale_with_secondaryAmount_ccd
71
+ hash = {
72
+ 'merchantId' => '101',
73
+ 'version'=>'8.8',
74
+ 'reportGroup'=>'Planets',
75
+ 'amount'=>'123',
76
+ 'secondaryAmount'=>'1',
77
+ 'verify'=>'true',
78
+ 'orderId'=>'12345',
79
+ 'orderSource'=>'ecommerce',
80
+ 'echeck' => {'accType'=>'Checking','accNum'=>'12345657890','routingNum'=>'123456789','checkNum'=>'123455','ccdPaymentInformation'=>'12345678901234567890123456789012345678901234567890123456789012345678901234567890'},
81
+ 'billToAddress'=>{'name'=>'Bob','city'=>'lowell','state'=>'MA','email'=>'vantiv.com'}
82
+ }
83
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<amount>123<\/amount><secondaryAmount>1<\/secondaryAmount>.*?<echeck>.*?<ccdPaymentInformation>.*<\/ccdPaymentInformation><\/echeck>.*/m), is_a(Hash))
84
+ LitleOnlineRequest.new.echeck_sale(hash)
85
+ end
86
+
70
87
  end
71
88
  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
@@ -108,7 +108,7 @@ module LitleOnline
108
108
  LitleOnlineRequest.new.force_capture(hash)
109
109
  end
110
110
 
111
- def test_secondary_amount
111
+ def test_secondary_amount
112
112
  hash = {
113
113
  'amount' => '2',
114
114
  'secondaryAmount' => '1',
@@ -140,6 +140,24 @@ def test_secondary_amount
140
140
  LitleOnlineRequest.new.force_capture(hash)
141
141
  end
142
142
 
143
+ def test_processing_type
144
+ hash = {
145
+ 'merchantId' => '101',
146
+ 'version'=>'8.8',
147
+ 'reportGroup'=>'Planets',
148
+ 'orderId'=>'12344',
149
+ 'amount'=>'106',
150
+ 'orderSource'=>'ecommerce',
151
+ 'processingType'=>'accountFunding',
152
+ 'card'=>{
153
+ 'type'=>'VI',
154
+ 'number' =>'4100000000000001',
155
+ 'expDate' =>'1210'
156
+ }}
157
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>accountFunding<\/processingType>.*/m), is_a(Hash))
158
+ LitleOnlineRequest.new.force_capture(hash)
159
+ end
160
+
143
161
  end
144
162
 
145
163
  end
@@ -0,0 +1,45 @@
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
+ require File.expand_path("../../../lib/LitleOnline",__FILE__)
26
+ require 'test/unit'
27
+ require 'mocha/setup'
28
+
29
+ #test FraudCheck Transaction
30
+ module LitleOnline
31
+ class TestFraudCheck < Test::Unit::TestCase
32
+ def test_success_fraud_check
33
+ hash = {
34
+ 'merchantId' => '101',
35
+ 'version'=>'10.1',
36
+ 'id' => '127',
37
+ 'reportGroup'=>'Planets',
38
+ 'advancedFraudChecks' => {'threatMetrixSessionId' => 'test2-BXXXXXX003'},
39
+ }
40
+
41
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<threatMetrixSessionId>test2-BXXXXXX003<\/threatMetrixSessionId>.*/m), is_a(Hash))
42
+ LitleOnlineRequest.new.fraud_check_request(hash)
43
+ end
44
+ end
45
+ 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,7 +68,7 @@ module LitleOnline
68
68
  'transactionId'=>'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
69
69
  },
70
70
  'signature' =>'sign',
71
- 'version' =>'1'
71
+ 'version' =>'1.0.0'
72
72
  }
73
73
  }
74
74
 
@@ -86,7 +86,7 @@ module LitleOnline
86
86
  'orderId'=>'12344',
87
87
  'amount'=>'106',
88
88
  'orderSource'=>'ecommerce',
89
- # 'fraudCheck'=>{'authenticationTransactionId'=>'123'}, #for test
89
+ 'fraudCheck'=>{'authenticationTransactionId'=>'123'}, #for test
90
90
  'card'=>{
91
91
  'type'=>'VI',
92
92
  'number' =>'4100000000000002',
@@ -255,8 +255,7 @@ module LitleOnline
255
255
  }
256
256
  }
257
257
 
258
- XMLObject.expects(:new)
259
- Communications.expects(:http_post).with(regexp_matches(/.*<merchantData>.*?<affiliate>bar<\/affiliate>.*?<\/merchantData>.*/m),kind_of(Hash))
258
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<merchantData>.*?<affiliate>bar<\/affiliate>.*?<\/merchantData>.*/m), is_a(Hash))
260
259
  LitleOnlineRequest.new.sale(hash)
261
260
  end
262
261
 
@@ -291,8 +290,7 @@ module LitleOnline
291
290
  'fraudFilterOverride'=> 'false'
292
291
  }
293
292
 
294
- XMLObject.expects(:new)
295
- Communications.expects(:http_post).with(regexp_matches(/.*<sale.*?<fraudFilterOverride>false<\/fraudFilterOverride>.*?<\/sale>.*/m),kind_of(Hash))
293
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<sale.*?<fraudFilterOverride>false<\/fraudFilterOverride>.*?<\/sale>.*/m), is_a(Hash))
296
294
  LitleOnlineRequest.new.sale(hash)
297
295
  end
298
296
 
@@ -461,5 +459,73 @@ module LitleOnline
461
459
  LitleOnlineRequest.new.sale(hash)
462
460
  end
463
461
 
462
+ def test_processingType
463
+ hash = {
464
+ 'merchantId' => '101',
465
+ 'version'=>'8.8',
466
+ 'reportGroup'=>'Planets',
467
+ 'litleTxnId'=>'123456',
468
+ 'orderId'=>'12344',
469
+ 'amount'=>'106',
470
+ 'orderSource'=>'ecommerce',
471
+ 'card'=>
472
+ {
473
+ 'type'=>'MC',
474
+ 'number' =>'5400000000000000',
475
+ 'expDate' =>'1210'
476
+ },
477
+ 'processingType'=>'initialInstallment'
478
+ }
479
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<processingType>initialInstallment<\/processingType>.*/m), is_a(Hash))
480
+ LitleOnlineRequest.new.sale(hash)
481
+ end
482
+
483
+ def test_originalNetworkTransactionId_originalTransactionAmount_pin
484
+ hash = {
485
+ 'merchantId' => '101',
486
+ 'version'=>'8.8',
487
+ 'reportGroup'=>'Planets',
488
+ 'litleTxnId'=>'123456',
489
+ 'orderId'=>'12344',
490
+ 'amount'=>'106',
491
+ 'orderSource'=>'ecommerce',
492
+ 'card'=>
493
+ {
494
+ 'type'=>'VI',
495
+ 'number' =>'4100700000000000',
496
+ 'expDate' =>'1210',
497
+ 'pin'=>'1111'
498
+ },
499
+ 'originalNetworkTransactionId'=>'98765432109876543210',
500
+ 'originalTransactionAmount'=>'7001'
501
+ }
502
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<originalNetworkTransactionId>98765432109876543210<\/originalNetworkTransactionId><originalTransactionAmount>7001<\/originalTransactionAmount>.*/m), is_a(Hash))
503
+ LitleOnlineRequest.new.sale(hash)
504
+ end
505
+
506
+ def test_wallet
507
+ hash = {
508
+ 'merchantId' => '101',
509
+ 'version'=>'8.8',
510
+ 'reportGroup'=>'Planets',
511
+ 'litleTxnId'=>'123456',
512
+ 'orderId'=>'12344',
513
+ 'amount'=>'106',
514
+ 'orderSource'=>'ecommerce',
515
+ 'card'=>
516
+ {
517
+ 'type'=>'VI',
518
+ 'number' =>'4100700000000000',
519
+ 'expDate' =>'1210',
520
+ },
521
+ 'wallet'=>{
522
+ 'walletSourceType'=>'VisaCheckout',
523
+ 'walletSourceTypeId'=>'VCIND'
524
+ }
525
+ }
526
+ LitleXmlMapper.expects(:request).with(regexp_matches(/.*<wallet><walletSourceType>VisaCheckout<\/walletSourceType><walletSourceTypeId>VCIND<\/walletSourceTypeId><\/wallet>.*/m), is_a(Hash))
527
+ LitleOnlineRequest.new.sale(hash)
528
+ end
529
+
464
530
  end
465
531
  end