activemerchant 1.112.0 → 1.118.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (204) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +115 -0
  3. data/README.md +1 -1
  4. data/lib/active_merchant.rb +1 -1
  5. data/lib/active_merchant/billing/avs_result.rb +1 -1
  6. data/lib/active_merchant/billing/compatibility.rb +3 -3
  7. data/lib/active_merchant/billing/credit_card.rb +3 -1
  8. data/lib/active_merchant/billing/credit_card_methods.rb +58 -11
  9. data/lib/active_merchant/billing/gateway.rb +1 -1
  10. data/lib/active_merchant/billing/gateways/adyen.rb +26 -16
  11. data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
  12. data/lib/active_merchant/billing/gateways/authorize_net.rb +50 -18
  13. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
  14. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +3 -2
  15. data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
  16. data/lib/active_merchant/billing/gateways/balanced.rb +5 -4
  17. data/lib/active_merchant/billing/gateways/bambora_apac.rb +8 -8
  18. data/lib/active_merchant/billing/gateways/bank_frick.rb +8 -8
  19. data/lib/active_merchant/billing/gateways/banwire.rb +1 -1
  20. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +6 -4
  21. data/lib/active_merchant/billing/gateways/beanstream.rb +3 -3
  22. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -5
  23. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -3
  24. data/lib/active_merchant/billing/gateways/blue_snap.rb +85 -23
  25. data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
  26. data/lib/active_merchant/billing/gateways/borgun.rb +12 -12
  27. data/lib/active_merchant/billing/gateways/bpoint.rb +8 -8
  28. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  29. data/lib/active_merchant/billing/gateways/braintree_blue.rb +20 -17
  30. data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -7
  31. data/lib/active_merchant/billing/gateways/cams.rb +8 -8
  32. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  33. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  34. data/lib/active_merchant/billing/gateways/card_stream.rb +2 -2
  35. data/lib/active_merchant/billing/gateways/cardknox.rb +8 -8
  36. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  37. data/lib/active_merchant/billing/gateways/cecabank.rb +5 -5
  38. data/lib/active_merchant/billing/gateways/cenpos.rb +11 -11
  39. data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
  40. data/lib/active_merchant/billing/gateways/checkout_v2.rb +18 -21
  41. data/lib/active_merchant/billing/gateways/clearhaus.rb +7 -7
  42. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  43. data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
  44. data/lib/active_merchant/billing/gateways/creditcall.rb +10 -10
  45. data/lib/active_merchant/billing/gateways/credorax.rb +32 -15
  46. data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
  47. data/lib/active_merchant/billing/gateways/culqi.rb +10 -10
  48. data/lib/active_merchant/billing/gateways/cyber_source.rb +61 -37
  49. data/lib/active_merchant/billing/gateways/d_local.rb +11 -11
  50. data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
  51. data/lib/active_merchant/billing/gateways/decidir.rb +24 -9
  52. data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
  53. data/lib/active_merchant/billing/gateways/digitzs.rb +6 -6
  54. data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
  55. data/lib/active_merchant/billing/gateways/efsnet.rb +3 -4
  56. data/lib/active_merchant/billing/gateways/elavon.rb +279 -227
  57. data/lib/active_merchant/billing/gateways/element.rb +8 -8
  58. data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
  59. data/lib/active_merchant/billing/gateways/eway.rb +3 -4
  60. data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
  61. data/lib/active_merchant/billing/gateways/eway_rapid.rb +8 -8
  62. data/lib/active_merchant/billing/gateways/exact.rb +8 -9
  63. data/lib/active_merchant/billing/gateways/ezic.rb +8 -8
  64. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  65. data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
  66. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  67. data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
  68. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
  69. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +21 -10
  70. data/lib/active_merchant/billing/gateways/flo2cash.rb +9 -9
  71. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  72. data/lib/active_merchant/billing/gateways/forte.rb +14 -8
  73. data/lib/active_merchant/billing/gateways/global_collect.rb +29 -10
  74. data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
  75. data/lib/active_merchant/billing/gateways/hdfc.rb +10 -10
  76. data/lib/active_merchant/billing/gateways/hps.rb +17 -14
  77. data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
  78. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  79. data/lib/active_merchant/billing/gateways/inspire.rb +3 -4
  80. data/lib/active_merchant/billing/gateways/instapay.rb +1 -2
  81. data/lib/active_merchant/billing/gateways/ipp.rb +7 -7
  82. data/lib/active_merchant/billing/gateways/iridium.rb +16 -17
  83. data/lib/active_merchant/billing/gateways/iveri.rb +7 -7
  84. data/lib/active_merchant/billing/gateways/ixopay.rb +7 -7
  85. data/lib/active_merchant/billing/gateways/jetpay.rb +1 -2
  86. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -5
  87. data/lib/active_merchant/billing/gateways/kushki.rb +6 -6
  88. data/lib/active_merchant/billing/gateways/latitude19.rb +14 -14
  89. data/lib/active_merchant/billing/gateways/linkpoint.rb +5 -6
  90. data/lib/active_merchant/billing/gateways/litle.rb +28 -12
  91. data/lib/active_merchant/billing/gateways/mastercard.rb +12 -12
  92. data/lib/active_merchant/billing/gateways/mercado_pago.rb +8 -8
  93. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -2
  94. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
  95. data/lib/active_merchant/billing/gateways/merchant_partners.rb +10 -10
  96. data/lib/active_merchant/billing/gateways/merchant_ware.rb +5 -7
  97. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +4 -6
  98. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  99. data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -5
  100. data/lib/active_merchant/billing/gateways/micropayment.rb +8 -8
  101. data/lib/active_merchant/billing/gateways/migs.rb +3 -4
  102. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +2 -4
  103. data/lib/active_merchant/billing/gateways/monei.rb +7 -7
  104. data/lib/active_merchant/billing/gateways/moneris.rb +4 -3
  105. data/lib/active_merchant/billing/gateways/money_movers.rb +2 -3
  106. data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -10
  107. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -4
  108. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +7 -7
  109. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -2
  110. data/lib/active_merchant/billing/gateways/netaxept.rb +6 -6
  111. data/lib/active_merchant/billing/gateways/netbanx.rb +12 -10
  112. data/lib/active_merchant/billing/gateways/netbilling.rb +4 -5
  113. data/lib/active_merchant/billing/gateways/network_merchants.rb +2 -3
  114. data/lib/active_merchant/billing/gateways/nmi.rb +21 -7
  115. data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
  116. data/lib/active_merchant/billing/gateways/omise.rb +13 -13
  117. data/lib/active_merchant/billing/gateways/openpay.rb +4 -5
  118. data/lib/active_merchant/billing/gateways/opp.rb +12 -12
  119. data/lib/active_merchant/billing/gateways/optimal_payment.rb +3 -4
  120. data/lib/active_merchant/billing/gateways/orbital.rb +175 -81
  121. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
  122. data/lib/active_merchant/billing/gateways/pagarme.rb +9 -9
  123. data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
  124. data/lib/active_merchant/billing/gateways/pay_conex.rb +8 -8
  125. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -7
  126. data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -8
  127. data/lib/active_merchant/billing/gateways/pay_junction.rb +4 -5
  128. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +9 -9
  129. data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -3
  130. data/lib/active_merchant/billing/gateways/paybox_direct.rb +23 -1
  131. data/lib/active_merchant/billing/gateways/payeezy.rb +35 -17
  132. data/lib/active_merchant/billing/gateways/payex.rb +11 -12
  133. data/lib/active_merchant/billing/gateways/payflow.rb +4 -1
  134. data/lib/active_merchant/billing/gateways/payflow/payflow_common_api.rb +1 -1
  135. data/lib/active_merchant/billing/gateways/payflow/payflow_express_response.rb +1 -1
  136. data/lib/active_merchant/billing/gateways/payment_express.rb +1 -2
  137. data/lib/active_merchant/billing/gateways/paymentez.rb +26 -6
  138. data/lib/active_merchant/billing/gateways/paymill.rb +10 -10
  139. data/lib/active_merchant/billing/gateways/paypal.rb +10 -2
  140. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -0
  141. data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
  142. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  143. data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
  144. data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
  145. data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
  146. data/lib/active_merchant/billing/gateways/payu_latam.rb +17 -10
  147. data/lib/active_merchant/billing/gateways/payway.rb +8 -9
  148. data/lib/active_merchant/billing/gateways/pin.rb +11 -0
  149. data/lib/active_merchant/billing/gateways/plugnpay.rb +2 -3
  150. data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
  151. data/lib/active_merchant/billing/gateways/psigate.rb +3 -4
  152. data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
  153. data/lib/active_merchant/billing/gateways/qbms.rb +4 -5
  154. data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
  155. data/lib/active_merchant/billing/gateways/quickbooks.rb +4 -3
  156. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
  157. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
  158. data/lib/active_merchant/billing/gateways/qvalent.rb +9 -9
  159. data/lib/active_merchant/billing/gateways/realex.rb +1 -1
  160. data/lib/active_merchant/billing/gateways/redsys.rb +87 -7
  161. data/lib/active_merchant/billing/gateways/s5.rb +7 -7
  162. data/lib/active_merchant/billing/gateways/safe_charge.rb +40 -14
  163. data/lib/active_merchant/billing/gateways/sage.rb +3 -5
  164. data/lib/active_merchant/billing/gateways/sage_pay.rb +6 -7
  165. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -2
  166. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -2
  167. data/lib/active_merchant/billing/gateways/secure_pay.rb +3 -4
  168. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -4
  169. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +1 -2
  170. data/lib/active_merchant/billing/gateways/securion_pay.rb +5 -6
  171. data/lib/active_merchant/billing/gateways/skip_jack.rb +3 -4
  172. data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -6
  173. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
  174. data/lib/active_merchant/billing/gateways/spreedly_core.rb +6 -6
  175. data/lib/active_merchant/billing/gateways/stripe.rb +12 -12
  176. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +30 -0
  177. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
  178. data/lib/active_merchant/billing/gateways/telr.rb +9 -9
  179. data/lib/active_merchant/billing/gateways/trans_first.rb +3 -3
  180. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +14 -14
  181. data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
  182. data/lib/active_merchant/billing/gateways/trust_commerce.rb +8 -9
  183. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
  184. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +36 -36
  185. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +4 -5
  186. data/lib/active_merchant/billing/gateways/vanco.rb +3 -3
  187. data/lib/active_merchant/billing/gateways/verifi.rb +1 -2
  188. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -2
  189. data/lib/active_merchant/billing/gateways/visanet_peru.rb +10 -10
  190. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  191. data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
  192. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
  193. data/lib/active_merchant/billing/gateways/worldpay.rb +18 -10
  194. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
  195. data/lib/active_merchant/billing/gateways/worldpay_us.rb +9 -9
  196. data/lib/active_merchant/billing/response.rb +3 -2
  197. data/lib/active_merchant/country.rb +1 -1
  198. data/lib/active_merchant/network_connection_retries.rb +2 -2
  199. data/lib/active_merchant/post_data.rb +1 -1
  200. data/lib/active_merchant/posts_data.rb +1 -1
  201. data/lib/active_merchant/version.rb +1 -1
  202. data/lib/support/ssl_verify.rb +2 -2
  203. data/lib/support/ssl_version.rb +2 -2
  204. 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]
@@ -176,11 +176,11 @@ module ActiveMerchant #:nodoc:
176
176
 
177
177
  def headers
178
178
  {
179
- 'Authorization' => 'Basic ' + Base64.strict_encode64(@options[:username].to_s + ':' + @options[:password].to_s),
179
+ 'Authorization' => 'Basic ' + Base64.strict_encode64(@options[:username].to_s + ':' + @options[:password].to_s)
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
 
@@ -234,7 +232,7 @@ module ActiveMerchant #:nodoc:
234
232
  phone: options[:phone] || (options[:billing_address][:phone] if options[:billing_address] &&
235
233
  options[:billing_address][:phone]),
236
234
  id: options[:customer],
237
- device_data: options[:device_data],
235
+ device_data: options[:device_data]
238
236
  }.merge credit_card_params
239
237
  result = @braintree_gateway.customer.create(merge_credit_card_options(parameters, options))
240
238
  Response.new(result.success?, message_from_result(result),
@@ -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
 
@@ -258,7 +255,7 @@ module ActiveMerchant #:nodoc:
258
255
  cvv: credit_card.verification_value,
259
256
  expiration_month: credit_card.month.to_s.rjust(2, '0'),
260
257
  expiration_year: credit_card.year.to_s,
261
- device_data: options[:device_data],
258
+ device_data: options[:device_data]
262
259
  }
263
260
  if options[:billing_address]
264
261
  address = map_address(options[:billing_address])
@@ -320,7 +317,7 @@ module ActiveMerchant #:nodoc:
320
317
  company: address[:company],
321
318
  locality: address[:city],
322
319
  region: address[:state],
323
- postal_code: scrub_zip(address[:zip]),
320
+ postal_code: scrub_zip(address[:zip])
324
321
  }
325
322
 
326
323
  mapped[:country_code_alpha2] = (address[:country] || address[:country_code_alpha2]) if address[:country] || address[:country_code_alpha2]
@@ -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,
@@ -508,7 +505,7 @@ module ActiveMerchant #:nodoc:
508
505
  customer_details = {
509
506
  'id' => transaction.customer_details.id,
510
507
  'email' => transaction.customer_details.email,
511
- 'phone' => transaction.customer_details.phone,
508
+ 'phone' => transaction.customer_details.phone
512
509
  }
513
510
 
514
511
  billing_details = {
@@ -518,7 +515,7 @@ module ActiveMerchant #:nodoc:
518
515
  'locality' => transaction.billing_details.locality,
519
516
  'region' => transaction.billing_details.region,
520
517
  'postal_code' => transaction.billing_details.postal_code,
521
- 'country_name' => transaction.billing_details.country_name,
518
+ 'country_name' => transaction.billing_details.country_name
522
519
  }
523
520
 
524
521
  shipping_details = {
@@ -528,7 +525,7 @@ module ActiveMerchant #:nodoc:
528
525
  'locality' => transaction.shipping_details.locality,
529
526
  'region' => transaction.shipping_details.region,
530
527
  'postal_code' => transaction.shipping_details.postal_code,
531
- 'country_name' => transaction.shipping_details.country_name,
528
+ 'country_name' => transaction.shipping_details.country_name
532
529
  }
533
530
  credit_card_details = {
534
531
  'masked_number' => transaction.credit_card_details.masked_number,
@@ -578,7 +575,7 @@ module ActiveMerchant #:nodoc:
578
575
  options: {
579
576
  store_in_vault: options[:store] ? true : false,
580
577
  submit_for_settlement: options[:submit_for_settlement],
581
- hold_in_escrow: options[:hold_in_escrow],
578
+ hold_in_escrow: options[:hold_in_escrow]
582
579
  }
583
580
  }
584
581
 
@@ -586,6 +583,7 @@ module ActiveMerchant #:nodoc:
586
583
  parameters[:device_data] = options[:device_data] if options[:device_data]
587
584
  parameters[:service_fee_amount] = options[:service_fee_amount] if options[:service_fee_amount]
588
585
 
586
+ add_account_type(parameters, options) if options[:account_type]
589
587
  add_skip_options(parameters, options)
590
588
  add_merchant_account_id(parameters, options)
591
589
 
@@ -612,6 +610,11 @@ module ActiveMerchant #:nodoc:
612
610
  parameters
613
611
  end
614
612
 
613
+ def add_account_type(parameters, options)
614
+ parameters[:options][:credit_card] = {}
615
+ parameters[:options][:credit_card][:account_type] = options[:account_type]
616
+ end
617
+
615
618
  def add_skip_options(parameters, options)
616
619
  parameters[:options][:skip_advanced_fraud_checking] = options[:skip_advanced_fraud_checking] if options[:skip_advanced_fraud_checking]
617
620
  parameters[:options][:skip_avs] = options[:skip_avs] if options[:skip_avs]
@@ -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