Class: ShopifyAPI::Checkout
- Inherits:
-
Base
- Object
- ActiveResource::Base
- Base
- ShopifyAPI::Checkout
show all
- Defined in:
- lib/shopify_api/resources/checkout.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, init_prefix, init_prefix_explicit, #persisted?, prefix, prefix=, prefix_source, resource_prefix, resource_prefix=, version_validation!
Methods included from Countable
#count
Class Method Details
7
8
9
|
# File 'lib/shopify_api/resources/checkout.rb', line 7
def self.
super.merge('X-Shopify-Checkout-Version' => '2016-09-06')
end
|
Instance Method Details
#complete ⇒ Object
11
12
13
|
# File 'lib/shopify_api/resources/checkout.rb', line 11
def complete
post(:complete)
end
|
#payments ⇒ Object
22
23
24
|
# File 'lib/shopify_api/resources/checkout.rb', line 22
def payments
Payment.find(:all, params: { checkout_id: id })
end
|
#ready? ⇒ Boolean
15
16
17
18
19
20
|
# File 'lib/shopify_api/resources/checkout.rb', line 15
def ready?
return false unless persisted?
reload
[200, 201].include?(ShopifyAPI::Base.connection.response.code.to_i)
end
|
#shipping_rates ⇒ Object
26
27
28
|
# File 'lib/shopify_api/resources/checkout.rb', line 26
def shipping_rates
ShippingRate.find(:all, params: { checkout_id: id })
end
|