Class: Yoomoney::Resources::Refunds
- Inherits:
-
Object
- Object
- Yoomoney::Resources::Refunds
- Defined in:
- lib/yoomoney/resources/refunds.rb
Instance Method Summary collapse
-
#create(amount:, payment_id:, idempotence_key:, deal: nil, description: nil, metadata: nil, receipt: nil, refund_method_data: nil, sources: nil, request_options: {}) ⇒ Yoomoney::Models::Refund
Some parameter documentations has been truncated, see Models::RefundCreateParams for more details.
-
#initialize(client:) ⇒ Refunds
constructor
private
A new instance of Refunds.
-
#list(created_at: nil, cursor: nil, limit: nil, payment_id: nil, status: nil, request_options: {}) ⇒ Yoomoney::Models::RefundListResponse
Список возвратов.
-
#retrieve(refund_id, request_options: {}) ⇒ Yoomoney::Models::Refund
Информация о возврате.
Constructor Details
#initialize(client:) ⇒ Refunds
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Refunds.
96 97 98 |
# File 'lib/yoomoney/resources/refunds.rb', line 96 def initialize(client:) @client = client end |
Instance Method Details
#create(amount:, payment_id:, idempotence_key:, deal: nil, description: nil, metadata: nil, receipt: nil, refund_method_data: nil, sources: nil, request_options: {}) ⇒ Yoomoney::Models::Refund
Some parameter documentations has been truncated, see Models::RefundCreateParams for more details.
Создание возврата
36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/yoomoney/resources/refunds.rb', line 36 def create(params) parsed, = Yoomoney::RefundCreateParams.dump_request(params) header_params = {idempotence_key: "idempotence-key"} @client.request( method: :post, path: "refunds", headers: parsed.slice(*header_params.keys).transform_keys(header_params), body: parsed.except(*header_params.keys), model: Yoomoney::Refund, options: ) end |
#list(created_at: nil, cursor: nil, limit: nil, payment_id: nil, status: nil, request_options: {}) ⇒ Yoomoney::Models::RefundListResponse
Список возвратов
82 83 84 85 86 87 88 89 90 91 |
# File 'lib/yoomoney/resources/refunds.rb', line 82 def list(params = {}) parsed, = Yoomoney::RefundListParams.dump_request(params) @client.request( method: :get, path: "refunds", query: parsed, model: Yoomoney::Models::RefundListResponse, options: ) end |
#retrieve(refund_id, request_options: {}) ⇒ Yoomoney::Models::Refund
Информация о возврате
59 60 61 62 63 64 65 66 |
# File 'lib/yoomoney/resources/refunds.rb', line 59 def retrieve(refund_id, params = {}) @client.request( method: :get, path: ["refunds/%1$s", refund_id], model: Yoomoney::Refund, options: params[:request_options] ) end |