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.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def amount @amount end |
#billing_address ⇒ Object
Returns the value of attribute billing_address.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def billing_address @billing_address end |
#credit_card ⇒ Object
Returns the value of attribute credit_card.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def credit_card @credit_card end |
#customer ⇒ Object
Returns the value of attribute customer.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def customer @customer end |
#description ⇒ Object
Returns the value of attribute description.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def description @description end |
#invoice_number ⇒ Object
Returns the value of attribute invoice_number.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def invoice_number @invoice_number end |
#length ⇒ Object
Returns the value of attribute length.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def length @length end |
#name ⇒ Object
Returns the value of attribute name.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def name @name end |
#shipping_address ⇒ Object
Returns the value of attribute shipping_address.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def shipping_address @shipping_address end |
#start_date ⇒ Object
Returns the value of attribute start_date.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def start_date @start_date end |
#subscription_id ⇒ Object
Returns the value of attribute subscription_id.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def subscription_id @subscription_id end |
#total_occurrences ⇒ Object
Returns the value of attribute total_occurrences.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def total_occurrences @total_occurrences end |
#trial_amount ⇒ Object
Returns the value of attribute trial_amount.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def trial_amount @trial_amount end |
#trial_occurrences ⇒ Object
Returns the value of attribute trial_occurrences.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def trial_occurrences @trial_occurrences end |
#unit ⇒ Object
Returns the value of attribute unit.
24 25 26 |
# File 'lib/authorize_net/arb/subscription.rb', line 24 def unit @unit end |
Instance Method Details
#to_hash ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/authorize_net/arb/subscription.rb', line 47 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 |