Description
A payment gateway integration between WooCommerce and Deema Payments. Accept payments from customers using BNPL (buy now, pay later). This plugin is specifically designed to work with Kuwaiti Dinar (KWD) and Bahraini Dinar (BHD) currencies.
Features:
* Support for both Classic and Block-based Checkout
* BNPL (Buy Now, Pay Later) payment method
* Sandbox and Production modes
* Automatic order status synchronization
* Refund support
* HPOS (High-Performance Order Storage) compatible
* Secure payment processing
Supported Currencies:
* KWD (Kuwaiti Dinar)
* BHD (Bahraini Dinar)
External services
This plugin relies on and connects to an external 3rd-party service, Deema Payments (provided by Deema Company for Computer Programming Activities WLL), to process Buy Now, Pay Later (BNPL) and installment payments for WooCommerce orders.
- Service: Deema Payments
- Website: Deema Website
- Terms of Service: Deema Terms and Conditions
- Privacy Policy: Deema Privacy Policy
- API Documentation: Deema API Documentation
Domains Used:
* Production API: https://api.deema.me/
* Sandbox API: https://sandbox-api.deema.me/
What data is sent, why, where, and when:
-
Creating Purchase Transactions (Checkout):
- When: When a customer selects “Deema Payment” on the checkout page (Classic or Block Checkout) and places an order.
- What data is sent: Order total amount, currency code (KWD or BHD), merchant order number/ID, and merchant redirect URLs (success and cancel URLs).
- Why: To initiate the purchase session with Deema Payments and obtain the hosted redirect link for the customer to complete payment.
- Where:
https://api.deema.me/api/merchant/v1/purchase(production) orhttps://sandbox-api.deema.me/api/merchant/v1/purchase(sandbox).
-
Verifying Payment Status (Callback):
- When: When the customer is redirected back to the merchant store after completing payment on the Deema hosted portal.
- What data is sent: The Deema order reference number and the merchant API key in the authorization header.
- Why: To perform server-to-server verification with Deema Payments to confirm that the payment is captured before marking the WooCommerce order as paid.
- Where:
https://api.deema.me/api/merchant/v1/purchase/status(production) orhttps://sandbox-api.deema.me/api/merchant/v1/purchase/status(sandbox).
-
Background Order Status Synchronization (WP-Cron):
- When: Every 5 minutes via a scheduled WordPress background cron job (
deema_custom_cron) for recent pending or on-hold orders. - What data is sent: The Deema order reference number and the merchant API key in the authorization header.
- Why: To automatically verify and synchronize order status (captured, cancelled, expired, or refunded) in case the customer closed their browser before redirecting or if a webhook notification was missed.
- Where:
https://api.deema.me/api/merchant/v1/purchase/status(production) orhttps://sandbox-api.deema.me/api/merchant/v1/purchase/status(sandbox).
- When: Every 5 minutes via a scheduled WordPress background cron job (
-
Processing Refunds:
- When: When a store administrator executes a refund for a Deema order through the WooCommerce order admin screen.
- What data is sent: Refund amount, currency code (KWD or BHD), optional refund reason comment, and the merchant API key.
- Why: To transmit the refund instruction to Deema Payments to release the refunded amount back to the customer.
- Where:
https://api.deema.me/api/merchant/v1/order/{order_reference}/refund(production) orhttps://sandbox-api.deema.me/api/merchant/v1/order/{order_reference}/refund(sandbox).
Installation
Minimum Requirements:
* WordPress 5.8 or higher
* WooCommerce 8.3 or higher
* PHP 7.3 or higher
Installation Steps:
- Upload the plugin files to the
/wp-content/plugins/deema-payment-gatewaydirectory, or install the plugin through the WordPress plugins screen directly - Activate the plugin through the ‘Plugins’ menu in WordPress
- Go to WooCommerce > Settings > Payments
- Click on “Deema Payment” to configure the gateway
- Enable the payment method and configure your API keys
- Save your settings
Configuration:
- Enable/Disable: Check to enable Deema Payment gateway
- Title: Enter the title customers see during checkout (default: “Split your payments with deema”)
- Description: Enter the description customers see during checkout
- Sandbox Mode: Enable for testing with sandbox API keys
- Sandbox API Key: Enter your sandbox API key from Deema dashboard
- API Key: Enter your production API key from Deema dashboard
- Debug Log: Enable to log payment events for troubleshooting
FAQ
What currencies does this plugin support?
This plugin supports Kuwaiti Dinar (KWD) and Bahraini Dinar (BHD) only. The payment method will automatically be hidden if your store uses a different currency.
Does this plugin work with WooCommerce Block Checkout?
Yes! Version 1.1.0 adds full support for WooCommerce Block-based Checkout pages.
Where can I get my API keys?
You can obtain your API keys from your Deema merchant dashboard at https://www.deema.me/
Can I test the plugin before going live?
Yes, enable Sandbox Mode in the settings and use your sandbox API key to test payments without processing real transactions.
Does this plugin support refunds?
Yes, you can process full and partial refunds directly from the WooCommerce order page.
Is this plugin compatible with HPOS?
Yes, this plugin is fully compatible with WooCommerce High-Performance Order Storage (HPOS).
Where can I view payment logs?
Enable Debug Log in the plugin settings, then view logs at WooCommerce > Status > Logs. Look for logs with the “deema_payment” source.
Changelog
1.1.4
- Updated: Readme documentation for external services disclosure, data transmission, and legal links per WordPress.org guidelines.
- Added: Direct file access security guards across all plugin PHP files.
1.1.3
- Added: Cryptographic HMAC-SHA256 signature validation for webhooks
- Added: Server-to-server transaction status verification on payment redirect callback
- Fixed: Block Checkout compatibility and React array serialization for payment gateway supports
- Fixed: Background cron job database mapping and order cancellation loop stability
- Improved: Server-side currency validation for KWD and BHD on Block Checkout
1.1.1 – 2025-12-24
- Updated: Refund API to use new endpoint (/api/merchant/v1/order/{order_reference}/refund)
- Added: Fully refunded order status handling in webhook
- Added: Fully refunded order status handling in cron for missed webhooks
- Added: Automatic stock restoration when orders are fully refunded
- Improved: Refund API logging (URL, payload, response)
1.1.0 – 2025-11-03
- Added: Full support for WooCommerce Block-based Checkout
- Added: HPOS (High-Performance Order Storage) compatibility declaration
- Added: Cart/Checkout Blocks compatibility declaration
- Improved: Replaced cURL with WordPress HTTP API (wp_remote_request)
- Improved: Enhanced security with proper data escaping and sanitization
- Improved: Better SQL query preparation to prevent SQL injection
- Improved: Logger implementation using modern WooCommerce logger
- Fixed: PHP 8.2+ compatibility – Added proper property declarations
- Fixed: Deprecated wc_get_log_file_path() function
- Fixed: Nonce verification warnings with proper comments for callbacks
- Updated: Minimum WooCommerce version to 8.3
- Updated: Code to follow WordPress coding standards
1.1.0
- Fixed: README.txt
- Various bug fixes and improvements