Brief Step by Step guide

Step1: Fill the forms as given below so that the integration team can assist you better with the integration

a.) Switch Integration Prerequisites

b.) PayU production MID details

📘

The production key is needed for the activation of the Switch payment flow. Without the activation, the payment flow will not work.

Step 2: Create and add one new parameter in the existing PayU code

You are already integrated with PayU, start sending one more parameter (transaction context) in the existing integration.

  1. Along with other mandatory parameters, pass the below values in the payment request
    (mandatorily)
    Production URL "secure.payu.in"{if you are PayU Biz Merchant)
    "https://www.payumoney.com/payment/seamlessPayment" {if you are PayU Money Seamless Merchant)

o pg = ‘CASH’ {if you are PayU Biz Merchant)
'CASHCARD' {if you are PayU Money Seamless Merchant)
o bankcode = ‘PPINAPP’

  1. We have also introduced an additional parameter which merchants need to pass
    o transactionContext (type) – string

The merchants need to change the value to two parameters in the existing flow and add a new parameter (transactionContext)

📘

Please use the key as: o3IRlM and Salt will be shared by the PhonePe integration team as this is been activated for PayU flow.

<input type="hidden" name="pg" value="CASH">
<input type="hidden" name="bankcode" value="PPINAPP">
<input type="hidden" name="transactionContext" value="eyJjYXJ0RGV0YWlscyI6IHsiY2FydEl0ZW1zIjogW3siY2F0ZWdvcnkiOiAiU0hPUFBJTkciLCAiaXRlbUlkIjogIkNEWVZaRSIsICJwcmljZSI6IDU2MDAuMCwgInNoaXBwaW5nSW5mbyI6IHsiZGVsaXZlcnlUeXBlIjogIlNUQU5EQVJEIiwgInRpbWUiOiB7InRpbWVzdGFtcCI6IDE1ODMzMDcwMTcsICJ6b25lT2ZmU2V0IjogIiswNTozMCJ9fSwgImFkZHJlc3MiOiB7ImNpdHkiOiAiSHlkZXJhYmFkIiwgImNvdW50cnkiOiAiSW5kaWEiLCAicGluY29kZSI6ICI1MDAwMzMiLCAibG9uZ2l0dWRlIjogNzguNDA2NDgsICJsYXRpdHVkZSI6IDE3LjQyMjMwMywgImFkZHJlc3NTdHJpbmciOiAiQTI4LCBQcmFzaGFzaGFuIE5hZ2FyLCBSb2FkIG51bWJlciA3MCwgSnViaWxlZSBIaWxscyJ9LCAiaXRlbU5hbWUiOiAiT3JkZXIgSURzOiBDRFlWWkUiLCAicXVhbnRpdHkiOiAxfV19LCAib3JkZXJDb250ZXh0IjogeyJ0cmFja2luZ0luZm8iOiB7InVybCI6ICJodHRwOi8vMTI3LjAuMC4xOjEyMzQvL2Rhc2hib2FyZC9vcmRlcnMvP3Rva2VuPVFoaTVQS0Z1eEwiLCAidHlwZSI6ICJIVFRQUyJ9fSwgImZhcmVEZXRhaWxzIjogeyJ0b3RhbEFtb3VudCI6IDU2MDAuMCwgInBheWFibGVBbW91bnQiOiA1NjAwLjB9fQ==">

Example :

Use Key : o3IRlM

URL for testing : https://test.payu.in/
URL for prod : https://secure.payu.in/

sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|u
df5||||||SALT)

SHA256(o3IRlM|PAYU_PHONEPE-Q9ECL|5600.0|[{"isRequired": false, "name": "MRI LS Spine", "value": "5950.0", "description": ""}]|Priyank|[email protected]|||||||||||<salt>)


==========================================================================


<form name="payuForm" action="https://test.payu.in/_payment" method="post">
    <input type="hidden" name="csrfmiddlewaretoken" value="tXuVyJhBQgRws8dOdFqEz77nZvG6yyyyyyFZdAxtUdvDII1DPxOnQkv0pzz4MOBsCco57qs">
    <input type="hidden" name="key" value="o3IRlM">
    <input type="hidden" name="txnid" value="PAYU_PHONEPE-Q9ECL">
    <input type="hidden" name="amount" value="5600.0">
    <input type="hidden" name="firstname" id="firstname" value="Priyank">
    <input type="hidden" name="email" id="email" value="[email protected]">
    <input type="hidden" name="phone" value="8511590131">
    <input type="hidden" name="surl" value="https://localhost:1234/order-payment/success/">
    <input type="hidden" name="furl" value="https://localhost:1234/order-payment/fail/">
    <textarea name="productinfo" style="display: none;">[{"isRequired": false, "name": "MRI LS Spine", "value": "5950.0", "description": ""}]</textarea>
    <input type="hidden" name="hash" value="71b28ca3a38f5b6b6a5d75b43f72d0ea312cc66dda24897cca20d03986b52904b42b5e7da67e7a0fa34a70fd7e56858bc165e98c202f5ff086ab446ec9cc85e1">
    <input type="hidden" name="pg" value="CASH">
    <input type="hidden" name="bankcode" value="PPINAPP">
    <input type="hidden" name="transactionContext" value="eyJjYXJ0RGV0YWlscyI6IHsiY2FydEl0ZW1zIjogW3siY2F0ZWdvcnkiOiAiU0hPUFBJTkciLCAiaXRlbUlkIjogIkNEWVZaRSIsICJwcmljZSI6IDU2MDAuMCwgInNoaXBwaW5nSW5mbyI6IHsiZGVsaXZlcnlUeXBlIjogIlNUQU5EQVJEIiwgInRpbWUiOiB7InRpbWVzdGFtcCI6IDE1ODMzMDcwMTcsICJ6b25lT2ZmU2V0IjogIiswNTozMCJ9fSwgImFkZHJlc3MiOiB7ImNpdHkiOiAiSHlkZXJhYmFkIiwgImNvdW50cnkiOiAiSW5kaWEiLCAicGluY29kZSI6ICI1MDAwMzMiLCAibG9uZ2l0dWRlIjogNzguNDA2NDgsICJsYXRpdHVkZSI6IDE3LjQyMjMwMywgImFkZHJlc3NTdHJpbmciOiAiQTI4LCBQcmFzaGFzaGFuIE5hZ2FyLCBSb2FkIG51bWJlciA3MCwgSnViaWxlZSBIaWxscyJ9LCAiaXRlbU5hbWUiOiAiT3JkZXIgSURzOiBDRFlWWkUiLCAicXVhbnRpdHkiOiAxfV19LCAib3JkZXJDb250ZXh0IjogeyJ0cmFja2luZ0luZm8iOiB7InVybCI6ICJodHRwOi8vMTI3LjAuMC4xOjEyMzQvL2Rhc2hib2FyZC9vcmRlcnMvP3Rva2VuPVFoaTVQS0Z1eEwiLCAidHlwZSI6ICJIVFRQUyJ9fSwgImZhcmVEZXRhaWxzIjogeyJ0b3RhbEFtb3VudCI6IDU2MDAuMCwgInBheWFibGVBbW91bnQiOiA1NjAwLjB9fQ==">
    <input type="hidden" value="Submit">
</form>

When a user clicks on Pay, the above code should trigger which will open the Switch Payment flow inside the PhonePe Application.

Step 3: Test the flow inside the PhonePe Application

How to test the flow inside PhonePe app can be found here

a.) Download the Apk and enter the static URL
b.) Enter the domains.
Request you to whitelist - "test.payu.in" and "secure.payu.in" while testing the flow.
c.) Enter appunique ID as SWITCHPREPROD_2002251929_PP_EXTERNAL

📘

Note: The payment flow will work only inside the PhonePe application. A merchant needs to test the flow inside PhonePe application.

Step 4: Identification of the source of traffic as PhonePe

As few merchants have to hide other payment options and other payment banners for the PhonePe Switch users, they should know that the user is opening the website inside the PhonePe application.

📘

Note

There should be no options shown to the user, as soon as he clicks on Pay, automatically PhonePe Payments page should open.

This can be done in 2 ways:

  1. Use a separate URL for your store in the PhonePe Apps Platform.
  2. Identify user agent as ‘PhonePe’ sent in PhonePe webview.

Step 5: Share the test cases to PhonePe Integration team

Refer to the section here. Merchant testing team needs to share the commented test cases to the PhonePe integration team on email for PreProd signoff.