lib/active_merchant/billing/gateways/paymill.rb in activemerchant-1.47.0 vs lib/active_merchant/billing/gateways/paymill.rb in activemerchant-1.48.0

- old
+ new

@@ -8,10 +8,11 @@ self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :discover, :union_pay, :jcb] self.homepage_url = 'https://paymill.com' self.display_name = 'PAYMILL' self.money_format = :cents self.default_currency = 'EUR' + self.live_url = "https://api.paymill.com/v2/" def initialize(options = {}) requires!(options, :public_key, :private_key) super end @@ -61,12 +62,12 @@ def headers { 'Authorization' => ('Basic ' + Base64.strict_encode64("#{@options[:private_key]}:X").chomp) } end - def commit(method, url, parameters=nil) + def commit(method, action, parameters=nil) begin - raw_response = ssl_request(method, "https://api.paymill.com/v2/#{url}", post_data(parameters), headers) + raw_response = ssl_request(method, live_url + action, post_data(parameters), headers) rescue ResponseError => e begin parsed = JSON.parse(e.response.body) rescue JSON::ParserError return Response.new(false, "Unable to parse error response: '#{e.response.body}'")