lib/active_merchant/billing/gateways/dibs.rb in activemerchant-1.114.0 vs lib/active_merchant/billing/gateways/dibs.rb in activemerchant-1.116.0

- old
+ new

@@ -9,23 +9,23 @@ self.supported_countries = %w[US FI NO SE GB] self.default_currency = 'USD' self.money_format = :cents self.supported_cardtypes = %i[visa master american_express discover] - def initialize(options={}) + def initialize(options = {}) requires!(options, :merchant_id, :secret_key) super end - def purchase(amount, payment_method, options={}) + def purchase(amount, payment_method, options = {}) MultiResponse.run(false) do |r| r.process { authorize(amount, payment_method, options) } r.process { capture(amount, r.authorization, options) } end end - def authorize(amount, payment_method, options={}) + def authorize(amount, payment_method, options = {}) post = {} add_amount(post, amount) add_invoice(post, amount, options) if payment_method.respond_to?(:number) add_payment_method(post, payment_method, options) @@ -34,34 +34,34 @@ add_ticket_id(post, payment_method) commit(:authorize_ticket, post) end end - def capture(amount, authorization, options={}) + def capture(amount, authorization, options = {}) post = {} add_amount(post, amount) add_reference(post, authorization) commit(:capture, post) end - def void(authorization, options={}) + def void(authorization, options = {}) post = {} add_reference(post, authorization) commit(:void, post) end - def refund(amount, authorization, options={}) + def refund(amount, authorization, options = {}) post = {} add_amount(post, amount) add_reference(post, authorization) commit(:refund, post) end - def verify(credit_card, options={}) + def verify(credit_card, options = {}) MultiResponse.run(:use_first_response) do |r| r.process { authorize(100, credit_card, options) } r.process(:ignore_result) { void(r.authorization, options) } end end @@ -85,10 +85,10 @@ gsub(%r(("cvc\\?":\\?")[^"]*)i, '\1[FILTERED]') end private - CURRENCY_CODES = Hash.new { |h, k| raise ArgumentError.new("Unsupported currency: #{k}") } + CURRENCY_CODES = Hash.new { |_h, k| raise ArgumentError.new("Unsupported currency: #{k}") } CURRENCY_CODES['USD'] = '840' CURRENCY_CODES['DKK'] = '208' CURRENCY_CODES['NOK'] = '578' CURRENCY_CODES['SEK'] = '752' CURRENCY_CODES['GBP'] = '826'