BazarChapay Credit
BazarChapay Credit BazarChapay Credit is a WordPress plugin for managing customer credit, loans, installments, and online installment payments. The plugin provides a centralized system for creating and managing customer loans, automatically generating installment schedules, tracking payment status, and allowing users to view and pay their install
by SeyedSina · github.com/seyedsinanabavi/bazarchapay-credit-fixed · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/seyedsinanabavi/bazarchapay-credit-fixed/archive/refs/heads/main.zipA powerful and extensible WordPress credit and installment management plugin for Persian-speaking e-commerce websites.
BazarChapay Credit is designed to provide a complete foundation for managing customer credit, installment plans, payments, notifications, and credit-related workflows directly inside WordPress.
🚧 Project Status: Active Development
✨ Features
- 💳 Customer credit management
- 📆 Installment and repayment management
- 💰 Credit balance tracking
- 👤 User credit profiles
- 🔐 Secure WordPress-based architecture
- 💸 Payment gateway integration
- 📱 SMS notification support
- ⚙️ Admin management panel
- 🧩 Modular and extensible architecture
- 🌐 Persian / RTL-friendly design
- 🔄 Scheduled tasks and automated processes
- 🗄️ Dedicated database layer for credit-related data
- 🛡️ WordPress capability and nonce-based security
- 🔌 Developer-friendly hooks and extensibility
📦 Installation
From WordPress Admin
- Download the latest release.
- Go to WordPress → Plugins → Add New → Upload Plugin.
- Upload the plugin ZIP file.
- Install and activate the plugin.
- Configure the plugin from the WordPress administration panel.
Manual Installation
Clone or extract the plugin into:
wp-content/plugins/bazarchapay-credit/
Then activate it from:
WordPress → Plugins
⚙️ Requirements
Before installing BazarChapay Credit, make sure your server meets the following requirements:
- WordPress 6.0+
- PHP 7.4+
- MySQL 5.7+ / MariaDB equivalent
- HTTPS strongly recommended
- WordPress Cron enabled for scheduled tasks
PHP 8.x is recommended for production environments.
🏗️ Project Structure
bazarchapay-credit/
│
├── bazarchapay-credit.php
├── uninstall.php
├── readme.txt
│
├── includes/
│ ├── class-activator.php
│ ├── class-plugin.php
│ ├── class-cron.php
│ ├── class-ippanel.php
│ ├── class-zarinpal.php
│ │
│ ├── admin/
│ │ └── class-admin-menu.php
│ │
│ └── frontend/
│ └── class-user-panel.php
│
├── assets/
│ ├── css/
│ └── js/
│
└── languages/
The project follows a modular structure so that payment gateways, notification providers, admin functionality, frontend components, and scheduled tasks can be maintained independently.
🔌 Architecture
BazarChapay Credit is built around a lightweight modular architecture.
Core Plugin
The main plugin bootstrap file is:
bazarchapay-credit.php
It is responsible for:
- Defining plugin constants
- Registering the autoloader
- Loading the main plugin class
- Registering activation/deactivation hooks
Plugin Core
includes/class-plugin.php
The main plugin class coordinates the different components of the system.
Database
Database-related functionality is separated from the rest of the application to make future changes and migrations easier.
Admin
Administrative functionality lives under:
includes/admin/
This layer handles WordPress administration pages and management interfaces.
Frontend
Frontend functionality lives under:
includes/frontend/
This area is responsible for customer-facing credit and installment functionality.
💳 Payment Gateway
The project includes support for payment processing through Zarinpal.
The payment layer is intentionally isolated so additional gateways can be added without rewriting the core credit system.
A future implementation can follow the same interface-based approach:
interface PaymentGatewayInterface
{
public function request(array $data);
public function verify(array $data);
public function redirect(string $authority);
}
This allows the application to support multiple payment providers while keeping business logic independent from the payment gateway.
📱 SMS Notifications
BazarChapay Credit includes an integration layer for IPPanel.
The notification system can be used for events such as:
- Credit approval
- Installment reminders
- Successful payments
- Failed payments
- Payment due notifications
- Customer account notifications
Keeping SMS functionality in its own class makes it possible to replace the provider without changing the rest of the plugin.
⏰ Scheduled Tasks
The plugin supports scheduled/background operations through WordPress Cron.
Potential scheduled jobs include:
Installment reminders
Payment status checks
Credit expiration checks
Notification processing
Periodic cleanup
For reliable production environments, it is recommended to configure a real server-side cron job instead of relying exclusively on WP-Cron.
🔐 Security
Security is a core part of the project.
The plugin follows standard WordPress security practices, including:
- Nonce verification
- Capability checks
- Input sanitization
- Output escaping
- Prepared database queries
- Secure payment verification
- Server-side validation
Never trust values received directly from:
$_GET
$_POST
$_REQUEST
Always validate and sanitize external input before processing it.
🧑💻 Development
Clone the repository:
git clone https://github.com/YOUR_USERNAME/bazarchapay-credit.git
Move into the project:
cd bazarchapay-credit
Install the plugin inside your WordPress development environment:
wp-content/plugins/bazarchapay-credit/
Activate it with WP-CLI:
wp plugin activate bazarchapay-credit
🧪 Testing
Before deploying to production, test the following workflows:
Credit
- Create a customer credit account
- Increase credit balance
- Decrease credit balance
- Verify credit limits
- Verify transaction history
Installments
- Create an installment plan
- Generate installments
- Mark an installment as paid
- Handle overdue installments
- Verify remaining balance
Payments
- Create a payment request
- Redirect to the gateway
- Verify a successful payment
- Handle failed payments
- Handle cancelled payments
- Prevent duplicate payment verification
Notifications
- Send an SMS notification
- Verify delivery handling
- Handle provider errors
- Test invalid phone numbers
🧩 Extensibility
The plugin is designed to be extended without modifying the core source code.
WordPress actions and filters can be added for:
do_action( 'bazarchapay_credit_before_payment', $payment );
do_action( 'bazarchapay_credit_payment_completed', $payment );
$amount = apply_filters(
'bazarchapay_credit_installment_amount',
$amount,
$installment
);
This approach allows third-party plugins and custom themes to integrate with BazarChapay Credit safely.
🛣️ Roadmap
Planned improvements may include:
- [ ] Multiple payment gateways
- [ ] Advanced installment plans
- [ ] Automatic payment reminders
- [ ] Comprehensive transaction ledger
- [ ] Credit scoring
- [ ] Customer credit limits
- [ ] Advanced reporting dashboard
- [ ] REST API
- [ ] Webhook support
- [ ] WooCommerce integration
- [ ] Export reports to CSV/Excel
- [ ] Improved automated testing
- [ ] Developer documentation
- [ ] Multilingual support
🤝 Contributing
Contributions are welcome.
Development Workflow
- Fork the repository.
- Create a feature branch.
git checkout -b feature/my-feature
- Make your changes.
- Test the changes thoroughly.
- Commit your changes.
git commit -m "Add my feature"
- Push the branch.
git push origin feature/my-feature
- Open a Pull Request.
Please keep pull requests focused and avoid unrelated changes.
🐛 Bug Reports
If you discover a bug, please open an issue and include:
- WordPress version
- PHP version
- Plugin version
- Steps to reproduce
- Expected behavior
- Actual behavior
- Relevant error logs
- Screenshots when applicable
For security vulnerabilities, please do not open a public issue. Contact the project maintainer privately.
📄 License
BazarChapay Credit is distributed under the terms of the license included with this project.
See:
LICENSE
for the complete license terms.
👨💻 Author
Developed with ❤️ for modern Persian e-commerce and credit-based payment systems.
BazarChapay Credit A modular foundation for credit, installment, payment, and customer financial management in WordPress.
⭐ Support the Project
If you find BazarChapay Credit useful:
- ⭐ Star the repository
- 🐛 Report bugs
- 💡 Suggest improvements
- 🔧 Submit pull requests
- 📢 Share the project
Every contribution helps make the project better.
BazarChapay Credit — Build smarter credit and installment experiences on WordPress.