Exception: Pago::V2026_04::Errors::Finalize403Error

Inherits:
PermissionDeniedError show all
Defined in:
lib/pago/v2026_04/errors.rb,
sig/pago/v2026_04/generated.rbs

Overview

Off-session charges are not enabled for this organization, or its account can't currently accept payments. Raised on HTTP 403.

Constant Summary collapse

STATUS_CODE =

Returns:

  • (Integer)
403

Instance Attribute Summary

Attributes inherited from APIError

#body, #data, #response, #status_code

Class Method Summary collapse

Methods inherited from APIError

#initialize

Constructor Details

This class inherits a constructor from Pago::APIError

Class Method Details

.from_response(status_code:, body:, response:) ⇒ Models::OffSessionChargesNotEnabled, Models::OrganizationNotReadyForPayments

Returns the deserialized error payload.

Parameters:

  • status_code: (Integer)
  • body: (Object)
  • response: (Object)

Returns:



343
344
345
346
347
348
349
350
351
# File 'lib/pago/v2026_04/errors.rb', line 343

def self.from_response(status_code:, body:, response:)
  new(
    "Pago API returned an error: #{status_code} - Finalize403Error",
    status_code: status_code,
    data: ::Pago::Serde.union(body, variants: [Models::OffSessionChargesNotEnabled, Models::OrganizationNotReadyForPayments]),
    body: body,
    response: response
  )
end