Class: Dodopayments::Resources::Refunds
- Inherits:
-
Object
- Object
- Dodopayments::Resources::Refunds
- Defined in:
- lib/dodopayments/resources/refunds.rb
Instance Method Summary collapse
- #create(payment_id: , items: nil, metadata: nil, reason: nil, request_options: {}) ⇒ Dodopayments::Models::Refund
-
#initialize(client:) ⇒ Refunds
constructor
private
A new instance of Refunds.
- #list(created_at_gte: nil, created_at_lte: nil, customer_id: nil, page_number: nil, page_size: nil, status: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::RefundListResponse>
- #retrieve(refund_id, request_options: {}) ⇒ Dodopayments::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.
84 85 86 |
# File 'lib/dodopayments/resources/refunds.rb', line 84 def initialize(client:) @client = client end |
Instance Method Details
#create(payment_id: , items: nil, metadata: nil, reason: nil, request_options: {}) ⇒ Dodopayments::Models::Refund
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/dodopayments/resources/refunds.rb', line 21 def create(params) parsed, = Dodopayments::RefundCreateParams.dump_request(params) @client.request( method: :post, path: "refunds", body: parsed, model: Dodopayments::Refund, options: ) end |
#list(created_at_gte: nil, created_at_lte: nil, customer_id: nil, page_number: nil, page_size: nil, status: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::RefundListResponse>
69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/dodopayments/resources/refunds.rb', line 69 def list(params = {}) parsed, = Dodopayments::RefundListParams.dump_request(params) @client.request( method: :get, path: "refunds", query: parsed, page: Dodopayments::Internal::DefaultPageNumberPagination, model: Dodopayments::Models::RefundListResponse, options: ) end |
#retrieve(refund_id, request_options: {}) ⇒ Dodopayments::Models::Refund
41 42 43 44 45 46 47 48 |
# File 'lib/dodopayments/resources/refunds.rb', line 41 def retrieve(refund_id, params = {}) @client.request( method: :get, path: ["refunds/%1$s", refund_id], model: Dodopayments::Refund, options: params[:request_options] ) end |