activemerchant 1.108.0 → 1.109.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (202) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +28 -0
  3. data/lib/active_merchant/billing/base.rb +0 -13
  4. data/lib/active_merchant/billing/check.rb +1 -1
  5. data/lib/active_merchant/billing/credit_card.rb +2 -0
  6. data/lib/active_merchant/billing/credit_card_methods.rb +9 -6
  7. data/lib/active_merchant/billing/gateways/adyen.rb +8 -8
  8. data/lib/active_merchant/billing/gateways/allied_wallet.rb +2 -2
  9. data/lib/active_merchant/billing/gateways/authorize_net.rb +7 -7
  10. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -3
  11. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -3
  12. data/lib/active_merchant/billing/gateways/axcessms.rb +1 -1
  13. data/lib/active_merchant/billing/gateways/balanced.rb +1 -1
  14. data/lib/active_merchant/billing/gateways/bambora_apac.rb +2 -2
  15. data/lib/active_merchant/billing/gateways/bank_frick.rb +2 -2
  16. data/lib/active_merchant/billing/gateways/banwire.rb +2 -2
  17. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +2 -2
  18. data/lib/active_merchant/billing/gateways/barclays_epdq_extra_plus.rb +1 -1
  19. data/lib/active_merchant/billing/gateways/be2bill.rb +1 -1
  20. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -4
  21. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -2
  22. data/lib/active_merchant/billing/gateways/blue_snap.rb +1 -1
  23. data/lib/active_merchant/billing/gateways/borgun.rb +3 -3
  24. data/lib/active_merchant/billing/gateways/bpoint.rb +1 -1
  25. data/lib/active_merchant/billing/gateways/braintree/braintree_common.rb +1 -1
  26. data/lib/active_merchant/billing/gateways/braintree_blue.rb +78 -28
  27. data/lib/active_merchant/billing/gateways/bridge_pay.rb +2 -2
  28. data/lib/active_merchant/billing/gateways/cams.rb +2 -2
  29. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  30. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  31. data/lib/active_merchant/billing/gateways/card_stream.rb +4 -4
  32. data/lib/active_merchant/billing/gateways/cardknox.rb +4 -4
  33. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  34. data/lib/active_merchant/billing/gateways/cashnet.rb +1 -1
  35. data/lib/active_merchant/billing/gateways/cecabank.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/cenpos.rb +12 -12
  37. data/lib/active_merchant/billing/gateways/checkout.rb +3 -3
  38. data/lib/active_merchant/billing/gateways/checkout_v2.rb +2 -2
  39. data/lib/active_merchant/billing/gateways/citrus_pay.rb +1 -1
  40. data/lib/active_merchant/billing/gateways/clearhaus.rb +3 -3
  41. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  42. data/lib/active_merchant/billing/gateways/conekta.rb +1 -1
  43. data/lib/active_merchant/billing/gateways/creditcall.rb +1 -1
  44. data/lib/active_merchant/billing/gateways/credorax.rb +6 -2
  45. data/lib/active_merchant/billing/gateways/ct_payment.rb +2 -2
  46. data/lib/active_merchant/billing/gateways/culqi.rb +1 -1
  47. data/lib/active_merchant/billing/gateways/cyber_source.rb +13 -4
  48. data/lib/active_merchant/billing/gateways/d_local.rb +7 -3
  49. data/lib/active_merchant/billing/gateways/data_cash.rb +1 -1
  50. data/lib/active_merchant/billing/gateways/dibs.rb +2 -2
  51. data/lib/active_merchant/billing/gateways/digitzs.rb +2 -2
  52. data/lib/active_merchant/billing/gateways/ebanx.rb +4 -4
  53. data/lib/active_merchant/billing/gateways/efsnet.rb +2 -2
  54. data/lib/active_merchant/billing/gateways/elavon.rb +1 -1
  55. data/lib/active_merchant/billing/gateways/element.rb +3 -3
  56. data/lib/active_merchant/billing/gateways/epay.rb +3 -3
  57. data/lib/active_merchant/billing/gateways/evo_ca.rb +1 -1
  58. data/lib/active_merchant/billing/gateways/eway.rb +1 -1
  59. data/lib/active_merchant/billing/gateways/eway_managed.rb +1 -1
  60. data/lib/active_merchant/billing/gateways/eway_rapid.rb +2 -2
  61. data/lib/active_merchant/billing/gateways/exact.rb +3 -3
  62. data/lib/active_merchant/billing/gateways/ezic.rb +1 -1
  63. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  64. data/lib/active_merchant/billing/gateways/federated_canada.rb +1 -1
  65. data/lib/active_merchant/billing/gateways/finansbank.rb +2 -2
  66. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  67. data/lib/active_merchant/billing/gateways/first_pay.rb +1 -1
  68. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +4 -4
  69. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +3 -3
  70. data/lib/active_merchant/billing/gateways/flo2cash.rb +10 -10
  71. data/lib/active_merchant/billing/gateways/forte.rb +2 -2
  72. data/lib/active_merchant/billing/gateways/garanti.rb +2 -2
  73. data/lib/active_merchant/billing/gateways/global_collect.rb +5 -5
  74. data/lib/active_merchant/billing/gateways/global_transport.rb +1 -1
  75. data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
  76. data/lib/active_merchant/billing/gateways/hps.rb +1 -1
  77. data/lib/active_merchant/billing/gateways/iats_payments.rb +2 -2
  78. data/lib/active_merchant/billing/gateways/inspire.rb +1 -1
  79. data/lib/active_merchant/billing/gateways/instapay.rb +1 -1
  80. data/lib/active_merchant/billing/gateways/ipp.rb +1 -1
  81. data/lib/active_merchant/billing/gateways/iridium.rb +3 -3
  82. data/lib/active_merchant/billing/gateways/itransact.rb +1 -1
  83. data/lib/active_merchant/billing/gateways/iveri.rb +2 -2
  84. data/lib/active_merchant/billing/gateways/ixopay.rb +1 -1
  85. data/lib/active_merchant/billing/gateways/jetpay.rb +2 -2
  86. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +2 -2
  87. data/lib/active_merchant/billing/gateways/komoju.rb +1 -1
  88. data/lib/active_merchant/billing/gateways/kushki.rb +4 -4
  89. data/lib/active_merchant/billing/gateways/latitude19.rb +2 -2
  90. data/lib/active_merchant/billing/gateways/linkpoint.rb +2 -2
  91. data/lib/active_merchant/billing/gateways/litle.rb +4 -4
  92. data/lib/active_merchant/billing/gateways/maxipago.rb +2 -2
  93. data/lib/active_merchant/billing/gateways/mercado_pago.rb +11 -6
  94. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -1
  95. data/lib/active_merchant/billing/gateways/merchant_one.rb +2 -2
  96. data/lib/active_merchant/billing/gateways/merchant_partners.rb +1 -1
  97. data/lib/active_merchant/billing/gateways/merchant_ware.rb +1 -1
  98. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +1 -1
  99. data/lib/active_merchant/billing/gateways/merchant_warrior.rb +2 -2
  100. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  101. data/lib/active_merchant/billing/gateways/metrics_global.rb +1 -1
  102. data/lib/active_merchant/billing/gateways/micropayment.rb +2 -2
  103. data/lib/active_merchant/billing/gateways/migs.rb +1 -1
  104. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +1 -1
  105. data/lib/active_merchant/billing/gateways/monei.rb +2 -2
  106. data/lib/active_merchant/billing/gateways/moneris.rb +17 -17
  107. data/lib/active_merchant/billing/gateways/money_movers.rb +1 -1
  108. data/lib/active_merchant/billing/gateways/mundipagg.rb +1 -1
  109. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -2
  110. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +1 -1
  111. data/lib/active_merchant/billing/gateways/net_registry.rb +2 -2
  112. data/lib/active_merchant/billing/gateways/netaxept.rb +2 -2
  113. data/lib/active_merchant/billing/gateways/netbanx.rb +46 -22
  114. data/lib/active_merchant/billing/gateways/netbilling.rb +2 -2
  115. data/lib/active_merchant/billing/gateways/netpay.rb +2 -2
  116. data/lib/active_merchant/billing/gateways/network_merchants.rb +1 -1
  117. data/lib/active_merchant/billing/gateways/nmi.rb +4 -4
  118. data/lib/active_merchant/billing/gateways/ogone.rb +2 -2
  119. data/lib/active_merchant/billing/gateways/omise.rb +1 -1
  120. data/lib/active_merchant/billing/gateways/openpay.rb +1 -1
  121. data/lib/active_merchant/billing/gateways/opp.rb +1 -1
  122. data/lib/active_merchant/billing/gateways/optimal_payment.rb +4 -4
  123. data/lib/active_merchant/billing/gateways/orbital.rb +6 -6
  124. data/lib/active_merchant/billing/gateways/orbital/orbital_soft_descriptors.rb +1 -1
  125. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +1 -1
  126. data/lib/active_merchant/billing/gateways/pagarme.rb +2 -2
  127. data/lib/active_merchant/billing/gateways/pago_facil.rb +1 -1
  128. data/lib/active_merchant/billing/gateways/pay_conex.rb +1 -1
  129. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +2 -2
  130. data/lib/active_merchant/billing/gateways/pay_hub.rb +1 -1
  131. data/lib/active_merchant/billing/gateways/pay_junction.rb +3 -3
  132. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +2 -2
  133. data/lib/active_merchant/billing/gateways/pay_secure.rb +1 -1
  134. data/lib/active_merchant/billing/gateways/paybox_direct.rb +3 -3
  135. data/lib/active_merchant/billing/gateways/payeezy.rb +2 -2
  136. data/lib/active_merchant/billing/gateways/payex.rb +13 -13
  137. data/lib/active_merchant/billing/gateways/payflow.rb +5 -5
  138. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
  139. data/lib/active_merchant/billing/gateways/payflow_uk.rb +1 -1
  140. data/lib/active_merchant/billing/gateways/payment_express.rb +1 -1
  141. data/lib/active_merchant/billing/gateways/paymentez.rb +1 -1
  142. data/lib/active_merchant/billing/gateways/paymill.rb +1 -1
  143. data/lib/active_merchant/billing/gateways/paypal.rb +2 -2
  144. data/lib/active_merchant/billing/gateways/paypal_ca.rb +1 -1
  145. data/lib/active_merchant/billing/gateways/payscout.rb +1 -1
  146. data/lib/active_merchant/billing/gateways/paystation.rb +1 -1
  147. data/lib/active_merchant/billing/gateways/payu_in.rb +1 -1
  148. data/lib/active_merchant/billing/gateways/payu_latam.rb +6 -7
  149. data/lib/active_merchant/billing/gateways/payway.rb +1 -1
  150. data/lib/active_merchant/billing/gateways/pin.rb +1 -1
  151. data/lib/active_merchant/billing/gateways/plugnpay.rb +5 -5
  152. data/lib/active_merchant/billing/gateways/pro_pay.rb +2 -2
  153. data/lib/active_merchant/billing/gateways/psigate.rb +1 -1
  154. data/lib/active_merchant/billing/gateways/psl_card.rb +2 -2
  155. data/lib/active_merchant/billing/gateways/qbms.rb +1 -1
  156. data/lib/active_merchant/billing/gateways/quantum.rb +3 -3
  157. data/lib/active_merchant/billing/gateways/quickbooks.rb +6 -6
  158. data/lib/active_merchant/billing/gateways/quickpay/quickpay_common.rb +3 -3
  159. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +4 -4
  160. data/lib/active_merchant/billing/gateways/qvalent.rb +1 -1
  161. data/lib/active_merchant/billing/gateways/realex.rb +1 -1
  162. data/lib/active_merchant/billing/gateways/redsys.rb +4 -4
  163. data/lib/active_merchant/billing/gateways/s5.rb +1 -1
  164. data/lib/active_merchant/billing/gateways/safe_charge.rb +2 -2
  165. data/lib/active_merchant/billing/gateways/sage.rb +3 -3
  166. data/lib/active_merchant/billing/gateways/sage_pay.rb +3 -3
  167. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -1
  168. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -1
  169. data/lib/active_merchant/billing/gateways/secure_pay.rb +1 -1
  170. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -2
  171. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +2 -2
  172. data/lib/active_merchant/billing/gateways/securion_pay.rb +1 -1
  173. data/lib/active_merchant/billing/gateways/skip_jack.rb +5 -5
  174. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +6 -6
  175. data/lib/active_merchant/billing/gateways/spreedly_core.rb +1 -1
  176. data/lib/active_merchant/billing/gateways/stripe.rb +6 -6
  177. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +20 -1
  178. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +1 -1
  179. data/lib/active_merchant/billing/gateways/telr.rb +4 -4
  180. data/lib/active_merchant/billing/gateways/tns.rb +1 -1
  181. data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
  182. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +1 -1
  183. data/lib/active_merchant/billing/gateways/transact_pro.rb +1 -1
  184. data/lib/active_merchant/billing/gateways/transax.rb +1 -1
  185. data/lib/active_merchant/billing/gateways/trexle.rb +1 -1
  186. data/lib/active_merchant/billing/gateways/trust_commerce.rb +5 -5
  187. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +6 -6
  188. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +1 -1
  189. data/lib/active_merchant/billing/gateways/vanco.rb +1 -1
  190. data/lib/active_merchant/billing/gateways/verifi.rb +3 -3
  191. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -1
  192. data/lib/active_merchant/billing/gateways/visanet_peru.rb +3 -3
  193. data/lib/active_merchant/billing/gateways/webpay.rb +1 -1
  194. data/lib/active_merchant/billing/gateways/wepay.rb +2 -2
  195. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -1
  196. data/lib/active_merchant/billing/gateways/world_net.rb +35 -35
  197. data/lib/active_merchant/billing/gateways/worldpay.rb +6 -6
  198. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +1 -1
  199. data/lib/active_merchant/billing/gateways/worldpay_us.rb +1 -1
  200. data/lib/active_merchant/version.rb +1 -1
  201. data/lib/support/gateway_support.rb +1 -1
  202. metadata +35 -35
@@ -8,7 +8,7 @@ module ActiveMerchant
8
8
  self.supported_countries = %w(US CA GB AT BE BG HR CY CZ DK EE FI FR DE GR HU IE IT LV LT LU MT NL PL PT RO SK SI ES SE AR BO BR BZ CL CO CR DO EC GF GP GT HN HT MF MQ MX NI PA PE PR PY SV UY VE)
9
9
 
10
10
  self.default_currency = 'USD'
11
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club, :maestro, :naranja, :cabal]
11
+ self.supported_cardtypes = %i[visa master american_express discover jcb diners_club maestro naranja cabal]
12
12
  self.currencies_without_fractions = %w(BYR CLP ILS JPY KRW VND XOF)
13
13
  self.currencies_with_three_decimal_places = %w(BHD JOD KWD OMR TND)
14
14
 
@@ -9,10 +9,10 @@ module ActiveMerchant #:nodoc:
9
9
  self.test_url = 'https://gatewaytest.borgun.is/ws/Heimir.pub.ws:Authorization'
10
10
  self.live_url = 'https://gateway01.borgun.is/ws/Heimir.pub.ws:Authorization'
11
11
 
12
- self.supported_countries = ['IS', 'GB', 'HU', 'CZ', 'DE', 'DK', 'SE']
12
+ self.supported_countries = %w[IS GB HU CZ DE DK SE]
13
13
  self.default_currency = 'ISK'
14
14
  self.money_format = :cents
15
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover, :jcb]
15
+ self.supported_cardtypes = %i[visa master american_express diners_club discover jcb]
16
16
 
17
17
  self.homepage_url = 'https://www.borgun.is/'
18
18
 
@@ -96,7 +96,7 @@ module ActiveMerchant #:nodoc:
96
96
  end
97
97
 
98
98
  def add_reference(post, authorization)
99
- dateandtime, _batch, transaction, rrn, authcode, _, _, _ = split_authorization(authorization)
99
+ dateandtime, _batch, transaction, rrn, authcode, = split_authorization(authorization)
100
100
  post[:DateAndTime] = dateandtime
101
101
  post[:Transaction] = transaction
102
102
  post[:RRN] = rrn
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
7
7
 
8
8
  self.supported_countries = ['AU']
9
9
  self.default_currency = 'AUD'
10
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club]
10
+ self.supported_cardtypes = %i[visa master american_express diners_club]
11
11
 
12
12
  self.homepage_url = 'https://www.bpoint.com.au/bpoint'
13
13
  self.display_name = 'BPoint'
@@ -1,7 +1,7 @@
1
1
  module BraintreeCommon
2
2
  def self.included(base)
3
3
  base.supported_countries = %w(US CA AD AT BE BG HR CY CZ DK EE FI FR GI DE GR GG HU IS IM IE IT JE LV LI LT LU MT MC NL NO PL PT RO SM SK SI ES SE CH TR GB SG HK MY AU NZ)
4
- base.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club, :maestro]
4
+ base.supported_cardtypes = %i[visa master american_express discover jcb diners_club maestro]
5
5
  base.homepage_url = 'http://www.braintreepaymentsolutions.com'
6
6
  base.display_name = 'Braintree'
7
7
  base.default_currency = 'USD'
@@ -299,7 +299,7 @@ module ActiveMerchant #:nodoc:
299
299
  def merge_credit_card_options(parameters, options)
300
300
  valid_options = {}
301
301
  options.each do |key, value|
302
- valid_options[key] = value if [:update_existing_token, :verify_card, :verification_merchant_account_id].include?(key)
302
+ valid_options[key] = value if %i[update_existing_token verify_card verification_merchant_account_id].include?(key)
303
303
  end
304
304
 
305
305
  valid_options[:verification_merchant_account_id] ||= @merchant_account_id if valid_options.include?(:verify_card) && @merchant_account_id
@@ -582,60 +582,110 @@ module ActiveMerchant #:nodoc:
582
582
  }
583
583
  }
584
584
 
585
- parameters[:options][:skip_advanced_fraud_checking] = options[:skip_advanced_fraud_checking] if options[:skip_advanced_fraud_checking]
586
-
587
- parameters[:options][:skip_avs] = options[:skip_avs] if options[:skip_avs]
588
-
589
- parameters[:options][:skip_cvv] = options[:skip_cvv] if options[:skip_cvv]
590
-
591
585
  parameters[:custom_fields] = options[:custom_fields]
592
586
  parameters[:device_data] = options[:device_data] if options[:device_data]
593
587
  parameters[:service_fee_amount] = options[:service_fee_amount] if options[:service_fee_amount]
594
- if merchant_account_id = (options[:merchant_account_id] || @merchant_account_id)
595
- parameters[:merchant_account_id] = merchant_account_id
596
- end
597
588
 
598
- if options[:transaction_source]
599
- parameters[:transaction_source] = options[:transaction_source]
600
- elsif options[:recurring]
601
- parameters[:recurring] = true
602
- end
589
+ add_skip_options(parameters, options)
590
+ add_merchant_account_id(parameters, options)
603
591
 
604
592
  add_payment_method(parameters, credit_card_or_vault_id, options)
605
593
  add_stored_credential_data(parameters, credit_card_or_vault_id, options)
594
+ add_addresses(parameters, options)
595
+
596
+ add_descriptor(parameters, options)
597
+ add_travel_data(parameters, options) if options[:travel_data]
598
+ add_lodging_data(parameters, options) if options[:lodging_data]
599
+ add_channel(parameters, options)
600
+ add_transaction_source(parameters, options)
601
+
602
+ add_level_2_data(parameters, options)
603
+ add_level_3_data(parameters, options)
604
+
605
+ add_3ds_info(parameters, options[:three_d_secure])
606
+
607
+ if options[:payment_method_nonce].is_a?(String)
608
+ parameters.delete(:customer)
609
+ parameters[:payment_method_nonce] = options[:payment_method_nonce]
610
+ end
611
+
612
+ parameters
613
+ end
614
+
615
+ def add_skip_options(parameters, options)
616
+ parameters[:options][:skip_advanced_fraud_checking] = options[:skip_advanced_fraud_checking] if options[:skip_advanced_fraud_checking]
617
+ parameters[:options][:skip_avs] = options[:skip_avs] if options[:skip_avs]
618
+ parameters[:options][:skip_cvv] = options[:skip_cvv] if options[:skip_cvv]
619
+ end
606
620
 
621
+ def add_merchant_account_id(parameters, options)
622
+ return unless merchant_account_id = (options[:merchant_account_id] || @merchant_account_id)
623
+
624
+ parameters[:merchant_account_id] = merchant_account_id
625
+ end
626
+
627
+ def add_transaction_source(parameters, options)
628
+ parameters[:transaction_source] = options[:transaction_source] if options[:transaction_source]
629
+ parameters[:transaction_source] = 'recurring' if options[:recurring]
630
+ end
631
+
632
+ def add_addresses(parameters, options)
607
633
  parameters[:billing] = map_address(options[:billing_address]) if options[:billing_address]
608
634
  parameters[:shipping] = map_address(options[:shipping_address]) if options[:shipping_address]
635
+ end
609
636
 
637
+ def add_channel(parameters, options)
610
638
  channel = @options[:channel] || application_id
611
639
  parameters[:channel] = channel if channel
640
+ end
612
641
 
613
- if options[:descriptor_name] || options[:descriptor_phone] || options[:descriptor_url]
614
- parameters[:descriptor] = {
615
- name: options[:descriptor_name],
616
- phone: options[:descriptor_phone],
617
- url: options[:descriptor_url]
618
- }
619
- end
642
+ def add_descriptor(parameters, options)
643
+ return unless options[:descriptor_name] || options[:descriptor_phone] || options[:descriptor_url]
620
644
 
621
- add_3ds_info(parameters, options[:three_d_secure])
645
+ parameters[:descriptor] = {
646
+ name: options[:descriptor_name],
647
+ phone: options[:descriptor_phone],
648
+ url: options[:descriptor_url]
649
+ }
650
+ end
622
651
 
652
+ def add_level_2_data(parameters, options)
623
653
  parameters[:tax_amount] = options[:tax_amount] if options[:tax_amount]
624
654
  parameters[:tax_exempt] = options[:tax_exempt] if options[:tax_exempt]
625
655
  parameters[:purchase_order_number] = options[:purchase_order_number] if options[:purchase_order_number]
656
+ end
626
657
 
658
+ def add_level_3_data(parameters, options)
627
659
  parameters[:shipping_amount] = options[:shipping_amount] if options[:shipping_amount]
628
660
  parameters[:discount_amount] = options[:discount_amount] if options[:discount_amount]
629
661
  parameters[:ships_from_postal_code] = options[:ships_from_postal_code] if options[:ships_from_postal_code]
630
662
 
631
663
  parameters[:line_items] = options[:line_items] if options[:line_items]
664
+ end
632
665
 
633
- if options[:payment_method_nonce].is_a?(String)
634
- parameters.delete(:customer)
635
- parameters[:payment_method_nonce] = options[:payment_method_nonce]
636
- end
666
+ def add_travel_data(parameters, options)
667
+ parameters[:industry] = {
668
+ industry_type: Braintree::Transaction::IndustryType::TravelAndCruise,
669
+ data: {}
670
+ }
637
671
 
638
- parameters
672
+ parameters[:industry][:data][:travel_package] = options[:travel_data][:travel_package] if options[:travel_data][:travel_package]
673
+ parameters[:industry][:data][:departure_date] = options[:travel_data][:departure_date] if options[:travel_data][:departure_date]
674
+ parameters[:industry][:data][:lodging_check_in_date] = options[:travel_data][:lodging_check_in_date] if options[:travel_data][:lodging_check_in_date]
675
+ parameters[:industry][:data][:lodging_check_out_date] = options[:travel_data][:lodging_check_out_date] if options[:travel_data][:lodging_check_out_date]
676
+ parameters[:industry][:data][:lodging_name] = options[:travel_data][:lodging_name] if options[:travel_data][:lodging_name]
677
+ end
678
+
679
+ def add_lodging_data(parameters, options)
680
+ parameters[:industry] = {
681
+ industry_type: Braintree::Transaction::IndustryType::Lodging,
682
+ data: {}
683
+ }
684
+
685
+ parameters[:industry][:data][:folio_number] = options[:lodging_data][:folio_number] if options[:lodging_data][:folio_number]
686
+ parameters[:industry][:data][:check_in_date] = options[:lodging_data][:check_in_date] if options[:lodging_data][:check_in_date]
687
+ parameters[:industry][:data][:check_out_date] = options[:lodging_data][:check_out_date] if options[:lodging_data][:check_out_date]
688
+ parameters[:industry][:data][:room_rate] = options[:lodging_data][:room_rate] if options[:lodging_data][:room_rate]
639
689
  end
640
690
 
641
691
  def add_3ds_info(parameters, three_d_secure_opts)
@@ -9,9 +9,9 @@ module ActiveMerchant #:nodoc:
9
9
  self.test_url = 'https://gatewaystage.itstgate.com/SmartPayments/transact3.asmx'
10
10
  self.live_url = 'https://gateway.itstgate.com/SmartPayments/transact3.asmx'
11
11
 
12
- self.supported_countries = ['CA', 'US']
12
+ self.supported_countries = %w[CA US]
13
13
  self.default_currency = 'USD'
14
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
14
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
15
15
 
16
16
  def initialize(options={})
17
17
  requires!(options, :user_name, :password)
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
5
5
 
6
6
  self.supported_countries = ['US']
7
7
  self.default_currency = 'USD'
8
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
8
+ self.supported_cardtypes = %i[visa master american_express discover]
9
9
 
10
10
  self.homepage_url = 'https://www.centralams.com/'
11
11
  self.display_name = 'CAMS: Central Account Management System'
@@ -167,7 +167,7 @@ module ActiveMerchant #:nodoc:
167
167
 
168
168
  def add_payment(post, payment)
169
169
  post[:ccnumber] = payment.number
170
- post[:ccexp] = "#{payment.month.to_s.rjust(2, "0")}#{payment.year.to_s[-2..-1]}"
170
+ post[:ccexp] = "#{payment.month.to_s.rjust(2, '0')}#{payment.year.to_s[-2..-1]}"
171
171
  post[:cvv] = payment.verification_value
172
172
  end
173
173
 
@@ -6,7 +6,7 @@ module ActiveMerchant #:nodoc:
6
6
 
7
7
  self.supported_countries = ['US']
8
8
  self.default_currency = 'USD'
9
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
9
+ self.supported_cardtypes = %i[visa master american_express discover]
10
10
 
11
11
  self.homepage_url = 'https://cardconnect.com/'
12
12
  self.display_name = 'Card Connect'
@@ -6,7 +6,7 @@ module ActiveMerchant #:nodoc:
6
6
 
7
7
  self.money_format = :cents
8
8
  self.default_currency = 'GBP'
9
- self.supported_cardtypes = [:visa, :maestro, :master, :american_express, :jcb]
9
+ self.supported_cardtypes = %i[visa maestro master american_express jcb]
10
10
  self.supported_countries = ['GB']
11
11
  self.homepage_url = 'http://www.cardsave.net/'
12
12
  self.display_name = 'CardSave'
@@ -7,8 +7,8 @@ module ActiveMerchant #:nodoc:
7
7
  self.money_format = :cents
8
8
  self.default_currency = 'GBP'
9
9
  self.currencies_without_fractions = %w(CVE ISK JPY UGX)
10
- self.supported_countries = ['GB', 'US', 'CH', 'SE', 'SG', 'NO', 'JP', 'IS', 'HK', 'NL', 'CZ', 'CA', 'AU']
11
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover, :jcb, :maestro]
10
+ self.supported_countries = %w[GB US CH SE SG NO JP IS HK NL CZ CA AU]
11
+ self.supported_cardtypes = %i[visa master american_express diners_club discover jcb maestro]
12
12
  self.homepage_url = 'http://www.cardstream.com/'
13
13
  self.display_name = 'CardStream'
14
14
 
@@ -247,7 +247,7 @@ module ActiveMerchant #:nodoc:
247
247
  add_pair(post, :statementNarrative1, options[:merchant_name]) if options[:merchant_name]
248
248
  add_pair(post, :statementNarrative2, options[:dynamic_descriptor]) if options[:dynamic_descriptor]
249
249
  if credit_card_or_reference.respond_to?(:number)
250
- if ['american_express', 'diners_club'].include?(card_brand(credit_card_or_reference).to_s)
250
+ if %w[american_express diners_club].include?(card_brand(credit_card_or_reference).to_s)
251
251
  add_pair(post, :item1Quantity, 1)
252
252
  add_pair(post, :item1Description, (options[:description] || options[:order_id]).slice(0, 15))
253
253
  add_pair(post, :item1GrossValue, localized_amount(money, options[:currency] || currency(money)))
@@ -309,7 +309,7 @@ module ActiveMerchant #:nodoc:
309
309
  end
310
310
 
311
311
  def commit(action, parameters)
312
- parameters.update(countryCode: self.supported_countries[0]) unless ['CAPTURE', 'CANCEL'].include?(action)
312
+ parameters.update(countryCode: self.supported_countries[0]) unless %w[CAPTURE CANCEL].include?(action)
313
313
  parameters.update(
314
314
  merchantID: @options[:login],
315
315
  action: action
@@ -3,9 +3,9 @@ module ActiveMerchant #:nodoc:
3
3
  class CardknoxGateway < Gateway
4
4
  self.live_url = 'https://x1.cardknox.com/gateway'
5
5
 
6
- self.supported_countries = ['US', 'CA', 'GB']
6
+ self.supported_countries = %w[US CA GB]
7
7
  self.default_currency = 'USD'
8
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
8
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
9
9
 
10
10
  self.homepage_url = 'https://www.cardknox.com/'
11
11
  self.display_name = 'Cardknox'
@@ -116,7 +116,7 @@ module ActiveMerchant #:nodoc:
116
116
  end
117
117
 
118
118
  def add_reference(post, reference)
119
- reference, _, _ = split_authorization(reference)
119
+ reference, = split_authorization(reference)
120
120
  post[:Refnum] = reference
121
121
  end
122
122
 
@@ -247,7 +247,7 @@ module ActiveMerchant #:nodoc:
247
247
  end
248
248
 
249
249
  def add_cardknox_token(post, authorization)
250
- _, token, _ = split_authorization(authorization)
250
+ _, token, = split_authorization(authorization)
251
251
 
252
252
  post[:Token] = token
253
253
  end
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
  MT HU NL AT PL PT RO SI SK FI SE GB IS LI NO
9
9
  CH ME MK AL RS TR BA ]
10
10
  self.default_currency = 'EUR'
11
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
11
+ self.supported_cardtypes = %i[visa master american_express diners_club jcb]
12
12
 
13
13
  self.homepage_url = 'https://vr-pay-ecommerce.docs.oppwa.com/'
14
14
  self.display_name = 'CardProcess VR-Pay'
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
7
7
  self.test_url = 'https://train.cashnet.com/'
8
8
 
9
9
  self.supported_countries = ['US']
10
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
10
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
11
11
  self.homepage_url = 'http://www.higherone.com/'
12
12
  self.display_name = 'Cashnet'
13
13
  self.money_format = :dollars
@@ -5,7 +5,7 @@ module ActiveMerchant #:nodoc:
5
5
  self.live_url = 'https://pgw.ceca.es'
6
6
 
7
7
  self.supported_countries = ['ES']
8
- self.supported_cardtypes = [:visa, :master, :american_express]
8
+ self.supported_cardtypes = %i[visa master american_express]
9
9
  self.homepage_url = 'http://www.ceca.es/es/'
10
10
  self.display_name = 'Cecabank'
11
11
  self.default_currency = 'EUR'
@@ -11,7 +11,7 @@ module ActiveMerchant #:nodoc:
11
11
  self.supported_countries = %w(AD AI AG AR AU AT BS BB BE BZ BM BR BN BG CA HR CY CZ DK DM EE FI FR DE GR GD GY HK HU IS IL IT JP LV LI LT LU MY MT MX MC MS NL PA PL PT KN LC MF VC SM SG SK SI ZA ES SR SE CH TR GB US UY)
12
12
  self.default_currency = 'USD'
13
13
  self.money_format = :dollars
14
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
14
+ self.supported_cardtypes = %i[visa master american_express discover]
15
15
 
16
16
  def initialize(options={})
17
17
  requires!(options, :merchant_id, :password, :user_id)
@@ -198,17 +198,17 @@ module ActiveMerchant #:nodoc:
198
198
  end
199
199
 
200
200
  def envelope(body)
201
- <<-EOS
202
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:acr="http://schemas.datacontract.org/2004/07/Acriter.ABI.CenPOS.EPayment.VirtualTerminal.Common" xmlns:acr1="http://schemas.datacontract.org/2004/07/Acriter.ABI.CenPOS.EPayment.VirtualTerminal.v6.Common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
203
- <soapenv:Header/>
204
- <soapenv:Body>
205
- <tem:ProcessCreditCard>
206
- <tem:request>
207
- #{body}
208
- </tem:request>
209
- </tem:ProcessCreditCard>
210
- </soapenv:Body>
211
- </soapenv:Envelope>
201
+ <<~EOS
202
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:acr="http://schemas.datacontract.org/2004/07/Acriter.ABI.CenPOS.EPayment.VirtualTerminal.Common" xmlns:acr1="http://schemas.datacontract.org/2004/07/Acriter.ABI.CenPOS.EPayment.VirtualTerminal.v6.Common" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
203
+ <soapenv:Header/>
204
+ <soapenv:Body>
205
+ <tem:ProcessCreditCard>
206
+ <tem:request>
207
+ #{body}
208
+ </tem:request>
209
+ </tem:ProcessCreditCard>
210
+ </soapenv:Body>
211
+ </soapenv:Envelope>
212
212
  EOS
213
213
  end
214
214
 
@@ -7,8 +7,8 @@ module ActiveMerchant #:nodoc:
7
7
  self.default_currency = 'USD'
8
8
  self.money_format = :cents
9
9
 
10
- self.supported_countries = ['AD', 'AT', 'BE', 'BG', 'CH', 'CY', 'CZ', 'DE', 'DK', 'EE', 'ES', 'FO', 'FI', 'FR', 'GB', 'GI', 'GL', 'GR', 'HR', 'HU', 'IE', 'IS', 'IL', 'IT', 'LI', 'LT', 'LU', 'LV', 'MC', 'MT', 'NL', 'NO', 'PL', 'PT', 'RO', 'SE', 'SI', 'SM', 'SK', 'SJ', 'TR', 'VA']
11
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club]
10
+ self.supported_countries = %w[AD AT BE BG CH CY CZ DE DK EE ES FO FI FR GB GI GL GR HR HU IE IS IL IT LI LT LU LV MC MT NL NO PL PT RO SE SI SM SK SJ TR VA]
11
+ self.supported_cardtypes = %i[visa master american_express diners_club]
12
12
 
13
13
  self.homepage_url = 'https://www.checkout.com/'
14
14
  self.display_name = 'Checkout.com'
@@ -150,7 +150,7 @@ module ActiveMerchant #:nodoc:
150
150
  end
151
151
 
152
152
  def add_reference(xml, authorization)
153
- transid, trackid, _, _, _ = split_authorization(authorization)
153
+ transid, trackid, = split_authorization(authorization)
154
154
  xml.transid transid
155
155
  add_track_id(xml, trackid)
156
156
  end
@@ -6,10 +6,10 @@ module ActiveMerchant #:nodoc:
6
6
  self.live_url = 'https://api.checkout.com'
7
7
  self.test_url = 'https://api.sandbox.checkout.com'
8
8
 
9
- self.supported_countries = ['AD', 'AE', 'AR', 'AT', 'AU', 'BE', 'BG', 'BH', 'BR', 'CH', 'CL', 'CN', 'CO', 'CY', 'CZ', 'DE', 'DK', 'EE', 'EG', 'ES', 'FI', 'FR', 'GB', 'GR', 'HK', 'HR', 'HU', 'IE', 'IS', 'IT', 'JO', 'JP', 'KW', 'LI', 'LT', 'LU', 'LV', 'MC', 'MT', 'MX', 'MY', 'NL', 'NO', 'NZ', 'OM', 'PE', 'PL', 'PT', 'QA', 'RO', 'SA', 'SE', 'SG', 'SI', 'SK', 'SM', 'TR', 'US']
9
+ self.supported_countries = %w[AD AE AR AT AU BE BG BH BR CH CL CN CO CY CZ DE DK EE EG ES FI FR GB GR HK HR HU IE IS IT JO JP KW LI LT LU LV MC MT MX MY NL NO NZ OM PE PL PT QA RO SA SE SG SI SK SM TR US]
10
10
  self.default_currency = 'USD'
11
11
  self.money_format = :cents
12
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :maestro, :discover]
12
+ self.supported_cardtypes = %i[visa master american_express diners_club maestro discover]
13
13
  self.currencies_without_fractions = %w(BIF DJF GNF ISK KMF XAF CLF XPF JPY PYG RWF KRW VUV VND XOF)
14
14
  self.currencies_with_three_decimal_places = %w(BHD LYD JOD KWD OMR TND)
15
15
 
@@ -15,7 +15,7 @@ module ActiveMerchant
15
15
  self.homepage_url = 'http://www.citruspay.com/'
16
16
  self.supported_countries = %w(AR AU BR FR DE HK MX NZ SG GB US)
17
17
  self.default_currency = 'USD'
18
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro]
18
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb maestro]
19
19
  end
20
20
  end
21
21
  end
@@ -4,12 +4,12 @@ module ActiveMerchant #:nodoc:
4
4
  self.test_url = 'https://gateway.test.clearhaus.com'
5
5
  self.live_url = 'https://gateway.clearhaus.com'
6
6
 
7
- self.supported_countries = ['DK', 'NO', 'SE', 'FI', 'DE', 'CH', 'NL', 'AD', 'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'FO', 'GL', 'EE', 'FR', 'GR',
8
- 'HU', 'IS', 'IE', 'IT', 'LV', 'LI', 'LT', 'LU', 'MT', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'GB']
7
+ self.supported_countries = %w[DK NO SE FI DE CH NL AD AT BE BG HR CY CZ FO GL EE FR GR
8
+ HU IS IE IT LV LI LT LU MT PL PT RO SK SI ES GB]
9
9
 
10
10
  self.default_currency = 'EUR'
11
11
  self.currencies_without_fractions = %w(BIF CLP DJF GNF JPY KMF KRW PYG RWF UGX VND VUV XAF XOF XPF)
12
- self.supported_cardtypes = [:visa, :master]
12
+ self.supported_cardtypes = %i[visa master]
13
13
 
14
14
  self.homepage_url = 'https://www.clearhaus.com'
15
15
  self.display_name = 'Clearhaus'
@@ -11,7 +11,7 @@ module ActiveMerchant #:nodoc:
11
11
 
12
12
  self.money_format = :dollars
13
13
  self.default_currency = 'EUR'
14
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
14
+ self.supported_cardtypes = %i[visa master american_express discover]
15
15
  self.homepage_url = 'http://www.commercegate.com/'
16
16
  self.display_name = 'CommerceGate'
17
17
 
@@ -4,7 +4,7 @@ module ActiveMerchant #:nodoc:
4
4
  self.live_url = 'https://api.conekta.io/'
5
5
 
6
6
  self.supported_countries = ['MX']
7
- self.supported_cardtypes = [:visa, :master, :american_express, :carnet]
7
+ self.supported_cardtypes = %i[visa master american_express carnet]
8
8
  self.homepage_url = 'https://conekta.io/'
9
9
  self.display_name = 'Conekta Gateway'
10
10
  self.money_format = :cents