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
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.
1000Something went wrongA general or unexpected error occurred.
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.
1008Payment data is missingThe paymentData object is missing. It can be provided during initialization or returned by the onBeforeProcessPayment event handler.
1009Token is missingThe token is missing. It can be provided during initialization or returned by the onBeforeProcessPayment event handler.
1010Failed to execute onBeforeProcessPaymentThe onBeforeProcessPayment event handler threw an error.
1011No result returned from onBeforeProcessPaymentThe onBeforeProcessPayment event handler did not return a promise that resolves with paymentData and token.
1012Payment data field is missing in result from onBeforeProcessPaymentThe object returned by the onBeforeProcessPayment event handler is missing the paymentData field.
1013Token field is missing in result from onBeforeProcessPaymentThe object returned by the onBeforeProcessPayment event handler is missing the token field.
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.
1016Unsupported transaction typeThe transaction type determined for the payment is not supported. Supported types are 'AUTH' and 'SALE'.