There are 3 key steps in the payment flow:
Step 1: User Creates Payment
↓
Backend creates INITIATED payment
↓
Step 2: User Completes Payment on GetEpay
↓
User redirects back to your app (Return URL)
↓
BUT: Status is still INITIATED at this point!
↓
Step 3: GetEpay Sends Callback (Server-to-Server)
↓
Backend receives encrypted callback
↓
Decrypts & updates status to SUCCESS/FAILED
↓
Frontend auto-refreshes and shows updated status
Common Cause: GetEpay callback is not reaching your backend
-
Callback URL not configured in GetEpay Dashboard
- Check your merchant settings at GetEpay
- Make sure callback URL is registered
- Callback URL should be:
https://yourdomain.com/api/v1/payments/callback(production)
-
Testing on localhost
- GetEpay servers can't reach
http://localhost:8080 - You need to use ngrok or similar to expose localhost to the internet
- OR test using the test callback script
- GetEpay servers can't reach
-
Database Connection Failed
- Even if callback is received, if database is down, update fails silently
- Check backend logs for [CALLBACK] messages
-
Wrong Callback URL in .env
- Check:
GETEPAY_CALLBACK_URL=http://localhost:8080/api/v1/payments/callback
- Check:
Run this command in your backend directory:
grep GETEPAY_CALLBACK_URL .envYou should see:
GETEPAY_CALLBACK_URL=http://localhost:8080/api/v1/payments/callback
Use the test callback script to simulate what GetEpay does:
# First, get a payment ID from your database or API response
# Then run:
node test-callback.js <PAYMENT_ID> SUCCESS
# Example:
node test-callback.js 8d3fb02b-9fe0-4c8d-93d9-a7640e867202 SUCCESSThis will:
- ✅ Encrypt a mock response like GetEpay does
- ✅ Send it to your callback endpoint
- ✅ Check if payment status updates
- ✅ Verify the database update worked
When you run the test-callback script, look for these logs in your backend terminal:
🧪 [TEST CALLBACK] Received test callback
🔔 [CALLBACK] Received callback from GetEpay
📦 [CALLBACK] Body: {...}
🔐 [CALLBACK] Decrypting response...
✅ [CALLBACK] Decrypted response: {...}
💰 [CALLBACK] Payment successful! Updating status to SUCCESS
If you DON'T see these messages, the callback endpoint isn't being called.
curl 'http://localhost:8080/api/v1/payments/{PAYMENT_ID}' \
-H 'Content-Type: application/json'Look for the "status" field:
- If it changed from
INITIATEDtoSUCCESS→ ✅ Callback worked - If it's still
INITIATED→ ❌ Callback didn't run or failed
When you deploy to production:
-
Update .env with production URLs
GETEPAY_CALLBACK_URL=https://yourdomain.com/api/v1/payments/callback -
Register callback URL in GetEpay Dashboard
- Log in to your GetEpay merchant account
- Go to Settings / Configuration
- Set the callback/webhook URL
- You should get a confirmation
-
Make sure HTTPS is configured
- GetEpay requires HTTPS in production
- Self-signed certificates won't work
-
Test end-to-end
- Create a payment
- Complete it on GetEpay
- Wait ~10 seconds for callback
- Refresh the payment-processing page
- Status should be updated
| Feature | Razorpay | GetEpay |
|---|---|---|
| Return URL | Shows when user closes payment modal | Redirect when payment completes |
| Callback | Webhook called after payment | Server-to-server callback with encryption |
| Status Update | Can use either return or webhook | Must use callback/webhook |
| Authentication | Uses signature verification | Uses AES-256-GCM encryption |
| Auto-Redirect | No (must handle manually) | Yes (redirects to return URL) |
| Callback Content | Plain JSON | AES-256-GCM encrypted JSON |
Key Difference: Razorpay can use the return URL to update status, but GetEpay requires the encrypted callback for security.
- Make sure both backend AND frontend servers are running
- Run
npm run devin CMS-Backend to start backend - Run
npm startin frontend directory to start frontend - Test callback manually:
node test-callback.js <PAYMENT_ID> SUCCESS - Check backend logs for
[CALLBACK]messages - Verify payment status with:
curl http://localhost:8080/api/v1/payments/<ID> - If status updates in test, problem is with GetEpay's callback URL config
- If status doesn't update in test, there's a database/decryption issue
Share these logs with your support:
- Output from
node test-callback.jscommand - Backend console output showing [CALLBACK] messages
- Your payment ID and status