Skip to main content

Overview

Popup Store supports two payment methods:
  1. UPI Direct - Customer pays directly via UPI, uploads proof (2% discount)
  2. Razorpay - Full payment gateway with cards, wallets, etc. (2-3% fee)

Payment Method Comparison


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:
Seller clicks “Verify & Approve” in iOS app:

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

  1. Create Razorpay Account: razorpay.com
  2. Get API Keys: Dashboard → Settings → API Keys
  3. Add to Environment:
.env.local
  1. Configure Webhook:
    • URL: https://mypopup.shop/api/webhooks/razorpay
    • Events: payment.captured, payment.failed
    • Secret: (copy from Razorpay dashboard)

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
Never auto-approve UPI payments without manual verification. Fraudulent screenshots are common!

Order Status Lifecycle

Status Definitions


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:
  1. Use a dummy UPI screenshot
  2. Upload to dev environment
  3. Verify seller can see proof in iOS app
  4. Approve/reject and check status updates

Troubleshooting

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)
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)
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

Razorpay Integration

Complete Razorpay setup guide

Order Fulfillment

How sellers process and ship orders