Class: Cardflex::Subscription
- Inherits:
-
Object
- Object
- Cardflex::Subscription
- Includes:
- BaseModule
- Defined in:
- lib/cardflex/subscription.rb
Defined Under Namespace
Modules: Type
Instance Attribute Summary collapse
-
#action_type ⇒ Object
readonly
Returns the value of attribute action_type.
-
#billing ⇒ Object
readonly
Returns the value of attribute billing.
-
#plan ⇒ Object
readonly
Returns the value of attribute plan.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#result_code ⇒ Object
readonly
Returns the value of attribute result_code.
-
#result_text ⇒ Object
readonly
Returns the value of attribute result_text.
-
#shipping ⇒ Object
readonly
Returns the value of attribute shipping.
-
#subscription_id ⇒ Object
readonly
Returns the value of attribute subscription_id.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(gateway, attributes) ⇒ Subscription
constructor
A new instance of Subscription.
Methods included from BaseModule
Methods included from BaseModule::ClassMethods
#create_helper_methods, #set_instance_variables_from_hash, #snakecase
Constructor Details
#initialize(gateway, attributes) ⇒ Subscription
Returns a new instance of Subscription.
13 14 15 16 17 |
# File 'lib/cardflex/subscription.rb', line 13 def initialize(gateway, attributes) @gateway = gateway @type = attributes[:action_type] set_instance_variables_from_hash(attributes) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Cardflex::BaseModule
Instance Attribute Details
#action_type ⇒ Object (readonly)
Returns the value of attribute action_type.
9 10 11 |
# File 'lib/cardflex/subscription.rb', line 9 def action_type @action_type end |
#billing ⇒ Object (readonly)
Returns the value of attribute billing.
11 12 13 |
# File 'lib/cardflex/subscription.rb', line 11 def billing @billing end |
#plan ⇒ Object (readonly)
Returns the value of attribute plan.
11 12 13 |
# File 'lib/cardflex/subscription.rb', line 11 def plan @plan end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
9 10 11 |
# File 'lib/cardflex/subscription.rb', line 9 def result @result end |
#result_code ⇒ Object (readonly)
Returns the value of attribute result_code.
9 10 11 |
# File 'lib/cardflex/subscription.rb', line 9 def result_code @result_code end |
#result_text ⇒ Object (readonly)
Returns the value of attribute result_text.
9 10 11 |
# File 'lib/cardflex/subscription.rb', line 9 def result_text @result_text end |
#shipping ⇒ Object (readonly)
Returns the value of attribute shipping.
11 12 13 |
# File 'lib/cardflex/subscription.rb', line 11 def shipping @shipping end |
#subscription_id ⇒ Object (readonly)
Returns the value of attribute subscription_id.
10 11 12 |
# File 'lib/cardflex/subscription.rb', line 10 def subscription_id @subscription_id end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
11 12 13 |
# File 'lib/cardflex/subscription.rb', line 11 def type @type end |
Class Method Details
.delete(subscription_id) ⇒ Object
19 20 21 22 |
# File 'lib/cardflex/subscription.rb', line 19 def self.delete(subscription_id) attributes = { :delete_subscription => { :subscription_id => subscription_id }} Configuration.gateway.subscription.request(attributes) end |