Testing and Go Live - Partner Integration
This section includes the Testing and Go Live checklist for Partner Integration onboarding and collect payment after onboarding.
Postman collection
Accelerate your integration workflow with our Postman collection for Partner Integration. Click the Download Postman Collection button below to download and get started.
Test Environment
Use the following test environment endpoints for Partner Integration:
| Resource | Test Environment URL | Production Environment URL |
|---|---|---|
| OAuth/Authentication | https://uat-accounts.payu.in/oauth/token | https://accounts.payu.in/oauth/token |
| Partner Onboarding APIs | https://uat-partner.payu.in | https://partner.payu.in |
| Payment APIs (Hosted Checkout) | https://test-partnerapilayer.payu.in/apilayer/partner/payments | https://secure.payu.in/_payment |
| Payment Postservice | https://test.payu.in/merchant/postservice.php | https://info.payu.in/merchant/postservice.php |
Note: All Partner API endpoints use UAT environment URLs with
uat-prefix for testing.
Testing Partner Onboarding Integration
Follow these steps to test the complete merchant onboarding flow:
1. Setup Test Credentials
Prerequisites:
- Partner Client ID and Client Secret (test environment)
- Access to partner dashboard (test mode)
- Postman or API testing tool
Contact PayU Partner Support to obtain your test environment client credentials.
2. Test OAuth Authentication
API: Get Token API
Test Steps:
- Generate access token using test client ID and secret
- Verify token expiration (default: 3600 seconds)
- Test token refresh mechanism
- Validate error handling for invalid credentials
Expected Results:
- Access token received successfully
- Token type is
Bearer - Refresh token received for renewal
3. Test Merchant Creation
API: Create Merchant API
Test Steps:
- Create a new merchant with valid test data
- Use dummy PAN:
AAAPA1234A(test PAN) - Use test mobile number:
9999999999 - Use test email:
[email protected]
Validation Points:
- Merchant UUID generated
- Merchant ID (MID) created
- Merchant status is
createdorpending_kyc - Response includes next steps
Common Test Scenarios:
- Valid merchant creation
- Duplicate PAN validation
- Invalid business entity handling
- Missing required fields
4. Test KYC Document Upload Flow
APIs:
Test Steps:
- Fetch required documents for merchant
- Upload each required document
- Verify document upload status
- Test document retrieval
- Test document deletion (if needed)
Document Upload Testing:
- Upload PAN card
- Upload address proof
- Upload bank proof (cancelled cheque/statement)
- Upload authorization letter (if applicable)
- Upload business proof/certificate
Validation Points:
- Document format validation (PDF, JPG, PNG)
- File size limits (max 5MB per document)
- Document status tracking
- Error handling for invalid formats
ReferenceFor document categories and types, refer to Document Categories and Types
5. Test Bank Details Addition
API: Update Merchant - Bank Details
Test Steps:
- Add bank account details
- Verify penny drop validation (if enabled)
- Update existing bank details
- Test IFSC code validation
Test Bank Details:
{
"account_number": "1234567890123456",
"ifsc_code": "SBIN0001234",
"account_holder_name": "Test Merchant Name",
"account_type": "current"
}Validation Points:
- Bank details saved successfully
- IFSC code validated
- Account holder name matches merchant name
- Penny drop verification completed (if applicable)
6. Test E-Sign/Agreement Flow
API: Generate Agreement for E-Sign
Test Steps:
- Generate merchant agreement document
- Send OTP to signatory email
- Verify OTP and complete e-sign
- Confirm signed agreement status
Validation Points:
- Agreement PDF generated
- OTP sent to signatory
- E-sign completed successfully
- Agreement status updated to
signed
7. Test Merchant Status Tracking
API: Get Merchant Details
Test Steps:
- Retrieve merchant details after each step
- Monitor merchant status transitions
- Track KYC completion percentage
- Identify pending requirements
Expected Status Flow:
created- Initial merchant creationpending_kyc- KYC documents pendingkyc_submitted- Documents uploadedunder_review- PayU team reviewingapproved- Merchant activatedlive- Ready for transactions
Validation Points:
- Status transitions correctly
- Pending actions clearly identified
- Error messages are actionable
- Completion percentage accurate
8. Test Webhook Integration
API: Partner Webhook
Test Steps:
- Configure webhook endpoint in partner dashboard
- Implement webhook receiver endpoint
- Test webhook signature verification
- Test idempotency handling
- Test retry mechanism
Webhook Events to Test:
merchant.createdmerchant.kyc_submittedmerchant.approvedmerchant.rejectedmerchant.live
Validation Points:
- Webhook received within SLA
- Signature verified successfully
- Duplicate webhooks handled (idempotency)
- Retry logic working for failures
- Status polling as fallback
Sample Webhook Handler:
app.post('/webhooks/payu-partner', (req, res) => {
// Verify signature
const signature = req.headers['x-payu-signature'];
const isValid = verifyWebhookSignature(req.body, signature, WEBHOOK_SECRET);
if (!isValid) {
return res.status(401).send('Invalid signature');
}
// Process webhook (idempotent handling)
const eventId = req.body.event_id;
if (!isEventProcessed(eventId)) {
processWebhookEvent(req.body);
markEventAsProcessed(eventId);
}
// Always return 200 OK quickly
res.status(200).send('OK');
});
ReferenceFor webhook implementation details and troubleshooting, refer to Get Real-time Merchant Status using Webhooks
Testing Partner Payment Integration
Follow these steps to test payment collection through Partner APIs:
1. Setup Payment Test Credentials
Prerequisites:
- Test Merchant Key and Salt (from onboarded merchant)
- Partner access token (OAuth)
- Test payment cards/methods
Test Payment CredentialsRefer to Test Cards, UPI IDs and Wallets documentation for test payment methods.
2. Test Payment Flow - Hosted Checkout
API: Hosted Checkout API - Partner Integration
Test Steps:
Step 1: Generate Access Token
Use Validate Auth Code and Client API to get partner access token
Step 2: Create Payment Request
Send payment request with mandatory parameters
Step 3: Hash Generation
Test hash generation using the formula:
hash = sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT)
Validation Points:
- Hash generated correctly
- All mandatory parameters included
- Payment page loads successfully
- Merchant branding displayed (if configured)
3. Test Payment Methods
Test transactions with each payment method:
Credit/Debit Cards
Test Card: 5123456789012346 (MasterCard)
- CVV:
123 - Expiry: Any future date
- OTP:
123456
Test Scenarios:
- Successful card payment
- Insufficient funds
- Invalid CVV
- Invalid OTP
- 3D Secure authentication
Net Banking
Test Banks:
- ICICI Bank (Test Mode)
- HDFC Bank (Test Mode)
- Axis Bank (Test Mode)
Test Scenarios:
- Successful net banking payment
- Payment cancellation
- Bank timeout handling
- Redirect flow validation
UPI
Test VPA: success@payu
Test Scenarios:
- UPI Collect successful
- UPI Intent successful
- Payment timeout
- User declined payment
API: UPI S2S Integration for Partners
Wallets
Test Wallets:
- PayTM (test mode)
- PhonePe (test mode)
- Google Pay (test mode)
4. Test Payment Response Handling
Test Steps:
- Handle success callback (SURL)
- Handle failure callback (FURL)
- Verify response parameters
- Validate reverse hash
Success Response Validation:
// Reverse hash verification
$reverseHash = hash('sha512',
$SALT.'|'.$status.'|||||||||||'.$email.'|'.$firstname.'|'
.$productinfo.'|'.$amount.'|'.$txnid.'|'.$key
);
if ($reverseHash == $receivedHash) {
// Response is valid
}Validation Points:
- SURL called on success
- FURL called on failure
- Reverse hash validated
- Transaction details match request
- Payment status is accurate
5. Test Transaction Verification
API: Verify Payment API
Test Steps:
- Verify transaction status after payment
- Handle cases where callback fails
- Test with different transaction IDs
- Validate response parameters
Validation Points:
- Transaction status matches actual payment
- Amount matches request
- Merchant verification successful
- Error handling for invalid txnid
6. Test Refund Flow
APIs:
Test Scenarios:
Full Refund
{
"merchantKey": "MERCHANT_KEY",
"paymentId": "PAYU_PAYMENT_ID",
"refundAmount": "100.00",
"token": "PARTNER_TOKEN"
}Partial Refund
{
"merchantKey": "MERCHANT_KEY",
"paymentId": "PAYU_PAYMENT_ID",
"refundAmount": "50.00",
"token": "PARTNER_TOKEN"
}Test Steps:
- Initiate full refund
- Initiate partial refund
- Check refund status
- Verify refund in merchant dashboard
- Test multiple partial refunds
Validation Points:
- Refund initiated successfully
- Refund status updated correctly
- Refund amount within allowed limits
- Error handling for invalid requests
- Notification sent to customer (if configured)
Additional API Testing
CKYC Verification Flow
APIs:
Test Steps:
- Send OTP to mobile number
- Verify OTP
- Fetch CKYC data
- Validate fetched information
DigiLocker Integration
Test Steps:
- Generate DigiLocker authorization link
- Complete DigiLocker authentication
- Verify document fetch
- Validate document details
Business Members & Signatory
APIs:
Test Steps:
- Add signatory details
- Add business members/KMP
- List all business members
- Verify details are correct
End-to-End Testing Scenarios
Test the complete integration flow from merchant onboarding to payment collection:
Scenario 1: New Merchant Onboarding + First Payment
- Create merchant via Create Merchant API
- Upload all KYC documents via Upload KYC Document API
- Complete e-sign via Generate Agreement for E-Sign
- Wait for approval (or use test auto-approve)
- Receive merchant credentials via Get Merchant Details
- Make first payment transaction via Hosted Checkout API
- Verify payment success
- Initiate test refund via Refund Transaction API
Scenario 2: Bulk Merchant Onboarding
- Create multiple merchants (5-10)
- Upload documents for all
- Track status via Partner Webhook
- Handle any rejections
- Test parallel processing
Scenario 3: Error Handling
- Test with invalid data
- Test network timeouts
- Test webhook delivery failures
- Test payment failures
- Test refund rejections
Go-Live Checklist
Use this checklist before moving to production:
Partner Onboarding - Go-Live Checklist
-
Legal Agreements
- Partner Reseller Agreement signed
- Data Processing Addendum in place
- Terms of Service accepted
-
Production Credentials
- Production Client ID obtained
- Production Client Secret obtained
- Production reseller token generated
- Credentials securely stored (environment variables/secrets manager)
-
Onboarding Flow Testing
- Full onboarding flow tested end-to-end
- All KYC document types uploaded successfully
- Bank verification completed
- E-sign flow tested and verified
- Merchant status transitions validated
- Error handling implemented
-
Webhook Integration
- Production webhook endpoint configured
- Webhook signature verification implemented
- Returns 200 OK within 5 seconds
- Idempotent webhook handling verified
- Retry logic implemented
- Dead letter queue for failed webhooks
- Status polling fallback mechanism
-
API Integration Best Practices
- All API endpoints use production URLs
- OAuth token refresh implemented via Refresh Token API
- Rate limiting handled (429 responses)
- Timeout handling (30 second default)
- Retry logic with exponential backoff
- Error logging and monitoring
-
Data Security & Compliance
- PII handling compliant (minimize storage)
- Encryption at rest for sensitive data
- Encryption in transit (HTTPS only)
- No plain text storage of PAN/bank details
- GDPR/data privacy compliance
- Consent captured at CKYC/DigiLocker/VKYC steps
- Data retention policy implemented
-
Monitoring & Logging
- API request/response logging
- Error tracking system integrated
- Performance monitoring setup
- Alert notifications configured
- Dashboard for merchant status tracking
Partner Payment Integration - Go-Live Checklist
-
Production Setup
- Production merchant keys obtained
- Production salt obtained
- Test environment code removed
- Production URLs configured
- Hash generation using production salt
-
Payment Flow Testing
- All payment methods tested
- Hash generation verified
- Reverse hash validation implemented
- Success/failure callbacks working
- Transaction verification integrated
-
Payment Security
- No sensitive data logged
- Hash generated server-side only
- Salt never exposed to client
- HTTPS enforced on all endpoints
- XSS and CSRF protection implemented
-
Response Handling
- Success URL (SURL) configured
- Failure URL (FURL) configured
- Response validation implemented
- Database transaction recording
- Customer notification system
-
Refund Implementation
- Refund API integrated
- Refund status tracking
- Full refund tested
- Partial refund tested
- Refund limits validated
- Customer refund notifications
-
Error Handling
- Payment timeout handling
- Network error handling
- Invalid response handling
- Duplicate transaction prevention
- User-friendly error messages
-
Compliance & Reconciliation
- Transaction reconciliation process
- Settlement tracking
- Tax compliance (GST/TDS)
- Dispute handling process
- Chargeback monitoring
-
Testing Completed
- End-to-end testing in production (small amounts)
- All payment methods verified
- All currencies tested (if multi-currency)
- Peak load testing
- Fallback mechanisms tested
Production URLs Reference
Once all testing is complete and checklist items are verified, update all endpoints to production:
| Resource | Production URL |
|---|---|
| OAuth/Authentication | https://accounts.payu.in/oauth/token |
| Partner Onboarding APIs | https://partner.payu.in |
| Payment (Hosted Checkout) | https://secure.payu.in/_payment |
| Payment Postservice | https://info.payu.in/merchant/postservice.php |
| Verify Payment | https://info.payu.in/merchant/postservice?form=2 |
Common Issues & Troubleshooting
Issue 1: OAuth Token Expired
Solution: Implement token refresh logic using Refresh Token API
Issue 2: Webhook Not Received
Solution:
- Verify endpoint is publicly accessible
- Check firewall rules
- Implement status polling as fallback
- Refer to KYC Errors and Solutions for common issues
Issue 3: Hash Mismatch
Solution:
- Verify parameter order
- Check salt is correct
- Ensure no extra spaces
- Use UTF-8 encoding
Issue 4: Payment Callback Not Triggered
Solution:
- Verify SURL/FURL are publicly accessible
- Implement Verify Payment API as fallback
- Check server logs for errors
Issue 5: KYC Document Upload Failures
Solution:
- Verify document format (PDF, JPG, PNG)
- Check file size (max 5MB)
- Ensure correct document category and type from Document Categories and Types
- Review error messages from Upload KYC Document API
Updated 16 days ago
