Handling Error Codes
Handling Error Codes in Google Pay Integration
When integrating Google Pay, 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.
Common Error Codes
Here are some common error codes that you may encounter:
1001: No Card Networks Configured
- Description: No card networks are configured for this terminal. Ensure that your payment gateway settings include the necessary card networks for processing transactions.
1002: Failed to Initialize the Google Pay Button
- Description: The Google Pay button could not be initialized. This error typically occurs if the browser does not support Google Pay or if there is a configuration issue. Ensure that the user's device and browser support Google Pay.
1003: Google Pay Session Validation Failed
- Description: The Google Pay session could not be validated. This may occur if there are issues with the merchant's domain verification or if the session request is malformed.
1004: Failed to Authorize Payment
- Description: The payment authorization failed. This could be due to incorrect payment details, network issues, or insufficient funds. Prompt the user to check their payment information and try again.
1005: Payment Processing Failed
- Description: The payment was authorized by Google Pay but could not be processed by our payment gateway. This error may occur due to internal gateway issues, incorrect merchant account settings or problems with the user's card. Please contact our support team for assistance if this error persists.
1006: Payment Data Missing
- Description: The payment data required for processing the transaction is missing. Ensure all required fields are provided in the payment request.
1007: Token Missing
- Description: The token required for the transaction is missing. This could be due to an issue with token generation or passing the token during the payment process.
1008: Payment Data Field Missing in Result from onClick
- Description: This error occurs when a required field in the payment data is missing while handling the
onClick
event, typically if the merchant is passing payment data during theonClick
event instead of during the initialization of the button. Ensure that all necessary payment data is correctly included in the event handler.
- Description: This error occurs when a required field in the payment data is missing while handling the
1009: Token Field Missing in Result from onClick
- Description: This error occurs when the token field is missing in the result from the
onClick
event, typically if the merchant is passing the token during theonClick
event instead of during the initialization of the button. Ensure that the token is correctly generated and included in the event handler.
- Description: This error occurs when the token field is missing in the result from the
Notes
User Experience: Provide clear instructions or next steps for the user when an error occurs, such as retrying the payment or contacting support.
By properly handling error codes, you can improve the reliability of your Google Pay integration and ensure a better user experience.