Class: AuthorizeNet::PaymentProfile

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

Constant Summary collapse

ATTRIBUTES =
{
  :id => {:key => "customerPaymentProfileId"},
  :credit_card => {
    :key => "creditCard",
    :type => AuthorizeNet::DataObject::TYPE_OBJECT,
    :class => AuthorizeNet::CreditCard,
  },
  :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, parse, #serialize

Instance Method Details

#to_hObject

Override



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/authorize_net/payment_profile.rb', line 26

def to_h
  hash = super

  hash.delete('creditCard')
  if !@credit_card.nil?
    hash['payment'] = {
      'creditCard' => @credit_card.to_h
    }
  end

  return hash
end