# SindiPay Payment Gateway for WooCommerce

Official WordPress plugin for accepting Iraqi bank cards including Qi Card through SindiPay payment gateway.

## Description

**The #1 Payment Gateway for Iraq** 🇮🇶

SindiPay is the leading payment gateway specialized for Iraqi businesses. Accept all Iraqi bank cards including Qi Card and expand your business across Iraq with confidence!

### Features

* 🇮🇶 Accept all Iraqi bank cards (Qi Card, local debit/credit cards)
* 🚀 Easy integration with WooCommerce
* 📱 Support for WooCommerce Blocks (Cart & Checkout Blocks)
* 🔒 Secure payment processing through SindiPay API
* 🌍 Multiple language support (Arabic & English)
* ⚡ Real-time payment status updates
* ✓ Automatic order completion on successful payment
* 📊 Comprehensive logging for debugging
* 🕐 24/7 support from Iraqi team

## Requirements

* WordPress 5.0 or higher (tested up to 6.8)
* WooCommerce 5.0 or higher (tested up to 8.9)
* PHP 7.2 or higher
* SindiPay merchant account and API Key

## Installation

1. Upload the plugin files to `/wp-content/plugins/sindipay-gateway/` or install through WordPress admin
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to **WooCommerce → Settings → Payments**
4. Find "SindiPay" and click **Manage**
5. Enable the payment method
6. Enter your SindiPay API Key
7. Configure titles and descriptions for English and Arabic
8. Save changes

## Getting Your API Key

To use this plugin, you need a SindiPay merchant account:

**Contact us 24/7:**
- **Phone/WhatsApp:** +964 787 877 0990
- **Website:** https://sindipay.com

**Quick Setup (Less than 3 hours):**
1. Call or WhatsApp us at +964 787 877 0990
2. Provide your business information
3. Get verified and receive your API Key (typically within 3 hours)
4. Start accepting payments immediately!

## External Service Usage

This plugin connects to the **SindiPay payment processing API** to handle payments.

**Service URL:** https://sindipay.com/api/v1/payments/gateway/

**Data Transmitted:**
- Order ID and total amount (required)
- Currency code (required)
- Customer's email address (optional, if provided)
- Customer's phone number (optional, if provided)
- Callback URLs for payment status (required)
- Site locale/language (required)

**Legal:**
- [Terms of Service](https://sindipay.com/terms)
- [Privacy Policy](https://sindipay.com/privacy)

Please review these policies and inform your customers about data transmission through your own privacy policy.

## Supported Cards

We accept all Iraqi bank cards:
- ✅ Qi Card (كي كارد)
- ✅ All Iraqi Visa cards
- ✅ All Iraqi MasterCard cards
- ✅ All local Iraqi bank debit/credit cards

## Support

**24/7 Support – We're always here!**

- **Phone/WhatsApp:** +964 787 877 0990
- **Website:** https://sindipay.com
- **WordPress Support:** Plugin support forum

## Languages

The plugin includes translations for:
- English (en_US)
- Arabic (ar)

Translation files are located in the `/languages/` directory.

## Development

### File Structure

```
wp-payment-gateway-plugin/
├── assets/
│   └── checkout.js          # Frontend checkout scripts
├── includes/
│   ├── class-sindipay-gateway.php    # Main gateway class
│   └── class-sindipay-blocks.php     # WooCommerce Blocks support
├── languages/
│   ├── sindipay-payment-gateway-ar.mo
│   ├── sindipay-payment-gateway-ar.po
│   ├── sindipay-payment-gateway-en_US.mo
│   └── sindipay-payment-gateway-en_US.po
└── sindipay-gateway.php     # Main plugin file
```

### Testing

To test the plugin:
1. Set up a local WordPress development environment
2. Install WooCommerce
3. Enable `WP_DEBUG` in `wp-config.php`
4. Test with your SindiPay test API key
5. Check debug logs in WooCommerce → Status → Logs

## Changelog

### 1.0.0
* Initial release
* WooCommerce Classic Checkout support
* WooCommerce Blocks support
* Arabic and English translations
* Secure payment processing via SindiPay API

## License

This plugin is licensed under GPL v2 or later.

## Credits

Developed by the SindiPay Team for the Iraqi e-commerce community.
