lib/active_merchant/billing/gateways/paymill.rb in activemerchant-1.43.3 vs lib/active_merchant/billing/gateways/paymill.rb in activemerchant-1.44.0
- old
+ new
@@ -3,11 +3,11 @@
class PaymillGateway < Gateway
self.supported_countries = %w(AD AT BE BG CH CY CZ DE DK EE ES FI FO FR GB
GI GR HR HU IE IL IM IS IT LI LT LU LV MC MT
NL NO PL PT RO SE SI SK TR VA)
- self.supported_cardtypes = [:visa, :master]
+ 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'
@@ -28,10 +28,11 @@
post = {}
add_amount(post, money, options)
post[:preauthorization] = preauth(authorization)
post[:description] = options[:description]
+ post[:source] = 'active_merchant'
commit(:post, 'transactions', post)
end
def refund(money, authorization, options={})
post = {}
@@ -114,18 +115,21 @@
post = {}
add_amount(post, money, options)
post[:token] = card_token
post[:description] = options[:description]
+ post[:source] = 'active_merchant'
commit(:post, 'transactions', post)
end
def authorize_with_token(money, card_token, options)
post = {}
add_amount(post, money, options)
post[:token] = card_token
+ post[:description] = options[:description]
+ post[:source] = 'active_merchant'
commit(:post, 'preauthorizations', post)
end
def save_card(credit_card)
post = {}
@@ -230,10 +234,12 @@
RESPONSE_CODES[code] || code.to_s
end
class ResponseParser
+ attr_reader :raw_response, :parsed, :succeeded, :message, :options
+
def initialize(raw_response="", options={})
@raw_response = raw_response
@options = options
end
@@ -247,10 +253,9 @@
Response.new(succeeded, message, parsed, options)
end
private
- attr_reader :raw_response, :parsed, :succeeded, :message, :options
def parse_response
@parsed = JSON.parse(raw_response.sub(/jsonPFunction\(/, '').sub(/\)\z/, ''))
end