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

- old
+ new

@@ -17,41 +17,41 @@ 'master' => 'MC', 'american_express' => 'AMEX', 'diners_club' => 'DINERS' } - def initialize(options={}) + def initialize(options = {}) requires!(options, :username, :password, :account_id) super end - def purchase(amount, payment_method, options={}) + def purchase(amount, payment_method, options = {}) MultiResponse.run 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_invoice(post, amount, options) add_payment_method(post, payment_method) add_customer_data(post, options) commit('ProcessAuthorise', post) end - def capture(amount, authorization, options={}) + def capture(amount, authorization, options = {}) post = {} add_invoice(post, amount, options) add_reference(post, authorization) add_customer_data(post, options) commit('ProcessCapture', post) end - def refund(amount, authorization, options={}) + def refund(amount, authorization, options = {}) post = {} add_invoice(post, amount, options) add_reference(post, authorization) add_customer_data(post, options) @@ -69,11 +69,11 @@ gsub(%r((<CardCSC>)[^<]+(<))i, '\1[FILTERED]\2') 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['NZD'] = '554' def add_invoice(post, money, options) post[:Amount] = amount(money) post[:Reference] = options[:order_id] @@ -140,19 +140,19 @@ body = xml.target! envelope_wrap(action, body) end def envelope_wrap(action, body) - <<~EOS + <<~XML <?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <#{action} xmlns="http://www.flo2cash.co.nz/webservices/paymentwebservice"> #{body} </#{action}> </soap12:Body> </soap12:Envelope> - EOS + XML end def url (test? ? test_url : live_url) end