CnpOnline 8.31.1 → 9.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +29 -12
- data/DESCRIPTION +2 -2
- data/LICENSE +1 -1
- data/README.md +1 -1
- data/Rakefile +4 -4
- data/Rakefile~ +5 -5
- data/SETUP.md +3 -3
- data/bin/Setup.rb +9 -8
- data/bin/sample_batch_driver.rb +1 -1
- data/bin/sample_driver.rb +1 -1
- data/lib/Communications.rb +1 -1
- data/lib/Configuration.rb +16 -16
- data/lib/EnvironmentVariables.rb +1 -2
- data/lib/LitleBatchRequest.rb +283 -147
- data/lib/LitleListeners.rb +132 -33
- data/lib/LitleOnline.rb +5 -4
- data/lib/LitleOnlineRequest.rb +69 -59
- data/lib/LitleRequest.rb +178 -141
- data/lib/LitleTransaction.rb +279 -122
- data/lib/LitleXmlMapper.rb +9 -4
- data/lib/XMLFields.rb +345 -26
- data/test/certification/certTest1_base.rb +74 -73
- data/test/certification/certTest2_authenhanced.rb +1 -1
- data/test/certification/certTest3_authreversal.rb +1 -1
- data/test/certification/certTest4_echeck.rb +4 -1
- data/test/certification/certTest5_token.rb +4 -4
- data/test/certification/certTest_batchAll.rb +296 -55
- data/test/certification/ts_all.rb +1 -1
- data/test/functional/test_activate.rb +7 -3
- data/test/functional/test_activateReversal.rb +7 -3
- data/test/functional/test_auth.rb +119 -16
- data/test/functional/test_authReversal.rb +5 -3
- data/test/functional/test_balanceInquiry.rb +5 -3
- data/test/functional/test_batch.rb +3 -3
- data/test/functional/test_batchStream.rb +14 -4
- data/test/functional/test_cancelSubscription.rb +5 -3
- data/test/functional/test_capture.rb +34 -3
- data/test/functional/test_captureGivenAuth.rb +55 -4
- data/test/functional/test_configuration.rb +2 -2
- data/test/functional/test_createPlan.rb +5 -3
- data/test/functional/test_credit.rb +45 -16
- data/test/functional/test_deactivate.rb +5 -3
- data/test/functional/test_deactivateReversal.rb +5 -3
- data/test/functional/test_depositReversal.rb +5 -3
- data/test/functional/test_echeckCredit.rb +26 -9
- data/test/functional/test_echeckRedeposit.rb +5 -3
- data/test/functional/test_echeckSale.rb +49 -28
- data/test/functional/test_echeckVerification.rb +20 -12
- data/test/functional/test_echeckVoid.rb +1 -1
- data/test/functional/test_forceCapture.rb +44 -22
- data/test/functional/test_fraudCheck.rb +77 -0
- data/test/functional/test_litle_requests.rb +24 -24
- data/test/functional/test_load.rb +5 -3
- data/test/functional/test_loadReversal.rb +5 -3
- data/test/functional/test_refundReversal.rb +5 -3
- data/test/functional/test_sale.rb +214 -29
- data/test/functional/test_token.rb +19 -3
- data/test/functional/test_unload.rb +5 -3
- data/test/functional/test_unloadReversal.rb +6 -4
- data/test/functional/test_updateCardValidationNumOnToken.rb +1 -1
- data/test/functional/test_updatePlan.rb +5 -3
- data/test/functional/test_updateSubscription.rb +5 -3
- data/test/functional/test_utf8.rb +44 -0
- data/test/functional/test_xmlfields.rb +10 -6
- data/test/functional/ts_all.rb +2 -1
- data/test/unit/test_LitleAUBatch.rb +29 -1
- data/test/unit/test_LitleBatchRequest.rb +247 -113
- data/test/unit/test_LitleOnlineRequest.rb +37 -54
- data/test/unit/test_LitleRequest.rb +3 -3
- data/test/unit/test_LitleTransaction.rb +5 -5
- data/test/unit/test_LitleXmlMapper.rb +136 -0
- data/test/unit/test_activate.rb +1 -21
- data/test/unit/test_activateReversal.rb +1 -1
- data/test/unit/test_auth.rb +54 -14
- data/test/unit/test_authReversal.rb +1 -1
- data/test/unit/test_balanceInquiry.rb +1 -1
- data/test/unit/test_cancelSubscription.rb +1 -1
- data/test/unit/test_capture.rb +27 -1
- data/test/unit/test_captureGivenAuth.rb +44 -18
- data/test/unit/test_createPlan.rb +1 -1
- data/test/unit/test_credit.rb +16 -3
- data/test/unit/test_deactivate.rb +1 -1
- data/test/unit/test_deactivateReversal.rb +1 -1
- data/test/unit/test_depositReversal.rb +1 -1
- data/test/unit/test_echeckCredit.rb +15 -2
- data/test/unit/test_echeckRedeposit.rb +1 -1
- data/test/unit/test_echeckSale.rb +18 -1
- data/test/unit/test_echeckVerification.rb +1 -1
- data/test/unit/test_echeckVoid.rb +1 -1
- data/test/unit/test_forceCapture.rb +20 -2
- data/test/unit/test_fraudCheck.rb +45 -0
- data/test/unit/test_load.rb +1 -1
- data/test/unit/test_loadReversal.rb +1 -1
- data/test/unit/test_refundReversal.rb +1 -1
- data/test/unit/test_sale.rb +73 -7
- data/test/unit/test_token.rb +15 -4
- data/test/unit/test_unload.rb +1 -1
- data/test/unit/test_unloadReversal.rb +1 -1
- data/test/unit/test_updateCardValidationNumOnToken.rb +1 -1
- data/test/unit/test_updatePlan.rb +1 -1
- data/test/unit/test_updateSubscription.rb +1 -1
- data/test/unit/test_xmlfields.rb +1 -1
- data/test/unit/ts_unit.rb +2 -1
- metadata +10 -7
- data/CHANGELOG~ +0 -142
data/lib/LitleListeners.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
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
|
@@ -22,121 +22,220 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
22
22
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
23
23
|
OTHER DEALINGS IN THE SOFTWARE.
|
24
24
|
=end
|
25
|
-
|
26
|
-
|
27
25
|
# This file contains the preloaded listeners for parsing the response XML.
|
28
26
|
|
29
|
-
|
30
27
|
module LitleOnline
|
31
|
-
|
32
28
|
# This listener will run the provided closure over every response hash
|
33
29
|
# This is the base class for all listeners applied to transaction responses
|
34
30
|
class DefaultLitleListener
|
35
31
|
def initialize(&action)
|
36
|
-
@action = action
|
32
|
+
@action = action
|
37
33
|
end
|
38
|
-
|
34
|
+
|
39
35
|
def apply(duck)
|
40
36
|
# apply the proc uniformly across all response types
|
41
37
|
@action.call(duck)
|
42
38
|
end
|
43
39
|
end
|
44
|
-
|
40
|
+
|
45
41
|
class AuthorizationListener < DefaultLitleListener
|
46
42
|
def apply(duck)
|
47
43
|
if(duck["type"] == "authorizationResponse") then
|
48
44
|
@action.call(duck)
|
49
45
|
end
|
50
|
-
end
|
46
|
+
end
|
51
47
|
end
|
52
|
-
|
48
|
+
|
53
49
|
class CaptureListener < DefaultLitleListener
|
54
50
|
def apply(duck)
|
55
51
|
if(duck["type"] == "captureResponse") then
|
56
52
|
@action.call(duck)
|
57
53
|
end
|
58
|
-
end
|
54
|
+
end
|
59
55
|
end
|
60
|
-
|
56
|
+
|
61
57
|
class ForceCaptureListener < DefaultLitleListener
|
62
58
|
def apply(duck)
|
63
59
|
if(duck["type"] == "forceCaptureResponse") then
|
64
60
|
@action.call(duck)
|
65
61
|
end
|
66
|
-
end
|
62
|
+
end
|
67
63
|
end
|
68
|
-
|
64
|
+
|
69
65
|
class CaptureGivenAuthListener < DefaultLitleListener
|
70
66
|
def apply(duck)
|
71
67
|
if(duck["type"] == "captureGivenAuthResponse") then
|
72
68
|
@action.call(duck)
|
73
69
|
end
|
74
|
-
end
|
70
|
+
end
|
75
71
|
end
|
76
|
-
|
72
|
+
|
77
73
|
class SaleListener < DefaultLitleListener
|
78
74
|
def apply(duck)
|
79
75
|
if(duck["type"] == "saleResponse") then
|
80
76
|
@action.call(duck)
|
81
77
|
end
|
82
|
-
end
|
78
|
+
end
|
83
79
|
end
|
84
|
-
|
85
|
-
|
80
|
+
|
86
81
|
class CreditListener < DefaultLitleListener
|
87
82
|
def apply(duck)
|
88
83
|
if(duck["type"] == "creditResponse") then
|
89
84
|
@action.call(duck)
|
90
85
|
end
|
91
|
-
end
|
86
|
+
end
|
92
87
|
end
|
93
|
-
|
88
|
+
|
94
89
|
class EcheckSaleListener < DefaultLitleListener
|
95
90
|
def apply(duck)
|
96
91
|
if(duck["type"] == "echeckSaleResponse") then
|
97
92
|
@action.call(duck)
|
98
93
|
end
|
99
|
-
end
|
94
|
+
end
|
100
95
|
end
|
101
|
-
|
96
|
+
|
102
97
|
class EcheckCreditListener < DefaultLitleListener
|
103
98
|
def apply(duck)
|
104
99
|
if(duck["type"] == "echeckCreditResponse") then
|
105
100
|
@action.call(duck)
|
106
101
|
end
|
107
|
-
end
|
102
|
+
end
|
108
103
|
end
|
109
|
-
|
104
|
+
|
110
105
|
class EcheckVerificationListener < DefaultLitleListener
|
111
106
|
def apply(duck)
|
112
107
|
if(duck["type"] == "echeckVerificationResponse") then
|
113
108
|
@action.call(duck)
|
114
109
|
end
|
115
|
-
end
|
110
|
+
end
|
116
111
|
end
|
117
|
-
|
112
|
+
|
118
113
|
class EcheckRedepositListener < DefaultLitleListener
|
119
114
|
def apply(duck)
|
120
115
|
if(duck["type"] == "echeckRedepositResponse") then
|
121
116
|
@action.call(duck)
|
122
117
|
end
|
123
|
-
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
class EcheckPreNoteSaleListener < DefaultLitleListener
|
122
|
+
def apply(duck)
|
123
|
+
if(duck["type"] == "echeckPreNoteSaleResponse") then
|
124
|
+
@action.call(duck)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
class EcheckPreNoteCreditListener < DefaultLitleListener
|
130
|
+
def apply(duck)
|
131
|
+
if(duck["type"] == "echeckPreNoteCreditResponse") then
|
132
|
+
@action.call(duck)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
class SubmerchantCreditListener < DefaultLitleListener
|
138
|
+
def apply(duck)
|
139
|
+
if(duck["type"] == "submerchantCreditResponse") then
|
140
|
+
@action.call(duck)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
class PayFacCreditListener < DefaultLitleListener
|
146
|
+
def apply(duck)
|
147
|
+
if(duck["type"] == "payFacCreditResponse") then
|
148
|
+
@action.call(duck)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
class ReserveCreditListener < DefaultLitleListener
|
154
|
+
def apply(duck)
|
155
|
+
if(duck["type"] == "reserveCreditResponse") then
|
156
|
+
@action.call(duck)
|
157
|
+
end
|
158
|
+
end
|
124
159
|
end
|
125
|
-
|
160
|
+
|
161
|
+
class VendorCreditListener < DefaultLitleListener
|
162
|
+
def apply(duck)
|
163
|
+
if(duck["type"] == "vendorCreditResponse") then
|
164
|
+
@action.call(duck)
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
class PhysicalCheckCreditListener < DefaultLitleListener
|
170
|
+
def apply(duck)
|
171
|
+
if(duck["type"] == "physicalCheckCreditResponse") then
|
172
|
+
@action.call(duck)
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
class SubmerchantDebitListener < DefaultLitleListener
|
178
|
+
def apply(duck)
|
179
|
+
if(duck["type"] == "submerchantDebitResponse") then
|
180
|
+
@action.call(duck)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
class PayFacDebitListener < DefaultLitleListener
|
186
|
+
def apply(duck)
|
187
|
+
if(duck["type"] == "payFacDebitResponse") then
|
188
|
+
@action.call(duck)
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
class ReserveDebitListener < DefaultLitleListener
|
194
|
+
def apply(duck)
|
195
|
+
if(duck["type"] == "reserveDebitResponse") then
|
196
|
+
@action.call(duck)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
class VendorDebitListener < DefaultLitleListener
|
202
|
+
def apply(duck)
|
203
|
+
if(duck["type"] == "vendorDebitResponse") then
|
204
|
+
@action.call(duck)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
209
|
+
class PhysicalCheckDebitListener < DefaultLitleListener
|
210
|
+
def apply(duck)
|
211
|
+
if(duck["type"] == "physicalCheckDebitResponse") then
|
212
|
+
@action.call(duck)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
126
217
|
class AuthReversalListener < DefaultLitleListener
|
127
218
|
def apply(duck)
|
128
219
|
if(duck["type"] == "authReversalResponse") then
|
129
220
|
@action.call(duck)
|
130
221
|
end
|
131
|
-
end
|
222
|
+
end
|
132
223
|
end
|
133
|
-
|
224
|
+
|
134
225
|
class RegisterTokenListener < DefaultLitleListener
|
135
226
|
def apply(duck)
|
136
227
|
if(duck["type"] == "registerTokenResponse") then
|
137
228
|
@action.call(duck)
|
138
229
|
end
|
139
|
-
end
|
230
|
+
end
|
140
231
|
end
|
141
|
-
|
232
|
+
|
233
|
+
class FraudCheckListener < DefaultLitleListener
|
234
|
+
def apply(duck)
|
235
|
+
if(duck["type"] == "advancedFraudResult") then
|
236
|
+
@action.call(duck)
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
142
241
|
end
|
data/lib/LitleOnline.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
=begin
|
2
|
-
Copyright (c)
|
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
|
@@ -54,9 +54,10 @@ require_relative 'LitleRequest'
|
|
54
54
|
require_relative 'LitleListeners'
|
55
55
|
require_relative 'Configuration'
|
56
56
|
|
57
|
-
#allows attribute values to be in double quotes,
|
58
|
-
|
57
|
+
# allows attribute values to be in double quotes,
|
58
|
+
# required by Vantiv eCommerce Server
|
59
|
+
REXML::Attribute.class_eval(%q^
|
59
60
|
def to_string
|
60
61
|
%Q[#@expanded_name="#{to_s().gsub(/"/, '"')}"]
|
61
62
|
end
|
62
|
-
^
|
63
|
+
^)
|
data/lib/LitleOnlineRequest.rb
CHANGED
@@ -1,88 +1,91 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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
|
23
25
|
require_relative 'Configuration'
|
24
26
|
|
25
27
|
#
|
26
|
-
# This class handles sending the
|
28
|
+
# This class handles sending the Vantiv eCommerce online request
|
27
29
|
#
|
28
30
|
module LitleOnline
|
31
|
+
|
29
32
|
class LitleOnlineRequest
|
30
33
|
def initialize
|
31
|
-
#
|
34
|
+
#load configuration data
|
32
35
|
@config_hash = Configuration.new.config
|
33
36
|
@litle_transaction = LitleTransaction.new
|
34
37
|
end
|
35
38
|
|
36
39
|
def virtual_giftcard(options)
|
37
|
-
|
40
|
+
transaction =@litle_transaction.virtual_giftcard(options)
|
38
41
|
|
39
|
-
|
42
|
+
commit(transaction, :virtualGiftCard, options)
|
40
43
|
end
|
41
44
|
|
42
45
|
def create_plan(options)
|
43
|
-
|
46
|
+
transaction =@litle_transaction.create_plan(options)
|
44
47
|
|
45
|
-
|
48
|
+
commit(transaction, :createPlan, options)
|
46
49
|
end
|
47
50
|
|
48
51
|
def update_plan(options)
|
49
|
-
|
52
|
+
transaction =@litle_transaction.update_plan(options)
|
50
53
|
|
51
|
-
|
54
|
+
commit(transaction, :updatePlan, options)
|
52
55
|
end
|
53
56
|
|
54
57
|
def cancel_subscription(options)
|
55
|
-
|
58
|
+
transaction =@litle_transaction.cancel_subscription(options)
|
56
59
|
|
57
|
-
|
60
|
+
commit(transaction, :cancelSubscription, options)
|
58
61
|
end
|
59
62
|
|
60
63
|
def update_subscription(options)
|
61
|
-
|
64
|
+
transaction =@litle_transaction.update_subscription(options)
|
62
65
|
|
63
|
-
|
66
|
+
commit(transaction, :updateSubscription, options)
|
64
67
|
end
|
65
68
|
|
66
69
|
def activate(options)
|
67
70
|
transaction = @litle_transaction.activate(options)
|
68
71
|
|
69
72
|
commit(transaction, :activate, options)
|
70
|
-
end
|
71
|
-
|
73
|
+
end
|
74
|
+
|
72
75
|
def deactivate(options)
|
73
|
-
|
76
|
+
transaction = @litle_transaction.deactivate(options)
|
74
77
|
|
75
78
|
commit(transaction, :deactivate, options)
|
76
79
|
end
|
77
80
|
|
78
81
|
def load_request(options)
|
79
|
-
|
82
|
+
transaction = @litle_transaction.load_request(options)
|
80
83
|
|
81
84
|
commit(transaction, :load, options)
|
82
85
|
end
|
83
86
|
|
84
87
|
def unload_request(options)
|
85
|
-
|
88
|
+
transaction = @litle_transaction.unload_request(options)
|
86
89
|
|
87
90
|
commit(transaction, :unload, options)
|
88
91
|
end
|
@@ -128,6 +131,7 @@ module LitleOnline
|
|
128
131
|
|
129
132
|
commit(transaction, :unloadReversal, options)
|
130
133
|
end
|
134
|
+
|
131
135
|
|
132
136
|
def authorization(options)
|
133
137
|
transaction = @litle_transaction.authorization(options)
|
@@ -142,14 +146,14 @@ module LitleOnline
|
|
142
146
|
end
|
143
147
|
|
144
148
|
def auth_reversal(options)
|
145
|
-
transaction = @litle_transaction.auth_reversal(options)
|
149
|
+
transaction = @litle_transaction.auth_reversal(options)
|
146
150
|
|
147
151
|
commit(transaction, :authReversal, options)
|
148
152
|
end
|
149
153
|
|
150
154
|
def credit(options)
|
151
155
|
transaction = @litle_transaction.credit(options)
|
152
|
-
|
156
|
+
|
153
157
|
commit(transaction, :credit, options)
|
154
158
|
end
|
155
159
|
|
@@ -158,28 +162,28 @@ module LitleOnline
|
|
158
162
|
|
159
163
|
commit(transaction, :registerTokenRequest, options)
|
160
164
|
end
|
161
|
-
|
165
|
+
|
162
166
|
def update_card_validation_num_on_token(options)
|
163
|
-
|
164
|
-
|
167
|
+
transaction = @litle_transaction.update_card_validation_num_on_token(options)
|
168
|
+
|
165
169
|
commit(transaction, :updateCardValidationNumOnToken, options)
|
166
170
|
end
|
167
171
|
|
168
172
|
def force_capture(options)
|
169
173
|
transaction = @litle_transaction.force_capture(options)
|
170
|
-
|
174
|
+
|
171
175
|
commit(transaction, :forceCapture, options)
|
172
176
|
end
|
173
177
|
|
174
178
|
def capture(options)
|
175
179
|
transaction = @litle_transaction.capture(options)
|
176
|
-
|
180
|
+
|
177
181
|
commit(transaction, :captureTxn, options)
|
178
182
|
end
|
179
183
|
|
180
184
|
def capture_given_auth(options)
|
181
185
|
transaction = @litle_transaction.capture_given_auth(options)
|
182
|
-
|
186
|
+
|
183
187
|
commit(transaction, :captureGivenAuth, options)
|
184
188
|
end
|
185
189
|
|
@@ -191,7 +195,7 @@ module LitleOnline
|
|
191
195
|
|
192
196
|
def echeck_redeposit(options)
|
193
197
|
transaction = @litle_transaction.echeck_redeposit(options)
|
194
|
-
|
198
|
+
|
195
199
|
commit(transaction, :echeckRedeposit, options)
|
196
200
|
end
|
197
201
|
|
@@ -221,21 +225,27 @@ module LitleOnline
|
|
221
225
|
|
222
226
|
def echeck_void(options)
|
223
227
|
transaction = @litle_transaction.echeck_void(options)
|
224
|
-
|
228
|
+
|
225
229
|
commit(transaction, :echeckVoid, options)
|
226
230
|
end
|
231
|
+
|
232
|
+
def fraud_check_request(options)
|
233
|
+
transaction = @litle_transaction.fraud_check_request(options)
|
234
|
+
|
235
|
+
commit(transaction, :fraudCheck, options)
|
236
|
+
end
|
227
237
|
|
228
238
|
private
|
229
239
|
|
230
240
|
def add_account_info(transaction, options)
|
231
|
-
if
|
232
|
-
|
241
|
+
if(transaction.respond_to?(:reportGroup))
|
242
|
+
transaction.reportGroup = get_report_group(options)
|
233
243
|
end
|
234
|
-
if
|
235
|
-
|
244
|
+
if(transaction.respond_to?(:transactionId))
|
245
|
+
transaction.transactionId = options['id']
|
236
246
|
end
|
237
|
-
if
|
238
|
-
|
247
|
+
if(transaction.respond_to?(:customerId))
|
248
|
+
transaction.customerId = options['customerId']
|
239
249
|
end
|
240
250
|
end
|
241
251
|
|
@@ -248,7 +258,7 @@ module LitleOnline
|
|
248
258
|
|
249
259
|
request.authentication = authentication
|
250
260
|
request.merchantId = get_merchant_id(options)
|
251
|
-
request.version = '
|
261
|
+
request.version = '9.14'
|
252
262
|
request.loggedInUser = get_logged_in_user(options)
|
253
263
|
request.xmlns = 'http://www.litle.com/schema'
|
254
264
|
request.merchantSdk = get_merchant_sdk(options)
|
@@ -268,7 +278,7 @@ module LitleOnline
|
|
268
278
|
LitleXmlMapper.request(xml, @config_hash)
|
269
279
|
end
|
270
280
|
|
271
|
-
def configure_connection(options
|
281
|
+
def configure_connection(options={})
|
272
282
|
@config_hash['proxy_addr'] = options['proxy_addr'] unless options['proxy_addr'].nil?
|
273
283
|
@config_hash['proxy_port'] = options['proxy_port'] unless options['proxy_port'].nil?
|
274
284
|
@config_hash['url'] = options['url'] unless options['url'].nil?
|
@@ -279,7 +289,7 @@ module LitleOnline
|
|
279
289
|
end
|
280
290
|
|
281
291
|
def get_merchant_sdk(options)
|
282
|
-
options['merchantSdk'] || 'Ruby;
|
292
|
+
options['merchantSdk'] || 'Ruby;9.14.0'
|
283
293
|
end
|
284
294
|
|
285
295
|
def get_report_group(options)
|
@@ -287,7 +297,7 @@ module LitleOnline
|
|
287
297
|
end
|
288
298
|
|
289
299
|
def get_config(field, options)
|
290
|
-
options[field.to_s]
|
300
|
+
options[field.to_s] == nil ? @config_hash[field.to_s] : options[field.to_s]
|
291
301
|
end
|
292
302
|
|
293
303
|
def get_logged_in_user(options)
|