Class: EPlat::Order

Inherits:
Base
  • Object
show all
Includes:
Concerns::Metafieldable
Defined in:
lib/e_plat/resource/order.rb

Defined Under Namespace

Classes: BillingAddress, Consignment, Fulfillment, LineItem, ShippingAddress, ShippingLine

Constant Summary

Constants included from Concerns::GraphQLable

Concerns::GraphQLable::FILTER_ARGS, Concerns::GraphQLable::QUERY_ARG_ARGS

Instance Attribute Summary

Attributes inherited from Base

#mapped_attributes, #mapping

Attributes included from Concerns::Aliases

#type_coercer

Instance Method Summary collapse

Methods included from Concerns::Metafieldable

#add_metafield, #find_metafield, #metafields

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

#count

Methods included from Concerns::GraphQLable

#graphql_mutation_string, #mutate_graphql, #remove_mutation_root_from

Methods included from Concerns::Aliases

#add_aliases!

Methods included from Concerns::FullJson

#as_full_json, #to_full_json

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

Instance Method Details

#cancel(options = {}) ⇒ Object



106
107
108
109
110
111
112
113
# File 'lib/e_plat/resource/order.rb', line 106

def cancel(options = {})
	if client.bigcommerce?
		self.status_id = 5
		save
	else
		load_attributes_from_response(post(:cancel, {}, options.to_json))
	end
end

#cancelled?Boolean

Returns:

  • (Boolean)


115
116
117
118
119
120
121
122
# File 'lib/e_plat/resource/order.rb', line 115

def cancelled?
	case client.platform
	when :shopify
		cancelled_at.present?
	when :bigcommerce
		status_id == 5
	end
end