Skip to main content
Version: Live

SDK errors

SDK errors are strings that start with a code, such as NOT_READY: Not all fields are ready to update the amount. You get the string in two places:

const result = await paytheory.transact({ amount: 1000 })

if (result.type === 'ERROR' && result.error.startsWith('NOT_VALID')) {
// Ask the payor to fix the highlighted fields
}

Errors from Pay Theory's servers start with SOCKET_ERROR, followed by the server's message. The errorObserver also receives field validation messages, which have no code.

Codedescription
ACTION_COMPLETEThe action already finished and can't run again. Remount the fields to start over.
ACTION_IN_PROGRESSThe same action is still running. Wait for it to finish.
CANCEL_FAILEDcancel couldn't cancel the payment.
FIELD_ERRORThe SDK couldn't mount the hosted fields.
INVALID_PARAMA parameter is missing, has the wrong type or conflicts with another parameter. The message names it.
NO_FIELDSThe SDK found no hosted field containers on the page.
NO_TOKENThe SDK couldn't get a session token. Usually a network failure.
NOT_READYThe SDK isn't connected yet. Wait for readyObserver.
NOT_VALIDThe transacting fields aren't valid. The payor needs to fix them.
SESSION_EXPIREDThe SDK's connection session expired. Arrives inside a SOCKET_ERROR message, as SOCKET_ERROR: SESSION_EXPIRED: ....
SOCKET_ERRORPay Theory's servers returned an error, such as an idempotency key reused with a different request, or a processor rejection.
TRANSACTING_FIELD_ERRORThe SDK found more than one set of transacting fields visible on the page, or none.