class ShopifyAPI::Refund

Attributes

created_at[R]
duties[R]
id[R]
note[R]
order_adjustments[R]
order_id[R]
processed_at[R]
refund_duties[R]
refund_line_items[R]
restock[R]
transactions[R]
user_id[R]

Public Class Methods

all( order_id: nil, limit: nil, fields: nil, in_shop_currency: nil, session: ShopifyAPI::Context.active_session, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/refund.rb, line 108
def all(
  order_id: nil,
  limit: nil,
  fields: nil,
  in_shop_currency: nil,
  session: ShopifyAPI::Context.active_session,
  **kwargs
)
  response = base_find(
    session: session,
    ids: {order_id: order_id},
    params: {limit: limit, fields: fields, in_shop_currency: in_shop_currency}.merge(kwargs).compact,
  )

  T.cast(response, T::Array[Refund])
end
find( id:, order_id: nil, fields: nil, in_shop_currency: nil, session: ShopifyAPI::Context.active_session ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/refund.rb, line 83
def find(
  id:,
  order_id: nil,
  fields: nil,
  in_shop_currency: nil,
  session: ShopifyAPI::Context.active_session
)
  result = base_find(
    session: session,
    ids: {id: id, order_id: order_id},
    params: {fields: fields, in_shop_currency: in_shop_currency},
  )
  T.cast(result[0], T.nilable(Refund))
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/refund.rb, line 19
def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)

  @created_at = T.let(nil, T.nilable(String))
  @duties = T.let(nil, T.nilable(T::Array[T.untyped]))
  @id = T.let(nil, T.nilable(Integer))
  @note = T.let(nil, T.nilable(String))
  @order_adjustments = T.let(nil, T.nilable(T::Array[T.untyped]))
  @order_id = T.let(nil, T.nilable(Integer))
  @processed_at = T.let(nil, T.nilable(String))
  @refund_duties = T.let(nil, T.nilable(T::Array[T.untyped]))
  @refund_line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
  @restock = T.let(nil, T.nilable(T::Boolean))
  @transactions = T.let(nil, T.nilable(T::Array[T.untyped]))
  @user_id = T.let(nil, T.nilable(Integer))

  super(session: session, from_hash: from_hash)
end

Public Instance Methods

calculate( shipping: nil, refund_line_items: nil, currency: nil, body: nil, **kwargs ) click to toggle source
# File lib/shopify_api/rest/resources/2022_04/refund.rb, line 136
def calculate(
  shipping: nil,
  refund_line_items: nil,
  currency: nil,
  body: nil,
  **kwargs
)
  self.class.request(
    http_method: :post,
    operation: :calculate,
    session: @session,
    ids: {order_id: @order_id},
    params: {shipping: shipping, refund_line_items: refund_line_items, currency: currency}.merge(kwargs).compact,
    body: body,
    entity: self,
  )
end