class AuthorizeNet::XmlTransaction
The ARB
transaction class.
Constants
Public Class Methods
DO NOT USE. Instantiate AuthorizeNet::ARB::Transaction
or AuthorizeNet::CIM::Transaction
instead.
AuthorizeNet::Transaction::new
# File lib/authorize_net/xml_transaction.rb, line 68 def initialize(api_login_id, api_transaction_key, options = {}) super() @api_login_id = api_login_id @api_transaction_key = api_transaction_key @response ||= nil @type ||= nil options = @@option_defaults.merge(options) @verify_ssl = options[:verify_ssl] @reference_id = options[:reference_id] @gateway = case options[:gateway].to_s when 'sandbox', 'test' Gateway::TEST when 'production', 'live' Gateway::LIVE else @gateway = options[:gateway] options[:gateway] end end
Public Instance Methods
Checks to see if the transaction has a response (meaning it has been submitted to the gateway). Returns TRUE if a response is present, FALSE otherwise.
# File lib/authorize_net/xml_transaction.rb, line 116 def has_response? !@response.nil? end
Retrieve the response object (or Nil if transaction hasn't been sent to the gateway).
# File lib/authorize_net/xml_transaction.rb, line 121 def response @response end
Submits the transaction to the gateway for processing. Returns a response object. If the transaction has already been run, it will return nil.
# File lib/authorize_net/xml_transaction.rb, line 127 def run make_request end
# File lib/authorize_net/xml_transaction.rb, line 90 def setOAuthOptions() if !@options_OAuth.blank? @options_OAuth = @@option_defaults.merge(@options_OAuth) @verify_ssl = options_OAuth[:verify_ssl] @reference_id = options_OAuth[:reference_id] @gateway = case options_OAuth[:gateway].to_s when 'sandbox', 'test' Gateway::TEST when 'production', 'live' Gateway::LIVE else @gateway = options_OAuth[:gateway] options_OAuth[:gateway] end end end
Checks if the transaction has been configured for the sandbox or not. Return FALSE if the transaction is running against the production, TRUE otherwise.
# File lib/authorize_net/xml_transaction.rb, line 110 def test? @gateway != Gateway::LIVE end
Returns a deep-copy of the XML object sent to the payment gateway. Or nil if there was no XML payload.
# File lib/authorize_net/xml_transaction.rb, line 132 def xml @xml end