Sequence
PhonePe PG Integration
Q. How can I integrate PhonePe Payment Gateway for my website?
Q. How can I integrate PhonePe Payment Gateway for my website?
You can integrate PhonePe Payment Gateway for your website using any one of the below links:
Q. How can I integrate PhonePe Payment Gateway for my app?
You can integrate PhonePe Payment Gateway for your app depending on the OS and the programming language with which your platform was designed.
- Native Android/iOS application: You can use the SDK Integration
- Cross-platform integration (React Native, Flutter, etc.): You can use the SDK Integration.
Q. How do I fix a generic API errors?
This will depend on the error code received as below:
401 - Unauthorized
This error occurs when you use incorrect or invalid Auth Token while making the API requests.
To fix this, you need to ensure:
- You are using the correct UAT/Production credentials shared by PhonePe as per the environment being tested.
- You are using the correct API host and endpoints corresponding to the environment.
- Make sure the Auth Token is valid. If not, regenerate the new AuthToken using Authorization API.
400 - Bad Request
This error occurs when any one of the request parameter is not being passed with the valid input.
To fix this, you need to ensure:
- You’ve passed all the request parameters marked as mandatory in the developer document and there are no blank values in the request body.
- You are not passing any additional request parameter that is not included in the developer document.
- You’ve passed the request parameters with the appropriate data type specified in the developer document.
500 - Internal Server Error
This error occurs when are sent in the API request.
To fix this, you need to ensure:
- If you are testing in the UAT/simulator environment, check if the simulator template is set correctly for the UAT MID using the PhonePe test app.
- If you are testing it in the Production environment, try any of the following,
- Try after some time
- Make sure you’ve passed the correct paymentFlow details with the required parameters in the request body as mentioned in the developer document
If you’ve followed the above steps and still continue to face issues, you can raise the integration ticket using PhonePe Business Dashboard under the Help section (or) call your business point of contact and share the below details:
- API host details and endpoints for triggering API
- Request payload
- Response payload
- Integration platform (Web/Android/iOS)
- Screenshot or Screen recording of the issue
Q. Why am I not receiving the callback response in the callback URL?
You could be facing this issue due to any one of the following reasons:
- You need to check on the PhonePe Business Dashboard whether the Callback URL is configured under the “Developer Settings -> Webhook” with the appropriate events.
- You need to configure the POST method (POST API) for the callback URL and able to handle the POST response.
- Your callback URL might have HTTP in it and not HTTPS. We do not post our response on HTTP callback URLs.
- There should not be any Port Number or IP Address mentioned in the Callback URL. It should contain only the Public Domain to receive the response.
- The configured callback URL is not able to receive the responses and capture them at the same time at merchant’s end.
Q. How do I fix the FRA Error : "Internal Security Block" ?
You’ll see this error in any of the following scenarios. To avoid transaction block in production, kindly check the below points:
- If you are using a personalised Chrome tab within their Android app, hindering URL retrieval. Please use Android/iOS SDK integration to resolve this issue.
- If you are launching PayPage in a new window or tab, resulting in the absence of a referrer, then either redirect or employ an iFrame for PayPage is essential.
- If you have implemented a no-referrer-policy then it leads to blank merchant URLs captured at our end. Please refrain from using it on the checkout page.
- If you are redirecting to the PhonePe Checkout Page using the URL/package name that you haven’t shared with us during the onboarding.
Note: If your URL/package name changed after you onboarded with us, please reach out to your business point of contact and get it updated.
Q. Is it mandatory to handle server-to-server (S2S)callback/webhook
response?
Yes, it’s extremely important to handle Server-to-server (S2S) callback/webhook response due to data security reasons and a consistent flow of responses on the server in real time. Please refer to the developer documentation for more details.
Q. Is it mandatory to implementation the Order Status API?
Yes, it is important to call the Order Status API using a cron/scheduler until the terminal state “COMPLETED” or “FAILED” is reached.
Example: You may not receive an S2S response for a payment or there can be some payments that are pending. In such cases, you will need to trigger the Order Status API. Please refer to the developer documentation to check the recommended time frequency to run this API.
Woocommerce Plugin
Q. How do I fix a 404 or 400 bad request error?
If you are getting a 404 error on the API endpoint, it’s because the UAT and the URL are the same (https://api-testing.phonepe.com/apis/hermes/). As your prefix contains api-testing, it points to UAT or stage environment. In such cases, the solution is to set the environment to production.
If you are still facing the same issue, you can raise the integration ticket using PhonePe Business Dashboard under the Help section to check and resolve it.
Q. Merchants seeing MID and SaltKey fields in v3.0.1 and above instead of Client Id and Client Secret?
This is because of the entry being created in merchant DB at the time they installed the older version of the plugin and tested with UAT or Prod PG V1 credentials. Due to this even after upgrading to plugin version 3.0.1 and above still the saltkey and MID fields are visible.
Solution:
- Check the database where your website is hosted.
- Locate the table named “wp-options”and execute the following query to delete the stored credentials
- DELETE FROM wp_options WHERE option_name=’woocommerce_phonepe_settings’; [This will remove any old keys stored in the table].
- After executing the query, you should navigate to the PhonePe plugin settings, where the fields will be reset, allowing them to re-enter their credentials and complete the integration.
Q. After entering Client Id and Client Secret when trying to save the screen goes blank or their has been a critical error on this website.
This is because the older version of PHP might be used.
Solution: To upgrade WooCommerce to Upgrade PHP Version to 8.2 or Above.
Q. Transaction could not be initiated because of a network issue. Please check network connectivity.
Merchant’s hosting provider is not allowing calls to phonepe or any other endpoints.
Solution: Merchants to check with their hosting provider to remove the block.