Module: Paymos
- Defined in:
- lib/paymos/client.rb,
lib/paymos/errors.rb,
lib/paymos/models.rb,
lib/paymos/signing.rb,
lib/paymos/version.rb,
lib/paymos/webhook_verifier.rb,
sig/paymos.rbs
Defined Under Namespace
Modules: InvoiceStatus, Pagination, Signing, WithdrawalStatus Classes: ApiError, AuthenticationError, Balance, Balances, Client, ConfigurationError, ConflictError, Error, GoneError, Invoice, InvoiceListItem, Invoices, Model, NotFoundError, Order, Page, Payment, RateLimitError, Resource, Response, ServerError, ServerTime, SignatureMismatchError, System, TimestampSkewError, Transfer, UnavailableError, ValidationError, WebhookEvent, WebhookVerifier, Withdrawal, Withdrawals
Constant Summary collapse
- ERROR_TYPES =
{ 400 => ValidationError, 401 => AuthenticationError, 403 => AuthenticationError, 404 => NotFoundError, 409 => ConflictError, 410 => GoneError, 429 => RateLimitError, 503 => UnavailableError }.freeze
- VERSION =
'1.0.3'
Class Method Summary collapse
Class Method Details
.api_error(status, body, headers = {}) ⇒ Object
89 90 91 92 |
# File 'lib/paymos/errors.rb', line 89 def self.api_error(status, body, headers = {}) type = ERROR_TYPES.fetch(status, status >= 500 ? ServerError : ApiError) type.new(status, body, headers) end |