Skip to main content

Handling Error Codes

Handling Error Codes in PayPal Integration

When integrating PayPal, the component may return various error codes during different stages of the payment process. It is essential to handle these errors appropriately to ensure a smooth user experience and provide meaningful feedback to your customers.

The following table lists the possible error codes that can be returned by the component:

CodeMessageExplanation
1001PayPal terminal ID is missingThe terminalId parameter was not provided during initialization.
1002Container element is missingThe containerElement parameter was not provided or the element does not exist in the DOM.
1003Failed to fetch terminal configurationThe component failed to retrieve the configuration from the DNA Payments API for the given terminalId.
1004PayPal configuration is missing in terminal configurationThe terminal configuration does not contain the necessary PayPal settings.
1005PayPal is disabled in terminal configurationPayPal payments are not enabled for the given terminalId.
1006PayPal client ID is missing in terminal configurationThe PayPal client ID is missing from the terminal configuration.
1007Failed to render PayPal buttonThe PayPal button could not be rendered in the container element.
1008No result returned from onBeforeProcessThe onBeforeProcessPayment event handler did not return a promise that resolves with paymentData and token.
1009Payment data is missingThe paymentData object is missing. It can be provided during initialization or returned by the onBeforeProcessPayment event handler.
1010Token is missingThe token is missing. It can be provided during initialization or returned by the onBeforeProcessPayment event handler.
1011Payment data field is missing in result from onBeforeProcessThe object returned by the onBeforeProcessPayment event handler is missing the paymentData field.
1012Token field is missing in result from onBeforeProcessThe object returned by the onBeforeProcessPayment event handler is missing the token field.
1013Failed to execute onBeforeProcessThe onBeforeProcessPayment event handler threw an error.
1014Failed to create orderThe component failed to create a PayPal order with the DNA Payments API.
1015Failed to approve orderThe component failed to approve the PayPal order with the DNA Payments API after the user authorized the payment.
1000Something went wrongAn unexpected error occurred.
400Bad requestThe request to the DNA Payments API was malformed.
401UnauthorizedThe request to the DNA Payments API was not authorized. Check your token.
403ForbiddenYou do not have permission to perform the requested action.
404Not foundThe requested resource was not found on the DNA Payments API.
500Internal server errorAn error occurred on the DNA Payments API server.