Class: AuthorizeNet::Transaction

Inherits:
DataObject show all
Defined in:
lib/authorize_net/transaction.rb

Constant Summary collapse

ATTRIBUTES =
{
  :id => {:key => "transId"},
  :timestamp_local => {:key => "submitTimeLocal"},
  :timestamp_utc => {:key => "submitTimeUTC"},
  :type => {:key => "transactionType"},
  :status => {:key => "transactionStatus"},
  :account_num => {:key => "accountNumber"},
  :account_type => {:key => "accountType"},
  :auth_code => {:key => "authCode"},
  :credit_card => {
    :key => "creditCard",
    :type => AuthorizeNet::DataObject::TYPE_OBJECT,
    :class => AuthorizeNet::CreditCard,
  },
  :customer_profile => {
    :key => "customer",
    :type => AuthorizeNet::DataObject::TYPE_OBJECT,
    :class => AuthorizeNet::CustomerProfile,
  },
  :billing_address => {
    :key => "billTo",
    :type => AuthorizeNet::DataObject::TYPE_OBJECT,
    :class => AuthorizeNet::Address,
  },
}

Constants inherited from DataObject

DataObject::TYPE_ARRAY, DataObject::TYPE_OBJECT, DataObject::TYPE_OBJECT_ARRAY

Instance Method Summary collapse

Methods inherited from DataObject

parse, #serialize, #to_h

Instance Method Details

#parse(xml) ⇒ Object



39
40
41
42
43
44
45
46
47
# File 'lib/authorize_net/transaction.rb', line 39

def parse(xml)
  super

  merchant_id = AuthorizeNet::Util.getXmlValue(xml, 'customer id')
  if !merchant_id.nil?
    @customer_profile ||= AuthorizeNet::CustomerProfile.new
    @customer_profile.merchant_id = merchant_id
  end
end