activemerchant 1.94.0 → 1.99.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +120 -1
- data/README.md +3 -0
- data/lib/active_merchant/billing/avs_result.rb +4 -5
- data/lib/active_merchant/billing/credit_card.rb +6 -0
- data/lib/active_merchant/billing/credit_card_methods.rb +65 -2
- data/lib/active_merchant/billing/gateway.rb +10 -0
- data/lib/active_merchant/billing/gateways/adyen.rb +119 -34
- data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +43 -10
- data/lib/active_merchant/billing/gateways/beanstream.rb +11 -6
- data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +3 -0
- data/lib/active_merchant/billing/gateways/blue_snap.rb +22 -2
- data/lib/active_merchant/billing/gateways/bpoint.rb +4 -4
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +56 -9
- data/lib/active_merchant/billing/gateways/card_connect.rb +2 -1
- data/lib/active_merchant/billing/gateways/cecabank.rb +7 -7
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +37 -27
- data/lib/active_merchant/billing/gateways/credorax.rb +69 -4
- data/lib/active_merchant/billing/gateways/cyber_source.rb +51 -11
- data/lib/active_merchant/billing/gateways/d_local.rb +1 -1
- data/lib/active_merchant/billing/gateways/decidir.rb +245 -0
- data/lib/active_merchant/billing/gateways/epay.rb +13 -2
- data/lib/active_merchant/billing/gateways/eway_rapid.rb +42 -12
- data/lib/active_merchant/billing/gateways/fat_zebra.rb +6 -0
- data/lib/active_merchant/billing/gateways/global_collect.rb +3 -7
- data/lib/active_merchant/billing/gateways/hps.rb +46 -1
- data/lib/active_merchant/billing/gateways/kushki.rb +1 -1
- data/lib/active_merchant/billing/gateways/mastercard.rb +30 -5
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +1 -1
- data/lib/active_merchant/billing/gateways/migs.rb +8 -0
- data/lib/active_merchant/billing/gateways/monei.rb +31 -0
- data/lib/active_merchant/billing/gateways/mundipagg.rb +33 -6
- data/lib/active_merchant/billing/gateways/nab_transact.rb +1 -1
- data/lib/active_merchant/billing/gateways/nmi.rb +39 -1
- data/lib/active_merchant/billing/gateways/opp.rb +20 -1
- data/lib/active_merchant/billing/gateways/orbital.rb +60 -10
- data/lib/active_merchant/billing/gateways/payflow.rb +64 -14
- data/lib/active_merchant/billing/gateways/paymill.rb +5 -0
- data/lib/active_merchant/billing/gateways/paypal.rb +14 -1
- data/lib/active_merchant/billing/gateways/payu_latam.rb +6 -2
- data/lib/active_merchant/billing/gateways/qvalent.rb +43 -1
- data/lib/active_merchant/billing/gateways/realex.rb +32 -9
- data/lib/active_merchant/billing/gateways/redsys.rb +113 -30
- data/lib/active_merchant/billing/gateways/spreedly_core.rb +43 -29
- data/lib/active_merchant/billing/gateways/stripe.rb +38 -9
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +271 -0
- data/lib/active_merchant/billing/gateways/tns.rb +10 -5
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +2 -2
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +45 -6
- data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +8 -5
- data/lib/active_merchant/billing/gateways/worldpay.rb +177 -39
- data/lib/active_merchant/country.rb +1 -0
- data/lib/active_merchant/version.rb +1 -1
- metadata +19 -4
@@ -12,7 +12,7 @@ module ActiveMerchant #:nodoc:
|
|
12
12
|
|
13
13
|
self.test_url = 'https://demo.transact.nab.com.au/xmlapi/payment'
|
14
14
|
self.live_url = 'https://transact.nab.com.au/live/xmlapi/payment'
|
15
|
-
self.test_periodic_url = 'https://transact.nab.com.au/
|
15
|
+
self.test_periodic_url = 'https://demo.transact.nab.com.au/xmlapi/periodic'
|
16
16
|
self.live_periodic_url = 'https://transact.nab.com.au/xmlapi/periodic'
|
17
17
|
|
18
18
|
self.supported_countries = ['AU']
|
@@ -31,9 +31,11 @@ module ActiveMerchant #:nodoc:
|
|
31
31
|
post = {}
|
32
32
|
add_invoice(post, amount, options)
|
33
33
|
add_payment_method(post, payment_method, options)
|
34
|
+
add_stored_credential(post, options)
|
34
35
|
add_customer_data(post, options)
|
35
36
|
add_vendor_data(post, options)
|
36
37
|
add_merchant_defined_fields(post, options)
|
38
|
+
add_level3_fields(post, options)
|
37
39
|
|
38
40
|
commit('sale', post)
|
39
41
|
end
|
@@ -42,9 +44,11 @@ module ActiveMerchant #:nodoc:
|
|
42
44
|
post = {}
|
43
45
|
add_invoice(post, amount, options)
|
44
46
|
add_payment_method(post, payment_method, options)
|
47
|
+
add_stored_credential(post, options)
|
45
48
|
add_customer_data(post, options)
|
46
49
|
add_vendor_data(post, options)
|
47
50
|
add_merchant_defined_fields(post, options)
|
51
|
+
add_level3_fields(post, options)
|
48
52
|
|
49
53
|
commit('auth', post)
|
50
54
|
end
|
@@ -81,6 +85,7 @@ module ActiveMerchant #:nodoc:
|
|
81
85
|
add_payment_method(post, payment_method, options)
|
82
86
|
add_customer_data(post, options)
|
83
87
|
add_vendor_data(post, options)
|
88
|
+
add_level3_fields(post, options)
|
84
89
|
|
85
90
|
commit('credit', post)
|
86
91
|
end
|
@@ -91,6 +96,7 @@ module ActiveMerchant #:nodoc:
|
|
91
96
|
add_customer_data(post, options)
|
92
97
|
add_vendor_data(post, options)
|
93
98
|
add_merchant_defined_fields(post, options)
|
99
|
+
add_level3_fields(post, options)
|
94
100
|
|
95
101
|
commit('validate', post)
|
96
102
|
end
|
@@ -117,7 +123,7 @@ module ActiveMerchant #:nodoc:
|
|
117
123
|
|
118
124
|
def scrub(transcript)
|
119
125
|
transcript.
|
120
|
-
gsub(%r((password=)
|
126
|
+
gsub(%r((password=)[^&\n]*), '\1[FILTERED]').
|
121
127
|
gsub(%r((ccnumber=)\d+), '\1[FILTERED]').
|
122
128
|
gsub(%r((cvv=)\d+), '\1[FILTERED]').
|
123
129
|
gsub(%r((checkaba=)\d+), '\1[FILTERED]').
|
@@ -131,6 +137,10 @@ module ActiveMerchant #:nodoc:
|
|
131
137
|
|
132
138
|
private
|
133
139
|
|
140
|
+
def add_level3_fields(post, options)
|
141
|
+
add_fields_to_post_if_present(post, options, [:tax, :shipping, :ponumber])
|
142
|
+
end
|
143
|
+
|
134
144
|
def add_invoice(post, money, options)
|
135
145
|
post[:amount] = amount(money)
|
136
146
|
post[:orderid] = options[:order_id]
|
@@ -170,6 +180,34 @@ module ActiveMerchant #:nodoc:
|
|
170
180
|
end
|
171
181
|
end
|
172
182
|
|
183
|
+
def add_stored_credential(post, options)
|
184
|
+
return unless (stored_credential = options[:stored_credential])
|
185
|
+
|
186
|
+
if stored_credential[:initiator] == 'cardholder'
|
187
|
+
post[:initiated_by] = 'customer'
|
188
|
+
else
|
189
|
+
post[:initiated_by] = 'merchant'
|
190
|
+
end
|
191
|
+
|
192
|
+
# :reason_type, when provided, overrides anything previously set in
|
193
|
+
# post[:billing_method] (see `add_invoice` and the :recurring) option
|
194
|
+
case stored_credential[:reason_type]
|
195
|
+
when 'recurring'
|
196
|
+
post[:billing_method] = 'recurring'
|
197
|
+
when 'installment'
|
198
|
+
post[:billing_method] = 'installment'
|
199
|
+
when 'unscheduled'
|
200
|
+
post.delete(:billing_method)
|
201
|
+
end
|
202
|
+
|
203
|
+
if stored_credential[:initial_transaction]
|
204
|
+
post[:stored_credential_indicator] = 'stored'
|
205
|
+
else
|
206
|
+
post[:stored_credential_indicator] = 'used'
|
207
|
+
post[:initial_transaction_id] = stored_credential[:network_transaction_id]
|
208
|
+
end
|
209
|
+
end
|
210
|
+
|
173
211
|
def add_customer_data(post, options)
|
174
212
|
post[:email] = options[:email]
|
175
213
|
post[:ipaddress] = options[:ip]
|
@@ -125,6 +125,9 @@ module ActiveMerchant #:nodoc:
|
|
125
125
|
|
126
126
|
def purchase(money, payment, options={})
|
127
127
|
# debit
|
128
|
+
if payment.is_a?(String)
|
129
|
+
options[:registrationId] = payment
|
130
|
+
end
|
128
131
|
execute_dbpa(options[:risk_workflow] ? 'PA.CP': 'DB',
|
129
132
|
money, payment, options)
|
130
133
|
end
|
@@ -156,6 +159,10 @@ module ActiveMerchant #:nodoc:
|
|
156
159
|
end
|
157
160
|
end
|
158
161
|
|
162
|
+
def store(credit_card, options = {})
|
163
|
+
execute_store(credit_card, options.merge(store: true))
|
164
|
+
end
|
165
|
+
|
159
166
|
def supports_scrubbing?
|
160
167
|
true
|
161
168
|
end
|
@@ -169,6 +176,15 @@ module ActiveMerchant #:nodoc:
|
|
169
176
|
|
170
177
|
private
|
171
178
|
|
179
|
+
def execute_store(payment, options)
|
180
|
+
post = {}
|
181
|
+
add_payment_method(post, payment, options)
|
182
|
+
add_address(post, options)
|
183
|
+
add_options(post, options)
|
184
|
+
add_3d_secure(post, options)
|
185
|
+
commit(post, nil, options)
|
186
|
+
end
|
187
|
+
|
172
188
|
def execute_dbpa(txtype, money, payment, options)
|
173
189
|
post = {}
|
174
190
|
post[:paymentType] = txtype
|
@@ -243,6 +259,7 @@ module ActiveMerchant #:nodoc:
|
|
243
259
|
end
|
244
260
|
|
245
261
|
def add_payment_method(post, payment, options)
|
262
|
+
return if payment.is_a?(String)
|
246
263
|
if options[:registrationId]
|
247
264
|
post[:card] = {
|
248
265
|
cvv: payment.verification_value,
|
@@ -278,7 +295,9 @@ module ActiveMerchant #:nodoc:
|
|
278
295
|
end
|
279
296
|
|
280
297
|
def build_url(url, authorization, options)
|
281
|
-
if options[:
|
298
|
+
if options[:store]
|
299
|
+
url.gsub(/payments/, 'registrations')
|
300
|
+
elsif options[:registrationId]
|
282
301
|
"#{url.gsub(/payments/, 'registrations')}/#{options[:registrationId]}/payments"
|
283
302
|
elsif authorization
|
284
303
|
"#{url}/#{authorization}"
|
@@ -465,16 +465,62 @@ module ActiveMerchant #:nodoc:
|
|
465
465
|
end
|
466
466
|
end
|
467
467
|
|
468
|
-
def
|
469
|
-
|
470
|
-
|
468
|
+
def add_eci(xml, creditcard, three_d_secure)
|
469
|
+
eci = if three_d_secure
|
470
|
+
three_d_secure[:eci]
|
471
|
+
elsif creditcard.is_a?(NetworkTokenizationCreditCard)
|
472
|
+
creditcard.eci
|
473
|
+
end
|
474
|
+
|
475
|
+
xml.tag!(:AuthenticationECIInd, eci) if eci
|
476
|
+
end
|
477
|
+
|
478
|
+
def add_xid(xml, creditcard, three_d_secure)
|
479
|
+
xid = if three_d_secure && creditcard.brand == 'visa'
|
480
|
+
three_d_secure[:xid]
|
481
|
+
elsif creditcard.is_a?(NetworkTokenizationCreditCard)
|
482
|
+
creditcard.transaction_id
|
483
|
+
end
|
484
|
+
|
485
|
+
xml.tag!(:XID, xid) if xid
|
486
|
+
end
|
487
|
+
|
488
|
+
def add_cavv(xml, creditcard, three_d_secure)
|
489
|
+
return unless three_d_secure && creditcard.brand == 'visa'
|
490
|
+
|
491
|
+
xml.tag!(:CAVV, three_d_secure[:cavv])
|
492
|
+
end
|
493
|
+
|
494
|
+
def add_aav(xml, creditcard, three_d_secure)
|
495
|
+
return unless three_d_secure && creditcard.brand == 'master'
|
496
|
+
|
497
|
+
xml.tag!(:AAV, three_d_secure[:cavv])
|
471
498
|
end
|
472
499
|
|
473
|
-
def
|
500
|
+
def add_dpanind(xml, creditcard)
|
501
|
+
return unless creditcard.is_a?(NetworkTokenizationCreditCard)
|
502
|
+
|
474
503
|
xml.tag! :DPANInd, 'Y'
|
504
|
+
end
|
505
|
+
|
506
|
+
def add_digital_token_cryptogram(xml, creditcard)
|
507
|
+
return unless creditcard.is_a?(NetworkTokenizationCreditCard)
|
508
|
+
|
475
509
|
xml.tag! :DigitalTokenCryptogram, creditcard.payment_cryptogram
|
476
510
|
end
|
477
511
|
|
512
|
+
def add_aevv(xml, creditcard, three_d_secure)
|
513
|
+
return unless three_d_secure && creditcard.brand == 'american_express'
|
514
|
+
|
515
|
+
xml.tag!(:AEVV, three_d_secure[:cavv])
|
516
|
+
end
|
517
|
+
|
518
|
+
def add_pymt_brand_program_code(xml, creditcard, three_d_secure)
|
519
|
+
return unless three_d_secure && creditcard.brand == 'american_express'
|
520
|
+
|
521
|
+
xml.tag!(:PymtBrandProgramCode, 'ASK')
|
522
|
+
end
|
523
|
+
|
478
524
|
def add_refund(xml, currency=nil)
|
479
525
|
xml.tag! :AccountNum, nil
|
480
526
|
|
@@ -633,9 +679,11 @@ module ActiveMerchant #:nodoc:
|
|
633
679
|
|
634
680
|
yield xml if block_given?
|
635
681
|
|
636
|
-
|
637
|
-
|
638
|
-
|
682
|
+
three_d_secure = parameters[:three_d_secure]
|
683
|
+
|
684
|
+
add_eci(xml, creditcard, three_d_secure)
|
685
|
+
add_cavv(xml, creditcard, three_d_secure)
|
686
|
+
add_xid(xml, creditcard, three_d_secure)
|
639
687
|
|
640
688
|
xml.tag! :OrderID, format_order_id(parameters[:order_id])
|
641
689
|
xml.tag! :Amount, amount(money)
|
@@ -644,11 +692,12 @@ module ActiveMerchant #:nodoc:
|
|
644
692
|
add_level_2_tax(xml, parameters)
|
645
693
|
add_level_2_advice_addendum(xml, parameters)
|
646
694
|
|
695
|
+
add_aav(xml, creditcard, three_d_secure)
|
647
696
|
# CustomerAni, AVSPhoneType and AVSDestPhoneType could be added here.
|
648
697
|
|
649
|
-
|
650
|
-
|
651
|
-
|
698
|
+
add_dpanind(xml, creditcard)
|
699
|
+
add_aevv(xml, creditcard, three_d_secure)
|
700
|
+
add_digital_token_cryptogram(xml, creditcard)
|
652
701
|
|
653
702
|
if parameters[:soft_descriptors].is_a?(OrbitalSoftDescriptors)
|
654
703
|
add_soft_descriptors(xml, parameters[:soft_descriptors])
|
@@ -666,6 +715,7 @@ module ActiveMerchant #:nodoc:
|
|
666
715
|
|
667
716
|
add_level_2_purchase(xml, parameters)
|
668
717
|
add_stored_credentials(xml, parameters)
|
718
|
+
add_pymt_brand_program_code(xml, creditcard, three_d_secure)
|
669
719
|
end
|
670
720
|
end
|
671
721
|
xml.target!
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'nokogiri'
|
1
2
|
require 'active_merchant/billing/gateways/payflow/payflow_common_api'
|
2
3
|
require 'active_merchant/billing/gateways/payflow/payflow_response'
|
3
4
|
require 'active_merchant/billing/gateways/payflow_express'
|
@@ -187,7 +188,44 @@ module ActiveMerchant #:nodoc:
|
|
187
188
|
end
|
188
189
|
end
|
189
190
|
end
|
190
|
-
xml.target
|
191
|
+
add_level_two_three_fields(xml.target!, options)
|
192
|
+
end
|
193
|
+
|
194
|
+
def add_level_two_three_fields(xml_string, options)
|
195
|
+
if options[:level_two_fields] || options[:level_three_fields]
|
196
|
+
xml_doc = Nokogiri::XML.parse(xml_string)
|
197
|
+
%i[level_two_fields level_three_fields].each do |fields|
|
198
|
+
xml_string = add_fields(xml_doc, options[fields]) if options[fields]
|
199
|
+
end
|
200
|
+
end
|
201
|
+
xml_string
|
202
|
+
end
|
203
|
+
|
204
|
+
def check_fields(parent, fields, xml_doc)
|
205
|
+
fields.each do |k, v|
|
206
|
+
if v.is_a? String
|
207
|
+
new_node = Nokogiri::XML::Node.new(k, xml_doc)
|
208
|
+
new_node.add_child(v)
|
209
|
+
xml_doc.at_css(parent).add_child(new_node)
|
210
|
+
else
|
211
|
+
check_subparent_before_continuing(parent, k, xml_doc)
|
212
|
+
check_fields(k, v, xml_doc)
|
213
|
+
end
|
214
|
+
end
|
215
|
+
xml_doc
|
216
|
+
end
|
217
|
+
|
218
|
+
def check_subparent_before_continuing(parent, subparent, xml_doc)
|
219
|
+
unless xml_doc.at_css(subparent)
|
220
|
+
subparent_node = Nokogiri::XML::Node.new(subparent, xml_doc)
|
221
|
+
xml_doc.at_css(parent).add_child(subparent_node)
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
225
|
+
def add_fields(xml_doc, options_fields)
|
226
|
+
fields_to_add = JSON.parse(options_fields)
|
227
|
+
check_fields('Invoice', fields_to_add, xml_doc)
|
228
|
+
xml_doc.root.to_s
|
191
229
|
end
|
192
230
|
|
193
231
|
def build_check_request(action, money, check, options)
|
@@ -213,7 +251,7 @@ module ActiveMerchant #:nodoc:
|
|
213
251
|
end
|
214
252
|
end
|
215
253
|
end
|
216
|
-
xml.target
|
254
|
+
add_level_two_three_fields(xml.target!, options)
|
217
255
|
end
|
218
256
|
|
219
257
|
def add_credit_card(xml, credit_card, options = {})
|
@@ -224,23 +262,35 @@ module ActiveMerchant #:nodoc:
|
|
224
262
|
xml.tag! 'NameOnCard', credit_card.first_name
|
225
263
|
xml.tag! 'CVNum', credit_card.verification_value if credit_card.verification_value?
|
226
264
|
|
227
|
-
|
228
|
-
three_d_secure = options[:three_d_secure]
|
229
|
-
xml.tag! 'BuyerAuthResult' do
|
230
|
-
xml.tag! 'Status', three_d_secure[:status] unless three_d_secure[:status].blank?
|
231
|
-
xml.tag! 'AuthenticationId', three_d_secure[:authentication_id] unless three_d_secure[:authentication_id].blank?
|
232
|
-
xml.tag! 'PAReq', three_d_secure[:pareq] unless three_d_secure[:pareq].blank?
|
233
|
-
xml.tag! 'ACSUrl', three_d_secure[:acs_url] unless three_d_secure[:acs_url].blank?
|
234
|
-
xml.tag! 'ECI', three_d_secure[:eci] unless three_d_secure[:eci].blank?
|
235
|
-
xml.tag! 'CAVV', three_d_secure[:cavv] unless three_d_secure[:cavv].blank?
|
236
|
-
xml.tag! 'XID', three_d_secure[:xid] unless three_d_secure[:xid].blank?
|
237
|
-
end
|
238
|
-
end
|
265
|
+
add_three_d_secure(options, xml)
|
239
266
|
|
240
267
|
xml.tag! 'ExtData', 'Name' => 'LASTNAME', 'Value' => credit_card.last_name
|
241
268
|
end
|
242
269
|
end
|
243
270
|
|
271
|
+
def add_three_d_secure(options, xml)
|
272
|
+
if options[:three_d_secure]
|
273
|
+
three_d_secure = options[:three_d_secure]
|
274
|
+
xml.tag! 'BuyerAuthResult' do
|
275
|
+
authentication_status(three_d_secure, xml)
|
276
|
+
xml.tag! 'AuthenticationId', three_d_secure[:authentication_id] unless three_d_secure[:authentication_id].blank?
|
277
|
+
xml.tag! 'PAReq', three_d_secure[:pareq] unless three_d_secure[:pareq].blank?
|
278
|
+
xml.tag! 'ACSUrl', three_d_secure[:acs_url] unless three_d_secure[:acs_url].blank?
|
279
|
+
xml.tag! 'ECI', three_d_secure[:eci] unless three_d_secure[:eci].blank?
|
280
|
+
xml.tag! 'CAVV', three_d_secure[:cavv] unless three_d_secure[:cavv].blank?
|
281
|
+
xml.tag! 'XID', three_d_secure[:xid] unless three_d_secure[:xid].blank?
|
282
|
+
end
|
283
|
+
end
|
284
|
+
end
|
285
|
+
|
286
|
+
def authentication_status(three_d_secure, xml)
|
287
|
+
if three_d_secure[:authentication_response_status].present?
|
288
|
+
xml.tag! 'Status', three_d_secure[:authentication_response_status]
|
289
|
+
elsif three_d_secure[:directory_response_status].present?
|
290
|
+
xml.tag! 'Status', three_d_secure[:directory_response_status]
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
244
294
|
def credit_card_type(credit_card)
|
245
295
|
return '' if card_brand(credit_card).blank?
|
246
296
|
|
@@ -48,6 +48,11 @@ module ActiveMerchant #:nodoc:
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def store(credit_card, options={})
|
51
|
+
# The store request requires a currency and amount of at least $1 USD.
|
52
|
+
# This is used for an authorization that is handled internally by Paymill.
|
53
|
+
options[:currency] = 'USD'
|
54
|
+
options[:money] = 100
|
55
|
+
|
51
56
|
save_card(credit_card, options)
|
52
57
|
end
|
53
58
|
|
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
|
|
9
9
|
include PaypalRecurringApi
|
10
10
|
|
11
11
|
self.supported_cardtypes = [:visa, :master, :american_express, :discover]
|
12
|
-
self.supported_countries = ['US']
|
12
|
+
self.supported_countries = ['CA', 'NZ', 'GB', 'US']
|
13
13
|
self.homepage_url = 'https://www.paypal.com/us/webapps/mpp/paypal-payments-pro'
|
14
14
|
self.display_name = 'PayPal Payments Pro (US)'
|
15
15
|
|
@@ -90,6 +90,8 @@ module ActiveMerchant #:nodoc:
|
|
90
90
|
xml.tag! 'n2:Payer', options[:email]
|
91
91
|
add_address(xml, 'n2:Address', address)
|
92
92
|
end
|
93
|
+
|
94
|
+
add_three_d_secure(xml, options) if options[:three_d_secure]
|
93
95
|
end
|
94
96
|
end
|
95
97
|
|
@@ -98,6 +100,17 @@ module ActiveMerchant #:nodoc:
|
|
98
100
|
xml.tag! 'n2:SoftDescriptorCity', options[:soft_descriptor_city] unless options[:soft_descriptor_city].blank?
|
99
101
|
end
|
100
102
|
|
103
|
+
def add_three_d_secure(xml, options)
|
104
|
+
three_d_secure = options[:three_d_secure]
|
105
|
+
xml.tag! 'ThreeDSecureRequest' do
|
106
|
+
xml.tag! 'MpiVendor3ds', 'Y'
|
107
|
+
xml.tag! 'AuthStatus3ds', three_d_secure[:trans_status] unless three_d_secure[:trans_status].blank?
|
108
|
+
xml.tag! 'Cavv', three_d_secure[:cavv] unless three_d_secure[:cavv].blank?
|
109
|
+
xml.tag! 'Eci3ds', three_d_secure[:eci] unless three_d_secure[:eci].blank?
|
110
|
+
xml.tag! 'Xid', three_d_secure[:xid] unless three_d_secure[:xid].blank?
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
101
114
|
def credit_card_type(type)
|
102
115
|
case type
|
103
116
|
when 'visa' then 'Visa'
|
@@ -12,13 +12,15 @@ module ActiveMerchant #:nodoc:
|
|
12
12
|
self.supported_countries = ['AR', 'BR', 'CL', 'CO', 'MX', 'PA', 'PE']
|
13
13
|
self.default_currency = 'USD'
|
14
14
|
self.money_format = :dollars
|
15
|
-
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club]
|
15
|
+
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :naranja, :cabal]
|
16
16
|
|
17
17
|
BRAND_MAP = {
|
18
18
|
'visa' => 'VISA',
|
19
19
|
'master' => 'MASTERCARD',
|
20
20
|
'american_express' => 'AMEX',
|
21
|
-
'diners_club' => 'DINERS'
|
21
|
+
'diners_club' => 'DINERS',
|
22
|
+
'naranja' => 'NARANJA',
|
23
|
+
'cabal' => 'CABAL'
|
22
24
|
}
|
23
25
|
|
24
26
|
MINIMUMS = {
|
@@ -195,6 +197,7 @@ module ActiveMerchant #:nodoc:
|
|
195
197
|
buyer[:fullName] = buyer_hash[:name]
|
196
198
|
buyer[:dniNumber] = buyer_hash[:dni_number]
|
197
199
|
buyer[:dniType] = buyer_hash[:dni_type]
|
200
|
+
buyer[:merchantBuyerId] = buyer_hash[:merchant_buyer_id]
|
198
201
|
buyer[:cnpj] = buyer_hash[:cnpj] if @options[:payment_country] == 'BR'
|
199
202
|
buyer[:emailAddress] = buyer_hash[:email]
|
200
203
|
buyer[:contactPhone] = (options[:billing_address][:phone] if options[:billing_address]) || (options[:shipping_address][:phone] if options[:shipping_address]) || ''
|
@@ -203,6 +206,7 @@ module ActiveMerchant #:nodoc:
|
|
203
206
|
buyer[:fullName] = payment_method.name.strip
|
204
207
|
buyer[:dniNumber] = options[:dni_number]
|
205
208
|
buyer[:dniType] = options[:dni_type]
|
209
|
+
buyer[:merchantBuyerId] = options[:merchant_buyer_id]
|
206
210
|
buyer[:cnpj] = options[:cnpj] if @options[:payment_country] == 'BR'
|
207
211
|
buyer[:emailAddress] = options[:email]
|
208
212
|
buyer[:contactPhone] = (options[:billing_address][:phone] if options[:billing_address]) || (options[:shipping_address][:phone] if options[:shipping_address]) || ''
|