Class: Pago::V2026_04::Services::Disputes
- Defined in:
- lib/pago/v2026_04/services/disputes.rb,
sig/pago/v2026_04/generated.rbs
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#accept(id) ⇒ Models::Dispute
Accept a dispute, conceding the chargeback.
-
#get(id) ⇒ Models::Dispute
Get a dispute by ID.
-
#list(organization_id: nil, order_id: nil, status: nil, page: 1, limit: 10, sorting: ["-created_at"]) ⇒ Models::ListResourceDispute
List disputes.
-
#list_each(organization_id: nil, order_id: nil, status: nil, limit: 10, sorting: ["-created_at"]) {|item| ... } ⇒ Pago::Paginator
Enumerate every item of
list, fetching pages on demand.
Methods inherited from Service
Constructor Details
This class inherits a constructor from Pago::Service
Instance Method Details
#accept(id) ⇒ Models::Dispute
Accept a dispute, conceding the chargeback.
Closes the dispute with the processor (settling it as lost) and records
the merchant's decision on the dispute's support case.
Scopes: disputes:write
77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/pago/v2026_04/services/disputes.rb', line 77 def accept(id) data = client.request( http_method: "POST", path: "/v1/disputes/{id}/accept", path_params: { "id" => id }, query: {}, response_type: :json, errors: { 404 => Errors::ResourceNotFound, 409 => Errors::DisputeNotOpenError, 422 => Errors::HTTPValidationError } ) Models::Dispute.from_json(data) end |
#get(id) ⇒ Models::Dispute
Get a dispute by ID.
Scopes: disputes:read disputes:write
52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/pago/v2026_04/services/disputes.rb', line 52 def get(id) data = client.request( http_method: "GET", path: "/v1/disputes/{id}", path_params: { "id" => id }, query: {}, response_type: :json, errors: { 404 => Errors::ResourceNotFound, 422 => Errors::HTTPValidationError } ) Models::Dispute.from_json(data) end |
#list(organization_id: nil, order_id: nil, status: nil, page: 1, limit: 10, sorting: ["-created_at"]) ⇒ Models::ListResourceDispute
List disputes.
Scopes: disputes:read disputes:write
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/pago/v2026_04/services/disputes.rb', line 20 def list(organization_id: nil, order_id: nil, status: nil, page: 1, limit: 10, sorting: ["-created_at"]) data = client.request( http_method: "GET", path: "/v1/disputes/", path_params: {}, query: { "organization_id" => organization_id, "order_id" => order_id, "status" => status, "page" => page, "limit" => limit, "sorting" => sorting }, response_type: :json, errors: { 422 => Errors::HTTPValidationError } ) Models::ListResourceDispute.from_json(data) end |
#list_each(organization_id: nil, order_id: nil, status: nil, limit: 10, sorting: ["-created_at"]) {|item| ... } ⇒ Pago::Paginator
Enumerate every item of list, fetching pages on demand.
36 37 38 39 40 41 |
# File 'lib/pago/v2026_04/services/disputes.rb', line 36 def list_each(organization_id: nil, order_id: nil, status: nil, limit: 10, sorting: ["-created_at"], &block) paginator = ::Pago::Paginator.new do |page_number| list(organization_id: organization_id, order_id: order_id, status: status, page: page_number, limit: limit, sorting: sorting) end block ? paginator.each(&block) : paginator end |