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

- old
+ new

@@ -15,11 +15,11 @@ def initialize(options = {}) requires!(options, :public_key, :private_key) super end - def purchase(money, payment_method, options={}) + def purchase(money, payment_method, options = {}) action_with_token(:purchase, money, payment_method, options) end def authorize(money, payment_method, options = {}) action_with_token(:authorize, money, payment_method, options) @@ -33,23 +33,23 @@ post[:description] = options[:order_id] post[:source] = 'active_merchant' commit(:post, 'transactions', post) end - def refund(money, authorization, options={}) + def refund(money, authorization, options = {}) post = {} post[:amount] = amount(money) post[:description] = options[:order_id] commit(:post, "refunds/#{transaction_id(authorization)}", post) end - def void(authorization, options={}) + def void(authorization, options = {}) commit(:delete, "preauthorizations/#{preauth(authorization)}") end - def store(credit_card, options={}) + def store(credit_card, options = {}) # The store request requires a currency and amount of at least $1 USD. # This is used for an authorization that is handled internally by Paymill. options[:currency] = 'USD' options[:money] = 100 @@ -92,11 +92,11 @@ def headers { 'Authorization' => ('Basic ' + Base64.strict_encode64("#{@options[:private_key]}:X").chomp) } end - def commit(method, action, parameters=nil) + def commit(method, action, parameters = nil) begin raw_response = ssl_request(method, live_url + action, post_data(parameters), headers) rescue ResponseError => e begin parsed = JSON.parse(e.response.body) @@ -196,11 +196,11 @@ end def post_data(params) return nil unless params - no_blanks = params.reject { |key, value| value.blank? } + no_blanks = params.reject { |_key, value| value.blank? } no_blanks.map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.join('&') end def add_amount(post, money, options) post[:amount] = amount(money) @@ -326,10 +326,10 @@ end class ResponseParser attr_reader :raw_response, :parsed, :succeeded, :message, :options - def initialize(raw_response='', options={}) + def initialize(raw_response = '', options = {}) @raw_response = raw_response @options = options end def generate_response