lib/active_merchant/billing/gateways/eway.rb in activemerchant-1.4.2 vs lib/active_merchant/billing/gateways/eway.rb in activemerchant-1.5.0
- old
+ new
@@ -129,11 +129,11 @@
"96" => "System Error"
}
self.money_format = :cents
self.supported_countries = ['AU']
- self.supported_cardtypes = [:visa, :master]
+ self.supported_cardtypes = [:visa, :master, :american_express]
self.homepage_url = 'http://www.eway.com.au/'
self.display_name = 'eWAY'
def initialize(options = {})
requires!(options, :login)
@@ -153,11 +153,15 @@
# The request fails if all of the fields aren't present
add_optional_data(post)
commit(money, post)
end
-
+
+ def test?
+ @options[:test] || super
+ end
+
private
def add_creditcard(post, creditcard)
post[:CardNumber] = creditcard.number
post[:CardExpiryMonth] = sprintf("%.2i", creditcard.month)
post[:CardExpiryYear] = sprintf("%.4i", creditcard.year)[-2..-1]
@@ -265,8 +269,9 @@
test ? TEST_CVN_URL : LIVE_CVN_URL
else
test ? TEST_URL : LIVE_URL
end
end
+
end
end
end