UPI Intent One-Time Mandate Integration - PayU Hosted
The pre_authorize parameter is used to pre-authorize payments using the PayU Hosted Checkout integration with the _payment API.
You need to activate the Pre-authorize payments before you start using the functionality. Please contact your PayU KAM to enable this functionality.
Step 1: Post the Pre-Authorization Request
Request Parameters
- key (mandatory): Merchant key provided by PayU during onboarding. Example: JPM7Fg
- txnid (mandatory): Transaction ID is a reference number for a specific transaction/order generated by the merchant. Example: aso6787
- amount (mandatory): The payment amount for the transaction. Example: 100.00
- productinfo (mandatory): A brief description of the product. Example: iPhone
- firstname (mandatory): The first name of the customer. Example: Ashish
- email (mandatory): The email address of the customer (for fraud detection). Example: [email protected]
- phone (mandatory): The phone number of the customer (for fraud detection). Example: 9876543210
- surl (mandatory): Success URL - the page PayU will redirect to if the transaction is successful. Example: https://apiplayground-response.herokuapp.com/
- furl (mandatory): Failure URL - the page PayU will redirect to if the transaction fails. Example: https://apiplayground-response.herokuapp.com/
- pre_authorize (mandatory): Set to 1 to enable pre-authorization. Example: 1
- si_details (optional): JSON parameter with structured mandate information.
- hash (mandatory): It is the hash calculated by the merchant.
API Endpoints
- Test Environment: https://test.payu.in/_payment
- Production Environment: https://secure.payu.in/_payment
Hashing
The hash value needs to be calculated using the SHA512 algorithm with a specific formula. Contact PayU support for details.
Sample Request
Please refer to the API documentation for the complete sample request.
Step 2: Check PayU Responses
When you initiate a pre-auth transaction request:
- The PayU response contains the intentURIData parameter
- For success cases, this provides a URL to invoke the intent
Success Scenario Response
The success response includes metadata with transaction details and a result object with payment information.
Failure Scenario Response
The failure response includes metadata with an error message and details about why the transaction failed.
Step 3: Capture Pre-Authorized Payment
After pre-authorization, you need to capture the transaction by sending a request to the capture endpoint.
Request Parameters
- key (mandatory): Merchant key provided by PayU.
- command (mandatory): Command to execute, set to "capture_transaction".
- hash (mandatory): Generated using SHA512 formula.
- var1 (mandatory): PayU-generated payuId from pre-authorization.
- var2 (mandatory): Merchant's reference token for the pre-authorization.
- var3 (mandatory): Captured amount.
Sample Request
Please refer to the API documentation for the complete sample request.
Sample Response
The response will include status information, a message, request ID, and bank reference number upon successful capture.
Step 4: Verify Payment Status
Use the verify_payment API to check the transaction status for final confirmation. Documentation for this API is available in the PayU developer documentation.
Make sure to use unique transaction IDs (txnid) for each transaction to avoid duplication errors.
Updated 29 days ago