Class: ShopifyAPI::Refund
- Inherits:
-
ShopifyAPI::Rest::Base
- Object
- ShopifyAPI::Rest::Base
- ShopifyAPI::Refund
- Extended by:
- T::Sig
- Defined in:
- lib/shopify_api/rest/resources/2022_04/refund.rb,
lib/shopify_api/rest/resources/2022_07/refund.rb,
lib/shopify_api/rest/resources/2022_10/refund.rb,
lib/shopify_api/rest/resources/2023_01/refund.rb,
lib/shopify_api/rest/resources/2023_04/refund.rb,
lib/shopify_api/rest/resources/2023_07/refund.rb,
lib/shopify_api/rest/resources/2023_10/refund.rb,
lib/shopify_api/rest/resources/2024_01/refund.rb,
lib/shopify_api/rest/resources/2024_04/refund.rb,
lib/shopify_api/rest/resources/2024_07/refund.rb,
lib/shopify_api/rest/resources/2024_10/refund.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#duties ⇒ Object
readonly
Returns the value of attribute duties.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#note ⇒ Object
readonly
Returns the value of attribute note.
-
#order_adjustments ⇒ Object
readonly
Returns the value of attribute order_adjustments.
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#processed_at ⇒ Object
readonly
Returns the value of attribute processed_at.
-
#refund_duties ⇒ Object
readonly
Returns the value of attribute refund_duties.
-
#refund_line_items ⇒ Object
readonly
Returns the value of attribute refund_line_items.
-
#restock ⇒ Object
readonly
Returns the value of attribute restock.
-
#transactions ⇒ Object
readonly
Returns the value of attribute transactions.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Attributes inherited from ShopifyAPI::Rest::Base
Class Method Summary collapse
- .all(order_id: nil, limit: nil, fields: nil, in_shop_currency: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
- .find(id:, order_id: nil, fields: nil, in_shop_currency: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
Instance Method Summary collapse
- #calculate(shipping: nil, refund_line_items: nil, currency: nil, body: nil, **kwargs) ⇒ Object
-
#initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) ⇒ Refund
constructor
A new instance of Refund.
Methods inherited from ShopifyAPI::Rest::Base
api_call_limit, base_find, class_name, create_instance, create_instances_from_response, #delete, get_path, get_path_ids, has_many?, has_one?, inherited, json_body_name, json_response_body_names, #method_missing, next_page?, next_page_info, prev_page?, prev_page_info, primary_key, read_only_attributes, request, #respond_to_missing?, retry_request_after, #save, #save!, #to_hash
Constructor Details
#initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) ⇒ Refund
Returns a new instance of Refund.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# 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 |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ShopifyAPI::Rest::Base
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
49 50 51 |
# File 'lib/shopify_api/rest/resources/2022_04/refund.rb', line 49 def created_at @created_at end |
#duties ⇒ Object (readonly)
Returns the value of attribute duties.
51 52 53 |
# File 'lib/shopify_api/rest/resources/2022_04/refund.rb', line 51 def duties @duties end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
53 54 55 |
# File 'lib/shopify_api/rest/resources/2022_04/refund.rb', line 53 def id @id end |
#note ⇒ Object (readonly)
Returns the value of attribute note.
55 56 57 |
# File 'lib/shopify_api/rest/resources/2022_04/refund.rb', line 55 def note @note end |
#order_adjustments ⇒ Object (readonly)
Returns the value of attribute order_adjustments.
57 58 59 |
# File 'lib/shopify_api/rest/resources/2022_04/refund.rb', line 57 def order_adjustments @order_adjustments end |
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
59 60 61 |
# File 'lib/shopify_api/rest/resources/2022_04/refund.rb', line 59 def order_id @order_id end |
#processed_at ⇒ Object (readonly)
Returns the value of attribute processed_at.
61 62 63 |
# File 'lib/shopify_api/rest/resources/2022_04/refund.rb', line 61 def processed_at @processed_at end |
#refund_duties ⇒ Object (readonly)
Returns the value of attribute refund_duties.
63 64 65 |
# File 'lib/shopify_api/rest/resources/2022_04/refund.rb', line 63 def refund_duties @refund_duties end |
#refund_line_items ⇒ Object (readonly)
Returns the value of attribute refund_line_items.
65 66 67 |
# File 'lib/shopify_api/rest/resources/2022_04/refund.rb', line 65 def refund_line_items @refund_line_items end |
#restock ⇒ Object (readonly)
Returns the value of attribute restock.
67 68 69 |
# File 'lib/shopify_api/rest/resources/2022_04/refund.rb', line 67 def restock @restock end |
#transactions ⇒ Object (readonly)
Returns the value of attribute transactions.
69 70 71 |
# File 'lib/shopify_api/rest/resources/2022_04/refund.rb', line 69 def transactions @transactions end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
71 72 73 |
# File 'lib/shopify_api/rest/resources/2022_04/refund.rb', line 71 def user_id @user_id end |
Class Method Details
.all(order_id: nil, limit: nil, fields: nil, in_shop_currency: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
# 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) ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
# 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 |
Instance Method Details
#calculate(shipping: nil, refund_line_items: nil, currency: nil, body: nil, **kwargs) ⇒ Object
136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# 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 |