TerminalException

class TerminalException @JvmOverloads() constructor(errorCode: TerminalException.TerminalErrorCode, errorMessage: String, apiError: ApiError?) : Exception

A TerminalException represents an error thrown during SDK operations and will contain a TerminalErrorCode and an errorMessage to provide more specific details.

Use of this SDK is subject to the Stripe Terminal Terms: https://stripe.com/terminal/legal

Constructors

TerminalException
Link copied to clipboard
fun TerminalException(errorCode: TerminalException.TerminalErrorCode, errorMessage: String, apiError: ApiError? = null)

Types

TerminalErrorCode
Link copied to clipboard
enum TerminalErrorCode : Enum<TerminalException.TerminalErrorCode>
A TerminalErrorCode represents the class of error

Functions

addSuppressed
Link copied to clipboard
fun addSuppressed(p0: Throwable)
fillInStackTrace
Link copied to clipboard
open fun fillInStackTrace(): Throwable
getLocalizedMessage
Link copied to clipboard
open fun getLocalizedMessage(): String
getStackTrace
Link copied to clipboard
open fun getStackTrace(): Array<StackTraceElement>
getSuppressed
Link copied to clipboard
fun getSuppressed(): Array<Throwable>
initCause
Link copied to clipboard
open fun initCause(p0: Throwable): Throwable
printStackTrace
Link copied to clipboard
open fun printStackTrace()
open fun printStackTrace(p0: PrintStream)
open fun printStackTrace(p0: PrintWriter)
setStackTrace
Link copied to clipboard
open fun setStackTrace(p0: Array<StackTraceElement>)

Properties

apiError
Link copied to clipboard
val apiError: ApiError? = null
If the errorCode is STRIPE_API_ERROR or DECLINED_BY_STRIPE_API, this field will return a representation of the error object, with additional details.
cause
Link copied to clipboard
open val cause: Throwable?
errorCode
Link copied to clipboard
val errorCode: TerminalException.TerminalErrorCode
errorMessage
Link copied to clipboard
val errorMessage: String
message
Link copied to clipboard
open val message: String?
paymentIntent
Link copied to clipboard
val paymentIntent: PaymentIntent?
If the exception is related to a PaymentIntent, this will return one of three things:
  1. The updated PaymentIntent with a PaymentIntent.status of REQUIRES_PAYMENT_METHOD. This signifies that there was a failure to confirm this payment method, and Terminal.collectPaymentMethod should be called again with the updated PaymentIntent to try charging another payment method.

  2. The updated PaymentIntent with a PaymentIntent.status of REQUIRES_CONFIRMATION. This signifies that the request failed due to an unexpected error (e.g. a temporary connectivity problem) and the call to Terminal.processPayment should be retried with the updated PaymentIntent.

  3. Null. This signifies that the request to Stripe's servers timed out and PaymentIntent.status is unknown. In this situation, the call to Terminal.processPayment should be retried with the original PaymentIntent. If you instead choose to abandon the original PaymentIntent and create a new one, be sure not to capture the original PaymentIntent.

For exceptions unrelated to a PaymentIntent, this will return null.