View Source Craftgate.Error exception (Craftgate v1.0.42)

Represents an error that was returned by Craftgate API

Link to this section Summary

Types

The unique code that represents the error

The human-readable error message

The group that the error belongs to. Only present in the case of a payment-related error.

t()

Functions

Callback implementation for Exception.message/1.

Link to this section Types

@type code() :: binary()

The unique code that represents the error

@type description() :: binary()

The human-readable error message

@type group() ::
  :NOT_SUFFICIENT_FUNDS
  | :DO_NOT_HONOUR
  | :INVALID_TRANSACTION
  | :LOST_CARD
  | :STOLEN_CARD
  | :EXPIRED_CARD
  | :INVALID_CVC2
  | :NOT_PERMITTED_TO_CARDHOLDER
  | :NOT_PERMITTED_TO_TERMINAL
  | :FRAUD_SUSPECT
  | :RESTRICTED_BY_LAW
  | :CARD_NOT_PERMITTED
  | :UNKNOWN
  | :APPROVED_COMPLETED
  | :INVALID_CHARS_IN_EMAIL
  | :INVALID_CVC2_LENGTH
  | :REFER_TO_CARD_ISSUER
  | :INVALID_MERCHANT_OR_SP
  | :BLOCKED_CARD
  | :INVALID_CAVV
  | :INVALID_ECI
  | :CVC2_MAX_ATTEMPT
  | :BIN_NOT_FOUND
  | :COMMUNICATION_OR_SYSTEM_ERROR
  | :INVALID_CARD_NUMBER
  | :NO_SUCH_ISSUER
  | :DEBIT_CARDS_REQUIRES_3DS
  | :DEBIT_CARDS_INSTALLMENT_NOT_ALLOWED
  | :REQUEST_TIMEOUT
  | :DECLINED
  | :NOT_PERMITTED_TO_FOREIGN_CARD
  | :NOT_PERMITTED_TO_INSTALLMENT
  | :REQUIRES_DAY_END
  | :EXCEEDS_WITHDRAWAL_AMOUNT_LIMIT
  | :RESTRICTED_CARD
  | :EXCEEDS_ALLOWABLE_PIN_TRIES
  | :INVALID_PIN
  | :ISSUER_OR_SWITCH_INOPERATIVE
  | :INVALID_EXPIRE_YEAR_MONTH
  | :REQUEST_BLOCKED_BY_BANK
  | :SALES_AMOUNT_LESS_THAN_AWARD
  | :INVALID_AMOUNT
  | :INVALID_CARD_TYPE
  | :NOT_SUFFICIENT_AWARD
  | :AMEX_CAN_USE_ONLY_MR
  | :NO_RESPONSE
  | :PICKUP_CARD
  | :CVC_REQUIRED
  | :INVALID_IP
  | :MAY_HAVE_ALREADY_REFUNDED
  | :ORDER_ID_ALREADY_USED
  | :THREEDS_INIT_ERROR
  | :APM_ERROR
  | :FRAUD_CHECK_BLOCK
  | :POS_BALANCE_NOT_SUFFICIENT
  | binary()
  | nil

The group that the error belongs to. Only present in the case of a payment-related error.

Use this property to differentiate payment errors.

See https://developer.craftgate.io/en/error-groups for a list of all possible options

@type t() :: %Craftgate.Error{
  __exception__: true,
  code: code(),
  description: description(),
  group: group()
}

Link to this section Functions

Callback implementation for Exception.message/1.