A comprehensive Frappe application for integrating Easebuzz Payment Gateway with ERPNext and other Frappe-based applications.
- Seamless Integration: Easy integration with ERPNext Sales Orders, Invoices, and Payment Entries
- Multiple Payment Methods: Support for Credit/Debit Cards, Net Banking, UPI, and Wallets
- Webhook Support: Real-time payment status updates via webhooks
- Transaction Management: Complete transaction lifecycle management
- Refund Support: Handle partial and full refunds
- Test & Live Mode: Switch between sandbox and production environments
- Comprehensive Logging: Detailed transaction logs for debugging and auditing
- Custom Fields: Automatic creation of required custom fields
- Frappe Framework (v13.0+)
- ERPNext (v13.0+) - Optional, for ERP integrations
- Python 3.6+
- Valid Easebuzz merchant account
# Navigate to your frappe-bench directory
cd frappe-bench
# Get the app from GitHub
bench get-app https://github.com/yourusername/easebuzz_integration.git
# Install the app on your site
bench --site your-site-name install-app easebuzz_integration
# Run migrations
bench --site your-site-name migrate# Clone the repository
git clone https://github.com/yourusername/easebuzz_integration.git
# Move to apps directory
mv easebuzz_integration frappe-bench/apps/
# Install the app
bench --site your-site-name install-app easebuzz_integrationNavigate to Setup > Integrations > Easebuzz Settings and configure:
- Merchant Key: Your Easebuzz merchant key
- Salt Key: Your Easebuzz salt key
- Environment: Choose between 'Sandbox' and 'Production'
- Success URL: URL to redirect after successful payment
- Failure URL: URL to redirect after failed payment
- Webhook URL: URL for receiving payment notifications
Go to Accounts > Payment Gateway and create a new gateway:
- Gateway: Select "Easebuzz"
- Settings: Link to your Easebuzz Settings
- Supported Currencies: INR (Indian Rupee)
Set up webhook endpoint in your Easebuzz merchant panel:
https://yoursite.com/api/method/easebuzz_integration.utils.webhook
# In your custom script or app
from easebuzz_integration.utils import create_payment_request
# Create payment request
payment_request = create_payment_request({
"amount": 1000.00,
"customer_name": "John Doe",
"customer_email": "john@example.com",
"customer_phone": "9876543210",
"reference_doctype": "Sales Order",
"reference_docname": "SO-2024-001"
})
# Get payment URL
payment_url = payment_request.get_payment_url()- Create a Sales Order
- Click Create > Payment Request
- Select Easebuzz as Payment Gateway
- Customer receives email with payment link
from easebuzz_integration.easebuzz_client import EasebuzzClient
client = EasebuzzClient()
# Initiate payment
response = client.initiate_payment({
"txnid": "TXN001",
"amount": "100.00",
"productinfo": "Test Product",
"firstname": "John",
"email": "john@example.com",
"phone": "9876543210"
})Creates a new payment request.
Parameters:
amount(float): Payment amountcustomer_name(str): Customer namecustomer_email(str): Customer emailcustomer_phone(str): Customer phone numberreference_doctype(str): Reference document typereference_docname(str): Reference document name
Processes webhook notifications from Easebuzz.
The app automatically creates the following custom fields:
Sales Order:
easebuzz_payment_request(Link to Payment Request)easebuzz_payment_status(Select)
Sales Invoice:
easebuzz_transaction_id(Data)easebuzz_payment_mode(Data)
# Run all tests
bench --site your-site-name run-tests easebuzz_integration
# Run specific test
bench --site your-site-name run-tests easebuzz_integration.tests.test_paymentUse the following test credentials in sandbox mode:
Test Card:
- Card Number:
4111111111111111 - CVV:
123 - Expiry: Any future date
Test UPI:
- UPI ID:
test@upi
# Clone the repository
git clone https://github.com/yourusername/easebuzz_integration.git
cd easebuzz_integration
# Create development branch
git checkout -b develop
# Install in development mode
bench --site your-site-name install-app easebuzz_integration --deveasebuzz_integration/
βββ easebuzz_integration/
β βββ easebuzz_integration/
β β βββ doctype/ # Custom DocTypes
β β βββ utils/ # Utility functions
β β βββ api/ # API endpoints
β βββ fixtures/ # Initial data
β βββ patches/ # Database patches
β βββ public/ # Static files
βββ tests/ # Test files
βββ requirements.txt # Python dependencies
βββ hooks.py # App hooks
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/amazing-feature
- Make your changes
- Add tests for your changes
- Run tests to ensure everything works
- Commit your changes
git commit -m 'Add some amazing feature' - Push to your branch
git push origin feature/amazing-feature
- Open a Pull Request
- Follow PEP 8 for Python code
- Use meaningful variable and function names
- Add docstrings to all functions and classes
- Write tests for new features
- Update documentation as needed
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues, please:
- Check existing GitHub Issues
- Create a new issue with:
- Detailed description
- Steps to reproduce
- Expected vs actual behavior
- System information (Frappe version, Python version, etc.)
- Documentation: Check this README and inline code documentation
- Community: Join our Discuss Forum
- Email: support@unityedu.ai
- Support for EMI payments
- Recurring payment subscriptions
- Enhanced fraud detection
- Multi-currency support
- Payment analytics dashboard
- Mobile SDK integration
- Frappe Technologies for the amazing framework
- Easebuzz for their robust payment gateway
- All contributors who have helped improve this integration
Made with β€οΈ by [Unity]