Overview
Popup Store supports two payment methods:- UPI Direct - Customer pays directly via UPI, uploads proof (2% discount)
- Razorpay - Full payment gateway with cards, wallets, etc. (2-3% fee)
Payment Method Comparison
| Feature | UPI Direct | Razorpay |
|---|---|---|
| Fee | 0% (2% discount to customer) | 2-3% (paid by customer) |
| Verification | Manual (seller verifies proof) | Automatic |
| Settlement | Direct to seller UPI | 2-3 business days |
| Supported | UPI only | Cards, UPI, Wallets, NetBanking |
| Best For | High-trust, repeat customers | New customers, international |
UPI Direct Flow
1. Customer Checkout
2. Payment Proof Upload
The customer pays via their UPI app, then uploads a screenshot:3. Seller Verification
Seller receives email with payment proof:Razorpay Flow
1. Initialize Payment
2. Frontend Checkout
3. Webhook Verification
Razorpay sends webhooks for payment events:api/webhooks/razorpay/route.ts
Fee Calculation
UPI Direct (2% Discount)
Razorpay (2-3% Fee)
The fee is charged to the customer, not deducted from the seller’s payout.
Configuration
Razorpay Setup
- Create Razorpay Account: razorpay.com
- Get API Keys: Dashboard → Settings → API Keys
- Add to Environment:
.env.local
- Configure Webhook:
- URL:
https://mypopup.shop/api/webhooks/razorpay - Events:
payment.captured,payment.failed - Secret: (copy from Razorpay dashboard)
- URL:
UPI Direct Setup
Seller configures UPI VPA in iOS app:Security
Payment Verification
Razorpay Signature Verification:UPI Proof Validation
Manual verification checklist for sellers:- Amount matches order total
- UPI transaction ID is visible
- Timestamp is recent (within 1 hour of order)
- Recipient name/UPI ID matches store’s UPI
Order Status Lifecycle
Status Definitions
| Status | Description | Next Action |
|---|---|---|
payment_pending | Waiting for payment | Customer pays |
proof_uploaded | UPI proof submitted | Seller verifies |
paid | Payment confirmed | Seller processes |
processing | Order being prepared | Seller ships |
shipped | Package dispatched | Delivery |
delivered | Customer received | Complete |
cancelled | Order cancelled | Refund (if paid) |
Email Notifications
Order Confirmation (Customer)
Sent when payment is confirmed:New Order Alert (Seller)
Sent immediately when order is placed:Testing
Razorpay Test Mode
Use test credentials for development:UPI Direct Testing
Create a test order flow:- Use a dummy UPI screenshot
- Upload to dev environment
- Verify seller can see proof in iOS app
- Approve/reject and check status updates
Troubleshooting
Razorpay payment not capturing
Razorpay payment not capturing
Check:
- API keys are correct (test vs live)
- Webhook is configured with correct URL
- Webhook secret matches environment variable
- Order amount is in paise (multiply by 100)
UPI proof upload failing
UPI proof upload failing
Common issues:
- File size > 5MB (compress image)
- Storage bucket permissions (check RLS policies)
- Invalid file type (only .jpg, .png, .webp)
- Network timeout (increase timeout limit)
Payment verified but order still pending
Payment verified but order still pending
This is a webhook delay. Check:
- Webhook logs in Razorpay dashboard
- Your webhook endpoint is reachable
- Signature verification is passing
- Database update query is running
