Class: EPlat::RecurringApplicationCharge
- Defined in:
- lib/e_plat/resource/shopify_only/recurring_application_charge.rb,
lib/e_plat/resource/shopify_only/recurring_application_charge/usage_charge.rb
Direct Known Subclasses
Shopify::RecurringApplicationCharge, ShopifyWebhook::RecurringApplicationCharge
Defined Under Namespace
Classes: UsageCharge
Constant Summary
Constants included from Concerns::GraphQLable
Concerns::GraphQLable::FILTER_ARGS, Concerns::GraphQLable::QUERY_ARG_ARGS
Instance Attribute Summary
Attributes inherited from Base
Attributes included from Concerns::Aliases
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
cached_shopify_webhook?, client, #client, exclude_from_json, #formatted_id, #graphql_input, #headers, #include_root_in_json, inherited, #initialize, initialize_singleton!, #mapped?, #native_keys, platform_specific_class?, prefix=, #read_only?
Methods included from Countable
Methods included from Concerns::GraphQLable
#graphql_mutation_string, #mutate_graphql, #remove_mutation_root_from
Methods included from Concerns::Aliases
Methods included from Concerns::FullJson
Methods included from Concerns::OverwriteRequestMethods
#collection_path, #element_path, included
Methods included from Concerns::OverwriteInstanceMethods
#as_eplat_json, #as_json, #create, #create_resource_for, #to_eplat_json, #to_json, #update
Constructor Details
This class inherits a constructor from EPlat::Base
Class Method Details
.current ⇒ Object
24 25 26 |
# File 'lib/e_plat/resource/shopify_only/recurring_application_charge.rb', line 24 def self.current (all || []).find { |c| c.status == 'active' } end |
Instance Method Details
#cancel ⇒ Object
38 39 40 |
# File 'lib/e_plat/resource/shopify_only/recurring_application_charge.rb', line 38 def cancel self.destroy end |
#save ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/e_plat/resource/shopify_only/recurring_application_charge.rb', line 28 def save if new_record? super else load_attributes_from_response( put(:customize, {}, to_json) ) end end |
#usage_charges ⇒ Object
42 43 44 |
# File 'lib/e_plat/resource/shopify_only/recurring_application_charge.rb', line 42 def usage_charges RecurringApplicationCharge::UsageCharge.find(:all, params: {recurring_application_charge: id}) end |