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
@@ -16,12 +16,12 @@ module ActiveMerchant #:nodoc:
16
16
 
17
17
  self.homepage_url = 'https://www.borgun.is/'
18
18
 
19
- def initialize(options={})
19
+ def initialize(options = {})
20
20
  requires!(options, :processor, :merchant_id, :username, :password)
21
21
  super
22
22
  end
23
23
 
24
- def purchase(money, payment, options={})
24
+ def purchase(money, payment, options = {})
25
25
  post = {}
26
26
  post[:TransType] = '1'
27
27
  add_invoice(post, money, options)
@@ -29,7 +29,7 @@ module ActiveMerchant #:nodoc:
29
29
  commit('sale', post)
30
30
  end
31
31
 
32
- def authorize(money, payment, options={})
32
+ def authorize(money, payment, options = {})
33
33
  post = {}
34
34
  post[:TransType] = '5'
35
35
  add_invoice(post, money, options)
@@ -37,7 +37,7 @@ module ActiveMerchant #:nodoc:
37
37
  commit('authonly', post, options)
38
38
  end
39
39
 
40
- def capture(money, authorization, options={})
40
+ def capture(money, authorization, options = {})
41
41
  post = {}
42
42
  post[:TransType] = '1'
43
43
  add_invoice(post, money, options)
@@ -45,7 +45,7 @@ module ActiveMerchant #:nodoc:
45
45
  commit('capture', post)
46
46
  end
47
47
 
48
- def refund(money, authorization, options={})
48
+ def refund(money, authorization, options = {})
49
49
  post = {}
50
50
  post[:TransType] = '3'
51
51
  add_invoice(post, money, options)
@@ -53,7 +53,7 @@ module ActiveMerchant #:nodoc:
53
53
  commit('refund', post)
54
54
  end
55
55
 
56
- def void(authorization, options={})
56
+ def void(authorization, options = {})
57
57
  post = {}
58
58
  # TransType, TrAmount, and currency must match original values from auth or purchase.
59
59
  _, _, _, _, _, transtype, tramount, currency = split_authorization(authorization)
@@ -76,7 +76,7 @@ module ActiveMerchant #:nodoc:
76
76
 
77
77
  private
78
78
 
79
- CURRENCY_CODES = Hash.new { |h, k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}") }
79
+ CURRENCY_CODES = Hash.new { |_h, k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}") }
80
80
  CURRENCY_CODES['ISK'] = '352'
81
81
  CURRENCY_CODES['EUR'] = '978'
82
82
  CURRENCY_CODES['USD'] = '840'
@@ -125,7 +125,7 @@ module ActiveMerchant #:nodoc:
125
125
  response
126
126
  end
127
127
 
128
- def commit(action, post, options={})
128
+ def commit(action, post, options = {})
129
129
  post[:Version] = '1000'
130
130
  post[:Processor] = @options[:processor]
131
131
  post[:MerchantID] = @options[:merchant_id]
@@ -180,7 +180,7 @@ module ActiveMerchant #:nodoc:
180
180
  }
181
181
  end
182
182
 
183
- def build_request(action, post, options={})
183
+ def build_request(action, post, options = {})
184
184
  mode = action == 'void' ? 'cancel' : 'get'
185
185
  xml = Builder::XmlMarkup.new indent: 18
186
186
  xml.instruct!(:xml, version: '1.0', encoding: 'utf-8')
@@ -205,7 +205,7 @@ module ActiveMerchant #:nodoc:
205
205
  end
206
206
 
207
207
  def envelope(mode)
208
- <<-EOS
208
+ <<-XML
209
209
  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:aut="http://Borgun/Heimir/pub/ws/Authorization">
210
210
  <soapenv:Header/>
211
211
  <soapenv:Body>
@@ -216,7 +216,7 @@ module ActiveMerchant #:nodoc:
216
216
  </aut:#{mode}AuthorizationInput>
217
217
  </soapenv:Body>
218
218
  </soapenv:Envelope>
219
- EOS
219
+ XML
220
220
  end
221
221
 
222
222
  def url(action)
@@ -12,12 +12,12 @@ module ActiveMerchant #:nodoc:
12
12
  self.homepage_url = 'https://www.bpoint.com.au/bpoint'
13
13
  self.display_name = 'BPoint'
14
14
 
15
- def initialize(options={})
15
+ def initialize(options = {})
16
16
  requires!(options, :username, :password, :merchant_number)
17
17
  super
18
18
  end
19
19
 
20
- def store(credit_card, options={})
20
+ def store(credit_card, options = {})
21
21
  options[:crn1] ||= 'DEFAULT'
22
22
  request_body = soap_request do |xml|
23
23
  add_token(xml, credit_card, options)
@@ -25,7 +25,7 @@ module ActiveMerchant #:nodoc:
25
25
  commit(request_body)
26
26
  end
27
27
 
28
- def purchase(amount, credit_card, options={})
28
+ def purchase(amount, credit_card, options = {})
29
29
  request_body = soap_request do |xml|
30
30
  process_payment(xml) do |payment_xml|
31
31
  add_purchase(payment_xml, amount, credit_card, options)
@@ -34,7 +34,7 @@ module ActiveMerchant #:nodoc:
34
34
  commit(request_body)
35
35
  end
36
36
 
37
- def authorize(amount, credit_card, options={})
37
+ def authorize(amount, credit_card, options = {})
38
38
  request_body = soap_request do |xml|
39
39
  process_payment(xml) do |payment_xml|
40
40
  add_authorize(payment_xml, amount, credit_card, options)
@@ -43,7 +43,7 @@ module ActiveMerchant #:nodoc:
43
43
  commit(request_body)
44
44
  end
45
45
 
46
- def capture(amount, authorization, options={})
46
+ def capture(amount, authorization, options = {})
47
47
  request_body = soap_request do |xml|
48
48
  process_payment(xml) do |payment_xml|
49
49
  add_capture(payment_xml, amount, authorization, options)
@@ -52,7 +52,7 @@ module ActiveMerchant #:nodoc:
52
52
  commit(request_body)
53
53
  end
54
54
 
55
- def refund(amount, authorization, options={})
55
+ def refund(amount, authorization, options = {})
56
56
  request_body = soap_request do |xml|
57
57
  process_payment(xml) do |payment_xml|
58
58
  add_refund(payment_xml, amount, authorization, options)
@@ -61,7 +61,7 @@ module ActiveMerchant #:nodoc:
61
61
  commit(request_body)
62
62
  end
63
63
 
64
- def void(authorization, options={})
64
+ def void(authorization, options = {})
65
65
  request_body = soap_request do |xml|
66
66
  process_payment(xml) do |payment_xml|
67
67
  add_void(payment_xml, authorization, options)
@@ -70,7 +70,7 @@ module ActiveMerchant #:nodoc:
70
70
  commit(request_body)
71
71
  end
72
72
 
73
- def verify(credit_card, options={})
73
+ def verify(credit_card, options = {})
74
74
  MultiResponse.run(:use_first_response) do |r|
75
75
  r.process { authorize(100, credit_card, options) }
76
76
  r.process(:ignore_result) { void(r.authorization, options.merge(amount: 100)) }
@@ -7,7 +7,7 @@ module ActiveMerchant #:nodoc:
7
7
 
8
8
  self.abstract_class = true
9
9
 
10
- def self.new(options={})
10
+ def self.new(options = {})
11
11
  if options.has_key?(:login)
12
12
  BraintreeOrangeGateway.new(options)
13
13
  else
@@ -163,12 +163,10 @@ module ActiveMerchant #:nodoc:
163
163
  email: scrub_email(options[:email]),
164
164
  phone: options[:phone] || (options[:billing_address][:phone] if options[:billing_address] &&
165
165
  options[:billing_address][:phone]),
166
- credit_card: credit_card_params
167
- )
166
+ credit_card: credit_card_params)
168
167
  Response.new(result.success?, message_from_result(result),
169
168
  braintree_customer: (customer_hash(@braintree_gateway.customer.find(vault_id), :include_credit_cards) if result.success?),
170
- customer_vault_id: (result.customer.id if result.success?)
171
- )
169
+ customer_vault_id: (result.customer.id if result.success?))
172
170
  end
173
171
  end
174
172
 
@@ -182,7 +180,7 @@ module ActiveMerchant #:nodoc:
182
180
  Response.new(true, 'OK')
183
181
  end
184
182
  end
185
- alias_method :delete, :unstore
183
+ alias delete unstore
186
184
 
187
185
  def supports_network_tokenization?
188
186
  true
@@ -205,9 +203,9 @@ module ActiveMerchant #:nodoc:
205
203
  def check_customer_exists(customer_vault_id)
206
204
  commit do
207
205
  @braintree_gateway.customer.find(customer_vault_id)
208
- ActiveMerchant::Billing::Response.new(true, 'Customer found', {exists: true}, authorization: customer_vault_id)
206
+ ActiveMerchant::Billing::Response.new(true, 'Customer found', { exists: true }, authorization: customer_vault_id)
209
207
  rescue Braintree::NotFoundError
210
- ActiveMerchant::Billing::Response.new(true, 'Customer not found', {exists: false})
208
+ ActiveMerchant::Billing::Response.new(true, 'Customer not found', { exists: false })
211
209
  end
212
210
  end
213
211
 
@@ -243,8 +241,7 @@ module ActiveMerchant #:nodoc:
243
241
  customer_vault_id: (result.customer.id if result.success?),
244
242
  credit_card_token: (result.customer.credit_cards[0].token if result.success?)
245
243
  },
246
- authorization: (result.customer.id if result.success?)
247
- )
244
+ authorization: (result.customer.id if result.success?))
248
245
  end
249
246
  end
250
247
 
@@ -464,7 +461,7 @@ module ActiveMerchant #:nodoc:
464
461
  end
465
462
  end
466
463
 
467
- def customer_hash(customer, include_credit_cards=false)
464
+ def customer_hash(customer, include_credit_cards = false)
468
465
  hash = {
469
466
  'email' => customer.email,
470
467
  'phone' => customer.phone,
@@ -13,12 +13,12 @@ module ActiveMerchant #:nodoc:
13
13
  self.default_currency = 'USD'
14
14
  self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
15
15
 
16
- def initialize(options={})
16
+ def initialize(options = {})
17
17
  requires!(options, :user_name, :password)
18
18
  super
19
19
  end
20
20
 
21
- def purchase(amount, payment_method, options={})
21
+ def purchase(amount, payment_method, options = {})
22
22
  post = initialize_required_fields('Sale')
23
23
 
24
24
  # Allow the same amount in multiple transactions.
@@ -30,7 +30,7 @@ module ActiveMerchant #:nodoc:
30
30
  commit(post)
31
31
  end
32
32
 
33
- def authorize(amount, payment_method, options={})
33
+ def authorize(amount, payment_method, options = {})
34
34
  post = initialize_required_fields('Auth')
35
35
 
36
36
  add_invoice(post, amount, options)
@@ -40,7 +40,7 @@ module ActiveMerchant #:nodoc:
40
40
  commit(post)
41
41
  end
42
42
 
43
- def capture(amount, authorization, options={})
43
+ def capture(amount, authorization, options = {})
44
44
  post = initialize_required_fields('Force')
45
45
 
46
46
  add_invoice(post, amount, options)
@@ -50,7 +50,7 @@ module ActiveMerchant #:nodoc:
50
50
  commit(post)
51
51
  end
52
52
 
53
- def refund(amount, authorization, options={})
53
+ def refund(amount, authorization, options = {})
54
54
  post = initialize_required_fields('Return')
55
55
 
56
56
  add_invoice(post, amount, options)
@@ -59,7 +59,7 @@ module ActiveMerchant #:nodoc:
59
59
  commit(post)
60
60
  end
61
61
 
62
- def void(authorization, options={})
62
+ def void(authorization, options = {})
63
63
  post = initialize_required_fields('Void')
64
64
 
65
65
  add_reference(post, authorization)
@@ -74,7 +74,7 @@ module ActiveMerchant #:nodoc:
74
74
  end
75
75
  end
76
76
 
77
- def store(creditcard, options={})
77
+ def store(creditcard, options = {})
78
78
  post = initialize_required_fields('')
79
79
  post[:transaction] = 'Create'
80
80
  post[:CardNumber] = creditcard.number
@@ -67,12 +67,12 @@ module ActiveMerchant #:nodoc:
67
67
  '894' => STANDARD_ERROR_CODE[:processing_error]
68
68
  }
69
69
 
70
- def initialize(options={})
70
+ def initialize(options = {})
71
71
  requires!(options, :username, :password)
72
72
  super
73
73
  end
74
74
 
75
- def purchase(money, payment, options={})
75
+ def purchase(money, payment, options = {})
76
76
  post = {}
77
77
  add_invoice(post, money, options)
78
78
 
@@ -86,7 +86,7 @@ module ActiveMerchant #:nodoc:
86
86
  commit('sale', post)
87
87
  end
88
88
 
89
- def authorize(money, payment, options={})
89
+ def authorize(money, payment, options = {})
90
90
  post = {}
91
91
  add_invoice(post, money, options)
92
92
  add_payment(post, payment)
@@ -95,7 +95,7 @@ module ActiveMerchant #:nodoc:
95
95
  commit('auth', post)
96
96
  end
97
97
 
98
- def capture(money, authorization, options={})
98
+ def capture(money, authorization, options = {})
99
99
  post = {}
100
100
  add_reference(post, authorization)
101
101
  add_invoice(post, money, options)
@@ -103,20 +103,20 @@ module ActiveMerchant #:nodoc:
103
103
  commit('capture', post)
104
104
  end
105
105
 
106
- def refund(money, authorization, options={})
106
+ def refund(money, authorization, options = {})
107
107
  post = {}
108
108
  add_reference(post, authorization)
109
109
  add_invoice(post, money, options)
110
110
  commit('refund', post)
111
111
  end
112
112
 
113
- def void(authorization, options={})
113
+ def void(authorization, options = {})
114
114
  post = {}
115
115
  add_reference(post, authorization)
116
116
  commit('void', post)
117
117
  end
118
118
 
119
- def verify(credit_card, options={})
119
+ def verify(credit_card, options = {})
120
120
  post = {}
121
121
  add_invoice(post, 0, options)
122
122
  add_payment(post, credit_card)
@@ -138,7 +138,7 @@ module ActiveMerchant #:nodoc:
138
138
 
139
139
  private
140
140
 
141
- def add_address(post, creditcard, options={})
141
+ def add_address(post, creditcard, options = {})
142
142
  post[:firstname] = creditcard.first_name
143
143
  post[:lastname] = creditcard.last_name
144
144
 
@@ -233,7 +233,7 @@ module ActiveMerchant #:nodoc:
233
233
  post[:items] = options[:items].map do |item|
234
234
  updated = {}
235
235
  item.each_pair do |k, v|
236
- updated.merge!(k.to_s.gsub(/_/, '') => v)
236
+ updated.merge!(k.to_s.delete('_') => v)
237
237
  end
238
238
  updated
239
239
  end
@@ -11,7 +11,7 @@ module ActiveMerchant #:nodoc:
11
11
  self.homepage_url = 'http://www.cardsave.net/'
12
12
  self.display_name = 'CardSave'
13
13
 
14
- def initialize(options={})
14
+ def initialize(options = {})
15
15
  super
16
16
  @test_url = 'https://gw1.cardsaveonlinepayments.com:4430/'
17
17
  @live_url = 'https://gw1.cardsaveonlinepayments.com:4430/'
@@ -203,7 +203,7 @@ module ActiveMerchant #:nodoc:
203
203
  commit('CANCEL', post)
204
204
  end
205
205
 
206
- def verify(creditcard, options={})
206
+ def verify(creditcard, options = {})
207
207
  MultiResponse.run(:use_first_response) do |r|
208
208
  r.process { authorize(100, creditcard, options) }
209
209
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -282,7 +282,7 @@ module ActiveMerchant #:nodoc:
282
282
  add_pair(post, :threeDSRequired, options[:threeds_required] || @threeds_required ? 'Y' : 'N')
283
283
  end
284
284
 
285
- def add_remote_address(post, options={})
285
+ def add_remote_address(post, options = {})
286
286
  add_pair(post, :remoteAddress, options[:ip] || '1.1.1.1')
287
287
  end
288
288
 
@@ -27,7 +27,7 @@ module ActiveMerchant #:nodoc:
27
27
  }
28
28
  }
29
29
 
30
- def initialize(options={})
30
+ def initialize(options = {})
31
31
  requires!(options, :api_key)
32
32
  super
33
33
  end
@@ -37,7 +37,7 @@ module ActiveMerchant #:nodoc:
37
37
  # - check
38
38
  # - cardknox token, which is returned in the the authorization string "ref_num;token;command"
39
39
 
40
- def purchase(amount, source, options={})
40
+ def purchase(amount, source, options = {})
41
41
  post = {}
42
42
  add_amount(post, amount, options)
43
43
  add_invoice(post, options)
@@ -48,7 +48,7 @@ module ActiveMerchant #:nodoc:
48
48
  commit(:purchase, source_type(source), post)
49
49
  end
50
50
 
51
- def authorize(amount, source, options={})
51
+ def authorize(amount, source, options = {})
52
52
  post = {}
53
53
  add_amount(post, amount)
54
54
  add_invoice(post, options)
@@ -66,7 +66,7 @@ module ActiveMerchant #:nodoc:
66
66
  commit(:capture, source_type(authorization), post)
67
67
  end
68
68
 
69
- def refund(amount, authorization, options={})
69
+ def refund(amount, authorization, options = {})
70
70
  post = {}
71
71
  add_reference(post, authorization)
72
72
  add_amount(post, amount)
@@ -79,7 +79,7 @@ module ActiveMerchant #:nodoc:
79
79
  commit(:void, source_type(authorization), post)
80
80
  end
81
81
 
82
- def verify(credit_card, options={})
82
+ def verify(credit_card, options = {})
83
83
  MultiResponse.run(:use_first_response) do |r|
84
84
  r.process { authorize(100, credit_card, options) }
85
85
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -276,7 +276,7 @@ module ActiveMerchant #:nodoc:
276
276
  amount: fields['xAuthAmount'],
277
277
  masked_card_num: fields['xMaskedCardNumber'],
278
278
  masked_account_number: fields['MaskedAccountNumber']
279
- }.delete_if { |k, v| v.nil? }
279
+ }.delete_if { |_k, v| v.nil? }
280
280
  end
281
281
 
282
282
  def commit(action, source_type, parameters)
@@ -320,7 +320,7 @@ module ActiveMerchant #:nodoc:
320
320
  initial_parameters[:Hash] = "s/#{seed}/#{hash}/n" unless @options[:pin].blank?
321
321
  parameters = initial_parameters.merge(parameters)
322
322
 
323
- parameters.reject { |k, v| v.blank? }.collect { |key, value| "x#{key}=#{CGI.escape(value.to_s)}" }.join('&')
323
+ parameters.reject { |_k, v| v.blank? }.collect { |key, value| "x#{key}=#{CGI.escape(value.to_s)}" }.join('&')
324
324
  end
325
325
  end
326
326
  end
@@ -26,7 +26,7 @@ module ActiveMerchant #:nodoc:
26
26
  # * <tt>:user_id</tt> -- The CardProcess user ID
27
27
  # * <tt>:password</tt> -- The CardProcess password
28
28
  # * <tt>:entity_id</tt> -- The CardProcess channel or entity ID for any transactions
29
- def initialize(options={})
29
+ def initialize(options = {})
30
30
  requires!(options, :user_id, :password, :entity_id)
31
31
  super
32
32
  # This variable exists purely to allow remote tests to force error codes;