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
@@ -26,12 +26,12 @@ module ActiveMerchant #:nodoc:
26
26
  'discover' => 'O'
27
27
  }
28
28
 
29
- def initialize(options={})
29
+ def initialize(options = {})
30
30
  requires!(options, :api_key, :company_number, :merchant_number)
31
31
  super
32
32
  end
33
33
 
34
- def purchase(money, payment, options={})
34
+ def purchase(money, payment, options = {})
35
35
  requires!(options, :order_id)
36
36
  post = {}
37
37
  add_terminal_number(post, options)
@@ -45,7 +45,7 @@ module ActiveMerchant #:nodoc:
45
45
  payment.is_a?(String) ? commit('purchaseWithToken', post) : commit('purchase', post)
46
46
  end
47
47
 
48
- def authorize(money, payment, options={})
48
+ def authorize(money, payment, options = {})
49
49
  requires!(options, :order_id)
50
50
  post = {}
51
51
  add_money(post, money)
@@ -59,7 +59,7 @@ module ActiveMerchant #:nodoc:
59
59
  payment.is_a?(String) ? commit('preAuthorizationWithToken', post) : commit('preAuthorization', post)
60
60
  end
61
61
 
62
- def capture(money, authorization, options={})
62
+ def capture(money, authorization, options = {})
63
63
  requires!(options, :order_id)
64
64
  post = {}
65
65
  add_invoice(post, money, options)
@@ -73,7 +73,7 @@ module ActiveMerchant #:nodoc:
73
73
  commit('completion', post)
74
74
  end
75
75
 
76
- def refund(money, authorization, options={})
76
+ def refund(money, authorization, options = {})
77
77
  requires!(options, :order_id)
78
78
  post = {}
79
79
  add_invoice(post, money, options)
@@ -86,7 +86,7 @@ module ActiveMerchant #:nodoc:
86
86
  commit('refundWithoutCard', post)
87
87
  end
88
88
 
89
- def credit(money, payment, options={})
89
+ def credit(money, payment, options = {})
90
90
  requires!(options, :order_id)
91
91
  post = {}
92
92
  add_terminal_number(post, options)
@@ -100,7 +100,7 @@ module ActiveMerchant #:nodoc:
100
100
  payment.is_a?(String) ? commit('refundWithToken', post) : commit('refund', post)
101
101
  end
102
102
 
103
- def void(authorization, options={})
103
+ def void(authorization, options = {})
104
104
  post = {}
105
105
  post[:InputType] = 'I'
106
106
  post[:LanguageCode] = 'E'
@@ -113,7 +113,7 @@ module ActiveMerchant #:nodoc:
113
113
  commit('void', post)
114
114
  end
115
115
 
116
- def verify(credit_card, options={})
116
+ def verify(credit_card, options = {})
117
117
  requires!(options, :order_id)
118
118
  post = {}
119
119
  add_terminal_number(post, options)
@@ -126,7 +126,7 @@ module ActiveMerchant #:nodoc:
126
126
  commit('verifyAccount', post)
127
127
  end
128
128
 
129
- def store(credit_card, options={})
129
+ def store(credit_card, options = {})
130
130
  requires!(options, :email)
131
131
  post = {
132
132
  LanguageCode: 'E',
@@ -228,7 +228,7 @@ module ActiveMerchant #:nodoc:
228
228
  r.process {
229
229
  split_auth = split_authorization(r.authorization)
230
230
  auth = (action.include?('recur') ? split_auth[4] : split_auth[0])
231
- action.include?('recur') ? commit_raw('recur/ack', {ID: auth}) : commit_raw('ack', {TransactionNumber: auth})
231
+ action.include?('recur') ? commit_raw('recur/ack', { ID: auth }) : commit_raw('ack', { TransactionNumber: auth })
232
232
  }
233
233
  end
234
234
  end
@@ -20,16 +20,16 @@ module ActiveMerchant #:nodoc:
20
20
  self.money_format = :dollars
21
21
  self.supported_cardtypes = %i[visa master diners_club american_express]
22
22
 
23
- def initialize(options={})
23
+ def initialize(options = {})
24
24
  requires!(options, :merchant_id, :terminal_id, :secret_key)
25
25
  super
26
26
  end
27
27
 
28
- def purchase(amount, payment_method, options={})
28
+ def purchase(amount, payment_method, options = {})
29
29
  authorize(amount, payment_method, options)
30
30
  end
31
31
 
32
- def authorize(amount, payment_method, options={})
32
+ def authorize(amount, payment_method, options = {})
33
33
  if payment_method.is_a?(String)
34
34
  action = :tokenpay
35
35
  else
@@ -45,7 +45,7 @@ module ActiveMerchant #:nodoc:
45
45
  commit(action, post)
46
46
  end
47
47
 
48
- def capture(amount, authorization, options={})
48
+ def capture(amount, authorization, options = {})
49
49
  action = :capture
50
50
  post = {}
51
51
  add_credentials(post)
@@ -56,7 +56,7 @@ module ActiveMerchant #:nodoc:
56
56
  commit(action, post)
57
57
  end
58
58
 
59
- def void(authorization, options={})
59
+ def void(authorization, options = {})
60
60
  action = :void
61
61
  post = {}
62
62
  add_credentials(post)
@@ -67,7 +67,7 @@ module ActiveMerchant #:nodoc:
67
67
  commit(action, post)
68
68
  end
69
69
 
70
- def refund(amount, authorization, options={})
70
+ def refund(amount, authorization, options = {})
71
71
  action = :refund
72
72
  post = {}
73
73
  add_credentials(post)
@@ -78,7 +78,7 @@ module ActiveMerchant #:nodoc:
78
78
  commit(action, post)
79
79
  end
80
80
 
81
- def verify(credit_card, options={})
81
+ def verify(credit_card, options = {})
82
82
  MultiResponse.run(:use_first_response) do |r|
83
83
  r.process { authorize(1000, credit_card, options) }
84
84
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -90,7 +90,7 @@ module ActiveMerchant #:nodoc:
90
90
  response.message.include? 'Transaction not found'
91
91
  end
92
92
 
93
- def store(credit_card, options={})
93
+ def store(credit_card, options = {})
94
94
  action = :tokenize
95
95
  post = {}
96
96
  post[:partnerid] = options[:partner_id] if options[:partner_id]
@@ -103,7 +103,7 @@ module ActiveMerchant #:nodoc:
103
103
  commit(action, post)
104
104
  end
105
105
 
106
- def invalidate(authorization, options={})
106
+ def invalidate(authorization, options = {})
107
107
  action = :invalidate
108
108
  post = {}
109
109
  post[:partnerid] = options[:partner_id] if options[:partner_id]
@@ -390,7 +390,7 @@ module ActiveMerchant #:nodoc:
390
390
  end
391
391
 
392
392
  def build_create_subscription_request(payment_method, options)
393
- default_subscription_params = {frequency: 'on-demand', amount: 0, automatic_renew: false}
393
+ default_subscription_params = { frequency: 'on-demand', amount: 0, automatic_renew: false }
394
394
  options[:subscription] = default_subscription_params.update(
395
395
  options[:subscription] || {}
396
396
  )
@@ -472,7 +472,7 @@ module ActiveMerchant #:nodoc:
472
472
 
473
473
  def add_line_item_data(xml, options)
474
474
  options[:line_items].each_with_index do |value, index|
475
- xml.tag! 'item', {'id' => index} do
475
+ xml.tag! 'item', { 'id' => index } do
476
476
  xml.tag! 'unitPrice', localized_amount(value[:declared_value].to_i, options[:currency] || default_currency)
477
477
  xml.tag! 'quantity', value[:quantity]
478
478
  xml.tag! 'productCode', value[:code] || 'shipping_only'
@@ -512,7 +512,7 @@ module ActiveMerchant #:nodoc:
512
512
  end
513
513
  end
514
514
 
515
- def add_purchase_data(xml, money = 0, include_grand_total = false, options={})
515
+ def add_purchase_data(xml, money = 0, include_grand_total = false, options = {})
516
516
  xml.tag! 'purchaseTotals' do
517
517
  xml.tag! 'currency', options[:currency] || currency(money)
518
518
  xml.tag!('grandTotalAmount', localized_amount(money.to_i, options[:currency] || default_currency)) if include_grand_total
@@ -576,7 +576,7 @@ module ActiveMerchant #:nodoc:
576
576
  end
577
577
 
578
578
  def add_mdd_fields(xml, options)
579
- return unless options.keys.any? { |key| key.to_s.start_with?('mdd_field') }
579
+ return unless options.keys.any? { |key| key.to_s.start_with?('mdd_field') && options[key] }
580
580
 
581
581
  xml.tag! 'merchantDefinedData' do
582
582
  (1..100).each do |each|
@@ -595,7 +595,7 @@ module ActiveMerchant #:nodoc:
595
595
  end
596
596
 
597
597
  def add_tax_service(xml)
598
- xml.tag! 'taxService', {'run' => 'true'} do
598
+ xml.tag! 'taxService', { 'run' => 'true' } do
599
599
  xml.tag!('nexus', @options[:nexus]) unless @options[:nexus].blank?
600
600
  xml.tag!('sellerRegistration', @options[:vat_reg_number]) unless @options[:vat_reg_number].blank?
601
601
  end
@@ -605,7 +605,7 @@ module ActiveMerchant #:nodoc:
605
605
  if network_tokenization?(payment_method)
606
606
  add_auth_network_tokenization(xml, payment_method, options)
607
607
  else
608
- xml.tag! 'ccAuthService', {'run' => 'true'} do
608
+ xml.tag! 'ccAuthService', { 'run' => 'true' } do
609
609
  if options[:three_d_secure]
610
610
  add_normalized_threeds_2_data(xml, payment_method, options)
611
611
  else
@@ -678,7 +678,7 @@ module ActiveMerchant #:nodoc:
678
678
 
679
679
  case brand
680
680
  when :visa
681
- xml.tag! 'ccAuthService', {'run' => 'true'} do
681
+ xml.tag! 'ccAuthService', { 'run' => 'true' } do
682
682
  xml.tag!('cavv', payment_method.payment_cryptogram)
683
683
  xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
684
684
  xml.tag!('xid', payment_method.payment_cryptogram)
@@ -689,13 +689,13 @@ module ActiveMerchant #:nodoc:
689
689
  xml.tag!('authenticationData', payment_method.payment_cryptogram)
690
690
  xml.tag!('collectionIndicator', DEFAULT_COLLECTION_INDICATOR)
691
691
  end
692
- xml.tag! 'ccAuthService', {'run' => 'true'} do
692
+ xml.tag! 'ccAuthService', { 'run' => 'true' } do
693
693
  xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
694
694
  xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
695
695
  end
696
696
  when :american_express
697
697
  cryptogram = Base64.decode64(payment_method.payment_cryptogram)
698
- xml.tag! 'ccAuthService', {'run' => 'true'} do
698
+ xml.tag! 'ccAuthService', { 'run' => 'true' } do
699
699
  xml.tag!('cavv', Base64.encode64(cryptogram[0...20]))
700
700
  xml.tag!('commerceIndicator', ECI_BRAND_MAPPING[brand])
701
701
  xml.tag!('xid', Base64.encode64(cryptogram[20...40]))
@@ -711,7 +711,7 @@ module ActiveMerchant #:nodoc:
711
711
  end
712
712
 
713
713
  def add_capture_service(xml, request_id, request_token)
714
- xml.tag! 'ccCaptureService', {'run' => 'true'} do
714
+ xml.tag! 'ccCaptureService', { 'run' => 'true' } do
715
715
  xml.tag! 'authRequestID', request_id
716
716
  xml.tag! 'authRequestToken', request_token
717
717
  xml.tag! 'reconciliationID', options[:reconciliation_id] if options[:reconciliation_id]
@@ -720,56 +720,56 @@ module ActiveMerchant #:nodoc:
720
720
 
721
721
  def add_purchase_service(xml, payment_method, options)
722
722
  if options[:pinless_debit_card]
723
- xml.tag! 'pinlessDebitService', {'run' => 'true'} do
723
+ xml.tag! 'pinlessDebitService', { 'run' => 'true' } do
724
724
  xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
725
725
  end
726
726
  else
727
727
  add_auth_service(xml, payment_method, options)
728
- xml.tag! 'ccCaptureService', {'run' => 'true'} do
728
+ xml.tag! 'ccCaptureService', { 'run' => 'true' } do
729
729
  xml.tag!('reconciliationID', options[:reconciliation_id]) if options[:reconciliation_id]
730
730
  end
731
731
  end
732
732
  end
733
733
 
734
734
  def add_void_service(xml, request_id, request_token)
735
- xml.tag! 'voidService', {'run' => 'true'} do
735
+ xml.tag! 'voidService', { 'run' => 'true' } do
736
736
  xml.tag! 'voidRequestID', request_id
737
737
  xml.tag! 'voidRequestToken', request_token
738
738
  end
739
739
  end
740
740
 
741
741
  def add_auth_reversal_service(xml, request_id, request_token)
742
- xml.tag! 'ccAuthReversalService', {'run' => 'true'} do
742
+ xml.tag! 'ccAuthReversalService', { 'run' => 'true' } do
743
743
  xml.tag! 'authRequestID', request_id
744
744
  xml.tag! 'authRequestToken', request_token
745
745
  end
746
746
  end
747
747
 
748
748
  def add_credit_service(xml, request_id = nil, request_token = nil)
749
- xml.tag! 'ccCreditService', {'run' => 'true'} do
749
+ xml.tag! 'ccCreditService', { 'run' => 'true' } do
750
750
  xml.tag! 'captureRequestID', request_id if request_id
751
751
  xml.tag! 'captureRequestToken', request_token if request_token
752
752
  end
753
753
  end
754
754
 
755
755
  def add_check_service(xml)
756
- xml.tag! 'ecDebitService', {'run' => 'true'}
756
+ xml.tag! 'ecDebitService', { 'run' => 'true' }
757
757
  end
758
758
 
759
759
  def add_subscription_create_service(xml, options)
760
- xml.tag! 'paySubscriptionCreateService', {'run' => 'true'}
760
+ xml.tag! 'paySubscriptionCreateService', { 'run' => 'true' }
761
761
  end
762
762
 
763
763
  def add_subscription_update_service(xml, options)
764
- xml.tag! 'paySubscriptionUpdateService', {'run' => 'true'}
764
+ xml.tag! 'paySubscriptionUpdateService', { 'run' => 'true' }
765
765
  end
766
766
 
767
767
  def add_subscription_delete_service(xml, options)
768
- xml.tag! 'paySubscriptionDeleteService', {'run' => 'true'}
768
+ xml.tag! 'paySubscriptionDeleteService', { 'run' => 'true' }
769
769
  end
770
770
 
771
771
  def add_subscription_retrieve_service(xml, options)
772
- xml.tag! 'paySubscriptionRetrieveService', {'run' => 'true'}
772
+ xml.tag! 'paySubscriptionRetrieveService', { 'run' => 'true' }
773
773
  end
774
774
 
775
775
  def add_subscription(xml, options, reference = nil)
@@ -834,13 +834,13 @@ module ActiveMerchant #:nodoc:
834
834
  end
835
835
 
836
836
  def add_validate_pinless_debit_service(xml)
837
- xml.tag! 'pinlessDebitValidateService', {'run' => 'true'}
837
+ xml.tag! 'pinlessDebitValidateService', { 'run' => 'true' }
838
838
  end
839
839
 
840
840
  def add_threeds_services(xml, options)
841
- xml.tag! 'payerAuthEnrollService', {'run' => 'true'} if options[:payer_auth_enroll_service]
841
+ xml.tag! 'payerAuthEnrollService', { 'run' => 'true' } if options[:payer_auth_enroll_service]
842
842
  if options[:payer_auth_validate_service]
843
- xml.tag! 'payerAuthValidateService', {'run' => 'true'} do
843
+ xml.tag! 'payerAuthValidateService', { 'run' => 'true' } do
844
844
  xml.tag! 'signedPARes', options[:pares]
845
845
  end
846
846
  end
@@ -851,7 +851,7 @@ module ActiveMerchant #:nodoc:
851
851
  country_code&.code(:alpha2)
852
852
  end
853
853
 
854
- def add_stored_credential_subsequent_auth(xml, options={})
854
+ def add_stored_credential_subsequent_auth(xml, options = {})
855
855
  return unless options[:stored_credential] || options[:stored_credential_overrides]
856
856
 
857
857
  stored_credential_subsequent_auth = 'true' if options.dig(:stored_credential, :initiator) == 'merchant'
@@ -861,7 +861,7 @@ module ActiveMerchant #:nodoc:
861
861
  xml.subsequentAuth override_subsequent_auth.nil? ? stored_credential_subsequent_auth : override_subsequent_auth
862
862
  end
863
863
 
864
- def add_stored_credential_options(xml, options={})
864
+ def add_stored_credential_options(xml, options = {})
865
865
  return unless options[:stored_credential] || options[:stored_credential_overrides]
866
866
 
867
867
  stored_credential_subsequent_auth_first = 'true' if options.dig(:stored_credential, :initial_transaction)
@@ -889,17 +889,17 @@ module ActiveMerchant #:nodoc:
889
889
 
890
890
  xml = Builder::XmlMarkup.new indent: 2
891
891
  xml.instruct!
892
- xml.tag! 's:Envelope', {'xmlns:s' => 'http://schemas.xmlsoap.org/soap/envelope/'} do
892
+ xml.tag! 's:Envelope', { 'xmlns:s' => 'http://schemas.xmlsoap.org/soap/envelope/' } do
893
893
  xml.tag! 's:Header' do
894
- xml.tag! 'wsse:Security', {'s:mustUnderstand' => '1', 'xmlns:wsse' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'} do
894
+ xml.tag! 'wsse:Security', { 's:mustUnderstand' => '1', 'xmlns:wsse' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' } do
895
895
  xml.tag! 'wsse:UsernameToken' do
896
896
  xml.tag! 'wsse:Username', @options[:login]
897
897
  xml.tag! 'wsse:Password', @options[:password], 'Type' => 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'
898
898
  end
899
899
  end
900
900
  end
901
- xml.tag! 's:Body', {'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema'} do
902
- xml.tag! 'requestMessage', {'xmlns' => "urn:schemas-cybersource-com:transaction-data-#{xsd_version}"} do
901
+ xml.tag! 's:Body', { 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema' } do
902
+ xml.tag! 'requestMessage', { 'xmlns' => "urn:schemas-cybersource-com:transaction-data-#{xsd_version}" } do
903
903
  add_merchant_data(xml, options)
904
904
  xml << body
905
905
  end
@@ -932,8 +932,7 @@ module ActiveMerchant #:nodoc:
932
932
  authorization: authorization,
933
933
  fraud_review: in_fraud_review?(response),
934
934
  avs_result: { code: response[:avsCode] },
935
- cvv_result: response[:cvCode]
936
- )
935
+ cvv_result: response[:cvCode])
937
936
  end
938
937
 
939
938
  # Parse the SOAP response
@@ -11,33 +11,33 @@ module ActiveMerchant #:nodoc:
11
11
  self.homepage_url = 'https://dlocal.com/'
12
12
  self.display_name = 'dLocal'
13
13
 
14
- def initialize(options={})
14
+ def initialize(options = {})
15
15
  requires!(options, :login, :trans_key, :secret_key)
16
16
  super
17
17
  end
18
18
 
19
- def purchase(money, payment, options={})
19
+ def purchase(money, payment, options = {})
20
20
  post = {}
21
21
  add_auth_purchase_params(post, money, payment, 'purchase', options)
22
22
 
23
23
  commit('purchase', post, options)
24
24
  end
25
25
 
26
- def authorize(money, payment, options={})
26
+ def authorize(money, payment, options = {})
27
27
  post = {}
28
28
  add_auth_purchase_params(post, money, payment, 'authorize', options)
29
29
 
30
30
  commit('authorize', post, options)
31
31
  end
32
32
 
33
- def capture(money, authorization, options={})
33
+ def capture(money, authorization, options = {})
34
34
  post = {}
35
35
  post[:authorization_id] = authorization
36
36
  add_invoice(post, money, options) if money
37
37
  commit('capture', post, options)
38
38
  end
39
39
 
40
- def refund(money, authorization, options={})
40
+ def refund(money, authorization, options = {})
41
41
  post = {}
42
42
  post[:payment_id] = authorization
43
43
  post[:notification_url] = options[:notification_url]
@@ -45,13 +45,13 @@ module ActiveMerchant #:nodoc:
45
45
  commit('refund', post, options)
46
46
  end
47
47
 
48
- def void(authorization, options={})
48
+ def void(authorization, options = {})
49
49
  post = {}
50
50
  post[:authorization_id] = authorization
51
51
  commit('void', post, options)
52
52
  end
53
53
 
54
- def verify(credit_card, options={})
54
+ def verify(credit_card, options = {})
55
55
  MultiResponse.run(:use_first_response) do |r|
56
56
  r.process { authorize(100, credit_card, options) }
57
57
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -138,7 +138,7 @@ module ActiveMerchant #:nodoc:
138
138
  house.empty? ? nil : house
139
139
  end
140
140
 
141
- def add_card(post, card, action, options={})
141
+ def add_card(post, card, action, options = {})
142
142
  post[:card] = {}
143
143
  post[:card][:holder_name] = card.name
144
144
  post[:card][:expiration_month] = card.month
@@ -155,7 +155,7 @@ module ActiveMerchant #:nodoc:
155
155
  JSON.parse(body)
156
156
  end
157
157
 
158
- def commit(action, parameters, options={})
158
+ def commit(action, parameters, options = {})
159
159
  url = url(action, parameters, options)
160
160
  post = post_data(action, parameters)
161
161
  begin
@@ -202,7 +202,7 @@ module ActiveMerchant #:nodoc:
202
202
  code&.to_s
203
203
  end
204
204
 
205
- def url(action, parameters, options={})
205
+ def url(action, parameters, options = {})
206
206
  "#{(test? ? test_url : live_url)}/#{endpoint(action, parameters, options)}/"
207
207
  end
208
208
 
@@ -221,7 +221,7 @@ module ActiveMerchant #:nodoc:
221
221
  end
222
222
  end
223
223
 
224
- def headers(post, options={})
224
+ def headers(post, options = {})
225
225
  timestamp = Time.now.utc.iso8601
226
226
  headers = {
227
227
  'Content-Type' => 'application/json',