activemerchant 1.114.0 → 1.116.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +45 -0
  3. data/lib/active_merchant.rb +1 -1
  4. data/lib/active_merchant/billing/avs_result.rb +1 -1
  5. data/lib/active_merchant/billing/compatibility.rb +3 -3
  6. data/lib/active_merchant/billing/credit_card_methods.rb +5 -5
  7. data/lib/active_merchant/billing/gateways/adyen.rb +23 -13
  8. data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
  9. data/lib/active_merchant/billing/gateways/authorize_net.rb +13 -11
  10. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
  11. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +1 -1
  12. data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
  13. data/lib/active_merchant/billing/gateways/balanced.rb +4 -3
  14. data/lib/active_merchant/billing/gateways/bambora_apac.rb +7 -7
  15. data/lib/active_merchant/billing/gateways/bank_frick.rb +7 -7
  16. data/lib/active_merchant/billing/gateways/banwire.rb +1 -1
  17. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +6 -4
  18. data/lib/active_merchant/billing/gateways/beanstream.rb +3 -3
  19. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -5
  20. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -3
  21. data/lib/active_merchant/billing/gateways/blue_snap.rb +19 -17
  22. data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
  23. data/lib/active_merchant/billing/gateways/borgun.rb +11 -11
  24. data/lib/active_merchant/billing/gateways/bpoint.rb +8 -8
  25. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  26. data/lib/active_merchant/billing/gateways/braintree_blue.rb +7 -10
  27. data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -7
  28. data/lib/active_merchant/billing/gateways/cams.rb +8 -8
  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 +2 -2
  32. data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
  33. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  34. data/lib/active_merchant/billing/gateways/cecabank.rb +5 -5
  35. data/lib/active_merchant/billing/gateways/cenpos.rb +10 -10
  36. data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
  37. data/lib/active_merchant/billing/gateways/checkout_v2.rb +16 -19
  38. data/lib/active_merchant/billing/gateways/clearhaus.rb +7 -7
  39. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  40. data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
  41. data/lib/active_merchant/billing/gateways/creditcall.rb +10 -10
  42. data/lib/active_merchant/billing/gateways/credorax.rb +9 -9
  43. data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
  44. data/lib/active_merchant/billing/gateways/culqi.rb +9 -9
  45. data/lib/active_merchant/billing/gateways/cyber_source.rb +30 -31
  46. data/lib/active_merchant/billing/gateways/d_local.rb +11 -11
  47. data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
  48. data/lib/active_merchant/billing/gateways/decidir.rb +9 -8
  49. data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
  50. data/lib/active_merchant/billing/gateways/digitzs.rb +5 -5
  51. data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
  52. data/lib/active_merchant/billing/gateways/efsnet.rb +2 -3
  53. data/lib/active_merchant/billing/gateways/elavon.rb +251 -232
  54. data/lib/active_merchant/billing/gateways/element.rb +8 -8
  55. data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
  56. data/lib/active_merchant/billing/gateways/eway.rb +3 -4
  57. data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
  58. data/lib/active_merchant/billing/gateways/eway_rapid.rb +6 -6
  59. data/lib/active_merchant/billing/gateways/exact.rb +8 -9
  60. data/lib/active_merchant/billing/gateways/ezic.rb +7 -7
  61. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  62. data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
  63. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  64. data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
  65. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
  66. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +4 -4
  67. data/lib/active_merchant/billing/gateways/flo2cash.rb +8 -8
  68. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  69. data/lib/active_merchant/billing/gateways/forte.rb +14 -8
  70. data/lib/active_merchant/billing/gateways/global_collect.rb +10 -10
  71. data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
  72. data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
  73. data/lib/active_merchant/billing/gateways/hps.rb +7 -7
  74. data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
  75. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  76. data/lib/active_merchant/billing/gateways/inspire.rb +3 -4
  77. data/lib/active_merchant/billing/gateways/instapay.rb +1 -2
  78. data/lib/active_merchant/billing/gateways/ipp.rb +5 -5
  79. data/lib/active_merchant/billing/gateways/iridium.rb +14 -15
  80. data/lib/active_merchant/billing/gateways/iveri.rb +7 -7
  81. data/lib/active_merchant/billing/gateways/ixopay.rb +7 -7
  82. data/lib/active_merchant/billing/gateways/jetpay.rb +1 -2
  83. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -5
  84. data/lib/active_merchant/billing/gateways/kushki.rb +6 -6
  85. data/lib/active_merchant/billing/gateways/latitude19.rb +14 -14
  86. data/lib/active_merchant/billing/gateways/linkpoint.rb +4 -5
  87. data/lib/active_merchant/billing/gateways/litle.rb +11 -11
  88. data/lib/active_merchant/billing/gateways/mastercard.rb +10 -10
  89. data/lib/active_merchant/billing/gateways/mercado_pago.rb +7 -7
  90. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -2
  91. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
  92. data/lib/active_merchant/billing/gateways/merchant_partners.rb +10 -10
  93. data/lib/active_merchant/billing/gateways/merchant_ware.rb +5 -7
  94. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +4 -6
  95. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  96. data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -5
  97. data/lib/active_merchant/billing/gateways/micropayment.rb +8 -8
  98. data/lib/active_merchant/billing/gateways/migs.rb +3 -4
  99. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +2 -4
  100. data/lib/active_merchant/billing/gateways/monei.rb +7 -7
  101. data/lib/active_merchant/billing/gateways/moneris.rb +4 -3
  102. data/lib/active_merchant/billing/gateways/money_movers.rb +2 -3
  103. data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -10
  104. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -4
  105. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +7 -7
  106. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -2
  107. data/lib/active_merchant/billing/gateways/netaxept.rb +6 -6
  108. data/lib/active_merchant/billing/gateways/netbanx.rb +8 -8
  109. data/lib/active_merchant/billing/gateways/netbilling.rb +4 -5
  110. data/lib/active_merchant/billing/gateways/network_merchants.rb +2 -3
  111. data/lib/active_merchant/billing/gateways/nmi.rb +21 -7
  112. data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
  113. data/lib/active_merchant/billing/gateways/omise.rb +13 -13
  114. data/lib/active_merchant/billing/gateways/openpay.rb +3 -4
  115. data/lib/active_merchant/billing/gateways/opp.rb +9 -9
  116. data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -3
  117. data/lib/active_merchant/billing/gateways/orbital.rb +61 -66
  118. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
  119. data/lib/active_merchant/billing/gateways/pagarme.rb +8 -8
  120. data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
  121. data/lib/active_merchant/billing/gateways/pay_conex.rb +8 -8
  122. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -7
  123. data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -8
  124. data/lib/active_merchant/billing/gateways/pay_junction.rb +2 -3
  125. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +9 -9
  126. data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -3
  127. data/lib/active_merchant/billing/gateways/paybox_direct.rb +23 -1
  128. data/lib/active_merchant/billing/gateways/payeezy.rb +9 -9
  129. data/lib/active_merchant/billing/gateways/payex.rb +6 -7
  130. data/lib/active_merchant/billing/gateways/payflow.rb +1 -1
  131. data/lib/active_merchant/billing/gateways/payment_express.rb +1 -2
  132. data/lib/active_merchant/billing/gateways/paymentez.rb +5 -5
  133. data/lib/active_merchant/billing/gateways/paymill.rb +7 -7
  134. data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
  135. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  136. data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
  137. data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
  138. data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
  139. data/lib/active_merchant/billing/gateways/payu_latam.rb +17 -10
  140. data/lib/active_merchant/billing/gateways/payway.rb +8 -9
  141. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -2
  142. data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
  143. data/lib/active_merchant/billing/gateways/psigate.rb +2 -3
  144. data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
  145. data/lib/active_merchant/billing/gateways/qbms.rb +1 -2
  146. data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
  147. data/lib/active_merchant/billing/gateways/quickbooks.rb +1 -1
  148. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
  149. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
  150. data/lib/active_merchant/billing/gateways/qvalent.rb +8 -8
  151. data/lib/active_merchant/billing/gateways/realex.rb +1 -1
  152. data/lib/active_merchant/billing/gateways/redsys.rb +4 -4
  153. data/lib/active_merchant/billing/gateways/s5.rb +7 -7
  154. data/lib/active_merchant/billing/gateways/safe_charge.rb +12 -12
  155. data/lib/active_merchant/billing/gateways/sage.rb +3 -5
  156. data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -3
  157. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -2
  158. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -2
  159. data/lib/active_merchant/billing/gateways/secure_pay.rb +3 -4
  160. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -4
  161. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +1 -2
  162. data/lib/active_merchant/billing/gateways/securion_pay.rb +5 -6
  163. data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -3
  164. data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -6
  165. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
  166. data/lib/active_merchant/billing/gateways/spreedly_core.rb +6 -6
  167. data/lib/active_merchant/billing/gateways/stripe.rb +9 -9
  168. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +9 -0
  169. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
  170. data/lib/active_merchant/billing/gateways/telr.rb +8 -8
  171. data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
  172. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +12 -12
  173. data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
  174. data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -2
  175. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
  176. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -32
  177. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -4
  178. data/lib/active_merchant/billing/gateways/vanco.rb +3 -3
  179. data/lib/active_merchant/billing/gateways/verifi.rb +1 -2
  180. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -2
  181. data/lib/active_merchant/billing/gateways/visanet_peru.rb +10 -10
  182. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  183. data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
  184. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
  185. data/lib/active_merchant/billing/gateways/worldpay.rb +12 -8
  186. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
  187. data/lib/active_merchant/billing/gateways/worldpay_us.rb +7 -7
  188. data/lib/active_merchant/billing/response.rb +1 -1
  189. data/lib/active_merchant/country.rb +1 -1
  190. data/lib/active_merchant/network_connection_retries.rb +2 -2
  191. data/lib/active_merchant/post_data.rb +1 -1
  192. data/lib/active_merchant/posts_data.rb +1 -1
  193. data/lib/active_merchant/version.rb +1 -1
  194. data/lib/support/ssl_verify.rb +2 -2
  195. data/lib/support/ssl_version.rb +2 -2
  196. metadata +2 -2
@@ -269,7 +269,8 @@ module ActiveMerchant #:nodoc:
269
269
  first_name: params[2],
270
270
  last_name: params[3],
271
271
  month: params[4],
272
- year: params[5])
272
+ year: params[5]
273
+ )
273
274
 
274
275
  xml.tag! 'TransarmorToken', params[0]
275
276
  xml.tag! 'Expiry_Date', expdate(credit_card)
@@ -371,10 +372,9 @@ module ActiveMerchant #:nodoc:
371
372
  Response.new(successful?(response), message_from(response), response,
372
373
  test: test?,
373
374
  authorization: successful?(response) ? response_authorization(action, response, credit_card) : '',
374
- avs_result: {code: response[:avs]},
375
+ avs_result: { code: response[:avs] },
375
376
  cvv_result: response[:cvv2],
376
- error_code: standard_error_code(response)
377
- )
377
+ error_code: standard_error_code(response))
378
378
  end
379
379
 
380
380
  def headers(method, url, request)
@@ -19,19 +19,19 @@ module ActiveMerchant #:nodoc:
19
19
  'diners_club' => 'DINERS'
20
20
  }
21
21
 
22
- def initialize(options={})
22
+ def initialize(options = {})
23
23
  requires!(options, :username, :password, :account_id)
24
24
  super
25
25
  end
26
26
 
27
- def purchase(amount, payment_method, options={})
27
+ def purchase(amount, payment_method, options = {})
28
28
  MultiResponse.run do |r|
29
29
  r.process { authorize(amount, payment_method, options) }
30
30
  r.process { capture(amount, r.authorization, options) }
31
31
  end
32
32
  end
33
33
 
34
- def authorize(amount, payment_method, options={})
34
+ def authorize(amount, payment_method, options = {})
35
35
  post = {}
36
36
  add_invoice(post, amount, options)
37
37
  add_payment_method(post, payment_method)
@@ -40,7 +40,7 @@ module ActiveMerchant #:nodoc:
40
40
  commit('ProcessAuthorise', post)
41
41
  end
42
42
 
43
- def capture(amount, authorization, options={})
43
+ def capture(amount, authorization, options = {})
44
44
  post = {}
45
45
  add_invoice(post, amount, options)
46
46
  add_reference(post, authorization)
@@ -49,7 +49,7 @@ module ActiveMerchant #:nodoc:
49
49
  commit('ProcessCapture', post)
50
50
  end
51
51
 
52
- def refund(amount, authorization, options={})
52
+ def refund(amount, authorization, options = {})
53
53
  post = {}
54
54
  add_invoice(post, amount, options)
55
55
  add_reference(post, authorization)
@@ -71,7 +71,7 @@ module ActiveMerchant #:nodoc:
71
71
 
72
72
  private
73
73
 
74
- CURRENCY_CODES = Hash.new { |h, k| raise ArgumentError.new("Unsupported currency: #{k}") }
74
+ CURRENCY_CODES = Hash.new { |_h, k| raise ArgumentError.new("Unsupported currency: #{k}") }
75
75
  CURRENCY_CODES['NZD'] = '554'
76
76
 
77
77
  def add_invoice(post, money, options)
@@ -142,7 +142,7 @@ module ActiveMerchant #:nodoc:
142
142
  end
143
143
 
144
144
  def envelope_wrap(action, body)
145
- <<~EOS
145
+ <<~XML
146
146
  <?xml version="1.0" encoding="utf-8"?>
147
147
  <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
148
148
  <soap12:Body>
@@ -151,7 +151,7 @@ module ActiveMerchant #:nodoc:
151
151
  </#{action}>
152
152
  </soap12:Body>
153
153
  </soap12:Envelope>
154
- EOS
154
+ XML
155
155
  end
156
156
 
157
157
  def url
@@ -3,7 +3,7 @@ module ActiveMerchant #:nodoc:
3
3
  class Flo2cashSimpleGateway < Flo2cashGateway
4
4
  self.display_name = 'Flo2Cash Simple'
5
5
 
6
- def purchase(amount, payment_method, options={})
6
+ def purchase(amount, payment_method, options = {})
7
7
  post = {}
8
8
  add_invoice(post, amount, options)
9
9
  add_payment_method(post, payment_method)
@@ -15,14 +15,15 @@ module ActiveMerchant #:nodoc:
15
15
  self.homepage_url = 'https://www.forte.net'
16
16
  self.display_name = 'Forte'
17
17
 
18
- def initialize(options={})
18
+ def initialize(options = {})
19
19
  requires!(options, :api_key, :secret, :location_id, :account_id)
20
20
  super
21
21
  end
22
22
 
23
- def purchase(money, payment_method, options={})
23
+ def purchase(money, payment_method, options = {})
24
24
  post = {}
25
25
  add_amount(post, money, options)
26
+ add_service_fee(post, options)
26
27
  add_invoice(post, options)
27
28
  add_payment_method(post, payment_method, options)
28
29
  add_billing_address(post, payment_method, options)
@@ -32,9 +33,10 @@ module ActiveMerchant #:nodoc:
32
33
  commit(:post, post)
33
34
  end
34
35
 
35
- def authorize(money, payment_method, options={})
36
+ def authorize(money, payment_method, options = {})
36
37
  post = {}
37
38
  add_amount(post, money, options)
39
+ add_service_fee(post, options)
38
40
  add_invoice(post, options)
39
41
  add_payment_method(post, payment_method, options)
40
42
  add_billing_address(post, payment_method, options)
@@ -44,7 +46,7 @@ module ActiveMerchant #:nodoc:
44
46
  commit(:post, post)
45
47
  end
46
48
 
47
- def capture(money, authorization, options={})
49
+ def capture(money, authorization, options = {})
48
50
  post = {}
49
51
  post[:transaction_id] = transaction_id_from(authorization)
50
52
  post[:authorization_code] = authorization_code_from(authorization) || ''
@@ -53,7 +55,7 @@ module ActiveMerchant #:nodoc:
53
55
  commit(:put, post)
54
56
  end
55
57
 
56
- def credit(money, payment_method, options={})
58
+ def credit(money, payment_method, options = {})
57
59
  post = {}
58
60
  add_amount(post, money, options)
59
61
  add_invoice(post, options)
@@ -64,7 +66,7 @@ module ActiveMerchant #:nodoc:
64
66
  commit(:post, post)
65
67
  end
66
68
 
67
- def refund(money, authorization, options={})
69
+ def refund(money, authorization, options = {})
68
70
  post = {}
69
71
  add_amount(post, money, options)
70
72
  post[:original_transaction_id] = transaction_id_from(authorization)
@@ -74,7 +76,7 @@ module ActiveMerchant #:nodoc:
74
76
  commit(:post, post)
75
77
  end
76
78
 
77
- def void(authorization, options={})
79
+ def void(authorization, options = {})
78
80
  post = {}
79
81
  post[:transaction_id] = transaction_id_from(authorization)
80
82
  post[:authorization_code] = authorization_code_from(authorization)
@@ -83,7 +85,7 @@ module ActiveMerchant #:nodoc:
83
85
  commit(:put, post)
84
86
  end
85
87
 
86
- def verify(credit_card, options={})
88
+ def verify(credit_card, options = {})
87
89
  MultiResponse.run(:use_first_response) do |r|
88
90
  r.process { authorize(100, credit_card, options) }
89
91
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -116,6 +118,10 @@ module ActiveMerchant #:nodoc:
116
118
  post[:authorization_amount] = amount(money)
117
119
  end
118
120
 
121
+ def add_service_fee(post, options)
122
+ post[:service_fee_amount] = options[:service_fee_amount] if options[:service_fee_amount]
123
+ end
124
+
119
125
  def add_billing_address(post, payment, options)
120
126
  post[:billing_address] = {}
121
127
  if address = options[:billing_address] || options[:address]
@@ -12,19 +12,19 @@ module ActiveMerchant #:nodoc:
12
12
  self.money_format = :cents
13
13
  self.supported_cardtypes = %i[visa master american_express discover naranja cabal]
14
14
 
15
- def initialize(options={})
15
+ def initialize(options = {})
16
16
  requires!(options, :merchant_id, :api_key_id, :secret_api_key)
17
17
  super
18
18
  end
19
19
 
20
- def purchase(money, payment, options={})
20
+ def purchase(money, payment, options = {})
21
21
  MultiResponse.run do |r|
22
22
  r.process { authorize(money, payment, options) }
23
23
  r.process { capture(money, r.authorization, options) } if should_request_capture?(r, options[:requires_approval])
24
24
  end
25
25
  end
26
26
 
27
- def authorize(money, payment, options={})
27
+ def authorize(money, payment, options = {})
28
28
  post = nestable_hash
29
29
  add_order(post, money, options)
30
30
  add_payment(post, payment, options)
@@ -35,7 +35,7 @@ module ActiveMerchant #:nodoc:
35
35
  commit(:authorize, post)
36
36
  end
37
37
 
38
- def capture(money, authorization, options={})
38
+ def capture(money, authorization, options = {})
39
39
  post = nestable_hash
40
40
  add_order(post, money, options, capture: true)
41
41
  add_customer_data(post, options)
@@ -43,7 +43,7 @@ module ActiveMerchant #:nodoc:
43
43
  commit(:capture, post, authorization)
44
44
  end
45
45
 
46
- def refund(money, authorization, options={})
46
+ def refund(money, authorization, options = {})
47
47
  post = nestable_hash
48
48
  add_amount(post, money, options)
49
49
  add_refund_customer_data(post, options)
@@ -51,13 +51,13 @@ module ActiveMerchant #:nodoc:
51
51
  commit(:refund, post, authorization)
52
52
  end
53
53
 
54
- def void(authorization, options={})
54
+ def void(authorization, options = {})
55
55
  post = nestable_hash
56
56
  add_creator_info(post, options)
57
57
  commit(:void, post, authorization)
58
58
  end
59
59
 
60
- def verify(payment, options={})
60
+ def verify(payment, options = {})
61
61
  MultiResponse.run(:use_first_response) do |r|
62
62
  r.process { authorize(100, payment, options) }
63
63
  r.process { void(r.authorization, options) }
@@ -142,7 +142,7 @@ module ActiveMerchant #:nodoc:
142
142
  post['shoppingCartExtension']['extensionID'] = options[:extension_ID] if options[:extension_ID]
143
143
  end
144
144
 
145
- def add_amount(post, money, options={})
145
+ def add_amount(post, money, options = {})
146
146
  post['amountOfMoney'] = {
147
147
  'amount' => amount(money),
148
148
  'currencyCode' => options[:currency] || currency(money)
@@ -296,12 +296,12 @@ module ActiveMerchant #:nodoc:
296
296
  end
297
297
 
298
298
  def auth_digest(action, post, authorization = nil)
299
- data = <<~EOS
299
+ data = <<~REQUEST
300
300
  POST
301
301
  #{content_type}
302
302
  #{date}
303
303
  #{uri(action, authorization)}
304
- EOS
304
+ REQUEST
305
305
  digest = OpenSSL::Digest.new('sha256')
306
306
  key = @options[:secret_api_key]
307
307
  "GCS v1HMAC:#{@options[:api_key_id]}:#{Base64.strict_encode64(OpenSSL::HMAC.digest(digest, key, data))}"
@@ -20,12 +20,12 @@ module ActiveMerchant #:nodoc:
20
20
  # :global_password - Your Global password
21
21
  # :term_type - 3 character field assigned by Global Transport after
22
22
  # - your application is certified.
23
- def initialize(options={})
23
+ def initialize(options = {})
24
24
  requires!(options, :global_user_name, :global_password, :term_type)
25
25
  super
26
26
  end
27
27
 
28
- def purchase(money, payment_method, options={})
28
+ def purchase(money, payment_method, options = {})
29
29
  post = {}
30
30
  add_invoice(post, money, options)
31
31
  add_payment_method(post, payment_method)
@@ -34,7 +34,7 @@ module ActiveMerchant #:nodoc:
34
34
  commit('Sale', post, options)
35
35
  end
36
36
 
37
- def authorize(money, payment_method, options={})
37
+ def authorize(money, payment_method, options = {})
38
38
  post = {}
39
39
  add_invoice(post, money, options)
40
40
  add_payment_method(post, payment_method)
@@ -43,7 +43,7 @@ module ActiveMerchant #:nodoc:
43
43
  commit('Auth', post, options)
44
44
  end
45
45
 
46
- def capture(money, authorization, options={})
46
+ def capture(money, authorization, options = {})
47
47
  post = {}
48
48
  add_invoice(post, money, options)
49
49
  add_auth(post, authorization)
@@ -51,7 +51,7 @@ module ActiveMerchant #:nodoc:
51
51
  commit('Force', post, options)
52
52
  end
53
53
 
54
- def refund(money, authorization, options={})
54
+ def refund(money, authorization, options = {})
55
55
  post = {}
56
56
  add_invoice(post, money, options)
57
57
  add_auth(post, authorization)
@@ -59,14 +59,14 @@ module ActiveMerchant #:nodoc:
59
59
  commit('Return', post, options)
60
60
  end
61
61
 
62
- def void(authorization, options={})
62
+ def void(authorization, options = {})
63
63
  post = {}
64
64
  add_auth(post, authorization)
65
65
 
66
66
  commit('Void', post, options)
67
67
  end
68
68
 
69
- def verify(payment_method, options={})
69
+ def verify(payment_method, options = {})
70
70
  post = {}
71
71
  add_payment_method(post, payment_method)
72
72
  add_address(post, options)
@@ -14,12 +14,12 @@ module ActiveMerchant #:nodoc:
14
14
  self.money_format = :dollars
15
15
  self.supported_cardtypes = %i[visa master discover diners_club]
16
16
 
17
- def initialize(options={})
17
+ def initialize(options = {})
18
18
  requires!(options, :login, :password)
19
19
  super
20
20
  end
21
21
 
22
- def purchase(amount, payment_method, options={})
22
+ def purchase(amount, payment_method, options = {})
23
23
  post = {}
24
24
  add_invoice(post, amount, options)
25
25
  add_payment_method(post, payment_method)
@@ -28,7 +28,7 @@ module ActiveMerchant #:nodoc:
28
28
  commit('purchase', post)
29
29
  end
30
30
 
31
- def authorize(amount, payment_method, options={})
31
+ def authorize(amount, payment_method, options = {})
32
32
  post = {}
33
33
  add_invoice(post, amount, options)
34
34
  add_payment_method(post, payment_method)
@@ -37,7 +37,7 @@ module ActiveMerchant #:nodoc:
37
37
  commit('authorize', post)
38
38
  end
39
39
 
40
- def capture(amount, authorization, options={})
40
+ def capture(amount, authorization, options = {})
41
41
  post = {}
42
42
  add_invoice(post, amount, options)
43
43
  add_reference(post, authorization)
@@ -46,7 +46,7 @@ module ActiveMerchant #:nodoc:
46
46
  commit('capture', post)
47
47
  end
48
48
 
49
- def refund(amount, authorization, options={})
49
+ def refund(amount, authorization, options = {})
50
50
  post = {}
51
51
  add_invoice(post, amount, options)
52
52
  add_reference(post, authorization)
@@ -57,7 +57,7 @@ module ActiveMerchant #:nodoc:
57
57
 
58
58
  private
59
59
 
60
- CURRENCY_CODES = Hash.new { |h, k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}") }
60
+ CURRENCY_CODES = Hash.new { |_h, k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}") }
61
61
  CURRENCY_CODES['AED'] = '784'
62
62
  CURRENCY_CODES['AUD'] = '036'
63
63
  CURRENCY_CODES['CAD'] = '124'
@@ -81,14 +81,14 @@ module ActiveMerchant #:nodoc:
81
81
  post[:udf2] = escape(options[:email]) if options[:email]
82
82
  if address = (options[:billing_address] || options[:address])
83
83
  post[:udf3] = escape(address[:phone]) if address[:phone]
84
- post[:udf4] = escape(<<~EOA)
84
+ post[:udf4] = escape(<<~ADDRESS)
85
85
  #{address[:name]}
86
86
  #{address[:company]}
87
87
  #{address[:address1]}
88
88
  #{address[:address2]}
89
89
  #{address[:city]} #{address[:state]} #{address[:zip]}
90
90
  #{address[:country]}
91
- EOA
91
+ ADDRESS
92
92
  end
93
93
  end
94
94
 
@@ -194,7 +194,7 @@ module ActiveMerchant #:nodoc:
194
194
  [tranid, member]
195
195
  end
196
196
 
197
- def escape(string, max_length=250)
197
+ def escape(string, max_length = 250)
198
198
  return '' unless string
199
199
 
200
200
  string = string[0...max_length] if max_length
@@ -25,12 +25,12 @@ module ActiveMerchant #:nodoc:
25
25
  google_pay: 'GooglePayApp'
26
26
  }
27
27
 
28
- def initialize(options={})
28
+ def initialize(options = {})
29
29
  requires!(options, :secret_api_key)
30
30
  super
31
31
  end
32
32
 
33
- def authorize(money, card_or_token, options={})
33
+ def authorize(money, card_or_token, options = {})
34
34
  commit('CreditAuth') do |xml|
35
35
  add_amount(xml, money)
36
36
  add_allow_dup(xml)
@@ -42,14 +42,14 @@ module ActiveMerchant #:nodoc:
42
42
  end
43
43
  end
44
44
 
45
- def capture(money, transaction_id, options={})
45
+ def capture(money, transaction_id, options = {})
46
46
  commit('CreditAddToBatch', transaction_id) do |xml|
47
47
  add_amount(xml, money)
48
48
  add_reference(xml, transaction_id)
49
49
  end
50
50
  end
51
51
 
52
- def purchase(money, payment_method, options={})
52
+ def purchase(money, payment_method, options = {})
53
53
  if payment_method.is_a?(Check)
54
54
  commit_check_sale(money, payment_method, options)
55
55
  else
@@ -57,7 +57,7 @@ module ActiveMerchant #:nodoc:
57
57
  end
58
58
  end
59
59
 
60
- def refund(money, transaction_id, options={})
60
+ def refund(money, transaction_id, options = {})
61
61
  commit('CreditReturn') do |xml|
62
62
  add_amount(xml, money)
63
63
  add_allow_dup(xml)
@@ -67,7 +67,7 @@ module ActiveMerchant #:nodoc:
67
67
  end
68
68
  end
69
69
 
70
- def verify(card_or_token, options={})
70
+ def verify(card_or_token, options = {})
71
71
  commit('CreditAccountVerify') do |xml|
72
72
  add_card_or_token_customer_data(xml, card_or_token, options)
73
73
  add_descriptor_name(xml, options)
@@ -75,7 +75,7 @@ module ActiveMerchant #:nodoc:
75
75
  end
76
76
  end
77
77
 
78
- def void(transaction_id, options={})
78
+ def void(transaction_id, options = {})
79
79
  if options[:check_void]
80
80
  commit('CheckVoid') do |xml|
81
81
  add_reference(xml, transaction_id)