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, subscription_id: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::RefundListItem>
- #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.
87 88 89 |
# File 'lib/dodopayments/resources/refunds.rb', line 87 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, subscription_id: nil, request_options: {}) ⇒ Dodopayments::Internal::DefaultPageNumberPagination<Dodopayments::Models::RefundListItem>
71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/dodopayments/resources/refunds.rb', line 71 def list(params = {}) parsed, = Dodopayments::RefundListParams.dump_request(params) query = Dodopayments::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "refunds", query: query, page: Dodopayments::Internal::DefaultPageNumberPagination, model: Dodopayments::RefundListItem, 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 |