Class: AuthorizeNet::ARB::Subscription
- Inherits:
-
Object
- Object
- AuthorizeNet::ARB::Subscription
- Includes:
- Model
- Defined in:
- lib/authorize_net/arb/subscription.rb
Overview
Models an ARB subscription.
Defined Under Namespace
Modules: IntervalUnits, Status
Constant Summary collapse
- UNLIMITED_OCCURRENCES =
Use this constant for the value of total_occurrences to get a subscription with no end.
9999
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#billing_address ⇒ Object
Returns the value of attribute billing_address.
-
#credit_card ⇒ Object
Returns the value of attribute credit_card.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#description ⇒ Object
Returns the value of attribute description.
-
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
-
#length ⇒ Object
Returns the value of attribute length.
-
#name ⇒ Object
Returns the value of attribute name.
-
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
-
#start_date ⇒ Object
Returns the value of attribute start_date.
-
#subscription_id ⇒ Object
Returns the value of attribute subscription_id.
-
#total_occurrences ⇒ Object
Returns the value of attribute total_occurrences.
-
#trial_amount ⇒ Object
Returns the value of attribute trial_amount.
-
#trial_occurrences ⇒ Object
Returns the value of attribute trial_occurrences.
-
#unit ⇒ Object
Returns the value of attribute unit.
Instance Method Summary collapse
Methods included from Model
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def amount @amount end |
#billing_address ⇒ Object
Returns the value of attribute billing_address.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def billing_address @billing_address end |
#credit_card ⇒ Object
Returns the value of attribute credit_card.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def credit_card @credit_card end |
#customer ⇒ Object
Returns the value of attribute customer.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def customer @customer end |
#description ⇒ Object
Returns the value of attribute description.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def description @description end |
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def invoice_number @invoice_number end |
#length ⇒ Object
Returns the value of attribute length.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def length @length end |
#name ⇒ Object
Returns the value of attribute name.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def name @name end |
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def shipping_address @shipping_address end |
#start_date ⇒ Object
Returns the value of attribute start_date.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def start_date @start_date end |
#subscription_id ⇒ Object
Returns the value of attribute subscription_id.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def subscription_id @subscription_id end |
#total_occurrences ⇒ Object
Returns the value of attribute total_occurrences.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def total_occurrences @total_occurrences end |
#trial_amount ⇒ Object
Returns the value of attribute trial_amount.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def trial_amount @trial_amount end |
#trial_occurrences ⇒ Object
Returns the value of attribute trial_occurrences.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def trial_occurrences @trial_occurrences end |
#unit ⇒ Object
Returns the value of attribute unit.
26 27 28 |
# File 'lib/authorize_net/arb/subscription.rb', line 26 def unit @unit end |
Instance Method Details
#to_hash ⇒ Object
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/authorize_net/arb/subscription.rb', line 49 def to_hash hash = { :subscription_name => @name, :subscription_length => @length, :subscription_unit => @unit, :subscription_start_date => @start_date, :subscription_total_occurrences => @total_occurrences, :subscription_trial_occurrences => @trial_occurrences, :subscription_amount => @amount, :subscription_trial_amount => @trial_amount, :invoice_num => @invoice_number, :description => @description, :subscription_id => @subscription_id } hash.merge!(@credit_card.to_hash) unless @credit_card.nil? hash.merge!(@billing_address.to_hash) unless @billing_address.nil? hash.merge!(@shipping_address.to_hash) unless @shipping_address.nil? hash.merge!(@customer.to_hash) unless @customer.nil? hash.delete_if {|k, v| v.nil?} end |