Testing and Go Live - OAuth Flow Partner Integration
This checklist covers everything you need to test and validate the Co-Branded OAuth flow before going live.
Postman Collection
Accelerate your integration workflow with our Postman collection for OAuth Integration. Click the Download Postman Collection button below to download and get started.
Test Environment
Use the following test environment endpoints for OAuth Integration:
| Resource | Test Environment URL | Production Environment URL |
|---|---|---|
| Authorization Page | https://onboardingtest.payu.in/app/account/signup?reseller_id={PayU partner identifier}&state={state} | https://onboarding.payu.in/app/account/signup?reseller_id={reseller_id}&state={session state} |
| Validate Auth Code | https://testdashboard.payu.in/oauth/validate-auth-code | https://dashboard.payu.in/oauth/validate-auth-code |
| Get Merchant Credentials | https://testdashboard.payu.in/oauth/get-merchant-credentials | https://dashboard.payu.in/oauth/get-merchant-credentials |
| Payment APIs (Partner API Layer) | https://test-partnerapilayer.payu.in/apilayer/partner/payments | https://partnerapilayer.payu.in/apilayer/partner/payments |
Note: All OAuth endpoints use test environment URLs with
testsubdomain for testing.
Testing OAuth Integration
Follow these steps to test the complete OAuth onboarding flow:
1. Setup Test Credentials
Prerequisites:
- Partner Client ID and Client Secret (test environment)
- Whitelisted redirect URL (test environment)
- Access to PayU Partner Portal (test mode)
Contact your PayU Key Account Manager (KAM) to:
- Enable OAuth onboarding for your partner account
- Obtain test environment Client ID and Secret
- Whitelist your test redirect URL(s)
How to Download Credentials:
- Log in to PayU Partner Portal (test environment)
- Navigate to Merchant Integration → Partner Integration
- Click Download Credentials
- Save Client ID and Client Secret securely
2. Test Authorization URL Construction
Step 1: Build Authorization URL
Construct the authorization URL with the required parameters:
Test URL Format:
https://onboardingtest.payu.in/app/account/signup?reseller_id={PayU partner identifier}&state={state}Required Parameters:
| Parameter | Description |
|---|---|
reseller_id | Contains encoded values of PayU partner identifier |
state | Contains encoded session state |
Sample Authorization URL:
https://onboarding.payu.in/app/account/signup?reseller_id=66ed-fc3c-512f47ed-ac95-4319452fbd89&state=Uqnr5ge22UValidation Points:
-
reseller_idis correctly populated with encoded Merchant ID and email -
stateparameter carries a unique session state value - URL opens the PayU authorization/sign-up page
- No browser errors or warnings
Step 2: URL Encoding Test
Verify URL encoding is correct:
| Original URL | URL Encoded |
|---|---|
https://partner.example.com/callback | https%3A%2F%2Fpartner.example.com%2Fcallback |
https://partner.example.com/callback?session=123 | https%3A%2F%2Fpartner.example.com%2Fcallback%3Fsession%3D123 |
https://partner.example.com/callback?a=1&b=2 | https%3A%2F%2Fpartner.example.com%2Fcallback%3Fa%3D1%26b%3D2 |
Tip: Use online URL encoding tools or programming language built-in functions:
- JavaScript:
encodeURIComponent(url)- Python:
urllib.parse.quote(url, safe='')- PHP:
urlencode($url)- Java:
URLEncoder.encode(url, "UTF-8")
3. Test Merchant Authorization Flow
Scenario 1: New Merchant Registration
Test Steps:
- Click authorization URL
- PayU authorization page loads
- Click "Create New Account"
- Fill merchant registration form:
- Business name:
Test Business OAuth - Email:
test.oauth.{timestamp}@example.com - Mobile:
9999999999 - PAN:
AAAPA1234A(test PAN)
- Business name:
- Complete OTP verification
- Grant authorization to partner app
- Redirected to partner redirect URL with
auth_code
Validation Points:
- Registration form loads correctly
- Mobile OTP received and verified
- Email verification completed
- Partner branding visible (if configured)
- Authorization grant screen displays correctly
- Redirect to partner URL successful
-
auth_codepresent in URL parameters
Scenario 2: Existing Merchant Login
Test Steps:
- Click authorization URL
- PayU authorization page loads
- Login with existing test merchant credentials
- Grant authorization to partner app
- Redirected to partner redirect URL with
auth_code
Validation Points:
- Login form loads correctly
- Authentication successful
- Authorization grant screen displays
- Partner app details shown correctly
- Redirect successful with
auth_code
Scenario 3: Already Onboarded Merchant
Test Steps:
- Click authorization URL with merchant already onboarded through partner
- Auto-redirect should occur with
auth_code
Validation Points:
- No additional consent required
- Immediate redirect to partner URL
- Valid
auth_codereceived
Scenario 4: Merchant Denies Authorization
Test Steps:
- Click authorization URL
- Login as merchant
- Click "Deny" or "Cancel" on authorization screen
- Redirected to partner URL
Validation Points:
- Redirect occurs even on denial
- Error parameter in redirect URL (e.g.,
?error=access_denied) - Partner app handles denial gracefully
- User-friendly error message displayed
4. Test Authorization Code Exchange
API: Validate Auth Code and Client API
Step 1: Capture Authorization Code
From the callback URL, extract the auth_code parameter:
Callback URL Format:
https://onboarding.payu.in/app/account/signup?reseller_id={{reseller_id}}&state={session state}Example:
https://onboarding.payu.in/app/account/signup?reseller_id=11f1-1078-ee249a86-9fdf-0aad783eb813&state=1513493Important: The
auth_codeis single-use and expires after a short period. Exchange it immediately for merchant credentials.
Step 2: Exchange Code for Credentials
Call the Validate Auth Code API immediately after receiving the auth_code:
Sample Request:
curl --location 'https://testdashboard.payu.in/oauth/validate-auth-code' \
--header 'Content-Type: application/json' \
--data '{
"client_id": "ABC123",
"client_secret": "your_client_secret",
"auth_code": "XYZ789ABC123"
}'Expected Success Response:
{
"access_token": "e6ff7e34b704be2b14c8ae3c0e776597df4ae7de9e12d3e4c79781fcbbf2c4bb",
"token_type": "Bearer",
"expires_in": 7199,
"refresh_token": "356fe080daa69438e0c2d3b0a80b3fe4aa3f78b264e6092e95e4429ae59486a7",
"scope": "credentials_using_oauth create_payment_links read_payment_links update_payment_links delete_payment_links",
"created_at": 1709198191,
"user_uuid": "11ed-933c-d307ba06-b71a-0a64ecf8a4cc"
}Response Parameters:
| Parameter | Description |
|---|---|
access_token | Bearer token to authorize payment API calls |
token_type | Always Bearer |
expires_in | Token validity in seconds |
refresh_token | Token used to obtain a new access token |
scope | Permissions granted |
created_at | Unix timestamp of token creation |
user_uuid | Unique identifier of the onboarded merchant |
Validation Points:
- API responds within 2 seconds
-
access_tokenreceived and is a valid hex string -
token_typeisBearer -
expires_invalue is present -
user_uuidreceived and associated with correct merchant
Step 3: Test Error Scenarios
Invalid Client ID:
{
"client_id": "INVALID",
"client_secret": "your_client_secret",
"auth_code": "valid_auth_code"
}Expected Response:
{
"status": 0,
"msg": "Invalid client credentials"
}Invalid Client Secret:
{
"client_id": "ABC123",
"client_secret": "INVALID",
"auth_code": "valid_auth_code"
}Expected Response:
{
"status": 0,
"msg": "Invalid client credentials"
}Expired/Invalid Auth Code:
{
"client_id": "ABC123",
"client_secret": "your_client_secret",
"auth_code": "EXPIRED_OR_INVALID"
}Expected Response:
{
"status": 0,
"msg": "Invalid auth code"
}Reused Auth Code:
{
"client_id": "ABC123",
"client_secret": "your_client_secret",
"auth_code": "ALREADY_USED_CODE"
}Expected Response:
{
"status": 0,
"msg": "Auth code already used"
}Validation Points:
- Invalid credentials rejected with
status: 0 - Expired codes rejected appropriately
- Reused codes cannot be exchanged again
- Error messages are clear and actionable
- No sensitive information leaked in errors
Step 4: Test Auth Code Expiration
Test Steps:
- Generate auth code
- Wait for the configured expiry period
- Attempt to exchange the expired code
- Verify rejection
Validation Points:
- Expired codes rejected
- Appropriate error message returned
- Must generate a new auth code by restarting the OAuth flow
5. Test Credential Storage and Security
Test 1: Secure Storage
Validation Points:
-
access_tokenstored encrypted in database -
refresh_tokenstored encrypted in database - Tokens never logged in plain text
- Tokens not exposed in client-side code
- Database access controlled and audited
Test 2: Credential Retrieval
Test Steps:
- Store tokens after receiving from the Validate Auth Code API
- Associate with partner's internal merchant ID using
user_uuid - Retrieve access token for payment processing
- Decrypt and use as Bearer token in payment API calls
Validation Points:
- Tokens retrieved successfully
- Decryption works correctly
- Associated with correct merchant via
user_uuid - Audit log created for retrieval
Test 3: Access Control
Test Steps:
- Implement role-based access control
- Test admin access to stored tokens
- Test non-admin access denied
- Test API-level access restrictions
Validation Points:
- Only authorized roles can access tokens
- Access attempts logged
- Failed access attempts trigger alerts
- No tokens visible in application logs
6. Test Get Merchant Credentials API
API: Get Merchant Credentials API
Use Case: Retrieve credentials at a later time if needed
Step 1: Basic Retrieval
curl --location 'https://testdashboard.payu.in/oauth/get-merchant-credentials' \
--header 'Content-Type: application/json' \
--data '{
"client_id": "ABC123",
"client_secret": "your_client_secret"
}'Expected Response:
{
"status": 1,
"msg": "Success",
"merchant_key": "mK3j2L9p",
"salt": "sA7x9B2c"
}Validation Points:
- Credentials match those received earlier
- API responds within 2 seconds
- Can be called multiple times
- Same credentials returned consistently
Step 2: Error Scenarios
Invalid Client Credentials:
{
"client_id": "INVALID",
"client_secret": "INVALID"
}Expected Response:
{
"status": 0,
"msg": "Invalid client credentials"
}No Merchant Onboarded:
For a valid partner client that hasn't onboarded any merchant via OAuth:
Expected Response:
{
"status": 0,
"msg": "No merchant found for this partner"
}Validation Points:
- Invalid credentials rejected
- Appropriate error messages returned
- No sensitive data in error responses
7. Test Payment Integration with OAuth Credentials
After receiving merchant credentials via OAuth, test payment collection using the Partner API Layer. Use the access_token received from the Validate Auth Code API as the Bearer token.
Step 1: Test Hosted Checkout Payment Request
Submit a payment using the Partner Payments API:
Sample Request:
curl --location --request POST \
'https://test-partnerapilayer.payu.in/apilayer/partner/payments' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <access_token>' \
--data-raw '{
"txnid": "nY3tkz3vciHFGTjblyFeycL2Zn1m",
"amount": 1090.33,
"productinfo": "whatsapp",
"firstname": "Manikanta",
"reseller_id": "83fe-eb64-021844d8-9397-26535b1bf0c2",
"merchant_id": "8238480",
"phone": 7036722360,
"hash": "52f45927e221a16bd5372709516de5110c06c55e0057f8a18a3b9b9f2c2f176870af276274709910f27d7c5df44822777542e3d4b86f29e8304e17fcb373133c",
"lastname": "CHeruku",
"email": "[email protected]",
"curl": "<YOUR_CANCEL_URL>",
"furl": "<YOUR_FAILURE_URL>",
"surl": "<YOUR_SUCCESS_URL>",
"udf1": "whatsapp"
}'Expected Response:
{
"redirectUri": "https://apitest.payu.in/public/#/35de666bac018494a06205addba2962cdb8d03ca9c2fa7954807098709f1b6dc"
}Validation Points:
- API call succeeds with valid Bearer token
-
redirectUrireceived in response - Redirect URI opens the PayU payment page
- Merchant name displayed correctly on payment page
- Test transaction completes successfully
- Redirected to success URL (SURL) after payment
Step 2: Test UPI S2S Payment Request
For UPI S2S flow, use the same Partner Payments API endpoint with txn_s2s_flow:
Sample Request:
curl --location --request POST 'https://test-partnerapilayer.payu.in/apilayer/partner/payments' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer 9d2ab8e1b99aa02f6b827af5b5000b277d9cb1cd037acb7cb31436a5b0da4f74' \
--data-raw '{
"txnid": "nY3tkz3vciHFGTjblyFeycL2Zn1m",
"amount": 1090.33,
"productinfo": "whatsapp",
"firstname": "Manikanta",
"reseller_id": "83fe-eb64-021844d8-9397-26535b1bf0c2",
"merchant_id": 8238480,
"phone": 7036722360,
"hash": "5aadceaf6bec9158ccba8ec0dab32debcacbfd50e3587c077fa11107a5be0ac26712fae230522afb8908d068122c02f2d5c733a46c33ace0f66e5cc9d2ae4714",
"lastname": "CHeruku",
"email": "[email protected]",
"curl": "https://www.google.com",
"furl": "https://www.google.com",
"surl": "https://www.youtube.com",
"txn_s2s_flow": "4",
"s2s_device_info": "ewew",
"s2s_client_ip": "ewew"
}'Expected Response:
{
"metaData": {
"message": null,
"referenceId": "024d9afbdbf85bd35b25649ccf983e16ee3d4646c2cdcffada88bd2df371fd43",
"statusCode": null,
"txnId": "nY3tkz3vciHFGTjblyFeycL2Zn1m",
"txnStatus": "pending",
"unmappedStatus": "pending"
},
"result": {
"paymentId": 403993715529028543,
"merchantName": "Merchant",
"merchantVpa": null,
"amount": "1090.33",
"intentURIData": "pa=&pn=&tr=403993715529028543&tid=PPPL403993715529028543290523133325&am=1090.33&cu=INR&tn=UPI Transaction for PPPL403993715529028543290523133325",
"otpPostUrl": "https://test.payu.in/ResponseHandler.php"
}
}Validation Points:
-
txnStatusispendingon initial response -
intentURIDatareceived for UPI deep link -
otpPostUrlpresent for OTP handling - Transaction completes after UPI confirmation
Step 3: Verify Payment Response
After payment completes, verify the transaction via PayU's callback:
Validation Points:
- SURL/FURL receives POST callback from PayU
-
txnidin callback matches the original request -
amountin callback matches the original request -
statusfield correctly reflects payment outcome (success/failure) -
mihpayid(PayU transaction ID) is present - Reverse hash validation passes to confirm authenticity
8. Test Multiple Merchant Onboarding
Test onboarding multiple merchants through OAuth:
Test Steps:
- Onboard Merchant A via OAuth
- Store Merchant A's
access_tokenanduser_uuid - Onboard Merchant B via OAuth
- Store Merchant B's
access_tokenanduser_uuid - Verify both sets of credentials work independently
Validation Points:
- Each merchant has a unique
access_tokenanduser_uuid - Tokens stored separately and correctly associated via
user_uuid - Payments for Merchant A use Merchant A's Bearer token
- Payments for Merchant B use Merchant B's Bearer token
- No credential cross-contamination
9. Test Error Handling and Edge Cases
Scenario 1: Redirect URL Mismatch
Test Steps:
- Whitelist URL:
https://partner.example.com/callback - Use redirect URL:
https://different.example.com/callback - Attempt authorization
Expected Result:
- Authorization blocked
- Error message displayed
- No auth code generated
Scenario 2: Missing Parameters
Test Steps:
- Build auth URL without
reseller_id - Build auth URL without
state - Attempt authorization
Expected Result:
- Error message displayed
- User not able to proceed
Scenario 3: Network Timeout
Test Steps:
- Simulate slow network during API call
- Test timeout handling
- Test retry logic
Validation Points:
- Timeout handled gracefully
- User-friendly error message
- Retry mechanism works
- No duplicate credential storage
Scenario 4: Concurrent OAuth Flows
Test Steps:
- Start OAuth flow for Merchant X
- Before completing, start OAuth flow for Merchant Y
- Complete both flows
Validation Points:
- Both flows complete successfully
- Correct credentials stored for each merchant
- No session confusion
- State management working correctly
End-to-End Testing Scenarios
Test the complete integration flow from OAuth authorization to payment collection:
Scenario 1: Complete OAuth Flow + First Payment
- Build and open the authorization URL
- Register new test merchant or login with existing credentials
- Grant authorization to partner app
- Receive auth code in redirect
- Exchange auth code for credentials via Validate Auth Code API
- Store
access_tokenanduser_uuidsecurely - Submit test payment to Partner Payments API using Bearer token
- Verify payment success via
redirectUri - Validate payment callback on SURL
Expected Duration: 3–5 minutes
Validation Points:
- All steps complete without errors
-
access_tokenreceived and stored - Payment successful with Bearer token auth
- Callback received with valid data
Scenario 2: OAuth Re-authorization
- Complete initial OAuth flow for a merchant
- Store credentials
- Later, initiate OAuth flow again for same merchant
- Verify auto-redirect with new auth code
- Exchange new auth code for credentials
- Verify
user_uuidmatches previously stored record
Validation Points:
- Re-authorization works smoothly
- Merchant not asked for consent again
- Same
user_uuidreturned - No duplicate merchant records
Scenario 3: Bulk Merchant Onboarding via OAuth
- Prepare list of 10 test merchants
- Send OAuth links to each
- Track completion status
- Store all
access_tokenanduser_uuidvalues - Test payment for each merchant using their respective Bearer token
Validation Points:
- All merchants onboarded successfully
- Each has a unique
access_tokenanduser_uuid - Parallel processing works
- No credential mix-ups
Scenario 4: Error Recovery
- Start OAuth flow
- Receive auth code
- API call fails (simulate network error)
- Retry auth code exchange
- Verify success on retry
Validation Points:
- Retry successful
- Auth code still valid within expiry
-
access_tokenreceived - No duplicate processing
Go-Live Checklist
Use this checklist before moving to production:
OAuth Integration — Go-Live Checklist
-
Legal Agreements
- Partner Reseller Agreement signed
- OAuth integration terms accepted
- Data Processing Addendum in place
-
Production Credentials
- Production Client ID obtained from Partner Portal
- Production Client Secret obtained
- Production redirect URL(s) whitelisted
- Credentials stored securely (secrets manager/vault)
- No test credentials in production code
-
OAuth Configuration
- OAuth scope enabled by PayU KAM for production
- Production authorization URL configured:
https://onboarding.payu.in/app/account/signup?reseller_id={reseller_id}&state={session state} - Production API endpoints configured
- Redirect URLs use HTTPS
- All redirect URLs whitelisted in Partner Portal
-
Authorization Flow
- Authorization URL construction tested with correct
reseller_idandstateparameters - Merchant login and registration tested
- Authorization grant screen tested
- Callback handling implemented
- Auth code extraction working
-
stateparameter used for session binding (recommended for security)
- Authorization URL construction tested with correct
-
API Integration
- Validate Auth Code API integration complete
- Get Merchant Credentials API integration complete (optional)
- API error handling implemented
- Timeout handling (30 second default)
- Retry logic with exponential backoff
- Rate limiting handled (429 responses)
-
Credential Management
- Auth code exchange happens immediately after redirect
-
access_tokenandrefresh_tokenstored securely - Tokens encrypted at rest
- Tokens associated with correct merchant via
user_uuid - Token refresh flow implemented before expiry
- No tokens logged in plain text
- No tokens exposed to client-side
-
Payment Integration
- Partner Payments API integration tested with Bearer token auth
- Hosted Checkout flow tested end-to-end
- UPI S2S flow tested end-to-end (if applicable)
- Success callback (SURL) implemented
- Failure callback (FURL) implemented
- Cancel callback (CURL) implemented
- Transaction verification integrated
-
Security Best Practices
- HTTPS enforced on all endpoints
- Redirect URLs validated before use
-
stateparameter used to prevent CSRF - Auth codes used only once
- Auth code expiry handled
- Client secret never exposed to client
- XSS protection implemented
- SQL injection prevention in place
-
Error Handling
- Invalid client credentials handled
- Expired auth code handled
- Used auth code rejection handled
- Network errors handled gracefully
- User-friendly error messages displayed
- Error logging implemented
- Alert notifications for critical errors
-
Data Privacy & Compliance
- GDPR/data privacy compliance verified
- User consent captured appropriately
- Minimal PII stored
- Data retention policy implemented
- Right to erasure implemented (if applicable)
- Privacy policy updated to mention OAuth
-
Monitoring & Logging
- OAuth flow events logged
- API requests/responses logged (excluding secrets)
- Token storage/retrieval audited
- Error tracking system integrated
- Performance monitoring setup
- Alert notifications configured
- Dashboard for merchant onboarding status
-
Testing Completed
- End-to-end OAuth flow tested in production (test merchants)
- Multiple merchant onboarding tested
- Payment with OAuth Bearer token tested
- Error scenarios tested
- Edge cases validated
- Load testing completed
-
Documentation
- Internal documentation for OAuth flow
- Runbooks for common issues
- Escalation procedures defined
- Knowledge base updated
- Training provided to support team
Production URLs Reference
Once all testing is complete and checklist items are verified, update all endpoints to production:
| Resource | Production URL |
|---|---|
| Authorization Page | https://onboarding.payu.in/app/account/signup?reseller_id={reseller_id}&state={session state} |
| Validate Auth Code | https://dashboard.payu.in/oauth/validate-auth-code |
| Get Merchant Credentials | https://dashboard.payu.in/oauth/get-merchant-credentials |
| Payment (Partner API Layer) | https://partnerapilayer.payu.in/apilayer/partner/payments |
| Verify Payment | https://info.payu.in/merchant/postservice?form=2 |
Common Issues & Troubleshooting
Issue 1: Authorization URL Not Loading
Symptoms: Authorization page shows error or doesn't load
Possible Causes:
- Invalid or missing
reseller_id - Client account not enabled for OAuth
stateparameter malformed or missing- OAuth not enabled for partner account
Solution:
- Verify
reseller_idis correctly constructed with encoded Merchant ID and email - Contact PayU KAM to confirm OAuth is enabled
- Ensure
statecarries a valid encoded session value - Verify using the test environment URL for testing
Issue 2: Redirect URL Mismatch Error
Symptoms: Error message: "Redirect URL not whitelisted"
Possible Causes:
- Redirect URL not whitelisted in Partner Portal
- URL encoding mismatch (encoded vs decoded)
- HTTP vs HTTPS mismatch
- Trailing slash mismatch
Solution:
- Log in to Partner Portal → Settings → OAuth Configuration
- Add exact redirect URL to whitelist (including protocol and path)
- Ensure URL in authorization request matches exactly
- Use HTTPS for all redirect URLs
- Be consistent with trailing slashes
Examples:
✅ Correct: https://partner.example.com/callback
❌ Wrong: http://partner.example.com/callback (HTTP instead of HTTPS)
✅ Correct: https://partner.example.com/callback/
❌ Wrong: https://partner.example.com/callback (missing trailing slash if whitelisted with it)Issue 3: Invalid Auth Code
Symptoms: "Invalid auth code" error when calling Validate Auth Code API
Possible Causes:
- Auth code already used
- Auth code expired
- Incorrect auth code copied from URL
- Special characters not handled properly
Solution:
- Extract auth code immediately from redirect URL
- Exchange auth code within the expiry window of receiving it
- Use auth code only once
- Handle URL decoding properly if auth code contains special characters
- Generate new auth code by repeating OAuth flow
Issue 4: Merchant Credentials Not Received
Symptoms: API returns success but no access_token or user_uuid
Possible Causes:
- Merchant not fully onboarded
- KYC pending for merchant
- Merchant account not activated
Solution:
- Check merchant status in PayU dashboard
- Ensure merchant completed KYC
- Wait for merchant approval (if under review)
- Contact PayU support if merchant shows as active but tokens not received
Issue 5: Payment API Authorization Failure
Symptoms: Partner Payments API returns 401 Unauthorized or hash mismatch error
Possible Causes:
- Using an expired or invalid
access_tokenas Bearer token - Incorrect
Authorizationheader format - Hash string parameter order incorrect
- Extra spaces in hash string
Solution:
- Verify the
access_tokenfrom OAuth is valid and not expired - Use the format:
Authorization: Bearer <access_token> - Check hash string parameter order:
key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT - Trim all parameters to remove spaces
- Refresh the access token using the
refresh_tokenif expired
Issue 6: Payment Callback Not Received
Symptoms: Payment completed but SURL/FURL not triggered
Possible Causes:
- SURL/FURL not publicly accessible
- Firewall blocking PayU servers
- Incorrect URL in payment request
- Server timeout during callback
Solution:
- Verify SURL/FURL are publicly accessible (use external tools to test)
- Whitelist PayU IP ranges in firewall
- Ensure URLs use HTTPS
- Check server logs for incoming requests
- Implement Verify Payment API as fallback
- Return HTTP 200 OK quickly in callback handler
Issue 7: Multiple OAuth Sessions Confusion
Symptoms: Wrong merchant credentials stored or retrieved
Possible Causes:
- Session management issues
stateparameter not used or not validated- Concurrent OAuth flows not handled
- Cache issues
Solution:
- Use
stateparameter in authorization URL to bind sessions:https://onboarding.payu.in/app/account/signup?reseller_id={{reseller_id}}&state=SESSION_ID - Verify
stateparameter in callback matches the original session - Store
access_tokenimmediately after receiving, keyed touser_uuid - Use unique
statevalues to track each OAuth flow - Implement proper session management
Issue 8: Auth Code Expiry
Symptoms: Auth code rejected even when exchanged quickly
Possible Causes:
- Auth code expired (short expiry window)
- Clock skew between servers
Solution:
- Exchange auth code immediately after redirect — do not store or delay
- Ensure server clocks are synchronized (NTP)
- Generate a new auth code by restarting the OAuth flow
Performance Optimization
Best Practices
-
Parallel Processing
- Process multiple OAuth flows concurrently
- Use asynchronous API calls where possible
- Implement queuing for token storage
-
Token Caching
- Cache
access_tokensecurely for itsexpires_induration - Use
refresh_tokento obtain new access tokens without re-authorizing - Use Redis or similar for session and token management
- Cache
-
Database Optimization
- Index
user_uuidandclient_idcolumns - Use connection pooling
- Optimize token retrieval queries
- Index
-
API Call Optimization
- Implement exponential backoff for retries on the Partner Payments API
- Set appropriate timeouts (30 seconds recommended)
- Handle
429 Too Many Requestswith backoff logic
-
Monitoring
- Track OAuth flow completion rates
- Monitor API response times
- Set up alerts for high error rates
- Track token refresh success rates
Security Checklist
-
Transport Security
- All OAuth URLs use HTTPS
- TLS 1.2 or higher enforced
- Valid SSL certificates installed
- HSTS headers configured
-
Data Protection
- Client secret stored in secrets manager (AWS Secrets Manager, HashiCorp Vault, etc.)
-
access_tokenandrefresh_tokenencrypted at rest (AES-256) - Encryption keys rotated regularly
- No tokens in application logs
- No tokens in error messages
-
Access Control
- Role-based access control (RBAC) implemented
- API endpoints require authentication
- Admin access audited
- Principle of least privilege applied
-
CSRF Protection
-
stateparameter used in OAuth flow -
stateparameter validated in callback - CSRF tokens on all forms
- SameSite cookie attribute set
-
-
Input Validation
- Auth code validated before use
- Client ID and Secret validated
- Redirect URL validated against whitelist
- All user inputs sanitized
-
Rate Limiting
- API rate limits implemented
- Brute force protection on OAuth endpoints
- IP-based rate limiting
- Account lockout after multiple failures
-
Audit Logging
- All OAuth events logged
- Token access logged
- Failed authentication attempts logged
- Logs retained according to policy
- Log tampering protection
Support & Escalation
When to Contact PayU Support
Contact PayU support in these scenarios:
- OAuth not enabled for your partner account
- Redirect URL whitelisting issues
- Merchant tokens not received despite successful OAuth flow
- Repeated API failures (not related to your implementation)
- Security concerns or suspected compromise
Contact Information
- Partner Support Email: [email protected]
- Technical Support: Navigate to help.payu.in or send an mail with complete issue details (including mid) to [email protected]
- Key Account Manager: (provided during onboarding)
Information to Provide When Contacting Support
When contacting support, include:
- Partner Client ID (never share Client Secret)
- Timestamp of issue
- Error messages received
- API request/response (redact sensitive data such as tokens)
- Steps to reproduce
- Environment (test/production)
ImportantAlways test thoroughly in the test environment before going live. Conduct small-scale production testing with a few merchants before full rollout.
Updated about 1 hour ago
