API ReferenceErrors

Errors

Error codes returned by the PayLexer plugin's developer API.

Functions return a WP_Error; adapter methods throw an Exception whose get_error_code() returns the same code.

Codes

CodeMeaning
paylexer_register_too_latepaylexer_register_platform() or paylexer_register_adapter() called outside paylexer_init.
paylexer_invalid_platform_id, paylexer_duplicate_platform, paylexer_platform_name_requiredBad registration.
paylexer_unknown_platformPlatform not registered. HTTP status 403 in the error data.
paylexer_feature_not_declaredNot in the platform's supports. 403.
paylexer_not_connectedPayLexer isn't connected, or checkout is paused for the site. 503.
paylexer_unknown_gatewayGateway not enabled for this site.
paylexer_currency_not_supported, paylexer_subscriptions_not_supportedGateway can't take this payment.
paylexer_invalid_amount, paylexer_invalid_email, paylexer_return_url_required, paylexer_invalid_subscriptionBad input.
paylexer_billing_address_requiredThe gateway needs a billing address field.
paylexer_not_foundNo such order or subscription for this platform, including ones created by other platforms.
paylexer_no_order_reference, paylexer_no_checkout_url, paylexer_no_subscription_idPayLexer returned an incomplete response.

Errors from PayLexer

Errors from PayLexer itself pass through as paylexer_api_error or paylexer_tenant_service_error, with PayLexer's message, for example Order is not refundable (status: PENDING).

Example

WP_Error( 'paylexer_not_connected', 'PayLexer is not connected.', array( 'status' => 503 ) )

For the common codes, Troubleshooting pairs each cause with its fix.