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
@@ -10,7 +10,7 @@ module ActiveMerchant #:nodoc:
10
10
 
11
11
  self.supported_countries = ['US']
12
12
  self.default_currency = 'USD'
13
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
13
+ self.supported_cardtypes = %i[visa master american_express discover]
14
14
 
15
15
  self.homepage_url = 'https://www.creditcall.com'
16
16
  self.display_name = 'Creditcall'
@@ -25,7 +25,7 @@ module ActiveMerchant #:nodoc:
25
25
  self.currencies_with_three_decimal_places = %w(BHD IQD JOD KWD LYD OMR TND)
26
26
 
27
27
  self.money_format = :cents
28
- self.supported_cardtypes = [:visa, :master, :maestro]
28
+ self.supported_cardtypes = %i[visa master maestro]
29
29
 
30
30
  RESPONSE_MESSAGES = {
31
31
  '00' => 'Approved or completed successfully',
@@ -238,6 +238,10 @@ module ActiveMerchant #:nodoc:
238
238
  normalized_value = normalize(value)
239
239
  next if normalized_value.nil?
240
240
 
241
+ if key == :'3ds_homephonecountry'
242
+ next unless options[:billing_address] && options[:billing_address][:phone]
243
+ end
244
+
241
245
  post[key] = normalized_value unless post[key]
242
246
  end
243
247
  end
@@ -413,7 +417,7 @@ module ActiveMerchant #:nodoc:
413
417
  success_from(response),
414
418
  message_from(response),
415
419
  response,
416
- authorization: "#{response["Z1"]};#{response["Z4"]};#{response["A1"]};#{action}",
420
+ authorization: "#{response['Z1']};#{response['Z4']};#{response['A1']};#{action}",
417
421
  avs_result: AVSResult.new(code: response['Z9']),
418
422
  cvv_result: CVVResult.new(response['Z14']),
419
423
  test: test?
@@ -4,9 +4,9 @@ module ActiveMerchant #:nodoc:
4
4
  self.test_url = 'https://test.ctpaiement.ca/v1/'
5
5
  self.live_url = 'https://www.ctpaiement.com/v1/'
6
6
 
7
- self.supported_countries = ['US', 'CA']
7
+ self.supported_countries = %w[US CA]
8
8
  self.default_currency = 'CAD'
9
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club]
9
+ self.supported_cardtypes = %i[visa master american_express discover diners_club]
10
10
 
11
11
  self.homepage_url = 'http://www.ct-payment.com/'
12
12
  self.display_name = 'CT Payment'
@@ -18,7 +18,7 @@ module ActiveMerchant #:nodoc:
18
18
  self.supported_countries = ['PE']
19
19
  self.default_currency = 'PEN'
20
20
  self.money_format = :dollars
21
- self.supported_cardtypes = [:visa, :master, :diners_club, :american_express]
21
+ self.supported_cardtypes = %i[visa master diners_club american_express]
22
22
 
23
23
  def initialize(options={})
24
24
  requires!(options, :merchant_id, :terminal_id, :secret_key)
@@ -36,8 +36,8 @@ module ActiveMerchant #:nodoc:
36
36
  }.freeze
37
37
  DEFAULT_COLLECTION_INDICATOR = 2
38
38
 
39
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :dankort, :maestro, :elo]
40
- self.supported_countries = %w(US BR CA CN DK FI FR DE IN JP MX NO SE GB SG LB PK)
39
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb dankort maestro elo]
40
+ self.supported_countries = %w(US AE BR CA CN DK FI FR DE IN JP MX NO SE GB SG LB PK)
41
41
 
42
42
  self.default_currency = 'USD'
43
43
  self.currencies_without_fractions = %w(JPY)
@@ -604,6 +604,7 @@ module ActiveMerchant #:nodoc:
604
604
  indicator = options[:commerce_indicator] || stored_credential_commerce_indicator(options)
605
605
  xml.tag!('commerceIndicator', indicator) if indicator
606
606
  end
607
+ xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
607
608
  end
608
609
  end
609
610
  end
@@ -660,6 +661,7 @@ module ActiveMerchant #:nodoc:
660
661
  xml.tag!('cavv', payment_method.payment_cryptogram)
661
662
  xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
662
663
  xml.tag!('xid', payment_method.payment_cryptogram)
664
+ xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
663
665
  end
664
666
  when :master
665
667
  xml.tag! 'ucaf' do
@@ -668,6 +670,7 @@ module ActiveMerchant #:nodoc:
668
670
  end
669
671
  xml.tag! 'ccAuthService', {'run' => 'true'} do
670
672
  xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
673
+ xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
671
674
  end
672
675
  when :american_express
673
676
  cryptogram = Base64.decode64(payment_method.payment_cryptogram)
@@ -675,6 +678,7 @@ module ActiveMerchant #:nodoc:
675
678
  xml.tag!('cavv', Base64.encode64(cryptogram[0...20]))
676
679
  xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
677
680
  xml.tag!('xid', Base64.encode64(cryptogram[20...40]))
681
+ xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
678
682
  end
679
683
  end
680
684
  end
@@ -689,15 +693,20 @@ module ActiveMerchant #:nodoc:
689
693
  xml.tag! 'ccCaptureService', {'run' => 'true'} do
690
694
  xml.tag! 'authRequestID', request_id
691
695
  xml.tag! 'authRequestToken', request_token
696
+ xml.tag! 'reconciliationID', options[:reconciliation_id] if options[:reconciliation_id]
692
697
  end
693
698
  end
694
699
 
695
700
  def add_purchase_service(xml, payment_method, options)
696
701
  if options[:pinless_debit_card]
697
- xml.tag! 'pinlessDebitService', {'run' => 'true'}
702
+ xml.tag! 'pinlessDebitService', {'run' => 'true'} do
703
+ xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
704
+ end
698
705
  else
699
706
  add_auth_service(xml, payment_method, options)
700
- xml.tag! 'ccCaptureService', {'run' => 'true'}
707
+ xml.tag! 'ccCaptureService', {'run' => 'true'} do
708
+ xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
709
+ end
701
710
  end
702
711
  end
703
712
 
@@ -4,9 +4,9 @@ module ActiveMerchant #:nodoc:
4
4
  self.test_url = 'https://sandbox.dlocal.com'
5
5
  self.live_url = 'https://api.dlocal.com'
6
6
 
7
- self.supported_countries = ['AR', 'BR', 'CL', 'CO', 'MX', 'PE', 'UY', 'TR']
7
+ self.supported_countries = %w[AR BR CL CO MX PE UY TR]
8
8
  self.default_currency = 'USD'
9
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club, :maestro, :naranja, :cabal]
9
+ self.supported_cardtypes = %i[visa master american_express discover jcb diners_club maestro naranja cabal]
10
10
 
11
11
  self.homepage_url = 'https://dlocal.com/'
12
12
  self.display_name = 'dLocal'
@@ -125,11 +125,15 @@ module ActiveMerchant #:nodoc:
125
125
  end
126
126
 
127
127
  def parse_street(address)
128
+ return unless address[:address1]
129
+
128
130
  street = address[:address1].split(/\s+/).keep_if { |x| x !~ /\d/ }.join(' ')
129
131
  street.empty? ? nil : street
130
132
  end
131
133
 
132
134
  def parse_house_number(address)
135
+ return unless address[:address1]
136
+
133
137
  house = address[:address1].split(/\s+/).keep_if { |x| x =~ /\d/ }.join(' ')
134
138
  house.empty? ? nil : house
135
139
  end
@@ -180,7 +184,7 @@ module ActiveMerchant #:nodoc:
180
184
  def success_from(action, response)
181
185
  return false unless response['status_code']
182
186
 
183
- ['100', '200', '400', '600'].include? response['status_code'].to_s
187
+ %w[100 200 400 600].include? response['status_code'].to_s
184
188
  end
185
189
 
186
190
  def message_from(action, response)
@@ -6,7 +6,7 @@ module ActiveMerchant
6
6
  self.default_currency = 'GBP'
7
7
  self.supported_countries = ['GB']
8
8
 
9
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb, :maestro]
9
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb maestro]
10
10
 
11
11
  self.homepage_url = 'http://www.datacash.com/'
12
12
  self.display_name = 'DataCash'
@@ -6,10 +6,10 @@ module ActiveMerchant #:nodoc:
6
6
 
7
7
  self.live_url = 'https://api.dibspayment.com/merchant/v1/JSON/Transaction/'
8
8
 
9
- self.supported_countries = ['US', 'FI', 'NO', 'SE', 'GB']
9
+ self.supported_countries = %w[US FI NO SE GB]
10
10
  self.default_currency = 'USD'
11
11
  self.money_format = :cents
12
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
12
+ self.supported_cardtypes = %i[visa master american_express discover]
13
13
 
14
14
  def initialize(options={})
15
15
  requires!(options, :merchant_id, :secret_key)
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
 
9
9
  self.supported_countries = ['US']
10
10
  self.default_currency = 'USD'
11
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
11
+ self.supported_cardtypes = %i[visa master american_express discover]
12
12
  self.money_format = :cents
13
13
 
14
14
  self.homepage_url = 'https://digitzs.com'
@@ -235,7 +235,7 @@ module ActiveMerchant #:nodoc:
235
235
 
236
236
  def authorization_from(response)
237
237
  if customer_id = response.try(:[], 'data').try(:[], 'attributes').try(:[], 'customerId')
238
- "#{customer_id}|#{response.try(:[], "data").try(:[], "id")}"
238
+ "#{customer_id}|#{response.try(:[], 'data').try(:[], 'id')}"
239
239
  else
240
240
  response.try(:[], 'data').try(:[], 'id')
241
241
  end
@@ -6,7 +6,7 @@ module ActiveMerchant #:nodoc:
6
6
 
7
7
  self.supported_countries = %w(BR MX CO CL AR PE)
8
8
  self.default_currency = 'USD'
9
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club]
9
+ self.supported_cardtypes = %i[visa master american_express discover diners_club]
10
10
 
11
11
  self.homepage_url = 'http://www.ebanx.com/'
12
12
  self.display_name = 'EBANX'
@@ -237,7 +237,7 @@ module ActiveMerchant #:nodoc:
237
237
  end
238
238
 
239
239
  def success_from(action, response)
240
- if [:purchase, :capture, :refund].include?(action)
240
+ if %i[purchase capture refund].include?(action)
241
241
  response.try(:[], 'payment').try(:[], 'status') == 'CO'
242
242
  elsif action == :authorize
243
243
  response.try(:[], 'payment').try(:[], 'status') == 'PE'
@@ -258,7 +258,7 @@ module ActiveMerchant #:nodoc:
258
258
 
259
259
  def authorization_from(action, parameters, response)
260
260
  if action == :store
261
- "#{response.try(:[], "token")}|#{CARD_BRAND[parameters[:payment_type_code].to_sym]}"
261
+ "#{response.try(:[], 'token')}|#{CARD_BRAND[parameters[:payment_type_code].to_sym]}"
262
262
  else
263
263
  response.try(:[], 'payment').try(:[], 'hash')
264
264
  end
@@ -278,7 +278,7 @@ module ActiveMerchant #:nodoc:
278
278
  end
279
279
 
280
280
  def requires_http_get(action)
281
- return true if [:capture, :void].include?(action)
281
+ return true if %i[capture void].include?(action)
282
282
 
283
283
  false
284
284
  end
@@ -4,7 +4,7 @@ module ActiveMerchant #:nodoc:
4
4
  module Billing #:nodoc:
5
5
  class EfsnetGateway < Gateway
6
6
  self.supported_countries = ['US']
7
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
7
+ self.supported_cardtypes = %i[visa master american_express discover]
8
8
  self.homepage_url = 'http://www.concordefsnet.com/'
9
9
  self.display_name = 'Efsnet'
10
10
 
@@ -53,7 +53,7 @@ module ActiveMerchant #:nodoc:
53
53
 
54
54
  def void(identification, options = {})
55
55
  requires!(options, :order_id)
56
- original_transaction_id, _ = identification.split(';')
56
+ original_transaction_id, = identification.split(';')
57
57
  commit(:void_transaction, {reference_number: format_reference_number(options[:order_id]), transaction_id: original_transaction_id})
58
58
  end
59
59
 
@@ -12,7 +12,7 @@ module ActiveMerchant #:nodoc:
12
12
 
13
13
  self.display_name = 'Elavon MyVirtualMerchant'
14
14
  self.supported_countries = %w(US CA PR DE IE NO PL LU BE NL MX)
15
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
15
+ self.supported_cardtypes = %i[visa master american_express discover]
16
16
  self.homepage_url = 'http://www.elavon.com/'
17
17
 
18
18
  self.delimiter = "\n"
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
9
9
 
10
10
  self.supported_countries = ['US']
11
11
  self.default_currency = 'USD'
12
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club, :jcb]
12
+ self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
13
13
 
14
14
  self.homepage_url = 'http://www.elementps.com'
15
15
  self.display_name = 'Element'
@@ -53,7 +53,7 @@ module ActiveMerchant #:nodoc:
53
53
  end
54
54
 
55
55
  def capture(money, authorization, options={})
56
- trans_id, _ = split_authorization(authorization)
56
+ trans_id, = split_authorization(authorization)
57
57
  options[:trans_id] = trans_id
58
58
 
59
59
  request = build_soap_request do |xml|
@@ -68,7 +68,7 @@ module ActiveMerchant #:nodoc:
68
68
  end
69
69
 
70
70
  def refund(money, authorization, options={})
71
- trans_id, _ = split_authorization(authorization)
71
+ trans_id, = split_authorization(authorization)
72
72
  options[:trans_id] = trans_id
73
73
 
74
74
  request = build_soap_request do |xml|
@@ -5,9 +5,9 @@ module ActiveMerchant #:nodoc:
5
5
 
6
6
  self.default_currency = 'DKK'
7
7
  self.money_format = :cents
8
- self.supported_cardtypes = [:dankort, :forbrugsforeningen, :visa, :master,
9
- :american_express, :diners_club, :jcb, :maestro]
10
- self.supported_countries = ['DK', 'SE', 'NO']
8
+ self.supported_countries = %w[DK SE NO]
9
+ self.supported_cardtypes = %i[dankort forbrugsforeningen visa master
10
+ american_express diners_club jcb maestro]
11
11
  self.homepage_url = 'http://epay.dk/'
12
12
  self.display_name = 'ePay'
13
13
 
@@ -36,7 +36,7 @@ module ActiveMerchant #:nodoc:
36
36
  self.live_url = 'https://secure.evoepay.com/api/transact.php'
37
37
 
38
38
  self.supported_countries = ['CA']
39
- self.supported_cardtypes = [:visa, :master, :american_express, :jcb, :discover]
39
+ self.supported_cardtypes = %i[visa master american_express jcb discover]
40
40
  self.money_format = :dollars
41
41
  self.homepage_url = 'http://www.evocanada.com/'
42
42
  self.display_name = 'EVO Canada'
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
9
9
 
10
10
  self.money_format = :cents
11
11
  self.supported_countries = ['AU']
12
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club]
12
+ self.supported_cardtypes = %i[visa master american_express diners_club]
13
13
  self.homepage_url = 'http://www.eway.com.au/'
14
14
  self.display_name = 'eWAY'
15
15
 
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
  self.supported_countries = ['AU']
9
9
 
10
10
  # The card types supported by the payment gateway
11
- self.supported_cardtypes = [:visa, :master]
11
+ self.supported_cardtypes = %i[visa master]
12
12
 
13
13
  self.default_currency = 'AUD'
14
14
 
@@ -7,8 +7,8 @@ module ActiveMerchant #:nodoc:
7
7
  self.live_url = 'https://api.ewaypayments.com/'
8
8
 
9
9
  self.money_format = :cents
10
- self.supported_countries = ['AU', 'NZ', 'GB', 'SG', 'MY', 'HK']
11
- self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
10
+ self.supported_countries = %w[AU NZ GB SG MY HK]
11
+ self.supported_cardtypes = %i[visa master american_express diners_club jcb]
12
12
  self.homepage_url = 'http://www.eway.com.au/'
13
13
  self.display_name = 'eWAY Rapid 3.1'
14
14
  self.default_currency = 'AUD'
@@ -28,10 +28,10 @@ module ActiveMerchant #:nodoc:
28
28
 
29
29
  SUCCESS = 'true'
30
30
 
31
- SENSITIVE_FIELDS = [:verification_str2, :expiry_date, :card_number]
31
+ SENSITIVE_FIELDS = %i[verification_str2 expiry_date card_number]
32
32
 
33
- self.supported_cardtypes = [:visa, :master, :american_express, :jcb, :discover]
34
- self.supported_countries = ['CA', 'US']
33
+ self.supported_countries = %w[CA US]
34
+ self.supported_cardtypes = %i[visa master american_express jcb discover]
35
35
  self.homepage_url = 'http://www.e-xact.com'
36
36
  self.display_name = 'E-xact'
37
37
 
@@ -5,7 +5,7 @@ module ActiveMerchant
5
5
 
6
6
  self.supported_countries = %w(AU CA CN FR DE GI IL MT MU MX NL NZ PA PH RU SG KR ES KN GB US)
7
7
  self.default_currency = 'USD'
8
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :jcb, :diners_club]
8
+ self.supported_cardtypes = %i[visa master american_express discover jcb diners_club]
9
9
 
10
10
  self.homepage_url = 'http://www.ezic.com/'
11
11
  self.display_name = 'Ezic'
@@ -9,7 +9,7 @@ module ActiveMerchant #:nodoc:
9
9
  self.supported_countries = ['AU']
10
10
  self.default_currency = 'AUD'
11
11
  self.money_format = :cents
12
- self.supported_cardtypes = [:visa, :master, :american_express, :jcb]
12
+ self.supported_cardtypes = %i[visa master american_express jcb]
13
13
 
14
14
  self.homepage_url = 'https://www.fatzebra.com.au/'
15
15
  self.display_name = 'Fat Zebra'
@@ -48,7 +48,7 @@ module ActiveMerchant #:nodoc:
48
48
  end
49
49
 
50
50
  def capture(money, authorization, options = {})
51
- txn_id, _ = authorization.to_s.split('|')
51
+ txn_id, = authorization.to_s.split('|')
52
52
  post = {}
53
53
 
54
54
  add_amount(post, money, options)
@@ -58,7 +58,7 @@ module ActiveMerchant #:nodoc:
58
58
  end
59
59
 
60
60
  def refund(money, authorization, options={})
61
- txn_id, _ = authorization.to_s.split('|')
61
+ txn_id, = authorization.to_s.split('|')
62
62
  post = {}
63
63
 
64
64
  add_extra_options(post, options)
@@ -110,7 +110,7 @@ module ActiveMerchant #:nodoc:
110
110
  post[:cvv] = creditcard.verification_value if creditcard.verification_value?
111
111
  post[:card_holder] = creditcard.name if creditcard.name
112
112
  elsif creditcard.is_a?(String)
113
- id, _ = creditcard.to_s.split('|')
113
+ id, = creditcard.to_s.split('|')
114
114
  post[:card_token] = id
115
115
  post[:cvv] = options[:cvv]
116
116
  elsif creditcard.is_a?(Hash)
@@ -12,7 +12,7 @@ module ActiveMerchant #:nodoc:
12
12
  self.default_currency = 'CAD'
13
13
 
14
14
  # The card types supported by the payment gateway
15
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
15
+ self.supported_cardtypes = %i[visa master american_express discover]
16
16
 
17
17
  # The homepage URL of the gateway
18
18
  self.homepage_url = 'http://www.federatedcanada.com/'
@@ -7,10 +7,10 @@ module ActiveMerchant #:nodoc:
7
7
  self.test_url = 'https://entegrasyon.asseco-see.com.tr/fim/api'
8
8
 
9
9
  # The countries the gateway supports merchants from as 2 digit ISO country codes
10
- self.supported_countries = ['US', 'TR']
10
+ self.supported_countries = %w[US TR]
11
11
 
12
12
  # The card types supported by the payment gateway
13
- self.supported_cardtypes = [:visa, :master]
13
+ self.supported_cardtypes = %i[visa master]
14
14
 
15
15
  # The homepage URL of the gateway
16
16
  self.homepage_url = 'https://www.fbwebpos.com/'
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
7
7
  self.live_url = 'https://api.firstgiving.com'
8
8
 
9
9
  self.supported_countries = ['US']
10
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
10
+ self.supported_cardtypes = %i[visa master american_express discover]
11
11
  self.homepage_url = 'http://www.firstgiving.com/'
12
12
  self.default_currency = 'USD'
13
13
  self.display_name = 'FirstGiving'
@@ -8,7 +8,7 @@ module ActiveMerchant #:nodoc:
8
8
  self.supported_countries = ['US']
9
9
  self.default_currency = 'USD'
10
10
  self.money_format = :dollars
11
- self.supported_cardtypes = [:visa, :master, :american_express, :discover]
11
+ self.supported_cardtypes = %i[visa master american_express discover]
12
12
 
13
13
  self.homepage_url = 'http://1stpaygateway.net/'
14
14
  self.display_name = '1stPayGateway.Net'