lib/active_merchant/billing/gateways/borgun.rb in activemerchant-1.79.2 vs lib/active_merchant/billing/gateways/borgun.rb in activemerchant-1.80.0

- old
+ new

@@ -1,11 +1,11 @@ -require "nokogiri" +require 'nokogiri' module ActiveMerchant #:nodoc: module Billing #:nodoc: class BorgunGateway < Gateway - self.display_name = "Borgun" + self.display_name = 'Borgun' self.homepage_url = 'http://www.borgun.com' self.test_url = 'https://gatewaytest.borgun.is/ws/Heimir.pub.ws:Authorization' self.live_url = 'https://gateway01.borgun.is/ws/Heimir.pub.ws:Authorization' @@ -75,13 +75,13 @@ end private CURRENCY_CODES = Hash.new{|h,k| raise ArgumentError.new("Unsupported currency for HDFC: #{k}")} - CURRENCY_CODES["ISK"] = "352" - CURRENCY_CODES["EUR"] = "978" - CURRENCY_CODES["USD"] = "840" + CURRENCY_CODES['ISK'] = '352' + CURRENCY_CODES['EUR'] = '978' + CURRENCY_CODES['USD'] = '840' def add_invoice(post, money, options) post[:TrAmount] = amount(money) post[:TrCurrency] = CURRENCY_CODES[options[:currency] || currency(money)] post[:TerminalID] = options[:terminal_id] || '1' @@ -89,16 +89,16 @@ def add_payment_method(post, payment_method) post[:PAN] = payment_method.number post[:ExpDate] = format(payment_method.year, :two_digits) + format(payment_method.month, :two_digits) post[:CVC2] = payment_method.verification_value - post[:DateAndTime] = Time.now.strftime("%y%m%d%H%M%S") + post[:DateAndTime] = Time.now.strftime('%y%m%d%H%M%S') post[:RRN] = 'AMRCNT' + six_random_digits end def add_reference(post, authorization) - dateandtime, batch, transaction, rrn, authcode, _, _, _ = split_authorization(authorization) + dateandtime, _batch, transaction, rrn, authcode, _, _, _ = split_authorization(authorization) post[:DateAndTime] = dateandtime post[:Transaction] = transaction post[:RRN] = rrn post[:AuthCode] = authcode end @@ -149,11 +149,11 @@ (response[:actioncode] == '000') end def message_from(succeeded, response) if succeeded - "Succeeded" + 'Succeeded' else response[:message] || "Error with ActionCode=#{response[:actioncode]}" end end @@ -165,14 +165,14 @@ response[:rrn], response[:authcode], response[:transtype], response[:tramount], response[:trcurrency] - ].join("|") + ].join('|') end def split_authorization(authorization) - dateandtime, batch, transaction, rrn, authcode, transtype, tramount, currency = authorization.split("|") + dateandtime, batch, transaction, rrn, authcode, transtype, tramount, currency = authorization.split('|') [dateandtime, batch, transaction, rrn, authcode, transtype, tramount, currency] end def headers {