class ShopifyAPI::Refund
Attributes
Public Class Methods
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
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
Source
# 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
Calls superclass method
ShopifyAPI::Rest::Base::new
Public Instance Methods
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