Description
AparimitLabs Payment Gateway for DPO Pay is a production-grade payment gateway that integrates DPO Pay (Direct Pay Online) — the leading payment service provider across Africa and the Middle East — into your WooCommerce store.
GitHub Repository: https://github.com/aparimitlabs/aparimitlabs-payment-gateway-dpo
The integration follows DPO Pay’s recommended Option A flow: CreateToken Hosted Payment Page VerifyToken. All API communication is XML-over-HTTP using WordPress’s native wp_remote_post() function.
Built following strict Aparimitlabs architectural standards: PSR-4 autoloading, HPOS (High-Performance Order Storage) compatibility, a dedicated transaction log table, and zero raw cURL dependencies.
Payment Flow
- Customer selects DPO Pay at checkout (fully compatible with WooCommerce Blocks) and clicks Place Order.
- The plugin calls
createTokenon the DPO API to generate a secure transaction token. - Customer is redirected to DPO Pay’s hosted payment page (
payv3.php?ID={token}). - Customer completes payment on DPO’s PCI-DSS secure hosted environment.
- Primary: DPO redirects the customer back to your store. The plugin calls
verifyTokento confirm payment status before completing the order. - Fallback (PTN): If the customer closes their browser, DPO sends a background XML Webhook ping to the plugin, which independently verifies the token and marks the order paid.
Key Features
- WooCommerce Blocks Ready: Fully integrated with the modern WooCommerce Blocks checkout experience.
- DPO Pay Hosted Payment Pages: Customer payment data is entered on DPO’s PCI-DSS certified hosted page — no card data passes through your server.
- Background Webhook (PTN) Support: Orders are guaranteed to update to “Processing” in the background even if the customer closes their browser before returning to your site.
- VerifyToken Reconciliation: Every returning customer session and webhook ping is independently verified against the DPO API before the WooCommerce order is marked complete, preventing spoofing.
- Sandbox & Live Environments: Switch between the DPO sandbox and live environment from the WooCommerce gateway settings panel.
- API Request Logging: Built-in WooCommerce status logger for API requests and XML responses to aid troubleshooting.
- Transaction Log Table: Every
createTokenandverifyTokenresult is persisted to a dedicatedwp_dpo_transactionsdatabase table for reporting and auditing. - HPOS Compatible: Explicitly declares High-Performance Order Storage compatibility.
- WordPress HTTP API Only: All outbound HTTP communication uses
wp_remote_post(). No raw cURL.
Third-Party Services
This plugin connects to the DPO Pay API to initiate and verify payments on behalf of the store owner and their customers. Use of this plugin constitutes acceptance of DPO Pay’s Terms and Conditions.
DPO Pay (Direct Pay Online)
What it is: DPO Pay is a payment service provider operating across Africa and the Middle East, supporting cards, mobile money, and other local payment methods.
When a connection is made: A connection to DPO Pay’s servers is established in two stages:
1. During checkout when a customer places an order (createToken API call — server-to-server).
2. When the customer returns from the DPO payment page (verifyToken API call — server-to-server).
No connection is made during page browsing or admin dashboard loads.
Data transmitted to DPO Pay:
– Your DPO Pay Company Token (in the XML request body for authentication).
– Your Service Type ID.
– The order total amount and currency.
– The WooCommerce order ID (as CompanyRef).
– The redirect and back URLs.
– A payment description string (e.g. “Order #123”).
No customer personal data (name, email, address, card numbers) is transmitted by this plugin. DPO Pay independently collects payment data on their hosted page under their own Privacy Policy.
API Endpoints used:
– API Base URL (Live & Sandbox): https://secure.3gdirectpay.com/API/v6/
– Payment Page URL (Live & Sandbox): https://secure.3gdirectpay.com/payv3.php?ID={token}
DPO Pay Service Links:
– Website
– API Documentation
– Merchant Portal
– Terms and Conditions
– Privacy Policy
Screenshots






Installation
- Upload the
aparimitlabs-payment-gateway-dpofolder to/wp-content/plugins/, or install directly via Plugins > Add New. - Activate the plugin.
- Navigate to WooCommerce > Settings > Payments and click Manage next to DPO Pay.
- Select your environment (Sandbox or Live), enter your Company Token and Service Type, and save.
FAQ
-
Where do I get my DPO Pay Company Token?
-
Log in to your DPO Pay merchant portal at https://portal.dpopay.com, navigate to your account settings, and copy your Company Token. It is a UUID in the format
XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX. -
What is the Service Type?
-
The Service Type is a numeric ID assigned by DPO Pay that identifies the category of goods or services you sell. It is provided to you by DPO Pay when your account is set up (e.g., 54841 for Test Product in the sandbox environment).
-
How do I test the integration?
-
Set Environment to Sandbox and use one of the DPO Pay sandbox Company Tokens and Service Types provided in your DPO support credentials. The plugin automatically routes both live and sandbox transactions to the correct
secure.3gdirectpay.comendpoint based on your token. -
Is this compatible with WooCommerce HPOS?
-
Yes. The plugin explicitly declares HPOS compatibility and uses
wc_get_order(),$order->update_meta_data(), and$order->payment_complete()throughout. -
What happens if the customer closes the browser on the DPO payment page?
-
Don’t worry! The plugin implements DPO Pay’s Payment Token Notification (PTN) Webhook. DPO Pay will secretly ping your WooCommerce store in the background the moment the payment succeeds, and the plugin will automatically update the order status to Processing.
-
Does this plugin store card numbers or payment credentials?
-
No. All card and wallet data is entered and stored on DPO Pay’s PCI-DSS certified hosted environment. This plugin only stores the DPO transaction token, order amount, currency, result code, and status in the local
wp_dpo_transactionstable.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“AparimitLabs Payment Gateway for DPO Pay” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “AparimitLabs Payment Gateway for DPO Pay” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.0
- Initial public release. Fully compliance-checked with Aparimitlabs architectural standards.
- PSR-4 autoloader, HPOS compatibility, dedicated transaction log table, CreateToken + VerifyToken flow.
- Full WooCommerce Blocks checkout integration.
- Payment Token Notification (PTN) Webhook support.
