Class: ActsAsSubscription::Subscription::Backend::RecurlyClient
- Inherits:
-
Object
- Object
- ActsAsSubscription::Subscription::Backend::RecurlyClient
- Defined in:
- lib/acts_as_subscription/backend/recurly_client.rb
Overview
A backend for the Recurly recurring billing service.
Instance Method Summary collapse
-
#cancel_subscription!(customer_code) ⇒ Object
Cancels the customer with the given
customer_code
on the backend subscription service. -
#create_subscription(subscription) ⇒ Object
Creates a customer on the backend subscription service, using the settings from the given
subscription
instance. -
#initialize(user, password, product_code) ⇒ RecurlyClient
constructor
Initializes the backend, and authenticates with the subscription service.
-
#update_subscription(subscription) ⇒ Object
Updates a customer on the backend subscription service, using the settings from the given
subscription
instance.
Constructor Details
#initialize(user, password, product_code) ⇒ RecurlyClient
Initializes the backend, and authenticates with the subscription service.
Required parameters are :
-
user
: The login used to connect to the remote API. -
password
: The password used to connect to the remote API. -
product_code
: The code for the product being sold.
14 15 16 |
# File 'lib/acts_as_subscription/backend/recurly_client.rb', line 14 def initialize(user, password, product_code) false end |
Instance Method Details
#cancel_subscription!(customer_code) ⇒ Object
Cancels the customer with the given customer_code
on the backend subscription service.
Returns true if the cancellation was successful, or false otherwise.
51 52 53 |
# File 'lib/acts_as_subscription/backend/recurly_client.rb', line 51 def cancel_subscription!(customer_code) false end |
#create_subscription(subscription) ⇒ Object
Creates a customer on the backend subscription service, using the settings from the given subscription
instance.
subscription
should be a subclass of ActiveRecord::Base
that implements acts_as_subscription
:
class Subscription < ActiveRecord::Base
acts_as_subscription
end
Returns true if the operation was successful, otherwise an error message.
29 30 31 |
# File 'lib/acts_as_subscription/backend/recurly_client.rb', line 29 def create_subscription(subscription) false end |
#update_subscription(subscription) ⇒ Object
Updates a customer on the backend subscription service, using the settings from the given subscription
instance.
subscription
should be a subclass of ActiveRecord::Base
that implements acts_as_subscription
:
class Subscription < ActiveRecord::Base
acts_as_subscription
end
Returns true if the update was successful, otherwise an error message.
44 45 46 |
# File 'lib/acts_as_subscription/backend/recurly_client.rb', line 44 def update_subscription(subscription) false end |