Results, Errors & Troubleshooting

What the Cashier returns, the error codes and how to fix common problems.

This page explains what the Cashier returns when it closes and what each error code means (§1), and how to fix common problems (§2).

1. Results and error codes

1.1 CashierResult

Your app gets one CashierResult when the Cashier closes, in onResult.

🚧

A result is not a payment confirmation

completed on the device does not prove that the money moved. Confirm every payment on your server from the Payment Notification before you credit or debit the customer.

PropertyDescriptionFormat
statusHow the Cashier ended (§1.2).CashierResult.Status
closedByWho closed it (§1.3).CashierResult.ClosedBy
errorCodeWhy the payment did not complete. Set only when status is .failed.CashierErrorCode?
transactionIDThe Praxis transaction ID, when a transaction exists. Use it to find the payment on your server.String?
traceIDThe Praxis trace ID, for support requests.String?
amountThe amount of the transaction, in major units (for example 50.00). Nil without a transaction.Decimal?
currencyThe ISO 4217 currency code of amount.String?
paymentMethodThe Praxis name of the payment method that paid. Use it to match the result with your records, not for display.String?
orderIDYour order_id of the session.String?
cardBrandThe card brand, for example "Visa". Never a card number or any part of one.String?
intent.deposit or .withdrawal. Nil when the Cashier closed before the session was read.CashierIntent?
withdrawalStatusThe Praxis status of a withdrawal's transaction (§1.4). Nil for a deposit, for a withdrawal without a transaction, and for a status the SDK does not list. Your server's Payment Notification is the source of truth.CashierResult.WithdrawalStatus?

The result never carries error text, customer data or card data.

1.2 Status

StatusRaw valueMeaning
.completedcompletedThe payment was approved.
.authorizedauthorizedThe card was authorized and not charged yet, for example a zero-amount authorization.
.pendingpendingThe payment is still processing, or a withdrawal request was accepted and waits to be paid out. The final status reaches your server later.
.failedfailedThe payment did not go through. errorCode says why.
.canceledcanceledThe Cashier closed before a payment started.

Status, closed-by, withdrawal status, step, intent, error code and error category values are structs with static values, not enums, so new values do not break your build. Always keep a default branch when you switch over them.

1.3 Closed by

ValueMeaning
.customerThe customer tapped the close button, or a button under the result.
.codeYour app closed the Cashier: it called close() on the session or the slot context, dismissed the CashierView or CashierViewController that made the session, or set the .cashierSheet binding to false.
.sdkThe SDK ended the session itself, for example with returnsAfterResult.

1.4 Withdrawals

A withdrawal ends with the same statuses as a deposit. result.intent is .withdrawal, and result.withdrawalStatus carries the Praxis status of the withdrawal. A request Praxis accepted but has not paid out yet ends with .pending and withdrawalStatus .requested:

if result.intent == .withdrawal, result.withdrawalStatus == .requested {
    showRequestAccepted()
}
withdrawalStatusRaw valueMeaning
.approvedapprovedPaid out.
.authorizedauthorizedAuthorized and waits to be paid out. The result status is .authorized.
.requestedrequestedThe withdrawal request was accepted and waits to be paid out.
.requestedPayoutrequested_payoutThe payout request was accepted and waits to be paid out.
.partialPayoutpartial_payoutOnly part of the amount was paid out. The result status is .pending; confirm the paid amount on your server.
.pendingpendingStill processing.
.pendingAsyncpending_asyncStill processing at the provider.
.initializedinitializedCreated, not processing yet.
.verificationverificationBeing verified.
.declineddeclinedRefused.
.errorerrorFailed.
.canceledcancelledCanceled.

See Transaction Statuses.

1.5 Error codes

The SDK never sends error text to your app. Map each code to your own message, in your own language:

func message(for code: CashierErrorCode?) -> LocalizedStringResource {
    switch code {
    case .declined:       "Your bank declined the payment. Try another card."
    case .network:        "Check your connection. If you were charged, the payment will appear shortly."
    case .sessionExpired: "This payment session expired. Please start again."
    default:              "The payment did not go through. Please try again."
    }
}
CodeRaw valueCategoryMoney taken?What your app can do
.declineddeclinedpaymentNoAsk for another card or method.
.cardInvalidcard_invalidpaymentNoAsk the customer to check the card.
.cardNotAcceptedcard_not_acceptedpaymentNoTry again later.
.transactionCanceledtransaction_canceledpaymentNoThe payment was canceled. The customer may pay again.
.noPaymentMethodno_payment_methodpaymentNoNo payment method is available for this session and currency.
.walletUnavailablewallet_unavailablepaymentNoApple Pay could not complete the payment. Nothing was sent. Offer the card instead. Apple Pay can then stay hidden for the session; when the sheet cannot open, the event wallet_not_presented is also sent.
.networknetworknetworkMaybeCheck the final status on your server.
.sessionExpiredsession_expiredsessionNoCreate a new session.
.sessionUnavailablesession_unavailablesessionNoThe Cashier could not read the session when it opened. Create a new session.
.invalidTokeninvalid_tokensessionNoThe token was empty; nothing was sent. Pass the token your server got.
.validationFailedvalidation_failedvalidationNoCheck the amount and the session settings. A withdrawal's preset amount must not be above the balance.
.serverErrorserver_errorserverMaybeCheck the final status on your server.
.unexpectedResponseunexpected_responseserverMaybeCheck the final status.
.unknownunknownserverMaybeCheck the final status on your server.
.configurationErrorconfiguration_errorconfigurationNoThe session was created for the web Cashier (create it with channel: ios_sdk), a payment method needs a native SDK this Cashier does not have, or your method filter returned no id from the list it got. Check the session and your filter.
.paymentMethodUnavailablepayment_method_unavailableconfigurationNoThe selected method could not be shown; nothing was sent. Try again or use another method. On a withdrawal it also ends the error page of a card withdrawal with no saved card, no new card allowed and no other method, or of a method that pays only to an account the customer has none of.

Use errorCode.category (.session, .network, .server, .validation, .configuration, .payment) to group codes instead of handling each one.

A code never changes its meaning. New codes can be added, so always keep a default branch.

When the Cashier cannot open (an empty token or a session it cannot read), it shows an error screen and, once closed, ends with .failed and the code of that screen.

📘

Support requests

Log the orderID, transactionID, traceID and errorCode.rawValue of each result. When you contact your CSM about a payment, include them with the iOS version and the sequence of event names you received.

2. Troubleshooting

2.1 Session creation

SymptomCauseFix
The iOS SDK is not available for your applicationThe iOS SDK is not enabled for the application.Ask your CSM to enable it, for the sandbox and live applications.
The iOS SDK needs the PCI card form for your applicationThe application does not use the PCI card form.Ask your CSM to enable the PCI card form, for the sandbox and live applications.
Incorrect app return urlapp_return_url is missing or is not a custom-scheme link or an https URL with a host.Send a valid app_return_url with every channel: ios_sdk session.
Incorrect channelchannel has a value other than web or ios_sdk.Send ios_sdk.
The iOS SDK channel is not available for this session typeThe session is not a regular cashier session (session_type missing or cashier), for example a payment_link session.Create a regular cashier session.
The response has no redirect_urlExpected for iOS SDK sessions.Use session.auth_token with the SDK.

See Integration Guide §1.2.3.

2.2 Opening the Cashier

SymptomCauseFix
The Cashier ends at once with configuration_errorThe session was created without channel: "ios_sdk" (a web session).Add channel and app_return_url to the Cashier Payment Request.
The Cashier ends with invalid_tokenThe token is empty. Nothing was sent.Pass session.auth_token from your server.
The Cashier ends with session_unavailableThe Cashier could not read the session: for example, the token is from another environment, or the session no longer exists.Check that the session was created in the environment you pass (.sandbox or .live), and create a new session.
The Cashier ends with session_expiredMore than 15 minutes have passed since the Cashier first opened the session.Create a new session.
A compile error when you store a CashierViewCashierView is generic over its layout.Write the full type, for example CashierView<Cashier.AmountFirstLayout>.

2.3 Payment methods

SymptomCauseFix
The method list is empty when the Cashier opensThe methods load once an amount above zero and a currency are set.Send amount with the session, or let the customer enter one.
The Cashier shows "no payment methods" and ends with no_payment_methodNo method is available for the session, intent and currency.Check the gateways configured for your application and currency with your CSM.
The Cashier ends with configuration_error after it loadsYour methodFilter returned no id from the list it got.Check your filter, and that it returns ids from the list it gets.
A saved card is missing.savedInstruments is off, or your filter removed saved-<n> rows.Turn the feature on, or keep the rows in your filter.

2.4 Payments and returns

SymptomCauseFix
The customer does not come back from a bank appYour app does not register the app_return_url.Register the URL scheme or Universal Link (see Integration Guide §1.2.5).
A 3-D Secure or provider page does not load, or stays blankThe page is not https, or the provider does not support in-app web views.Check the method on a real device and contact your CSM with the traceID. See 3-D Secure and provider pages.
The result is .pending after a 3-D Secure or provider pageThe customer closed the page before the provider confirmed, or the provider confirms later.Wait for the Payment Notification; do not ask the customer to pay again.
The result is .pendingThe payment is still processing at the provider, or the Cashier was closed while it ran.Wait for the Payment Notification on your server.
The result is .completed but no Payment Notification arrivedThe notification is delayed or your endpoint refused it.Check that notification_url is reachable over HTTPS and answers successfully. Never credit the customer without the notification.
A card brand error shows on the card number after payingThe brand is not allowed for the session.Expected: brands are checked when the card is submitted, not while the customer types.

2.5 Layouts and customization

SymptomCauseFix
The main button stays disabled, and layout_incomplete is sent with reason requiredBlockYour layout leaves out a block the payment needs.Add the block. Put Terms in the bottom area of every page. See Required blocks.
layout_incomplete with reason duplicateSealedTwo card blocks are on screen at once.Show one card block at a time.
layout_incomplete with reason presentation; only the amount section opensYour layout places blocks outside Cashier.Pages.Put the blocks inside Cashier.Pages. For one screen, use one Cashier.Page. See Layouts.
The app stops when slot content reads the session@Environment(CashierSession.self) is nil inside slot content.Read @Environment(\.cashierSlotContext) instead.
The Deposit / Withdraw tabs are missingThe header was replaced or hidden.Keep Cashier.Header in sessions with more than one intent.
A configuration value or text has no effect, and configuration_value_ignored is sentThe value is invalid (for example a hex color without #, a negative corner radius or amount, a URL that is not https) or the text key is unknown.Read ignoredName in the event and fix that value.
No quick amount buttons or promotions showBoth are off by default. Or no quick amount list matches the session's method, currency and transaction type.Set amount.quickAmounts or promotions.style. Check the currency and intent of your lists.
A setting changed in the Praxis Backoffice (Theme Editor) has no effect in the appThe SDK does not read those settings.Set the value in CashierConfiguration.
Your font does not showThe font is not registered in your app. The Cashier falls back to a system font.Register the font in your app and pass its family name.
A text shows its key instead of wordingNo text exists for that key in the session language.Set the text with CashierTexts.

2.6 Contacting support

When you contact your CSM about a payment, include the orderID, transactionID, traceID and errorCode.rawValue of the CashierResult, the iOS version and the sequence of event names you received.

What's next


Did this page help you?