public class TerminalException
A TerminalException
represents an error thrown during SDK operations and will contain
a enum TerminalException.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
enum TerminalException.TerminalErrorCode
Modifier and Type | Method and Description |
---|---|
ApiError |
getApiError()
If the exception is of type
|
TerminalException.TerminalErrorCode |
getErrorCode() |
java.lang.String |
getErrorMessage() |
PaymentIntent |
getPaymentIntent()
If the exception is of type
PROCESS_PAYMENT_ERROR , this will return one of
three things: |
@Nullable public PaymentIntent getPaymentIntent()
If the exception is of type PROCESS_PAYMENT_ERROR
, this will return one of
three things:
The existing class PaymentIntent
with status REQUIRES_PAYMENT_METHOD
. This
signifies that there was a failure to confirm this payment method, and
Terminal.collectPaymentMethod
should be called again to try a new payment
method.
The existing class PaymentIntent
with status 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 class PaymentIntent
returned.
Null. This signifies that the request to Stripe's servers timed out and the
class PaymentIntent
's status is unknown. In this situation, the the call to
Terminal.processPayment
should be retried with the original
class PaymentIntent
.
For any other enum TerminalException.TerminalErrorCode
, this will return null.
https://stripe.com/docs/terminal/payments#process
@NotNull public TerminalException.TerminalErrorCode getErrorCode()
@NotNull public java.lang.String getErrorMessage()
@Nullable public ApiError getApiError()
If the exception is of type
API_ERROR
or PAYMENT_DECLINED_BY_STRIPE_API
,this field will return a representation of the error object, with additional details.