lib/active_merchant/billing/gateways/quantum.rb in jelaniharris-activemerchant-1.24.1 vs lib/active_merchant/billing/gateways/quantum.rb in jelaniharris-activemerchant-1.29.1

- old
+ new

@@ -8,11 +8,11 @@ # * You can force email of receipt with :email_receipt => true # * You can force email of merchant receipt with :merchant_receipt => true # * You can exclude CVV with :ignore_cvv => true # * All transactions use dollar values. class QuantumGateway < Gateway - LIVE_URL = 'https://secure.quantumgateway.com/cgi/xml_requester.php' + self.live_url = self.test_url = 'https://secure.quantumgateway.com/cgi/xml_requester.php' # visa, master, american_express, discover self.supported_cardtypes = [:visa, :master, :american_express, :discover] self.supported_countries = ['US'] self.default_currency = 'USD' @@ -35,19 +35,13 @@ # :ignore_avs => true ignore both AVS and CVV verification # :ignore_cvv => true don't want to use CVV so continue processing even if CVV would have failed # def initialize(options = {}) requires!(options, :login, :password) - @options = options super end - # Should run against the test servers or not? - def test? - @options[:test] || Base.gateway_mode == :test - end - # Request an authorization for an amount from CyberSource # def authorize(money, creditcard, options = {}) setup_address_hash(options) commit(build_auth_request(money, creditcard, options), options ) @@ -208,11 +202,11 @@ end # Contact CyberSource, make the SOAP request, and parse the reply into a Response object def commit(request, options) headers = { 'Content-Type' => 'text/xml' } - response = parse(ssl_post(LIVE_URL, build_request(request, options), headers)) + response = parse(ssl_post(self.live_url, build_request(request, options), headers)) success = response[:request_status] == "Success" message = response[:request_message] if success # => checking for connectivity success first @@ -266,14 +260,14 @@ reply[node.name.to_sym] = node.text end end return reply end - + def authorization_for(reply) "#{reply[:TransactionID]};#{reply[:CreditCardNumber]}" end - + def authorization_parts_from(authorization) authorization.split(/;/) end end