class Recharge::Subscription
Constants
- COLLECTION
- PATH
- SINGLE
Public Class Methods
activate(id)
click to toggle source
Activate a subscription
Arguments¶ ↑
- id (Integer)
-
ID of subscription to cancel
Returns¶ ↑
Recharge::Subscription
-
The activated subscription
Errors¶ ↑
Recharge::ConnectionError, Recharge::RequestError
If the subscription was already activated a Recharge::RequestError
will be raised
# File lib/recharge/classes.rb, line 559 def self.activate(id) id_required!(id) instance(POST(join(id, "activate"), :status => "active")) end
cancel(id, reason)
click to toggle source
Cancel a subscription
Arguments¶ ↑
- id (Integer)
-
ID of subscription to cancel
- reason (String)
-
Reason for the cancellation
Returns¶ ↑
Recharge::Subscription
-
The canceled subscription
Errors¶ ↑
Recharge::ConnectionError, Recharge::RequestError
If the subscription was already canceled a Recharge::RequestError
will be raised
# File lib/recharge/classes.rb, line 582 def self.cancel(id, reason) id_required!(id) instance(POST(join(id, "cancel"), :cancellation_reason => reason)) end
list(options = nil)
click to toggle source
Calls superclass method
# File lib/recharge/classes.rb, line 592 def self.list(options = nil) #options[:status] = options[:status].upcase if options[:status] super(convert_date_params(options, :created_at, :created_at_max, :updated_at, :updated_at_max)) end
set_next_charge_date(id, date)
click to toggle source
# File lib/recharge/classes.rb, line 587 def self.set_next_charge_date(id, date) id_required!(id) instance(POST(join(id, "set_next_charge_date"), :date => date_param(date))) end