No-code setup
Embed Payment Forms or Payment Buttons directly in your frontend
Advanced integration
Advanced integration with authentication, server-side services, and database storage
No-code setup
If you want to integrate Cashfree’s no-code solutions, such as a Payment Form or Payment Button, you can do so without setting up any server-side services. This is the simplest integration path and works entirely in a no-code environment.PrerequisitesEnsure you have a functioning front-end for this integration.
Steps to integrate
1
Create a Payment Form in Cashfree
- Log in to the Merchant Dashboard.
- Go to Payment Gateway > Payment Forms.
- Fill in the required details and create a Payment Form.
- Copy the Payment Form Link.
2
Create a Payment Button (Optional)
If you want to embed a button that directly opens the payment form:
- Log in to the Merchant Dashboard.
- Go to Payment Gateway > Payment Buttons.
- Generate a Payment Button.
- Copy the Payment Button Code provided by Cashfree.
3
Embed in Lovable
In Lovable, you just need to provide the button code or the payment form link. Lovable will automatically embed it in your app.
Sample prompt for Lovable
Sample prompt for Lovable
“Integrate Cashfree Payments using a Payment Form (no code solution). The form should open when clicking on Cashfree’s payment button. Please embed the following button code in the app. When clicked, it should redirect to the Cashfree Payment Form:Form Link:
<!-- Paste your Payment Form link here -->
Payment Button Code: <!-- Paste your Payment Button code here -->
”Advanced integration with Supabase
If your use case involves server-side services, authentication, or transaction persistence, Supabase is the recommended path. Lovable comes with native Supabase integration, making it easy to set up your server-side services. By connecting Cashfree with Supabase, you can securely store API keys, process payments through Edge Functions, and maintain transaction records all within a single, streamlined setup. Why Supabase integration?- Secure API key storage in Supabase secrets
- User authentication
- Server-side edge functions for order creation, loading Cashfree checkout and payment verification
- Database persistence for transactions and order mappings
Prerequisites
- A functioning frontend that can initiate payment requests
- A Supabase connection activated in Lovable
- Your Cashfree credentials: App ID and Secret Key
- The correct environment URLs:
- Sandbox (test) for development
-
Production for live payments: The domain you use must be whitelisted in the Cashfree dashboard. To request whitelisting:
- Log in to the Merchant Dashboard.
- Go to Developers > Whitelisting.
Integration steps
1
Connect Supabase to Lovable
In Lovable, click the green Supabase button (top-right).
2
Add Edge Functions for Payment Flow to Supabase using CLI
Use the provided Edge Functions from the repository: https://github.com/cashfree/cashfree-supabase-edge-functionsFollow these steps to deploy edge functions via a CLI:Locate your Project Reference IDNavigate to the Supabase FolderDevelopmentTo run the functions locally, you need to have the Supabase CLI installed:
- Go to your Supabase Dashboard.
- Open your project and check the address. Your project reference ID is embedded in it (for example,
https://supabase.com/dashboard/project/<project-reference-id>
).
3
Configure Cashfree Integration Flow
Store API Keys and Environment in Supabase SecretsEither through Supabase CLI:OR through prompt on Lovable (Example: “Help me securely store my Cashfree App ID and Secret Key in Supabase secrets. I will also provide the environment. These will be used by my Edge Functions.”)
4
Configure Your Frontend to Accept Payments via Cashfree
The Edge Functions are designed to work with the minimum order details required by Cashfree. You can customize these functions based on your specific needs while keeping the same base structure. To ensure proper functioning, your frontend must send the essential order details to Supabase in the exact format expected by the Edge Functions, including:
- Order amount
- Order currency
- Customer details (customer ID and mobile number)
Example prompt for Lovable
Example prompt for Lovable