Class: ShopifyAPI::RecurringApplicationCharge

Inherits:
Base
  • Object
show all
Defined in:
lib/shopify_api/resources/recurring_application_charge.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

activate_session, api_version, api_version=, #as_json, clear_session, early_july_pagination?, #encode, headers, init_prefix, init_prefix_explicit, #persisted?, prefix, prefix=, prefix_source, resource_prefix, resource_prefix=, version_validation!

Methods included from Countable

#count

Class Method Details

.currentObject


7
8
9
# File 'lib/shopify_api/resources/recurring_application_charge.rb', line 7

def current
  (all || []).find { |c| c.status == 'active' }
end

Instance Method Details

#activateObject


24
25
26
# File 'lib/shopify_api/resources/recurring_application_charge.rb', line 24

def activate
  load_attributes_from_response(post(:activate))
end

#cancelObject


20
21
22
# File 'lib/shopify_api/resources/recurring_application_charge.rb', line 20

def cancel
  load_attributes_from_response(self.destroy)
end

#customize(customize_recurring_app_charge_params = {}) ⇒ Object


28
29
30
31
32
# File 'lib/shopify_api/resources/recurring_application_charge.rb', line 28

def customize(customize_recurring_app_charge_params = {})
  load_attributes_from_response(
    put(:customize, recurring_application_charge: customize_recurring_app_charge_params)
  )
end

#usage_chargesObject


16
17
18
# File 'lib/shopify_api/resources/recurring_application_charge.rb', line 16

def usage_charges
  UsageCharge.find(:all, params: { recurring_application_charge_id: id })
end