activemerchant 1.113.0 → 1.119.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +114 -0
  3. data/README.md +1 -1
  4. data/lib/active_merchant.rb +1 -1
  5. data/lib/active_merchant/billing/avs_result.rb +1 -1
  6. data/lib/active_merchant/billing/compatibility.rb +3 -3
  7. data/lib/active_merchant/billing/credit_card.rb +3 -0
  8. data/lib/active_merchant/billing/credit_card_methods.rb +72 -13
  9. data/lib/active_merchant/billing/gateways/adyen.rb +24 -14
  10. data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
  11. data/lib/active_merchant/billing/gateways/authorize_net.rb +44 -12
  12. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
  13. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +2 -1
  14. data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
  15. data/lib/active_merchant/billing/gateways/balanced.rb +4 -3
  16. data/lib/active_merchant/billing/gateways/bambora_apac.rb +7 -7
  17. data/lib/active_merchant/billing/gateways/bank_frick.rb +7 -7
  18. data/lib/active_merchant/billing/gateways/banwire.rb +1 -1
  19. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +6 -4
  20. data/lib/active_merchant/billing/gateways/beanstream.rb +3 -3
  21. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -5
  22. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -3
  23. data/lib/active_merchant/billing/gateways/blue_snap.rb +37 -12
  24. data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
  25. data/lib/active_merchant/billing/gateways/borgun.rb +11 -11
  26. data/lib/active_merchant/billing/gateways/bpoint.rb +8 -8
  27. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  28. data/lib/active_merchant/billing/gateways/braintree_blue.rb +13 -10
  29. data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -7
  30. data/lib/active_merchant/billing/gateways/cams.rb +8 -8
  31. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  32. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  33. data/lib/active_merchant/billing/gateways/card_stream.rb +2 -2
  34. data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
  35. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/cecabank.rb +5 -5
  37. data/lib/active_merchant/billing/gateways/cenpos.rb +10 -10
  38. data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
  39. data/lib/active_merchant/billing/gateways/checkout_v2.rb +17 -20
  40. data/lib/active_merchant/billing/gateways/clearhaus.rb +7 -7
  41. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  42. data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
  43. data/lib/active_merchant/billing/gateways/creditcall.rb +10 -10
  44. data/lib/active_merchant/billing/gateways/credorax.rb +26 -15
  45. data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
  46. data/lib/active_merchant/billing/gateways/culqi.rb +9 -9
  47. data/lib/active_merchant/billing/gateways/cyber_source.rb +58 -36
  48. data/lib/active_merchant/billing/gateways/d_local.rb +11 -11
  49. data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
  50. data/lib/active_merchant/billing/gateways/decidir.rb +31 -10
  51. data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
  52. data/lib/active_merchant/billing/gateways/digitzs.rb +5 -5
  53. data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
  54. data/lib/active_merchant/billing/gateways/efsnet.rb +2 -3
  55. data/lib/active_merchant/billing/gateways/elavon.rb +286 -225
  56. data/lib/active_merchant/billing/gateways/element.rb +8 -8
  57. data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
  58. data/lib/active_merchant/billing/gateways/eway.rb +3 -4
  59. data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
  60. data/lib/active_merchant/billing/gateways/eway_rapid.rb +19 -6
  61. data/lib/active_merchant/billing/gateways/exact.rb +8 -9
  62. data/lib/active_merchant/billing/gateways/ezic.rb +7 -7
  63. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  64. data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
  65. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  66. data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
  67. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
  68. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +21 -10
  69. data/lib/active_merchant/billing/gateways/flo2cash.rb +8 -8
  70. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  71. data/lib/active_merchant/billing/gateways/forte.rb +14 -8
  72. data/lib/active_merchant/billing/gateways/global_collect.rb +35 -16
  73. data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
  74. data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
  75. data/lib/active_merchant/billing/gateways/hps.rb +17 -8
  76. data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
  77. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  78. data/lib/active_merchant/billing/gateways/inspire.rb +3 -4
  79. data/lib/active_merchant/billing/gateways/instapay.rb +1 -2
  80. data/lib/active_merchant/billing/gateways/ipp.rb +5 -5
  81. data/lib/active_merchant/billing/gateways/iridium.rb +14 -15
  82. data/lib/active_merchant/billing/gateways/iveri.rb +7 -7
  83. data/lib/active_merchant/billing/gateways/ixopay.rb +7 -7
  84. data/lib/active_merchant/billing/gateways/jetpay.rb +1 -2
  85. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -5
  86. data/lib/active_merchant/billing/gateways/kushki.rb +6 -6
  87. data/lib/active_merchant/billing/gateways/latitude19.rb +14 -14
  88. data/lib/active_merchant/billing/gateways/linkpoint.rb +4 -5
  89. data/lib/active_merchant/billing/gateways/litle.rb +31 -15
  90. data/lib/active_merchant/billing/gateways/mastercard.rb +10 -10
  91. data/lib/active_merchant/billing/gateways/mercado_pago.rb +7 -7
  92. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -2
  93. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
  94. data/lib/active_merchant/billing/gateways/merchant_partners.rb +10 -10
  95. data/lib/active_merchant/billing/gateways/merchant_ware.rb +5 -7
  96. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +4 -6
  97. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  98. data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -5
  99. data/lib/active_merchant/billing/gateways/micropayment.rb +8 -8
  100. data/lib/active_merchant/billing/gateways/migs.rb +3 -4
  101. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +2 -4
  102. data/lib/active_merchant/billing/gateways/monei.rb +7 -7
  103. data/lib/active_merchant/billing/gateways/moneris.rb +4 -3
  104. data/lib/active_merchant/billing/gateways/money_movers.rb +2 -3
  105. data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -10
  106. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -4
  107. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +7 -7
  108. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -2
  109. data/lib/active_merchant/billing/gateways/netaxept.rb +6 -6
  110. data/lib/active_merchant/billing/gateways/netbanx.rb +19 -8
  111. data/lib/active_merchant/billing/gateways/netbilling.rb +4 -5
  112. data/lib/active_merchant/billing/gateways/network_merchants.rb +2 -3
  113. data/lib/active_merchant/billing/gateways/nmi.rb +21 -7
  114. data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
  115. data/lib/active_merchant/billing/gateways/omise.rb +13 -13
  116. data/lib/active_merchant/billing/gateways/openpay.rb +3 -4
  117. data/lib/active_merchant/billing/gateways/opp.rb +9 -9
  118. data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -3
  119. data/lib/active_merchant/billing/gateways/orbital.rb +196 -85
  120. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
  121. data/lib/active_merchant/billing/gateways/pagarme.rb +8 -8
  122. data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
  123. data/lib/active_merchant/billing/gateways/pay_conex.rb +8 -8
  124. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -7
  125. data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -8
  126. data/lib/active_merchant/billing/gateways/pay_junction.rb +2 -3
  127. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +9 -9
  128. data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -3
  129. data/lib/active_merchant/billing/gateways/paybox_direct.rb +23 -1
  130. data/lib/active_merchant/billing/gateways/payeezy.rb +32 -14
  131. data/lib/active_merchant/billing/gateways/payex.rb +6 -7
  132. data/lib/active_merchant/billing/gateways/payflow.rb +1 -1
  133. data/lib/active_merchant/billing/gateways/payment_express.rb +8 -4
  134. data/lib/active_merchant/billing/gateways/paymentez.rb +26 -6
  135. data/lib/active_merchant/billing/gateways/paymill.rb +7 -7
  136. data/lib/active_merchant/billing/gateways/paypal.rb +10 -2
  137. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -0
  138. data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
  139. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  140. data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
  141. data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
  142. data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
  143. data/lib/active_merchant/billing/gateways/payu_latam.rb +17 -10
  144. data/lib/active_merchant/billing/gateways/payway.rb +8 -9
  145. data/lib/active_merchant/billing/gateways/pin.rb +11 -0
  146. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -2
  147. data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
  148. data/lib/active_merchant/billing/gateways/psigate.rb +2 -3
  149. data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
  150. data/lib/active_merchant/billing/gateways/qbms.rb +1 -2
  151. data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
  152. data/lib/active_merchant/billing/gateways/quickbooks.rb +1 -1
  153. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
  154. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
  155. data/lib/active_merchant/billing/gateways/qvalent.rb +8 -8
  156. data/lib/active_merchant/billing/gateways/realex.rb +1 -1
  157. data/lib/active_merchant/billing/gateways/redsys.rb +86 -5
  158. data/lib/active_merchant/billing/gateways/s5.rb +7 -7
  159. data/lib/active_merchant/billing/gateways/safe_charge.rb +40 -14
  160. data/lib/active_merchant/billing/gateways/sage.rb +3 -5
  161. data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -3
  162. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -2
  163. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -2
  164. data/lib/active_merchant/billing/gateways/secure_pay.rb +3 -4
  165. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -4
  166. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +1 -2
  167. data/lib/active_merchant/billing/gateways/securion_pay.rb +5 -6
  168. data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -3
  169. data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -6
  170. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
  171. data/lib/active_merchant/billing/gateways/spreedly_core.rb +6 -6
  172. data/lib/active_merchant/billing/gateways/stripe.rb +10 -10
  173. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +30 -0
  174. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
  175. data/lib/active_merchant/billing/gateways/telr.rb +8 -8
  176. data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
  177. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +12 -12
  178. data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
  179. data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -2
  180. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
  181. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -32
  182. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -4
  183. data/lib/active_merchant/billing/gateways/vanco.rb +3 -3
  184. data/lib/active_merchant/billing/gateways/verifi.rb +1 -2
  185. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -2
  186. data/lib/active_merchant/billing/gateways/visanet_peru.rb +10 -10
  187. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  188. data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
  189. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
  190. data/lib/active_merchant/billing/gateways/worldpay.rb +19 -11
  191. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
  192. data/lib/active_merchant/billing/gateways/worldpay_us.rb +7 -7
  193. data/lib/active_merchant/billing/response.rb +3 -2
  194. data/lib/active_merchant/country.rb +1 -1
  195. data/lib/active_merchant/network_connection_retries.rb +2 -2
  196. data/lib/active_merchant/post_data.rb +1 -1
  197. data/lib/active_merchant/posts_data.rb +1 -1
  198. data/lib/active_merchant/version.rb +1 -1
  199. data/lib/support/ssl_verify.rb +2 -2
  200. data/lib/support/ssl_version.rb +2 -2
  201. metadata +2 -2
@@ -12,12 +12,12 @@ module ActiveMerchant #:nodoc:
12
12
  self.supported_cardtypes = %i[visa master american_express discover
13
13
  diners_club jcb maestro]
14
14
 
15
- def initialize(options={})
15
+ def initialize(options = {})
16
16
  requires!(options, :site_id, :merchant_id, :token)
17
17
  super
18
18
  end
19
19
 
20
- def purchase(amount, payment_method, options={})
20
+ def purchase(amount, payment_method, options = {})
21
21
  post = {}
22
22
  add_invoice(post, amount, options)
23
23
  add_payment_method(post, payment_method)
@@ -26,7 +26,7 @@ module ActiveMerchant #:nodoc:
26
26
  commit(:purchase, post)
27
27
  end
28
28
 
29
- def authorize(amount, payment_method, options={})
29
+ def authorize(amount, payment_method, options = {})
30
30
  post = {}
31
31
  add_invoice(post, amount, options)
32
32
  add_payment_method(post, payment_method)
@@ -35,7 +35,7 @@ module ActiveMerchant #:nodoc:
35
35
  commit(:authorize, post)
36
36
  end
37
37
 
38
- def capture(amount, authorization, options={})
38
+ def capture(amount, authorization, options = {})
39
39
  post = {}
40
40
  add_invoice(post, amount, options)
41
41
  add_reference(post, authorization, :capture)
@@ -44,14 +44,14 @@ module ActiveMerchant #:nodoc:
44
44
  commit(:capture, post)
45
45
  end
46
46
 
47
- def void(authorization, options={})
47
+ def void(authorization, options = {})
48
48
  post = {}
49
49
  add_reference(post, authorization, :void)
50
50
 
51
51
  commit(:void, post)
52
52
  end
53
53
 
54
- def refund(amount, authorization, options={})
54
+ def refund(amount, authorization, options = {})
55
55
  post = {}
56
56
  add_invoice(post, amount, options)
57
57
  add_reference(post, authorization, :refund)
@@ -61,7 +61,7 @@ module ActiveMerchant #:nodoc:
61
61
  commit(:refund, post)
62
62
  end
63
63
 
64
- def verify(credit_card, options={})
64
+ def verify(credit_card, options = {})
65
65
  MultiResponse.run(:use_first_response) do |r|
66
66
  r.process { authorize(100, credit_card, options) }
67
67
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -94,7 +94,7 @@ module ActiveMerchant
94
94
  PAYMENT_METHOD_NOT_SUPPORTED_ERROR = '155'
95
95
  INELIGIBLE_FOR_ISSUING_CREDIT_ERROR = '54'
96
96
 
97
- def initialize(options={})
97
+ def initialize(options = {})
98
98
  requires!(options, :login, :password)
99
99
  super
100
100
  end
@@ -111,7 +111,7 @@ module ActiveMerchant
111
111
  end
112
112
  end
113
113
 
114
- def authorize(amount, payment, options={})
114
+ def authorize(amount, payment, options = {})
115
115
  if payment.is_a?(String)
116
116
  commit(:cim_authorize, options) do |xml|
117
117
  add_cim_auth_purchase(xml, 'profileTransAuthOnly', amount, payment, options)
@@ -123,7 +123,7 @@ module ActiveMerchant
123
123
  end
124
124
  end
125
125
 
126
- def capture(amount, authorization, options={})
126
+ def capture(amount, authorization, options = {})
127
127
  if auth_was_for_cim?(authorization)
128
128
  cim_capture(amount, authorization, options)
129
129
  else
@@ -131,7 +131,7 @@ module ActiveMerchant
131
131
  end
132
132
  end
133
133
 
134
- def refund(amount, authorization, options={})
134
+ def refund(amount, authorization, options = {})
135
135
  response =
136
136
  if auth_was_for_cim?(authorization)
137
137
  cim_refund(amount, authorization, options)
@@ -149,7 +149,7 @@ module ActiveMerchant
149
149
  end
150
150
  end
151
151
 
152
- def void(authorization, options={})
152
+ def void(authorization, options = {})
153
153
  if auth_was_for_cim?(authorization)
154
154
  cim_void(authorization, options)
155
155
  else
@@ -157,7 +157,7 @@ module ActiveMerchant
157
157
  end
158
158
  end
159
159
 
160
- def credit(amount, payment, options={})
160
+ def credit(amount, payment, options = {})
161
161
  raise ArgumentError, 'Reference credits are not supported. Please supply the original credit card or use the #refund method.' if payment.is_a?(String)
162
162
 
163
163
  commit(:credit) do |xml|
@@ -257,6 +257,8 @@ module ActiveMerchant
257
257
  add_settings(xml, payment, options)
258
258
  add_user_fields(xml, amount, options)
259
259
  add_ship_from_address(xml, options)
260
+ add_processing_options(xml, options)
261
+ add_subsequent_auth_information(xml, options)
260
262
  end
261
263
  end
262
264
 
@@ -408,7 +410,7 @@ module ActiveMerchant
408
410
 
409
411
  def add_settings(xml, source, options)
410
412
  xml.transactionSettings do
411
- if options[:recurring]
413
+ if options[:recurring] || subsequent_recurring_transaction?(options)
412
414
  xml.setting do
413
415
  xml.settingName('recurringBilling')
414
416
  xml.settingValue('true')
@@ -568,9 +570,11 @@ module ActiveMerchant
568
570
  xml.cardholderAuthentication do
569
571
  three_d_secure = options.fetch(:three_d_secure, {})
570
572
  xml.authenticationIndicator(
571
- options[:authentication_indicator] || three_d_secure[:eci])
573
+ options[:authentication_indicator] || three_d_secure[:eci]
574
+ )
572
575
  xml.cardholderAuthenticationValue(
573
- options[:cardholder_authentication_value] || three_d_secure[:cavv])
576
+ options[:cardholder_authentication_value] || three_d_secure[:cavv]
577
+ )
574
578
  end
575
579
  end
576
580
 
@@ -595,7 +599,7 @@ module ActiveMerchant
595
599
  end
596
600
  end
597
601
 
598
- def add_shipping_address(xml, options, root_node='shipTo')
602
+ def add_shipping_address(xml, options, root_node = 'shipTo')
599
603
  address = options[:shipping_address] || options[:address]
600
604
  return unless address
601
605
 
@@ -619,7 +623,7 @@ module ActiveMerchant
619
623
  end
620
624
  end
621
625
 
622
- def add_ship_from_address(xml, options, root_node='shipFrom')
626
+ def add_ship_from_address(xml, options, root_node = 'shipFrom')
623
627
  address = options[:ship_from_address]
624
628
  return unless address
625
629
 
@@ -700,6 +704,30 @@ module ActiveMerchant
700
704
  xml.extraOptions("x_delim_char=#{options[:delimiter]}") if options[:delimiter]
701
705
  end
702
706
 
707
+ def add_processing_options(xml, options)
708
+ return unless options[:stored_credential]
709
+
710
+ xml.processingOptions do
711
+ if options[:stored_credential][:initial_transaction]
712
+ xml.isFirstSubsequentAuth 'true'
713
+ # xml.isFirstRecurringPayment 'true' if options[:stored_credential][:reason_type] == 'recurring'
714
+ elsif options[:stored_credential][:initiator] == 'cardholder'
715
+ xml.isStoredCredentials 'true'
716
+ else
717
+ xml.isSubsequentAuth 'true'
718
+ end
719
+ end
720
+ end
721
+
722
+ def add_subsequent_auth_information(xml, options)
723
+ return unless options.dig(:stored_credential, :reason_type) == 'unscheduled'
724
+
725
+ xml.subsequentAuthInformation do
726
+ xml.reason options[:stored_credential_reason_type_override] if options[:stored_credential_reason_type_override]
727
+ xml.originalNetworkTransId options[:stored_credential][:network_transaction_id] if options[:stored_credential][:network_transaction_id]
728
+ end
729
+ end
730
+
703
731
  def create_customer_payment_profile(credit_card, options)
704
732
  commit(:cim_store_update, options) do |xml|
705
733
  xml.customerProfileId options[:customer_profile_id]
@@ -762,6 +790,10 @@ module ActiveMerchant
762
790
  end
763
791
  end
764
792
 
793
+ def subsequent_recurring_transaction?(options)
794
+ options.dig(:stored_credential, :reason_type) == 'recurring' && !options.dig(:stored_credential, :initial_transaction)
795
+ end
796
+
765
797
  def headers
766
798
  { 'Content-Type' => 'text/xml' }
767
799
  end
@@ -842,7 +874,7 @@ module ActiveMerchant
842
874
  doc = Nokogiri::XML(body)
843
875
  doc.remove_namespaces!
844
876
 
845
- response = {action: action}
877
+ response = { action: action }
846
878
 
847
879
  response[:response_code] = if (element = doc.at_xpath('//transactionResponse/responseCode'))
848
880
  empty?(element.content) ? nil : element.content.to_i
@@ -82,7 +82,7 @@ module ActiveMerchant #:nodoc:
82
82
  # +:interval => { :unit => :months, :length => 3 }+ (REQUIRED)
83
83
  # * <tt>:duration</tt> -- A hash containing keys for the <tt>:start_date</tt> the subscription begins (also the date the
84
84
  # initial billing occurs) and the total number of billing <tt>:occurrences</tt> or payments for the subscription. (REQUIRED)
85
- def recurring(money, creditcard, options={})
85
+ def recurring(money, creditcard, options = {})
86
86
  requires!(options, :interval, :duration, :billing_address)
87
87
  requires!(options[:interval], :length, %i[unit days months])
88
88
  requires!(options[:duration], :start_date, :occurrences)
@@ -110,7 +110,7 @@ module ActiveMerchant #:nodoc:
110
110
  #
111
111
  # * <tt>:subscription_id</tt> -- A string containing the <tt>:subscription_id</tt> of the recurring payment already in place
112
112
  # for a given credit card. (REQUIRED)
113
- def update_recurring(options={})
113
+ def update_recurring(options = {})
114
114
  requires!(options, :subscription_id)
115
115
  request = build_recurring_request(:update, options)
116
116
  recurring_commit(:update, request)
@@ -395,8 +395,7 @@ module ActiveMerchant #:nodoc:
395
395
 
396
396
  Response.new(success, message, response,
397
397
  test: test_mode,
398
- authorization: response[:subscription_id]
399
- )
398
+ authorization: response[:subscription_id])
400
399
  end
401
400
 
402
401
  def recurring_parse(action, xml)
@@ -1,4 +1,5 @@
1
1
  # -*- coding: utf-8 -*-
2
+
2
3
  module ActiveMerchant #:nodoc:
3
4
  module Billing #:nodoc:
4
5
  # ==== Customer Information Manager (CIM)
@@ -878,7 +879,7 @@ module ActiveMerchant #:nodoc:
878
879
 
879
880
  def parse_direct_response(params)
880
881
  delimiter = @options[:delimiter] || ','
881
- direct_response = {'raw' => params}
882
+ direct_response = { 'raw' => params }
882
883
  direct_response_fields = params.split(delimiter)
883
884
  direct_response.merge(
884
885
  {
@@ -23,33 +23,33 @@ module ActiveMerchant #:nodoc:
23
23
  PAYMENT_CODE_REFUND = 'CC.RF'
24
24
  PAYMENT_CODE_REBILL = 'CC.RB'
25
25
 
26
- def initialize(options={})
26
+ def initialize(options = {})
27
27
  requires!(options, :sender, :login, :password, :channel)
28
28
  super
29
29
  end
30
30
 
31
- def purchase(money, payment, options={})
31
+ def purchase(money, payment, options = {})
32
32
  payment_code = payment.respond_to?(:number) ? PAYMENT_CODE_DEBIT : PAYMENT_CODE_REBILL
33
33
  commit(payment_code, money, payment, options)
34
34
  end
35
35
 
36
- def authorize(money, authorization, options={})
36
+ def authorize(money, authorization, options = {})
37
37
  commit(PAYMENT_CODE_PREAUTHORIZATION, money, authorization, options)
38
38
  end
39
39
 
40
- def capture(money, authorization, options={})
40
+ def capture(money, authorization, options = {})
41
41
  commit(PAYMENT_CODE_CAPTURE, money, authorization, options)
42
42
  end
43
43
 
44
- def refund(money, authorization, options={})
44
+ def refund(money, authorization, options = {})
45
45
  commit(PAYMENT_CODE_REFUND, money, authorization, options)
46
46
  end
47
47
 
48
- def void(authorization, options={})
48
+ def void(authorization, options = {})
49
49
  commit(PAYMENT_CODE_REVERSAL, nil, authorization, options)
50
50
  end
51
51
 
52
- def verify(credit_card, options={})
52
+ def verify(credit_card, options = {})
53
53
  MultiResponse.run(:use_first_response) do |r|
54
54
  r.process { authorize(100, credit_card, options) }
55
55
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -73,8 +73,7 @@ module ActiveMerchant #:nodoc:
73
73
 
74
74
  Response.new(success, message, response,
75
75
  authorization: authorization,
76
- test: (response[:mode] != 'LIVE')
77
- )
76
+ test: (response[:mode] != 'LIVE'))
78
77
  end
79
78
 
80
79
  def parse(body)
@@ -99,7 +99,7 @@ module ActiveMerchant #:nodoc:
99
99
  commit('refunds', "debits/#{reference_identifier_from(identifier)}/refunds", post)
100
100
  end
101
101
 
102
- def store(credit_card, options={})
102
+ def store(credit_card, options = {})
103
103
  post = {}
104
104
 
105
105
  post[:number] = credit_card.number
@@ -156,7 +156,7 @@ module ActiveMerchant #:nodoc:
156
156
  post[:meta] = options[:meta]
157
157
  end
158
158
 
159
- def commit(entity_name, path, post, method=:post)
159
+ def commit(entity_name, path, post, method = :post)
160
160
  raw_response =
161
161
  begin
162
162
  parse(
@@ -165,7 +165,8 @@ module ActiveMerchant #:nodoc:
165
165
  live_url + "/#{path}",
166
166
  post_data(post),
167
167
  headers
168
- ))
168
+ )
169
+ )
169
170
  rescue ResponseError => e
170
171
  raise unless e.response.code.to_s =~ /4\d\d/
171
172
 
@@ -21,12 +21,12 @@ module ActiveMerchant #:nodoc:
21
21
  '54' => STANDARD_ERROR_CODE[:expired_card]
22
22
  }
23
23
 
24
- def initialize(options={})
24
+ def initialize(options = {})
25
25
  requires!(options, :username, :password)
26
26
  super
27
27
  end
28
28
 
29
- def purchase(money, payment, options={})
29
+ def purchase(money, payment, options = {})
30
30
  commit('SubmitSinglePayment') do |xml|
31
31
  xml.Transaction do
32
32
  xml.CustRef options[:order_id]
@@ -39,7 +39,7 @@ module ActiveMerchant #:nodoc:
39
39
  end
40
40
  end
41
41
 
42
- def authorize(money, payment, options={})
42
+ def authorize(money, payment, options = {})
43
43
  commit('SubmitSinglePayment') do |xml|
44
44
  xml.Transaction do
45
45
  xml.CustRef options[:order_id]
@@ -52,7 +52,7 @@ module ActiveMerchant #:nodoc:
52
52
  end
53
53
  end
54
54
 
55
- def capture(money, authorization, options={})
55
+ def capture(money, authorization, options = {})
56
56
  commit('SubmitSingleCapture') do |xml|
57
57
  xml.Capture do
58
58
  xml.Receipt authorization
@@ -62,7 +62,7 @@ module ActiveMerchant #:nodoc:
62
62
  end
63
63
  end
64
64
 
65
- def refund(money, authorization, options={})
65
+ def refund(money, authorization, options = {})
66
66
  commit('SubmitSingleRefund') do |xml|
67
67
  xml.Refund do
68
68
  xml.Receipt authorization
@@ -72,7 +72,7 @@ module ActiveMerchant #:nodoc:
72
72
  end
73
73
  end
74
74
 
75
- def void(authorization, options={})
75
+ def void(authorization, options = {})
76
76
  commit('SubmitSingleVoid') do |xml|
77
77
  xml.Void do
78
78
  xml.Receipt authorization
@@ -82,7 +82,7 @@ module ActiveMerchant #:nodoc:
82
82
  end
83
83
  end
84
84
 
85
- def store(payment, options={})
85
+ def store(payment, options = {})
86
86
  commit('TokeniseCreditCard') do |xml|
87
87
  xml.TokeniseCreditCard do
88
88
  xml.CardNumber payment.number
@@ -27,12 +27,12 @@ module ActiveMerchant #:nodoc:
27
27
  'void' => 'CC.RV'
28
28
  }
29
29
 
30
- def initialize(options={})
30
+ def initialize(options = {})
31
31
  requires!(options, :sender, :channel, :userid, :userpwd)
32
32
  super
33
33
  end
34
34
 
35
- def purchase(money, payment, options={})
35
+ def purchase(money, payment, options = {})
36
36
  post = {}
37
37
  add_invoice(post, money, options)
38
38
  add_payment(post, payment)
@@ -42,7 +42,7 @@ module ActiveMerchant #:nodoc:
42
42
  commit('sale', post)
43
43
  end
44
44
 
45
- def authorize(money, payment, options={})
45
+ def authorize(money, payment, options = {})
46
46
  post = {}
47
47
  add_invoice(post, money, options)
48
48
  add_payment(post, payment)
@@ -52,7 +52,7 @@ module ActiveMerchant #:nodoc:
52
52
  commit('authonly', post)
53
53
  end
54
54
 
55
- def capture(money, authorization, options={})
55
+ def capture(money, authorization, options = {})
56
56
  post = {}
57
57
  post[:authorization] = authorization
58
58
  add_invoice(post, money, options)
@@ -60,7 +60,7 @@ module ActiveMerchant #:nodoc:
60
60
  commit('capture', post)
61
61
  end
62
62
 
63
- def refund(money, authorization, options={})
63
+ def refund(money, authorization, options = {})
64
64
  post = {}
65
65
  post[:authorization] = authorization
66
66
  add_invoice(post, money, options)
@@ -68,14 +68,14 @@ module ActiveMerchant #:nodoc:
68
68
  commit('refund', post)
69
69
  end
70
70
 
71
- def void(authorization, options={})
71
+ def void(authorization, options = {})
72
72
  post = {}
73
73
  post[:authorization] = authorization
74
74
 
75
75
  commit('void', post)
76
76
  end
77
77
 
78
- def verify(credit_card, options={})
78
+ def verify(credit_card, options = {})
79
79
  MultiResponse.run(:use_first_response) do |r|
80
80
  r.process { authorize(100, credit_card, options) }
81
81
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -74,7 +74,7 @@ module ActiveMerchant #:nodoc:
74
74
 
75
75
  def card_brand(card)
76
76
  brand = super
77
- ({'master' => 'mastercard', 'american_express' => 'amex'}[brand] || brand)
77
+ ({ 'master' => 'mastercard', 'american_express' => 'amex' }[brand] || brand)
78
78
  end
79
79
 
80
80
  def parse(body)