Cashfree Payment Plugin
This integration enables merchants to accept payments via Cashfree's payment gateway within MedusaJS 2 stores.
Features
Payment Methods
- UPI: Unified Payments Interface
- Credit/Debit Cards: All major card networks
- Net Banking: Direct bank transfers
- Wallets: Popular digital wallets
Core Capabilities
- Streamlined Refunds: Easy refund processing
- Webhook Integration: Real-time payment status updates
- Multiple Environments: Sandbox and production support
- Secure Processing: Industry-standard security measures
Installation
Install via your preferred package manager:
npm install medusa-cashfree-payment-plugin
Configuration
Add to Medusa Config
Update your medusa-config.js:
module.exports = {
plugins: [
{
resolve: 'medusa-cashfree-payment-plugin',
options: {
api_key: process.env.CASHFREE_API_KEY,
api_secret: process.env.CASHFREE_API_SECRET,
environment: process.env.CASHFREE_ENVIRONMENT, // 'sandbox' or 'production'
},
},
],
}
Environment Variables
Set the following environment variables:
CASHFREE_API_KEY: Your Cashfree API keyCASHFREE_API_SECRET: Your Cashfree API secretCASHFREE_ENVIRONMENT: ‘sandbox’ or ‘production’
Setup Steps
- Install the Plugin: Add via npm/yarn/pnpm
- Configure Credentials: Set API credentials in medusa-config.js
- Enable in Admin: Enable Cashfree in Medusa admin region settings
- Configure Webhooks: Set up webhooks in Cashfree dashboard
Webhook Configuration
Configure webhooks through the Cashfree dashboard to:
- Receive payment notifications
- Update order status
- Handle payment failures
- Process refunds
Version 1.0.4 Updates
Security Enhancements
- Webhook Secret Validation: Required for all webhook requests
- Enhanced Data Protection: Improved security measures
- Cryptographic Security: Better refund processing security
- Input Validation: Enhanced validation for all inputs
Admin Configuration
- Navigate to Medusa Admin
- Go to Settings → Regions
- Select your region
- Add Cashfree as a payment provider
- Configure payment settings
Use Cases
- Indian market e-commerce
- Multi-payment method support
- Regional payment preferences
- UPI transaction processing
- Digital wallet integration
Requirements
- MedusaJS 2.x
- Cashfree merchant account
- Valid API credentials