activemerchant 1.113.0 → 1.119.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +114 -0
  3. data/README.md +1 -1
  4. data/lib/active_merchant.rb +1 -1
  5. data/lib/active_merchant/billing/avs_result.rb +1 -1
  6. data/lib/active_merchant/billing/compatibility.rb +3 -3
  7. data/lib/active_merchant/billing/credit_card.rb +3 -0
  8. data/lib/active_merchant/billing/credit_card_methods.rb +72 -13
  9. data/lib/active_merchant/billing/gateways/adyen.rb +24 -14
  10. data/lib/active_merchant/billing/gateways/allied_wallet.rb +7 -7
  11. data/lib/active_merchant/billing/gateways/authorize_net.rb +44 -12
  12. data/lib/active_merchant/billing/gateways/authorize_net_arb.rb +3 -4
  13. data/lib/active_merchant/billing/gateways/authorize_net_cim.rb +2 -1
  14. data/lib/active_merchant/billing/gateways/axcessms.rb +8 -9
  15. data/lib/active_merchant/billing/gateways/balanced.rb +4 -3
  16. data/lib/active_merchant/billing/gateways/bambora_apac.rb +7 -7
  17. data/lib/active_merchant/billing/gateways/bank_frick.rb +7 -7
  18. data/lib/active_merchant/billing/gateways/banwire.rb +1 -1
  19. data/lib/active_merchant/billing/gateways/barclaycard_smartpay.rb +6 -4
  20. data/lib/active_merchant/billing/gateways/beanstream.rb +3 -3
  21. data/lib/active_merchant/billing/gateways/beanstream/beanstream_core.rb +4 -5
  22. data/lib/active_merchant/billing/gateways/blue_pay.rb +2 -3
  23. data/lib/active_merchant/billing/gateways/blue_snap.rb +37 -12
  24. data/lib/active_merchant/billing/gateways/bogus.rb +19 -19
  25. data/lib/active_merchant/billing/gateways/borgun.rb +11 -11
  26. data/lib/active_merchant/billing/gateways/bpoint.rb +8 -8
  27. data/lib/active_merchant/billing/gateways/braintree.rb +1 -1
  28. data/lib/active_merchant/billing/gateways/braintree_blue.rb +13 -10
  29. data/lib/active_merchant/billing/gateways/bridge_pay.rb +7 -7
  30. data/lib/active_merchant/billing/gateways/cams.rb +8 -8
  31. data/lib/active_merchant/billing/gateways/card_connect.rb +1 -1
  32. data/lib/active_merchant/billing/gateways/card_save.rb +1 -1
  33. data/lib/active_merchant/billing/gateways/card_stream.rb +2 -2
  34. data/lib/active_merchant/billing/gateways/cardknox.rb +7 -7
  35. data/lib/active_merchant/billing/gateways/cardprocess.rb +1 -1
  36. data/lib/active_merchant/billing/gateways/cecabank.rb +5 -5
  37. data/lib/active_merchant/billing/gateways/cenpos.rb +10 -10
  38. data/lib/active_merchant/billing/gateways/checkout.rb +2 -2
  39. data/lib/active_merchant/billing/gateways/checkout_v2.rb +17 -20
  40. data/lib/active_merchant/billing/gateways/clearhaus.rb +7 -7
  41. data/lib/active_merchant/billing/gateways/commercegate.rb +1 -1
  42. data/lib/active_merchant/billing/gateways/conekta.rb +2 -2
  43. data/lib/active_merchant/billing/gateways/creditcall.rb +10 -10
  44. data/lib/active_merchant/billing/gateways/credorax.rb +26 -15
  45. data/lib/active_merchant/billing/gateways/ct_payment.rb +10 -10
  46. data/lib/active_merchant/billing/gateways/culqi.rb +9 -9
  47. data/lib/active_merchant/billing/gateways/cyber_source.rb +58 -36
  48. data/lib/active_merchant/billing/gateways/d_local.rb +11 -11
  49. data/lib/active_merchant/billing/gateways/data_cash.rb +2 -3
  50. data/lib/active_merchant/billing/gateways/decidir.rb +31 -10
  51. data/lib/active_merchant/billing/gateways/dibs.rb +8 -8
  52. data/lib/active_merchant/billing/gateways/digitzs.rb +5 -5
  53. data/lib/active_merchant/billing/gateways/ebanx.rb +9 -9
  54. data/lib/active_merchant/billing/gateways/efsnet.rb +2 -3
  55. data/lib/active_merchant/billing/gateways/elavon.rb +286 -225
  56. data/lib/active_merchant/billing/gateways/element.rb +8 -8
  57. data/lib/active_merchant/billing/gateways/evo_ca.rb +5 -6
  58. data/lib/active_merchant/billing/gateways/eway.rb +3 -4
  59. data/lib/active_merchant/billing/gateways/eway_managed.rb +6 -7
  60. data/lib/active_merchant/billing/gateways/eway_rapid.rb +19 -6
  61. data/lib/active_merchant/billing/gateways/exact.rb +8 -9
  62. data/lib/active_merchant/billing/gateways/ezic.rb +7 -7
  63. data/lib/active_merchant/billing/gateways/fat_zebra.rb +4 -4
  64. data/lib/active_merchant/billing/gateways/federated_canada.rb +2 -3
  65. data/lib/active_merchant/billing/gateways/first_giving.rb +1 -1
  66. data/lib/active_merchant/billing/gateways/first_pay.rb +6 -6
  67. data/lib/active_merchant/billing/gateways/firstdata_e4.rb +7 -7
  68. data/lib/active_merchant/billing/gateways/firstdata_e4_v27.rb +21 -10
  69. data/lib/active_merchant/billing/gateways/flo2cash.rb +8 -8
  70. data/lib/active_merchant/billing/gateways/flo2cash_simple.rb +1 -1
  71. data/lib/active_merchant/billing/gateways/forte.rb +14 -8
  72. data/lib/active_merchant/billing/gateways/global_collect.rb +35 -16
  73. data/lib/active_merchant/billing/gateways/global_transport.rb +7 -7
  74. data/lib/active_merchant/billing/gateways/hdfc.rb +9 -9
  75. data/lib/active_merchant/billing/gateways/hps.rb +17 -8
  76. data/lib/active_merchant/billing/gateways/iats_payments.rb +9 -4
  77. data/lib/active_merchant/billing/gateways/in_context_paypal_express.rb +1 -1
  78. data/lib/active_merchant/billing/gateways/inspire.rb +3 -4
  79. data/lib/active_merchant/billing/gateways/instapay.rb +1 -2
  80. data/lib/active_merchant/billing/gateways/ipp.rb +5 -5
  81. data/lib/active_merchant/billing/gateways/iridium.rb +14 -15
  82. data/lib/active_merchant/billing/gateways/iveri.rb +7 -7
  83. data/lib/active_merchant/billing/gateways/ixopay.rb +7 -7
  84. data/lib/active_merchant/billing/gateways/jetpay.rb +1 -2
  85. data/lib/active_merchant/billing/gateways/jetpay_v2.rb +4 -5
  86. data/lib/active_merchant/billing/gateways/kushki.rb +6 -6
  87. data/lib/active_merchant/billing/gateways/latitude19.rb +14 -14
  88. data/lib/active_merchant/billing/gateways/linkpoint.rb +4 -5
  89. data/lib/active_merchant/billing/gateways/litle.rb +31 -15
  90. data/lib/active_merchant/billing/gateways/mastercard.rb +10 -10
  91. data/lib/active_merchant/billing/gateways/mercado_pago.rb +7 -7
  92. data/lib/active_merchant/billing/gateways/merchant_e_solutions.rb +1 -2
  93. data/lib/active_merchant/billing/gateways/merchant_one.rb +1 -1
  94. data/lib/active_merchant/billing/gateways/merchant_partners.rb +10 -10
  95. data/lib/active_merchant/billing/gateways/merchant_ware.rb +5 -7
  96. data/lib/active_merchant/billing/gateways/merchant_ware_version_four.rb +4 -6
  97. data/lib/active_merchant/billing/gateways/mercury.rb +4 -4
  98. data/lib/active_merchant/billing/gateways/metrics_global.rb +4 -5
  99. data/lib/active_merchant/billing/gateways/micropayment.rb +8 -8
  100. data/lib/active_merchant/billing/gateways/migs.rb +3 -4
  101. data/lib/active_merchant/billing/gateways/modern_payments_cim.rb +2 -4
  102. data/lib/active_merchant/billing/gateways/monei.rb +7 -7
  103. data/lib/active_merchant/billing/gateways/moneris.rb +4 -3
  104. data/lib/active_merchant/billing/gateways/money_movers.rb +2 -3
  105. data/lib/active_merchant/billing/gateways/mundipagg.rb +37 -10
  106. data/lib/active_merchant/billing/gateways/nab_transact.rb +2 -4
  107. data/lib/active_merchant/billing/gateways/ncr_secure_pay.rb +7 -7
  108. data/lib/active_merchant/billing/gateways/net_registry.rb +1 -2
  109. data/lib/active_merchant/billing/gateways/netaxept.rb +6 -6
  110. data/lib/active_merchant/billing/gateways/netbanx.rb +19 -8
  111. data/lib/active_merchant/billing/gateways/netbilling.rb +4 -5
  112. data/lib/active_merchant/billing/gateways/network_merchants.rb +2 -3
  113. data/lib/active_merchant/billing/gateways/nmi.rb +21 -7
  114. data/lib/active_merchant/billing/gateways/ogone.rb +3 -3
  115. data/lib/active_merchant/billing/gateways/omise.rb +13 -13
  116. data/lib/active_merchant/billing/gateways/openpay.rb +3 -4
  117. data/lib/active_merchant/billing/gateways/opp.rb +9 -9
  118. data/lib/active_merchant/billing/gateways/optimal_payment.rb +2 -3
  119. data/lib/active_merchant/billing/gateways/orbital.rb +196 -85
  120. data/lib/active_merchant/billing/gateways/pac_net_raven.rb +3 -4
  121. data/lib/active_merchant/billing/gateways/pagarme.rb +8 -8
  122. data/lib/active_merchant/billing/gateways/pago_facil.rb +2 -2
  123. data/lib/active_merchant/billing/gateways/pay_conex.rb +8 -8
  124. data/lib/active_merchant/billing/gateways/pay_gate_xml.rb +6 -7
  125. data/lib/active_merchant/billing/gateways/pay_hub.rb +7 -8
  126. data/lib/active_merchant/billing/gateways/pay_junction.rb +2 -3
  127. data/lib/active_merchant/billing/gateways/pay_junction_v2.rb +9 -9
  128. data/lib/active_merchant/billing/gateways/pay_secure.rb +2 -3
  129. data/lib/active_merchant/billing/gateways/paybox_direct.rb +23 -1
  130. data/lib/active_merchant/billing/gateways/payeezy.rb +32 -14
  131. data/lib/active_merchant/billing/gateways/payex.rb +6 -7
  132. data/lib/active_merchant/billing/gateways/payflow.rb +1 -1
  133. data/lib/active_merchant/billing/gateways/payment_express.rb +8 -4
  134. data/lib/active_merchant/billing/gateways/paymentez.rb +26 -6
  135. data/lib/active_merchant/billing/gateways/paymill.rb +7 -7
  136. data/lib/active_merchant/billing/gateways/paypal.rb +10 -2
  137. data/lib/active_merchant/billing/gateways/paypal/paypal_common_api.rb +1 -0
  138. data/lib/active_merchant/billing/gateways/paypal_express.rb +1 -1
  139. data/lib/active_merchant/billing/gateways/paypal_express_common.rb +1 -1
  140. data/lib/active_merchant/billing/gateways/payscout.rb +1 -2
  141. data/lib/active_merchant/billing/gateways/paystation.rb +3 -4
  142. data/lib/active_merchant/billing/gateways/payu_in.rb +3 -3
  143. data/lib/active_merchant/billing/gateways/payu_latam.rb +17 -10
  144. data/lib/active_merchant/billing/gateways/payway.rb +8 -9
  145. data/lib/active_merchant/billing/gateways/pin.rb +11 -0
  146. data/lib/active_merchant/billing/gateways/plugnpay.rb +1 -2
  147. data/lib/active_merchant/billing/gateways/pro_pay.rb +8 -8
  148. data/lib/active_merchant/billing/gateways/psigate.rb +2 -3
  149. data/lib/active_merchant/billing/gateways/psl_card.rb +1 -2
  150. data/lib/active_merchant/billing/gateways/qbms.rb +1 -2
  151. data/lib/active_merchant/billing/gateways/quantum.rb +1 -2
  152. data/lib/active_merchant/billing/gateways/quickbooks.rb +1 -1
  153. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v10.rb +3 -4
  154. data/lib/active_merchant/billing/gateways/quickpay/quickpay_v4to7.rb +1 -2
  155. data/lib/active_merchant/billing/gateways/qvalent.rb +8 -8
  156. data/lib/active_merchant/billing/gateways/realex.rb +1 -1
  157. data/lib/active_merchant/billing/gateways/redsys.rb +86 -5
  158. data/lib/active_merchant/billing/gateways/s5.rb +7 -7
  159. data/lib/active_merchant/billing/gateways/safe_charge.rb +40 -14
  160. data/lib/active_merchant/billing/gateways/sage.rb +3 -5
  161. data/lib/active_merchant/billing/gateways/sage_pay.rb +2 -3
  162. data/lib/active_merchant/billing/gateways/sallie_mae.rb +1 -2
  163. data/lib/active_merchant/billing/gateways/secure_net.rb +1 -2
  164. data/lib/active_merchant/billing/gateways/secure_pay.rb +3 -4
  165. data/lib/active_merchant/billing/gateways/secure_pay_au.rb +2 -4
  166. data/lib/active_merchant/billing/gateways/secure_pay_tech.rb +1 -2
  167. data/lib/active_merchant/billing/gateways/securion_pay.rb +5 -6
  168. data/lib/active_merchant/billing/gateways/skip_jack.rb +2 -3
  169. data/lib/active_merchant/billing/gateways/smart_ps.rb +5 -6
  170. data/lib/active_merchant/billing/gateways/so_easy_pay.rb +7 -7
  171. data/lib/active_merchant/billing/gateways/spreedly_core.rb +6 -6
  172. data/lib/active_merchant/billing/gateways/stripe.rb +10 -10
  173. data/lib/active_merchant/billing/gateways/stripe_payment_intents.rb +30 -0
  174. data/lib/active_merchant/billing/gateways/swipe_checkout.rb +3 -4
  175. data/lib/active_merchant/billing/gateways/telr.rb +8 -8
  176. data/lib/active_merchant/billing/gateways/trans_first.rb +2 -2
  177. data/lib/active_merchant/billing/gateways/trans_first_transaction_express.rb +12 -12
  178. data/lib/active_merchant/billing/gateways/transact_pro.rb +9 -9
  179. data/lib/active_merchant/billing/gateways/trust_commerce.rb +1 -2
  180. data/lib/active_merchant/billing/gateways/usa_epay.rb +1 -1
  181. data/lib/active_merchant/billing/gateways/usa_epay_advanced.rb +32 -32
  182. data/lib/active_merchant/billing/gateways/usa_epay_transaction.rb +3 -4
  183. data/lib/active_merchant/billing/gateways/vanco.rb +3 -3
  184. data/lib/active_merchant/billing/gateways/verifi.rb +1 -2
  185. data/lib/active_merchant/billing/gateways/viaklix.rb +1 -2
  186. data/lib/active_merchant/billing/gateways/visanet_peru.rb +10 -10
  187. data/lib/active_merchant/billing/gateways/webpay.rb +2 -2
  188. data/lib/active_merchant/billing/gateways/wepay.rb +3 -2
  189. data/lib/active_merchant/billing/gateways/wirecard.rb +1 -2
  190. data/lib/active_merchant/billing/gateways/worldpay.rb +19 -11
  191. data/lib/active_merchant/billing/gateways/worldpay_online_payments.rb +14 -16
  192. data/lib/active_merchant/billing/gateways/worldpay_us.rb +7 -7
  193. data/lib/active_merchant/billing/response.rb +3 -2
  194. data/lib/active_merchant/country.rb +1 -1
  195. data/lib/active_merchant/network_connection_retries.rb +2 -2
  196. data/lib/active_merchant/post_data.rb +1 -1
  197. data/lib/active_merchant/posts_data.rb +1 -1
  198. data/lib/active_merchant/version.rb +1 -1
  199. data/lib/support/ssl_verify.rb +2 -2
  200. data/lib/support/ssl_version.rb +2 -2
  201. metadata +2 -2
@@ -447,8 +447,7 @@ module ActiveMerchant #:nodoc:
447
447
  test: test?,
448
448
  authorization: authorization_from(action, data),
449
449
  cvv_result: data['cvv'],
450
- avs_result: { code: data['avs'] }
451
- )
450
+ avs_result: { code: data['avs'] })
452
451
  end
453
452
 
454
453
  def parse(body)
@@ -12,7 +12,7 @@ module ActiveMerchant #:nodoc:
12
12
  # :software id or :live_url are passed in the options hash it will
13
13
  # create an instance of UsaEpayAdvancedGateway.
14
14
  #
15
- def self.new(options={})
15
+ def self.new(options = {})
16
16
  if options.has_key?(:software_id) || options.has_key?(:live_url)
17
17
  UsaEpayAdvancedGateway.new(options)
18
18
  else
@@ -289,7 +289,7 @@ module ActiveMerchant #:nodoc:
289
289
  #
290
290
  # Note: See run_transaction for additional options.
291
291
  #
292
- def purchase(money, creditcard, options={})
292
+ def purchase(money, creditcard, options = {})
293
293
  run_sale(options.merge!(amount: money, payment_method: creditcard))
294
294
  end
295
295
 
@@ -297,7 +297,7 @@ module ActiveMerchant #:nodoc:
297
297
  #
298
298
  # Note: See run_transaction for additional options.
299
299
  #
300
- def authorize(money, creditcard, options={})
300
+ def authorize(money, creditcard, options = {})
301
301
  run_auth_only(options.merge!(amount: money, payment_method: creditcard))
302
302
  end
303
303
 
@@ -305,7 +305,7 @@ module ActiveMerchant #:nodoc:
305
305
  #
306
306
  # Note: See run_transaction for additional options.
307
307
  #
308
- def capture(money, identification, options={})
308
+ def capture(money, identification, options = {})
309
309
  capture_transaction(options.merge!(amount: money, reference_number: identification))
310
310
  end
311
311
 
@@ -313,7 +313,7 @@ module ActiveMerchant #:nodoc:
313
313
  #
314
314
  # Note: See run_transaction for additional options.
315
315
  #
316
- def void(identification, options={})
316
+ def void(identification, options = {})
317
317
  void_transaction(options.merge!(reference_number: identification))
318
318
  end
319
319
 
@@ -321,11 +321,11 @@ module ActiveMerchant #:nodoc:
321
321
  #
322
322
  # Note: See run_transaction for additional options.
323
323
  #
324
- def refund(money, identification, options={})
324
+ def refund(money, identification, options = {})
325
325
  refund_transaction(options.merge!(amount: money, reference_number: identification))
326
326
  end
327
327
 
328
- def credit(money, identification, options={})
328
+ def credit(money, identification, options = {})
329
329
  ActiveMerchant.deprecated CREDIT_DEPRECATION_MESSAGE
330
330
  refund(money, identification, options)
331
331
  end
@@ -368,7 +368,7 @@ module ActiveMerchant #:nodoc:
368
368
  # ==== Response
369
369
  # * <tt>#message</tt> -- customer number assigned by gateway
370
370
  #
371
- def add_customer(options={})
371
+ def add_customer(options = {})
372
372
  request = build_request(__method__, options)
373
373
  commit(__method__, request)
374
374
  end
@@ -381,7 +381,7 @@ module ActiveMerchant #:nodoc:
381
381
  # ==== Options
382
382
  # * Same as add_customer
383
383
  #
384
- def update_customer(options={})
384
+ def update_customer(options = {})
385
385
  requires! options, :customer_number
386
386
 
387
387
  request = build_request(__method__, options)
@@ -429,7 +429,7 @@ module ActiveMerchant #:nodoc:
429
429
  # ==== Response
430
430
  # * <tt>#message</tt> -- boolean; Returns true if successful. Exception thrown all failures.
431
431
  #
432
- def quick_update_customer(options={})
432
+ def quick_update_customer(options = {})
433
433
  requires! options, :customer_number
434
434
  requires! options, :update_data
435
435
 
@@ -444,7 +444,7 @@ module ActiveMerchant #:nodoc:
444
444
  # ==== Required
445
445
  # * <tt>:customer_number</tt>
446
446
  #
447
- def enable_customer(options={})
447
+ def enable_customer(options = {})
448
448
  requires! options, :customer_number
449
449
 
450
450
  request = build_request(__method__, options)
@@ -456,7 +456,7 @@ module ActiveMerchant #:nodoc:
456
456
  # ==== Required
457
457
  # * <tt>:customer_number</tt>
458
458
  #
459
- def disable_customer(options={})
459
+ def disable_customer(options = {})
460
460
  requires! options, :customer_number
461
461
 
462
462
  request = build_request(__method__, options)
@@ -479,7 +479,7 @@ module ActiveMerchant #:nodoc:
479
479
  # ==== Response
480
480
  # * <tt>#message</tt> -- method_id of new customer payment method
481
481
  #
482
- def add_customer_payment_method(options={})
482
+ def add_customer_payment_method(options = {})
483
483
  requires! options, :customer_number
484
484
 
485
485
  request = build_request(__method__, options)
@@ -494,7 +494,7 @@ module ActiveMerchant #:nodoc:
494
494
  # ==== Response
495
495
  # * <tt>#message</tt> -- either a single hash or an array of hashes of payment methods
496
496
  #
497
- def get_customer_payment_methods(options={})
497
+ def get_customer_payment_methods(options = {})
498
498
  requires! options, :customer_number
499
499
 
500
500
  request = build_request(__method__, options)
@@ -510,7 +510,7 @@ module ActiveMerchant #:nodoc:
510
510
  # ==== Response
511
511
  # * <tt>#message</tt> -- hash of payment method
512
512
  #
513
- def get_customer_payment_method(options={})
513
+ def get_customer_payment_method(options = {})
514
514
  requires! options, :customer_number, :method_id
515
515
 
516
516
  request = build_request(__method__, options)
@@ -531,7 +531,7 @@ module ActiveMerchant #:nodoc:
531
531
  # ==== Response
532
532
  # * <tt>#message</tt> -- hash of payment method
533
533
  #
534
- def update_customer_payment_method(options={})
534
+ def update_customer_payment_method(options = {})
535
535
  requires! options, :method_id
536
536
 
537
537
  request = build_request(__method__, options)
@@ -544,7 +544,7 @@ module ActiveMerchant #:nodoc:
544
544
  # * <tt>:customer_number</tt>
545
545
  # * <tt>:method_id</tt>
546
546
  #
547
- def delete_customer_payment_method(options={})
547
+ def delete_customer_payment_method(options = {})
548
548
  requires! options, :customer_number, :method_id
549
549
 
550
550
  request = build_request(__method__, options)
@@ -556,7 +556,7 @@ module ActiveMerchant #:nodoc:
556
556
  # ==== Required
557
557
  # * <tt>:customer_number</tt>
558
558
  #
559
- def delete_customer(options={})
559
+ def delete_customer(options = {})
560
560
  requires! options, :customer_number
561
561
 
562
562
  request = build_request(__method__, options)
@@ -607,7 +607,7 @@ module ActiveMerchant #:nodoc:
607
607
  # ==== Response
608
608
  # * <tt>#message</tt> -- transaction response hash
609
609
  #
610
- def run_customer_transaction(options={})
610
+ def run_customer_transaction(options = {})
611
611
  requires! options, :customer_number, :command, :amount
612
612
 
613
613
  request = build_request(__method__, options)
@@ -671,7 +671,7 @@ module ActiveMerchant #:nodoc:
671
671
  # ==== Response
672
672
  # * <tt>#message</tt> -- transaction response hash
673
673
  #
674
- def run_transaction(options={})
674
+ def run_transaction(options = {})
675
675
  request = build_request(__method__, options)
676
676
  commit(__method__, request)
677
677
  end
@@ -699,7 +699,7 @@ module ActiveMerchant #:nodoc:
699
699
  # ==== Response
700
700
  # * <tt>#message</tt> -- transaction response hash
701
701
  #
702
- def post_auth(options={})
702
+ def post_auth(options = {})
703
703
  requires! options, :authorization_code
704
704
 
705
705
  request = build_request(__method__, options)
@@ -721,7 +721,7 @@ module ActiveMerchant #:nodoc:
721
721
  # ==== Response
722
722
  # * <tt>#message</tt> -- transaction response hash
723
723
  #
724
- def capture_transaction(options={})
724
+ def capture_transaction(options = {})
725
725
  requires! options, :reference_number
726
726
 
727
727
  request = build_request(__method__, options)
@@ -738,7 +738,7 @@ module ActiveMerchant #:nodoc:
738
738
  # ==== Response
739
739
  # * <tt>#message</tt> -- transaction response hash
740
740
  #
741
- def void_transaction(options={})
741
+ def void_transaction(options = {})
742
742
  requires! options, :reference_number
743
743
 
744
744
  request = build_request(__method__, options)
@@ -757,7 +757,7 @@ module ActiveMerchant #:nodoc:
757
757
  # ==== Response
758
758
  # * <tt>#message</tt> -- transaction response hash
759
759
  #
760
- def refund_transaction(options={})
760
+ def refund_transaction(options = {})
761
761
  requires! options, :reference_number, :amount
762
762
 
763
763
  request = build_request(__method__, options)
@@ -777,7 +777,7 @@ module ActiveMerchant #:nodoc:
777
777
  # ==== Response
778
778
  # * <tt>#message</tt> -- transaction response hash
779
779
  #
780
- def override_transaction(options={})
780
+ def override_transaction(options = {})
781
781
  requires! options, :reference_number
782
782
 
783
783
  request = build_request(__method__, options)
@@ -820,7 +820,7 @@ module ActiveMerchant #:nodoc:
820
820
  # ==== Response
821
821
  # * <tt>#message</tt> -- transaction response hash
822
822
  #
823
- def run_quick_sale(options={})
823
+ def run_quick_sale(options = {})
824
824
  requires! options, :reference_number, :amount
825
825
 
826
826
  request = build_request(__method__, options)
@@ -858,7 +858,7 @@ module ActiveMerchant #:nodoc:
858
858
  # ==== Response
859
859
  # * <tt>#message</tt> -- transaction response hash
860
860
  #
861
- def run_quick_credit(options={})
861
+ def run_quick_credit(options = {})
862
862
  requires! options, :reference_number
863
863
 
864
864
  request = build_request(__method__, options)
@@ -875,7 +875,7 @@ module ActiveMerchant #:nodoc:
875
875
  # ==== Response
876
876
  # * <tt>#message</tt> -- transaction hash
877
877
  #
878
- def get_transaction(options={})
878
+ def get_transaction(options = {})
879
879
  requires! options, :reference_number
880
880
 
881
881
  request = build_request(__method__, options)
@@ -892,7 +892,7 @@ module ActiveMerchant #:nodoc:
892
892
  # * <tt>response.message</tt> -- message of the referenced transaction
893
893
  # * <tt>response.authorization</tt> -- same as :reference_number in options
894
894
  #
895
- def get_transaction_status(options={})
895
+ def get_transaction_status(options = {})
896
896
  requires! options, :reference_number
897
897
 
898
898
  request = build_request(__method__, options)
@@ -990,7 +990,7 @@ module ActiveMerchant #:nodoc:
990
990
  # ==== Response
991
991
  # * <tt>#message</tt> -- hash; keys are the field values
992
992
  #
993
- def get_transaction_custom(options={})
993
+ def get_transaction_custom(options = {})
994
994
  requires! options, :reference_number, :fields
995
995
 
996
996
  request = build_request(__method__, options)
@@ -1005,7 +1005,7 @@ module ActiveMerchant #:nodoc:
1005
1005
  # ==== Response
1006
1006
  # * <tt>#message</tt> -- check trace hash
1007
1007
  #
1008
- def get_check_trace(options={})
1008
+ def get_check_trace(options = {})
1009
1009
  requires! options, :reference_number
1010
1010
 
1011
1011
  request = build_request(__method__, options)
@@ -1078,7 +1078,7 @@ module ActiveMerchant #:nodoc:
1078
1078
  end
1079
1079
  end
1080
1080
 
1081
- def build_customer(soap, options, type, add_customer_data=false)
1081
+ def build_customer(soap, options, type, add_customer_data = false)
1082
1082
  soap.tag! "ns1:#{type}" do
1083
1083
  build_token soap, options
1084
1084
  build_tag soap, :integer, 'CustNum', options[:customer_number]
@@ -1378,7 +1378,7 @@ module ActiveMerchant #:nodoc:
1378
1378
 
1379
1379
  # Transaction Helpers ===========================================
1380
1380
 
1381
- def build_transaction_request_object(soap, options, name='Params')
1381
+ def build_transaction_request_object(soap, options, name = 'Params')
1382
1382
  soap.tag! name, 'xsi:type' => 'ns1:TransactionRequestObject' do
1383
1383
  TRANSACTION_REQUEST_OBJECT_OPTIONS.each do |k, v|
1384
1384
  build_tag soap, v[0], v[1], options[k]
@@ -198,7 +198,7 @@ module ActiveMerchant #:nodoc:
198
198
  post[:description] = options[:description]
199
199
  end
200
200
 
201
- def add_payment(post, payment, options={})
201
+ def add_payment(post, payment, options = {})
202
202
  if payment.respond_to?(:routing_number)
203
203
  post[:checkformat] = options[:check_format] if options[:check_format]
204
204
  if payment.account_type
@@ -310,7 +310,7 @@ module ActiveMerchant #:nodoc:
310
310
  error_code: fields['UMerrorcode'],
311
311
  acs_url: fields['UMacsurl'],
312
312
  payload: fields['UMpayload']
313
- }.delete_if { |k, v| v.nil? }
313
+ }.delete_if { |_k, v| v.nil? }
314
314
  end
315
315
 
316
316
  def commit(action, parameters)
@@ -324,8 +324,7 @@ module ActiveMerchant #:nodoc:
324
324
  authorization: response[:ref_num],
325
325
  cvv_result: response[:cvv2_result_code],
326
326
  avs_result: { code: response[:avs_result_code] },
327
- error_code: error_code
328
- )
327
+ error_code: error_code)
329
328
  end
330
329
 
331
330
  def message_from(response)
@@ -15,19 +15,19 @@ module ActiveMerchant
15
15
  self.homepage_url = 'http://vancopayments.com/'
16
16
  self.display_name = 'Vanco Payment Solutions'
17
17
 
18
- def initialize(options={})
18
+ def initialize(options = {})
19
19
  requires!(options, :user_id, :password, :client_id)
20
20
  super
21
21
  end
22
22
 
23
- def purchase(money, payment_method, options={})
23
+ def purchase(money, payment_method, options = {})
24
24
  MultiResponse.run do |r|
25
25
  r.process { login }
26
26
  r.process { commit(purchase_request(money, payment_method, r.params['response_sessionid'], options), :response_transactionref) }
27
27
  end
28
28
  end
29
29
 
30
- def refund(money, authorization, options={})
30
+ def refund(money, authorization, options = {})
31
31
  MultiResponse.run do |r|
32
32
  r.process { login }
33
33
  r.process { commit(refund_request(money, authorization, r.params['response_sessionid']), :response_creditrequestreceived) }
@@ -198,8 +198,7 @@ module ActiveMerchant #:nodoc:
198
198
  test: test?,
199
199
  authorization: response[:transactionid],
200
200
  avs_result: { code: response[:avsresponse] },
201
- cvv_result: response[:cvvresponse]
202
- )
201
+ cvv_result: response[:cvvresponse])
203
202
  end
204
203
 
205
204
  def message_from(response)
@@ -140,8 +140,7 @@ module ActiveMerchant #:nodoc:
140
140
  test: @options[:test] || test?,
141
141
  authorization: authorization_from(response),
142
142
  avs_result: { code: response['avs_response'] },
143
- cvv_result: response['cvv2_response']
144
- )
143
+ cvv_result: response['cvv2_response'])
145
144
  end
146
145
 
147
146
  def authorization_from(response)
@@ -13,19 +13,19 @@ module ActiveMerchant #:nodoc:
13
13
  self.money_format = :dollars
14
14
  self.supported_cardtypes = %i[visa master american_express discover]
15
15
 
16
- def initialize(options={})
16
+ def initialize(options = {})
17
17
  requires!(options, :access_key_id, :secret_access_key, :merchant_id)
18
18
  super
19
19
  end
20
20
 
21
- def purchase(amount, payment_method, options={})
21
+ def purchase(amount, payment_method, options = {})
22
22
  MultiResponse.run() do |r|
23
23
  r.process { authorize(amount, payment_method, options) }
24
24
  r.process { capture(amount, r.authorization, options) }
25
25
  end
26
26
  end
27
27
 
28
- def authorize(amount, payment_method, options={})
28
+ def authorize(amount, payment_method, options = {})
29
29
  params = {}
30
30
 
31
31
  add_invoice(params, amount, options)
@@ -37,20 +37,20 @@ module ActiveMerchant #:nodoc:
37
37
  commit('authorize', params, options)
38
38
  end
39
39
 
40
- def capture(amount, authorization, options={})
40
+ def capture(amount, authorization, options = {})
41
41
  params = {}
42
42
  options[:id_unico] = split_authorization(authorization)[1]
43
43
  add_auth_order_id(params, authorization, options)
44
44
  commit('deposit', params, options)
45
45
  end
46
46
 
47
- def void(authorization, options={})
47
+ def void(authorization, options = {})
48
48
  params = {}
49
49
  add_auth_order_id(params, authorization, options)
50
50
  commit('void', params, options)
51
51
  end
52
52
 
53
- def refund(amount, authorization, options={})
53
+ def refund(amount, authorization, options = {})
54
54
  params = {}
55
55
  params[:amount] = amount(amount) if amount
56
56
  add_auth_order_id(params, authorization, options)
@@ -65,7 +65,7 @@ module ActiveMerchant #:nodoc:
65
65
  commit('refund', params, options)
66
66
  end
67
67
 
68
- def verify(credit_card, options={})
68
+ def verify(credit_card, options = {})
69
69
  MultiResponse.run(:use_first_response) do |r|
70
70
  r.process { authorize(100, credit_card, options) }
71
71
  r.process(:ignore_result) { void(r.authorization, options) }
@@ -85,7 +85,7 @@ module ActiveMerchant #:nodoc:
85
85
 
86
86
  private
87
87
 
88
- CURRENCY_CODES = Hash.new { |h, k| raise ArgumentError.new("Unsupported currency: #{k}") }
88
+ CURRENCY_CODES = Hash.new { |_h, k| raise ArgumentError.new("Unsupported currency: #{k}") }
89
89
  CURRENCY_CODES['USD'] = 840
90
90
  CURRENCY_CODES['PEN'] = 604
91
91
 
@@ -142,7 +142,7 @@ module ActiveMerchant #:nodoc:
142
142
  authorization.split('|')
143
143
  end
144
144
 
145
- def commit(action, params, options={})
145
+ def commit(action, params, options = {})
146
146
  raw_response = ssl_request(method(action), url(action, params, options), params.to_json, headers)
147
147
  response = parse(raw_response)
148
148
  rescue ResponseError => e
@@ -168,7 +168,7 @@ module ActiveMerchant #:nodoc:
168
168
  }
169
169
  end
170
170
 
171
- def url(action, params, options={})
171
+ def url(action, params, options = {})
172
172
  if action == 'authorize'
173
173
  "#{base_url}/#{@options[:merchant_id]}"
174
174
  elsif action == 'refund'
@@ -51,7 +51,7 @@ module ActiveMerchant #:nodoc:
51
51
  MultiResponse.run(:first) do |r|
52
52
  r.process { commit(:post, "customers/#{CGI.escape(options[:customer])}/", post, options) }
53
53
 
54
- return r unless options[:set_default] and r.success? and !r.params['id'].blank?
54
+ return r unless options[:set_default] && r.success? && !r.params['id'].blank?
55
55
 
56
56
  r.process { update_customer(options[:customer], default_card: r.params['id']) }
57
57
  end
@@ -89,7 +89,7 @@ module ActiveMerchant #:nodoc:
89
89
  'Authorization' => 'Basic ' + Base64.encode64(@api_key.to_s + ':').strip,
90
90
  'User-Agent' => "Webpay/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
91
91
  'X-Webpay-Client-User-Agent' => user_agent,
92
- 'X-Webpay-Client-User-Metadata' => {ip: options[:ip]}.to_json
92
+ 'X-Webpay-Client-User-Metadata' => { ip: options[:ip] }.to_json
93
93
  }
94
94
  end
95
95
  end