activemerchant 1.126.0 → 1.131.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +269 -0
- data/lib/active_merchant/billing/check.rb +40 -8
- data/lib/active_merchant/billing/credit_card.rb +28 -1
- data/lib/active_merchant/billing/credit_card_methods.rb +80 -24
- data/lib/active_merchant/billing/gateways/adyen.rb +69 -10
- data/lib/active_merchant/billing/gateways/airwallex.rb +40 -11
- data/lib/active_merchant/billing/gateways/alelo.rb +256 -0
- data/lib/active_merchant/billing/gateways/authorize_net.rb +24 -6
- data/lib/active_merchant/billing/gateways/beanstream.rb +18 -0
- data/lib/active_merchant/billing/gateways/blue_snap.rb +22 -1
- data/lib/active_merchant/billing/gateways/bogus.rb +4 -0
- data/lib/active_merchant/billing/gateways/borgun.rb +57 -16
- data/lib/active_merchant/billing/gateways/braintree_blue.rb +72 -24
- data/lib/active_merchant/billing/gateways/card_connect.rb +27 -9
- data/lib/active_merchant/billing/gateways/card_stream.rb +23 -0
- data/lib/active_merchant/billing/gateways/checkout_v2.rb +238 -57
- data/lib/active_merchant/billing/gateways/commerce_hub.rb +366 -0
- data/lib/active_merchant/billing/gateways/credorax.rb +47 -27
- data/lib/active_merchant/billing/gateways/cyber_source/cyber_source_common.rb +36 -0
- data/lib/active_merchant/billing/gateways/cyber_source.rb +119 -33
- data/lib/active_merchant/billing/gateways/cyber_source_rest.rb +454 -0
- data/lib/active_merchant/billing/gateways/d_local.rb +45 -5
- data/lib/active_merchant/billing/gateways/decidir.rb +15 -4
- data/lib/active_merchant/billing/gateways/ebanx.rb +36 -24
- data/lib/active_merchant/billing/gateways/element.rb +21 -1
- data/lib/active_merchant/billing/gateways/global_collect.rb +113 -40
- data/lib/active_merchant/billing/gateways/ipg.rb +13 -8
- data/lib/active_merchant/billing/gateways/iveri.rb +39 -3
- data/lib/active_merchant/billing/gateways/kushki.rb +21 -1
- data/lib/active_merchant/billing/gateways/litle.rb +25 -5
- data/lib/active_merchant/billing/gateways/mastercard.rb +1 -8
- data/lib/active_merchant/billing/gateways/mercado_pago.rb +17 -0
- data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +44 -10
- data/lib/active_merchant/billing/gateways/monei.rb +2 -0
- data/lib/active_merchant/billing/gateways/moneris.rb +20 -5
- data/lib/active_merchant/billing/gateways/mundipagg.rb +3 -0
- data/lib/active_merchant/billing/gateways/ogone.rb +35 -7
- data/lib/active_merchant/billing/gateways/openpay.rb +20 -3
- data/lib/active_merchant/billing/gateways/orbital.rb +43 -22
- data/lib/active_merchant/billing/gateways/pay_trace.rb +64 -18
- data/lib/active_merchant/billing/gateways/payeezy.rb +59 -4
- data/lib/active_merchant/billing/gateways/paymentez.rb +18 -6
- data/lib/active_merchant/billing/gateways/paypal/paypal_express_response.rb +4 -0
- data/lib/active_merchant/billing/gateways/paypal_express.rb +2 -0
- data/lib/active_merchant/billing/gateways/paysafe.rb +22 -14
- data/lib/active_merchant/billing/gateways/payu_latam.rb +4 -1
- data/lib/active_merchant/billing/gateways/plexo.rb +308 -0
- data/lib/active_merchant/billing/gateways/priority.rb +29 -6
- data/lib/active_merchant/billing/gateways/rapyd.rb +110 -49
- data/lib/active_merchant/billing/gateways/reach.rb +277 -0
- data/lib/active_merchant/billing/gateways/redsys.rb +11 -6
- data/lib/active_merchant/billing/gateways/sage_pay.rb +1 -1
- data/lib/active_merchant/billing/gateways/securion_pay.rb +40 -0
- data/lib/active_merchant/billing/gateways/shift4.rb +345 -0
- data/lib/active_merchant/billing/gateways/simetrik.rb +28 -22
- data/lib/active_merchant/billing/gateways/stripe.rb +30 -6
- data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +62 -22
- data/lib/active_merchant/billing/gateways/tns.rb +2 -5
- data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +1 -1
- data/lib/active_merchant/billing/gateways/trust_commerce.rb +14 -3
- data/lib/active_merchant/billing/gateways/vanco.rb +12 -3
- data/lib/active_merchant/billing/gateways/visanet_peru.rb +1 -1
- data/lib/active_merchant/billing/gateways/vpos.rb +7 -4
- data/lib/active_merchant/billing/gateways/wompi.rb +8 -4
- data/lib/active_merchant/billing/gateways/worldpay.rb +128 -13
- data/lib/active_merchant/billing/response.rb +15 -1
- data/lib/active_merchant/connection.rb +0 -2
- data/lib/active_merchant/country.rb +1 -0
- data/lib/active_merchant/errors.rb +4 -1
- data/lib/active_merchant/version.rb +1 -1
- metadata +24 -3
@@ -22,8 +22,8 @@ module ActiveMerchant #:nodoc:
|
|
22
22
|
self.live_url = 'https://ics2wsa.ic3.com/commerce/1.x/transactionProcessor'
|
23
23
|
|
24
24
|
# Schema files can be found here: https://ics2ws.ic3.com/commerce/1.x/transactionProcessor/
|
25
|
-
TEST_XSD_VERSION = '1.
|
26
|
-
PRODUCTION_XSD_VERSION = '1.
|
25
|
+
TEST_XSD_VERSION = '1.201'
|
26
|
+
PRODUCTION_XSD_VERSION = '1.201'
|
27
27
|
ECI_BRAND_MAPPING = {
|
28
28
|
visa: 'vbv',
|
29
29
|
master: 'spa',
|
@@ -65,6 +65,7 @@ module ActiveMerchant #:nodoc:
|
|
65
65
|
r100: 'Successful transaction',
|
66
66
|
r101: 'Request is missing one or more required fields',
|
67
67
|
r102: 'One or more fields contains invalid data',
|
68
|
+
r104: 'The merchantReferenceCode sent with this authorization request matches the merchantReferenceCode of another authorization request that you sent in the last 15 minutes.', r110: 'Partial amount was approved',
|
68
69
|
r150: 'General failure',
|
69
70
|
r151: 'The request was received but a server time-out occurred',
|
70
71
|
r152: 'The request was received, but a service timed out',
|
@@ -79,7 +80,9 @@ module ActiveMerchant #:nodoc:
|
|
79
80
|
r209: 'American Express Card Identifiction Digits (CID) did not match',
|
80
81
|
r210: 'The card has reached the credit limit',
|
81
82
|
r211: 'Invalid card verification number',
|
83
|
+
r220: 'Generic Decline.',
|
82
84
|
r221: "The customer matched an entry on the processor's negative file",
|
85
|
+
r222: 'customer\'s account is frozen',
|
83
86
|
r230: 'The authorization request was approved by the issuing bank but declined by CyberSource because it did not pass the card verification check',
|
84
87
|
r231: 'Invalid account number',
|
85
88
|
r232: 'The card type is not accepted by the payment processor',
|
@@ -97,9 +100,36 @@ module ActiveMerchant #:nodoc:
|
|
97
100
|
r244: 'The bank account number failed the validation check',
|
98
101
|
r246: 'The capture or credit is not voidable because the capture or credit information has already been submitted to your processor',
|
99
102
|
r247: 'You requested a credit for a capture that was previously voided',
|
103
|
+
r248: 'The boleto request was declined by your processor.',
|
100
104
|
r250: 'The request was received, but a time-out occurred with the payment processor',
|
105
|
+
r251: 'The Pinless Debit card\'s use frequency or maximum amount per use has been exceeded.',
|
101
106
|
r254: 'Your CyberSource account is prohibited from processing stand-alone refunds',
|
102
|
-
r255: 'Your CyberSource account is not configured to process the service in the country you specified'
|
107
|
+
r255: 'Your CyberSource account is not configured to process the service in the country you specified',
|
108
|
+
r400: 'Soft Decline - Fraud score exceeds threshold.',
|
109
|
+
r450: 'Apartment number missing or not found.',
|
110
|
+
r451: 'Insufficient address information.',
|
111
|
+
r452: 'House/Box number not found on street.',
|
112
|
+
r453: 'Multiple address matches were found.',
|
113
|
+
r454: 'P.O. Box identifier not found or out of range.',
|
114
|
+
r455: 'Route service identifier not found or out of range.',
|
115
|
+
r456: 'Street name not found in Postal code.',
|
116
|
+
r457: 'Postal code not found in database.',
|
117
|
+
r458: 'Unable to verify or correct address.',
|
118
|
+
r459: 'Multiple addres matches were found (international)',
|
119
|
+
r460: 'Address match not found (no reason given)',
|
120
|
+
r461: 'Unsupported character set',
|
121
|
+
r475: 'The cardholder is enrolled in Payer Authentication. Please authenticate the cardholder before continuing with the transaction.',
|
122
|
+
r476: 'Encountered a Payer Authentication problem. Payer could not be authenticated.',
|
123
|
+
r478: 'Strong customer authentication (SCA) is required for this transaction.',
|
124
|
+
r480: 'The order is marked for review by Decision Manager',
|
125
|
+
r481: 'The order has been rejected by Decision Manager',
|
126
|
+
r490: 'Your aggregator or acquirer is not accepting transactions from you at this time.',
|
127
|
+
r491: 'Your aggregator or acquirer is not accepting this transaction.',
|
128
|
+
r520: 'Soft Decline - The authorization request was approved by the issuing bank but declined by CyberSource based on your Smart Authorization settings.',
|
129
|
+
r700: 'The customer matched the Denied Parties List',
|
130
|
+
r701: 'Export bill_country/ship_country match',
|
131
|
+
r702: 'Export email_country match',
|
132
|
+
r703: 'Export hostname_country/ip_country match'
|
103
133
|
}
|
104
134
|
|
105
135
|
# These are the options that can be used when creating a new CyberSource
|
@@ -288,15 +318,16 @@ module ActiveMerchant #:nodoc:
|
|
288
318
|
add_mdd_fields(xml, options)
|
289
319
|
add_auth_service(xml, creditcard_or_reference, options)
|
290
320
|
add_threeds_services(xml, options)
|
291
|
-
add_payment_network_token(xml) if network_tokenization?(creditcard_or_reference)
|
292
321
|
add_business_rules_data(xml, creditcard_or_reference, options)
|
322
|
+
add_airline_data(xml, options)
|
323
|
+
add_sales_slip_number(xml, options)
|
324
|
+
add_payment_network_token(xml) if network_tokenization?(creditcard_or_reference)
|
325
|
+
add_tax_management_indicator(xml, options)
|
293
326
|
add_stored_credential_subsequent_auth(xml, options)
|
294
327
|
add_issuer_additional_data(xml, options)
|
295
328
|
add_partner_solution_id(xml)
|
296
329
|
add_stored_credential_options(xml, options)
|
297
330
|
add_merchant_description(xml, options)
|
298
|
-
add_sales_slip_number(xml, options)
|
299
|
-
add_airline_data(xml, options)
|
300
331
|
xml.target!
|
301
332
|
end
|
302
333
|
|
@@ -317,6 +348,7 @@ module ActiveMerchant #:nodoc:
|
|
317
348
|
add_purchase_data(xml, 0, false, options)
|
318
349
|
add_tax_service(xml)
|
319
350
|
add_business_rules_data(xml, creditcard, options)
|
351
|
+
add_tax_management_indicator(xml, options)
|
320
352
|
xml.target!
|
321
353
|
end
|
322
354
|
|
@@ -328,8 +360,9 @@ module ActiveMerchant #:nodoc:
|
|
328
360
|
add_purchase_data(xml, money, true, options)
|
329
361
|
add_other_tax(xml, options)
|
330
362
|
add_mdd_fields(xml, options)
|
331
|
-
add_capture_service(xml, request_id, request_token)
|
363
|
+
add_capture_service(xml, request_id, request_token, options)
|
332
364
|
add_business_rules_data(xml, authorization, options)
|
365
|
+
add_tax_management_indicator(xml, options)
|
333
366
|
add_issuer_additional_data(xml, options)
|
334
367
|
add_merchant_description(xml, options)
|
335
368
|
add_partner_solution_id(xml)
|
@@ -345,21 +378,27 @@ module ActiveMerchant #:nodoc:
|
|
345
378
|
add_threeds_2_ucaf_data(xml, payment_method_or_reference, options)
|
346
379
|
add_decision_manager_fields(xml, options)
|
347
380
|
add_mdd_fields(xml, options)
|
348
|
-
|
349
|
-
add_airline_data(xml, options)
|
350
|
-
if !payment_method_or_reference.is_a?(String) && card_brand(payment_method_or_reference) == 'check'
|
381
|
+
if (!payment_method_or_reference.is_a?(String) && card_brand(payment_method_or_reference) == 'check') || reference_is_a_check?(payment_method_or_reference)
|
351
382
|
add_check_service(xml)
|
383
|
+
add_airline_data(xml, options)
|
384
|
+
add_sales_slip_number(xml, options)
|
385
|
+
add_tax_management_indicator(xml, options)
|
352
386
|
add_issuer_additional_data(xml, options)
|
353
387
|
add_partner_solution_id(xml)
|
388
|
+
options[:payment_method] = :check
|
354
389
|
else
|
355
390
|
add_purchase_service(xml, payment_method_or_reference, options)
|
356
391
|
add_threeds_services(xml, options)
|
357
|
-
add_payment_network_token(xml) if network_tokenization?(payment_method_or_reference)
|
358
392
|
add_business_rules_data(xml, payment_method_or_reference, options)
|
393
|
+
add_airline_data(xml, options)
|
394
|
+
add_sales_slip_number(xml, options)
|
395
|
+
add_payment_network_token(xml) if network_tokenization?(payment_method_or_reference)
|
396
|
+
add_tax_management_indicator(xml, options)
|
359
397
|
add_stored_credential_subsequent_auth(xml, options)
|
360
398
|
add_issuer_additional_data(xml, options)
|
361
399
|
add_partner_solution_id(xml)
|
362
400
|
add_stored_credential_options(xml, options)
|
401
|
+
options[:payment_method] = :credit_card
|
363
402
|
end
|
364
403
|
|
365
404
|
add_merchant_description(xml, options)
|
@@ -367,6 +406,10 @@ module ActiveMerchant #:nodoc:
|
|
367
406
|
xml.target!
|
368
407
|
end
|
369
408
|
|
409
|
+
def reference_is_a_check?(payment_method_or_reference)
|
410
|
+
payment_method_or_reference.is_a?(String) && payment_method_or_reference.split(';')[7] == 'check'
|
411
|
+
end
|
412
|
+
|
370
413
|
def build_void_request(identification, options)
|
371
414
|
order_id, request_id, request_token, action, money, currency = identification.split(';')
|
372
415
|
options[:order_id] = order_id
|
@@ -393,7 +436,9 @@ module ActiveMerchant #:nodoc:
|
|
393
436
|
|
394
437
|
xml = Builder::XmlMarkup.new indent: 2
|
395
438
|
add_purchase_data(xml, money, true, options)
|
396
|
-
add_credit_service(xml, request_id,
|
439
|
+
add_credit_service(xml, request_id: request_id,
|
440
|
+
request_token: request_token,
|
441
|
+
use_check_service: reference_is_a_check?(identification))
|
397
442
|
add_partner_solution_id(xml)
|
398
443
|
|
399
444
|
xml.target!
|
@@ -404,7 +449,7 @@ module ActiveMerchant #:nodoc:
|
|
404
449
|
|
405
450
|
add_payment_method_or_subscription(xml, money, creditcard_or_reference, options)
|
406
451
|
add_mdd_fields(xml, options)
|
407
|
-
add_credit_service(xml)
|
452
|
+
add_credit_service(xml, use_check_service: creditcard_or_reference.is_a?(Check))
|
408
453
|
add_issuer_additional_data(xml, options)
|
409
454
|
add_merchant_description(xml, options)
|
410
455
|
|
@@ -421,11 +466,13 @@ module ActiveMerchant #:nodoc:
|
|
421
466
|
add_address(xml, payment_method, options[:billing_address], options)
|
422
467
|
add_purchase_data(xml, options[:setup_fee] || 0, true, options)
|
423
468
|
if card_brand(payment_method) == 'check'
|
424
|
-
add_check(xml, payment_method)
|
469
|
+
add_check(xml, payment_method, options)
|
425
470
|
add_check_payment_method(xml)
|
471
|
+
options[:payment_method] = :check
|
426
472
|
else
|
427
473
|
add_creditcard(xml, payment_method)
|
428
474
|
add_creditcard_payment_method(xml)
|
475
|
+
options[:payment_method] = :credit_card
|
429
476
|
end
|
430
477
|
add_subscription(xml, options)
|
431
478
|
if options[:setup_fee]
|
@@ -438,6 +485,7 @@ module ActiveMerchant #:nodoc:
|
|
438
485
|
end
|
439
486
|
add_subscription_create_service(xml, options)
|
440
487
|
add_business_rules_data(xml, payment_method, options)
|
488
|
+
add_tax_management_indicator(xml, options)
|
441
489
|
xml.target!
|
442
490
|
end
|
443
491
|
|
@@ -450,6 +498,7 @@ module ActiveMerchant #:nodoc:
|
|
450
498
|
add_subscription(xml, options, reference)
|
451
499
|
add_subscription_update_service(xml, options)
|
452
500
|
add_business_rules_data(xml, creditcard, options)
|
501
|
+
add_tax_management_indicator(xml, options)
|
453
502
|
xml.target!
|
454
503
|
end
|
455
504
|
|
@@ -470,11 +519,9 @@ module ActiveMerchant #:nodoc:
|
|
470
519
|
def add_business_rules_data(xml, payment_method, options)
|
471
520
|
prioritized_options = [options, @options]
|
472
521
|
|
473
|
-
|
474
|
-
xml.tag! '
|
475
|
-
|
476
|
-
xml.tag!('ignoreCVResult', 'true') if extract_option(prioritized_options, :ignore_cvv).to_s == 'true'
|
477
|
-
end
|
522
|
+
xml.tag! 'businessRules' do
|
523
|
+
xml.tag!('ignoreAVSResult', 'true') if extract_option(prioritized_options, :ignore_avs).to_s == 'true'
|
524
|
+
xml.tag!('ignoreCVResult', 'true') if extract_option(prioritized_options, :ignore_cvv).to_s == 'true'
|
478
525
|
end
|
479
526
|
end
|
480
527
|
|
@@ -512,12 +559,14 @@ module ActiveMerchant #:nodoc:
|
|
512
559
|
end
|
513
560
|
|
514
561
|
def add_merchant_descriptor(xml, options)
|
515
|
-
return unless options[:merchant_descriptor] || options[:user_po] || options[:taxable]
|
562
|
+
return unless options[:merchant_descriptor] || options[:user_po] || options[:taxable] || options[:reference_data_code] || options[:invoice_number]
|
516
563
|
|
517
564
|
xml.tag! 'invoiceHeader' do
|
518
565
|
xml.tag! 'merchantDescriptor', options[:merchant_descriptor] if options[:merchant_descriptor]
|
519
566
|
xml.tag! 'userPO', options[:user_po] if options[:user_po]
|
520
567
|
xml.tag! 'taxable', options[:taxable] if options[:taxable]
|
568
|
+
xml.tag! 'referenceDataCode', options[:reference_data_code] if options[:reference_data_code]
|
569
|
+
xml.tag! 'invoiceNumber', options[:invoice_number] if options[:invoice_number]
|
521
570
|
end
|
522
571
|
end
|
523
572
|
|
@@ -551,10 +600,20 @@ module ActiveMerchant #:nodoc:
|
|
551
600
|
end
|
552
601
|
end
|
553
602
|
|
603
|
+
def add_tax_management_indicator(xml, options)
|
604
|
+
return unless options[:tax_management_indicator]
|
605
|
+
|
606
|
+
xml.tag! 'taxManagementIndicator', options[:tax_management_indicator] if options[:tax_management_indicator]
|
607
|
+
end
|
608
|
+
|
554
609
|
def add_purchase_data(xml, money = 0, include_grand_total = false, options = {})
|
555
610
|
xml.tag! 'purchaseTotals' do
|
556
611
|
xml.tag! 'currency', options[:currency] || currency(money)
|
612
|
+
xml.tag!('discountManagementIndicator', options[:discount_management_indicator]) if options[:discount_management_indicator]
|
613
|
+
xml.tag!('taxAmount', options[:purchase_tax_amount]) if options[:purchase_tax_amount]
|
557
614
|
xml.tag!('grandTotalAmount', localized_amount(money.to_i, options[:currency] || default_currency)) if include_grand_total
|
615
|
+
xml.tag!('originalAmount', options[:original_amount]) if options[:original_amount]
|
616
|
+
xml.tag!('invoiceAmount', options[:invoice_amount]) if options[:invoice_amount]
|
558
617
|
end
|
559
618
|
end
|
560
619
|
|
@@ -623,6 +682,7 @@ module ActiveMerchant #:nodoc:
|
|
623
682
|
return unless options[:local_tax_amount] || options[:national_tax_amount] || options[:national_tax_indicator]
|
624
683
|
|
625
684
|
xml.tag! 'otherTax' do
|
685
|
+
xml.tag! 'vatTaxRate', options[:vat_tax_rate] if options[:vat_tax_rate]
|
626
686
|
xml.tag! 'localTaxAmount', options[:local_tax_amount] if options[:local_tax_amount]
|
627
687
|
xml.tag! 'nationalTaxAmount', options[:national_tax_amount] if options[:national_tax_amount]
|
628
688
|
xml.tag! 'nationalTaxIndicator', options[:national_tax_indicator] if options[:national_tax_indicator]
|
@@ -640,11 +700,12 @@ module ActiveMerchant #:nodoc:
|
|
640
700
|
end
|
641
701
|
end
|
642
702
|
|
643
|
-
def add_check(xml, check)
|
703
|
+
def add_check(xml, check, options)
|
644
704
|
xml.tag! 'check' do
|
645
705
|
xml.tag! 'accountNumber', check.account_number
|
646
|
-
xml.tag! 'accountType', check.account_type
|
647
|
-
xml.tag! 'bankTransitNumber', check.routing_number
|
706
|
+
xml.tag! 'accountType', check.account_type == 'checking' ? 'C' : 'S'
|
707
|
+
xml.tag! 'bankTransitNumber', format_routing_number(check.routing_number, options)
|
708
|
+
xml.tag! 'secCode', options[:sec_code] if options[:sec_code]
|
648
709
|
end
|
649
710
|
end
|
650
711
|
|
@@ -667,6 +728,7 @@ module ActiveMerchant #:nodoc:
|
|
667
728
|
xml.tag!('commerceIndicator', indicator) if indicator
|
668
729
|
end
|
669
730
|
xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
|
731
|
+
xml.tag!('mobileRemotePaymentType', options[:mobile_remote_payment_type]) if options[:mobile_remote_payment_type]
|
670
732
|
end
|
671
733
|
end
|
672
734
|
end
|
@@ -759,9 +821,11 @@ module ActiveMerchant #:nodoc:
|
|
759
821
|
xml.tag! 'ccAuthService', { 'run' => 'true' } do
|
760
822
|
xml.tag!('cavv', Base64.encode64(cryptogram[0...20]))
|
761
823
|
xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
|
762
|
-
xml.tag!('xid', Base64.encode64(cryptogram[20...40]))
|
824
|
+
xml.tag!('xid', Base64.encode64(cryptogram[20...40])) if cryptogram.bytes.count > 20
|
763
825
|
xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
|
764
826
|
end
|
827
|
+
else
|
828
|
+
raise ArgumentError.new("Payment method #{brand} is not supported, check https://developer.cybersource.com/docs/cybs/en-us/payments/developer/all/rest/payments/CreatingOnlineAuth/CreatingAuthReqPNT.html")
|
765
829
|
end
|
766
830
|
end
|
767
831
|
|
@@ -771,10 +835,11 @@ module ActiveMerchant #:nodoc:
|
|
771
835
|
end
|
772
836
|
end
|
773
837
|
|
774
|
-
def add_capture_service(xml, request_id, request_token)
|
838
|
+
def add_capture_service(xml, request_id, request_token, options)
|
775
839
|
xml.tag! 'ccCaptureService', { 'run' => 'true' } do
|
776
840
|
xml.tag! 'authRequestID', request_id
|
777
841
|
xml.tag! 'authRequestToken', request_token
|
842
|
+
xml.tag! 'gratuityAmount', options[:gratuity_amount] if options[:gratuity_amount]
|
778
843
|
xml.tag! 'reconciliationID', options[:reconciliation_id] if options[:reconciliation_id]
|
779
844
|
end
|
780
845
|
end
|
@@ -800,10 +865,14 @@ module ActiveMerchant #:nodoc:
|
|
800
865
|
end
|
801
866
|
end
|
802
867
|
|
803
|
-
def add_credit_service(xml,
|
804
|
-
|
805
|
-
|
806
|
-
|
868
|
+
def add_credit_service(xml, options = {})
|
869
|
+
service = options[:use_check_service] ? 'ecCreditService' : 'ccCreditService'
|
870
|
+
request_tag = options[:use_check_service] ? 'debitRequestID' : 'captureRequestID'
|
871
|
+
options.delete :request_token if options[:use_check_service]
|
872
|
+
|
873
|
+
xml.tag! service, { 'run' => 'true' } do
|
874
|
+
xml.tag! request_tag, options[:request_id] if options[:request_id]
|
875
|
+
xml.tag! 'captureRequestToken', options[:request_token] if options[:request_token]
|
807
876
|
end
|
808
877
|
end
|
809
878
|
|
@@ -870,7 +939,7 @@ module ActiveMerchant #:nodoc:
|
|
870
939
|
add_address(xml, payment_method_or_reference, options[:billing_address], options)
|
871
940
|
add_purchase_data(xml, money, true, options)
|
872
941
|
add_installments(xml, options)
|
873
|
-
add_check(xml, payment_method_or_reference)
|
942
|
+
add_check(xml, payment_method_or_reference, options)
|
874
943
|
else
|
875
944
|
add_address(xml, payment_method_or_reference, options[:billing_address], options)
|
876
945
|
add_address(xml, payment_method_or_reference, options[:shipping_address], options, true)
|
@@ -882,12 +951,15 @@ module ActiveMerchant #:nodoc:
|
|
882
951
|
end
|
883
952
|
|
884
953
|
def add_installments(xml, options)
|
885
|
-
return unless
|
954
|
+
return unless %i[installment_total_count installment_total_amount installment_plan_type first_installment_date installment_annual_interest_rate installment_grace_period_duration].any? { |gsf| options.include?(gsf) }
|
886
955
|
|
887
956
|
xml.tag! 'installment' do
|
888
|
-
xml.tag!
|
957
|
+
xml.tag!('totalCount', options[:installment_total_count]) if options[:installment_total_count]
|
958
|
+
xml.tag!('totalAmount', options[:installment_total_amount]) if options[:installment_total_amount]
|
889
959
|
xml.tag!('planType', options[:installment_plan_type]) if options[:installment_plan_type]
|
890
960
|
xml.tag!('firstInstallmentDate', options[:first_installment_date]) if options[:first_installment_date]
|
961
|
+
xml.tag!('annualInterestRate', options[:installment_annual_interest_rate]) if options[:installment_annual_interest_rate]
|
962
|
+
xml.tag!('gracePeriodDuration', options[:installment_grace_period_duration]) if options[:installment_grace_period_duration]
|
891
963
|
end
|
892
964
|
end
|
893
965
|
|
@@ -981,6 +1053,8 @@ module ActiveMerchant #:nodoc:
|
|
981
1053
|
message = message_from(response)
|
982
1054
|
authorization = success || in_fraud_review?(response) ? authorization_from(response, action, amount, options) : nil
|
983
1055
|
|
1056
|
+
message = auto_void?(authorization_from(response, action, amount, options), response, message, options)
|
1057
|
+
|
984
1058
|
Response.new(success, message, response,
|
985
1059
|
test: test?,
|
986
1060
|
authorization: authorization,
|
@@ -989,6 +1063,14 @@ module ActiveMerchant #:nodoc:
|
|
989
1063
|
cvv_result: response[:cvCode])
|
990
1064
|
end
|
991
1065
|
|
1066
|
+
def auto_void?(authorization, response, message, options = {})
|
1067
|
+
return message unless response[:reasonCode] == '230' && options[:auto_void_230]
|
1068
|
+
|
1069
|
+
response = void(authorization, options)
|
1070
|
+
response&.success? ? message += ' - transaction has been auto-voided.' : message += ' - transaction could not be auto-voided.'
|
1071
|
+
message
|
1072
|
+
end
|
1073
|
+
|
992
1074
|
# Parse the SOAP response
|
993
1075
|
# Technique inspired by the Paypal Gateway
|
994
1076
|
def parse(xml)
|
@@ -1033,7 +1115,7 @@ module ActiveMerchant #:nodoc:
|
|
1033
1115
|
|
1034
1116
|
def authorization_from(response, action, amount, options)
|
1035
1117
|
[options[:order_id], response[:requestID], response[:requestToken], action, amount,
|
1036
|
-
options[:currency], response[:subscriptionID]].join(';')
|
1118
|
+
options[:currency], response[:subscriptionID], options[:payment_method]].join(';')
|
1037
1119
|
end
|
1038
1120
|
|
1039
1121
|
def in_fraud_review?(response)
|
@@ -1057,6 +1139,10 @@ module ActiveMerchant #:nodoc:
|
|
1057
1139
|
def eligible_for_zero_auth?(payment_method, options = {})
|
1058
1140
|
payment_method.is_a?(CreditCard) && options[:zero_amount_auth]
|
1059
1141
|
end
|
1142
|
+
|
1143
|
+
def format_routing_number(routing_number, options)
|
1144
|
+
options[:currency] == 'CAD' && routing_number.length > 8 ? routing_number[-8..-1] : routing_number
|
1145
|
+
end
|
1060
1146
|
end
|
1061
1147
|
end
|
1062
1148
|
end
|