lib/active_merchant/billing/gateways/trust_commerce.rb in activemerchant-1.4.1 vs lib/active_merchant/billing/gateways/trust_commerce.rb in activemerchant-1.4.2
- old
+ new
@@ -99,10 +99,13 @@
"dnsfailure" => "The TCLink software was unable to resolve DNS hostnames",
"linkfailure" => "The connection was established, but was severed before the transaction could complete",
"failtoprocess" => "The bank servers are offline and unable to authorize transactions"
}
+ TEST_LOGIN = 'TestMerchant'
+ TEST_PASSWORD = 'password'
+
self.money_format = :cents
self.supported_cardtypes = [:visa, :master, :discover, :american_express, :diners_club, :jcb]
self.supported_countries = ['US']
self.homepage_url = 'http://www.trustcommerce.com/'
self.display_name = 'TrustCommerce'
@@ -135,10 +138,11 @@
def tclink?
self.class.tclink?
end
def test?
- @options[:test] || super
+ @options[:login] == TEST_LOGIN &&
+ @options[:password] == TEST_PASSWORD || @options[:test] || super
end
# authorize() is the first half of the preauth(authorize)/postauth(capture) model. The TC API docs call this
# preauth, we preserve active_merchant's nomenclature of authorize() for consistency with the rest of the library. This
# method simply checks to make sure funds are available for a transaction, and returns a transid that can be used later to
\ No newline at end of file