StripeError

data class StripeError constructor(val type: String? = null, val message: String? = null, val code: String? = null, val param: String? = null, val declineCode: String? = null, val charge: String? = null, val docUrl: String? = null, val extraFields: Map<String, String>? = null) : StripeModel, Serializable

A model representing a Stripe Errors object.

Stripe uses conventional HTTP response codes to indicate the success or failure of an API request. In general:

  • Codes in the 2xx range indicate success.

  • Codes in the 4xx range indicate an error that failed given the information provided (e.g. a required parameter was omitted, a charge failed, etc.).

  • Codes in the 5xx range indicate an error with Stripe's servers (these are rare).

Some 4xx errors that could be handled programmatically (e.g., a card is declined) include an error code that briefly explains the error reported.

Constructors

Link copied to clipboard
constructor(type: String? = null, message: String? = null, code: String? = null, param: String? = null, declineCode: String? = null, charge: String? = null, docUrl: String? = null, extraFields: Map<String, String>? = null)

Properties

Link copied to clipboard
val charge: String? = null

For card errors, the ID of the failed charge.

Link copied to clipboard
val code: String? = null

For some errors that could be handled programmatically, a short string indicating the error code reported.

Link copied to clipboard
val declineCode: String? = null

For card errors resulting from a card issuer decline, a short string indicating the card issuer’s reason for the decline if they provide one.

Link copied to clipboard
val docUrl: String? = null

A URL to more information about the error code reported.

Link copied to clipboard
val extraFields: Map<String, String>? = null

Internal list of extra fields related to the error. Note - value type is ignored and always parsed as string (true -> "true")

Link copied to clipboard
val message: String? = null

A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.

Link copied to clipboard
val param: String? = null

If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.

Link copied to clipboard
val type: String? = null

The type of error returned. One of api_connection_error, api_error, authentication_error, card_error, idempotency_error, invalid_request_error, or rate_limit_error

Functions

Link copied to clipboard
abstract fun describeContents(): Int
Link copied to clipboard
abstract fun writeToParcel(p0: Parcel, p1: Int)