Payments
Overview
The Payments feature manages how Siyahfy stores accept money from customers. Vendors can configure multiple payment gateways — currently Razorpay and Cashfree — along with Cash on Delivery (COD) and manual payment methods. The system handles payment creation, verification via webhooks, refund processing, and subscription billing for Siyahfy platform plans.
How It Works
Payment Flow (Razorpay)
- When a customer selects Razorpay, the backend creates a Razorpay order using the vendor’s Razorpay API keys.
- The frontend opens the Razorpay checkout widget.
- Customer completes payment (UPI, card, net banking, etc.).
- Razorpay sends a webhook to the backend confirming payment status.
- The backend verifies the webhook signature and updates the order status.
Payment Flow (Cashfree)
- The backend creates a Cashfree payment session with order details.
- Customer is redirected to the Cashfree payment page.
- After payment, Cashfree sends a webhook notification.
- The backend verifies payment status via Cashfree’s API and updates the order.
Payment Method Setup
Vendors configure their payment methods through the admin panel:
- Enter Razorpay Key ID and Key Secret
- Enter Cashfree App ID and Secret Key
- Enable/disable COD with conditions
- Configure Stripe (available but optional)
- Set custom payment method labels and logos
Key API Endpoints
Payment Method Configuration
Razorpay Payments
Cashfree Payments
Storefront Payment APIs
Subscription Payments
Database Tables
| Table | Purpose |
|---|---|
payment_methods | Payment gateway configurations per store — API keys, enabled status, display settings |
orders | Payment status, method used, transaction ID stored per order |
vendor_subscriptions | Razorpay subscription IDs for vendor plan billing |
refunds | Refund records linked to orders with amounts and status |
Related Features
- Orders — Payments are processed as part of the order flow
- Shipping — COD is a payment method tied to shipping configuration
- Storefront — Checkout page where customers select payment methods
- Integrations — Razorpay and Cashfree are third-party integrations