class ShopifyAPI::Checkout

Attributes

applied_discount[R]
billing_address[R]
buyer_accepts_marketing[R]
created_at[R]
currency[R]
customer_id[R]
discount_code[R]
email[R]
gift_cards[R]
line_items[R]
order[R]
payment_due[R]
payment_url[R]
phone[R]
presentment_currency[R]
requires_shipping[R]
reservation_time[R]
reservation_time_left[R]
shipping_address[R]
shipping_line[R]
shipping_rate[R]
source_identifier[R]
source_name[R]
source_url[R]
subtotal_price[R]
tax_lines[R]
taxes_included[R]
token[R]
total_price[R]
total_tax[R]
updated_at[R]
user_id[R]
web_url[R]

Public Class Methods

find( token:, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/checkout.rb, line 154
def find(
  token:,
  session: ShopifyAPI::Context.active_session
)
  result = base_find(
    session: session,
    ids: {token: token},
    params: {},
  )
  T.cast(result[0], T.nilable(Checkout))
end
new(session: ShopifyAPI::Context.active_session, from_hash: nil) click to toggle source
Calls superclass method ShopifyAPI::Rest::Base::new
# File lib/shopify_api/rest/resources/2022_04/checkout.rb, line 19
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

  @billing_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
  @line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
  @applied_discount = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
  @buyer_accepts_marketing = T.let(nil, T.nilable(T::Boolean))
  @created_at = T.let(nil, T.nilable(String))
  @currency = T.let(nil, T.nilable(String))
  @customer_id = T.let(nil, T.nilable(Integer))
  @discount_code = T.let(nil, T.nilable(DiscountCode))
  @email = T.let(nil, T.nilable(String))
  @gift_cards = T.let(nil, T.nilable(T::Array[T.untyped]))
  @order = T.let(nil, T.nilable(Order))
  @payment_due = T.let(nil, T.nilable(String))
  @payment_url = T.let(nil, T.nilable(String))
  @phone = T.let(nil, T.nilable(String))
  @presentment_currency = T.let(nil, T.nilable(String))
  @requires_shipping = T.let(nil, T.nilable(T::Boolean))
  @reservation_time = T.let(nil, T.nilable(String))
  @reservation_time_left = T.let(nil, T.nilable(Integer))
  @shipping_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
  @shipping_line = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
  @shipping_rate = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
  @source_identifier = T.let(nil, T.nilable(String))
  @source_name = T.let(nil, T.nilable(String))
  @source_url = T.let(nil, T.nilable(String))
  @subtotal_price = T.let(nil, T.nilable(String))
  @tax_lines = T.let(nil, T.nilable(T::Array[T.untyped]))
  @taxes_included = T.let(nil, T.nilable(T::Boolean))
  @token = T.let(nil, T.nilable(String))
  @total_price = T.let(nil, T.nilable(String))
  @total_tax = T.let(nil, T.nilable(String))
  @updated_at = T.let(nil, T.nilable(String))
  @user_id = T.let(nil, T.nilable(Integer))
  @web_url = T.let(nil, T.nilable(String))

  super(session: session, from_hash: from_hash)
end
primary_key() click to toggle source
# File lib/shopify_api/rest/resources/2022_04/checkout.rb, line 144
def primary_key()
  "token"
end
shipping_rates( token:, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/checkout.rb, line 173
def shipping_rates(
  token:,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  request(
    http_method: :get,
    operation: :shipping_rates,
    session: session,
    ids: {token: token},
    params: {}.merge(kwargs).compact,
    body: {},
    entity: nil,
  )
end

Public Instance Methods

complete( body: nil, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/checkout.rb, line 197
def complete(
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :post,
    operation: :complete,
    session: @session,
    ids: {token: @token},
    params: {}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end