lib/active_merchant/billing/gateways/smart_ps.rb in activemerchant-1.86.0 vs lib/active_merchant/billing/gateways/smart_ps.rb in activemerchant-1.87.0

- old
+ new

@@ -21,11 +21,11 @@ # customer_vault_id the gateway should use (make sure it's # unique). def authorize(money, creditcard, options = {}) post = {} add_invoice(post, options) - add_payment_source(post, creditcard,options) + add_payment_source(post, creditcard, options) add_address(post, options[:billing_address] || options[:address]) add_address(post, options[:shipping_address], 'shipping') add_customer_data(post, options) add_currency(post, money, options) add_taxes(post, options) @@ -63,11 +63,11 @@ post = {} add_invoice(post, options) add_payment_source(post, payment_source, options) add_address(post, options[:billing_address] || options[:address]) add_customer_data(post, options) - add_sku(post,options) + add_sku(post, options) add_currency(post, money, options) add_processor(post, options) commit('credit', money, post) end @@ -136,11 +136,11 @@ if options.has_key? :ip post[:ipaddress] = options[:ip] end end - def add_address(post, address,prefix='') + def add_address(post, address, prefix='') prefix +='_' unless prefix.blank? unless address.blank? or address.values.blank? post[prefix+'address1'] = address[:address1].to_s post[prefix+'address2'] = address[:address2].to_s unless address[:address2].blank? post[prefix+'company'] = address[:company].to_s @@ -204,11 +204,11 @@ post[:checkaccount] = check.account_number # The customer's account number post[:account_holder_type] = check.account_holder_type # The customer's type of ACH account post[:account_type] = check.account_type # The customer's type of ACH account end - def add_sku(post,options) + def add_sku(post, options) post['product_sku_#'] = options[:sku] || options['product_sku_#'] end def add_transaction(post, auth) post[:transactionid] = auth @@ -219,20 +219,20 @@ end def parse(body) results = {} body.split(/&/).each do |pair| - key,val = pair.split(/=/) + key, val = pair.split(/=/) results[key] = val end results end def commit(action, money, parameters) parameters[:amount] = localized_amount(money, parameters[:currency] || default_currency) if money - response = parse( ssl_post(self.live_url, post_data(action,parameters)) ) + response = parse(ssl_post(self.live_url, post_data(action, parameters))) Response.new(response['response'] == '1', message_from(response), response, :authorization => (response['transactionid'] || response['customer_vault_id']), :test => test?, :cvv_result => response['cvvresponse'], :avs_result => { :code => response['avsresponse'] } @@ -261,10 +261,10 @@ post = {} post[:username] = @options[:login] post[:password] = @options[:password] post[:type] = action if action - request = post.merge(parameters).map {|key,value| "#{key}=#{CGI.escape(value.to_s)}"}.join('&') + request = post.merge(parameters).map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&') request end def determine_funding_source(source) case