UAT Simulator

What is Merchant Simulator?
The merchant simulator is used to simulate the end-to-end payment flows for online merchants. A template is a mapping of APIs and their mock responses using which merchants can simulate the scenarios like Success, Failure, and Pending.

Benefits of using the Merchant Simulator

  • Even when the PhonePe UAT server is down, the Merchant simulator gives you a seamless user experience through which you will be able to test the end-to-end payment flow without any interruptions.

Postman Collection and Setup

  • Download the PhonePe Simulator postman collection from here.
  • Once downloaded, import the collection to your Postman.

Quick Links

Steps for Custom Checkout Page

Follow the below steps to verify different payment methods on the Custom Checkout page.

Web-Based Flows

  • Update the Host URL of UAT Simulator for PG PAY and PG Check Status API:

👍

Host: https://api-preprod.phonepe.com/apis/merchant-simulator

Android/iOS Intent Based Flow

  • Download and install the Simulator PhonePe App on an android mobile device. APK can be downloaded from here.
  • Merchant would need to specify that the merchant app wants to use the PhonePe Simulator, add the below lines in tag of AndroidManifest.xml file.

  • For the UPI_INTENT flow, the package name of the simulator is com.phonepe.simulator.

🚧

UAT Simulator is supported from Android SDK Version: 1.7.1

👍

AndroidManifest.xml

<meta-data
android:name="com.phonepe.android.sdk.isSimulator"
android:value="true" />

Configure Template

To configure the required template, you can use the "Configure Template" API call.

  • Open the "Configure Template" API.
  • Click on "Pre-request Script"
  • Update the UAT MID received from the PhonePe Integration Team for the variable "merchantId"
  • Update the templateName variable with the template merchant wants to test the flow.

Templates for each type of Payment Method

For Success - "b2bPg_custom_upiIntent_success"
For Failure - "b2bPg_custom_upiIntent_failure"
For Pending - "b2bPg_custom_upiIntent_pending"
For Success - "b2bPg_custom_upiCollect_success"
For Failure - "b2bPg_custom_upiCollect_failure"
For Pending - "b2bPg_custom_upiCollect_pending"
For Success - "b2bPg_custom_netBanking_success"
For Failure - "b2bPg_custom_netBanking_failure"
For Pending - "b2bPg_custom_netBanking_pending"
For Success - "b2bPg_custom_card_success"
For Failure - "b2bPg_custom_card_failure"
For Pending - "b2bPg_custom_card_pending"

Configure Template API

2716

👍

Example

  • If the merchant wants to test the PG UPI Intent - Pending scenario, the merchant will select "PG - UPI Intent Templates" and take the template corresponding to the Pending error code "b2bPg_custom_upiIntent_pending".

  • Similarly, for Success - "b2bPg_custom_upiIntent_success" and for Failure - "b2bPg_custom_upiIntent_failure"

{
    "message": "b2bPg_custom_upiIntent_pending template configured for merchant MERCHANTUAT"
}

Once configured, you can make the payment on the Custom Checkout page with the respective payment method.

Get Configured Template

To get the current configured Template, you can use the "Get Configured Template" API call.

Get Configured Template API

2722
{
    "b2bPgFlow": "b2bPg_custom_upiIntent_pending"
}

For any queries reach out to [email protected]

Test Card Details

"card_number": "4622943126146407", 
"card_type": "DEBIT_CARD", 
"card_issuer": "VISA",
"expiry_month": 12, 
"expiry_year": 2023, 
"cvv": "936"

👍

Note: The OTP to be used on the Bank Page: 123456

Test Net Banking Details

Always use "bankId": "SBIN" for testing purposes in the request payload of PAY API.

Username: test
Password: test
and click "Submit" on the next screen.

🚧

Note: For testing transactions, the lower amount limit is defined as Rs.1/- and the upper amount limit is defined as Rs.1000/-. Please make sure your transaction requests are within these limits.