WP Manifestindependent plugin directory
manifest / unclassified / dpay-woocommerce

DPay Payments for WooCommerce

Official DPay payment gateway for WooCommerce — every payment method on your DPay account through DPay's hosted checkout, Arabic-first. Classic + Blocks checkout, HPOS.

by DPay · github.com/ditsly/dpay-woocommerce · website

★ 0stars
0forks

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/ditsly/dpay-woocommerce/archive/refs/heads/main.zip

DPay Payments for WooCommerce — مدفوعات DPay لووكومرس

dpay-payments-for-woocommerce · WordPress 6.6+ · WooCommerce 9.0+ (tested to 11.1) · PHP 8.1+ · GPL-2.0-or-later

استقبل مدفوعات إدفعلي، سداد، موبي كاش، مصارف MITF، معاملات وغيرها في متجر WooCommerce عبر صفحة DPay المستضافة: يضغط العميل «إتمام الطلب»، يختار طريقته على صفحة DPay، ويعود إلى المتجر والطلب مدفوع. المتجر لا يرى رقم هاتف ولا رمز تحقق ولا بطاقة، ولا يُعلَّم الطلب مدفوعًا إلا بعد إعادة قراءة حالة الدفع من DPay برمزك. وصف التاجر والأسئلة الشائعة في readme.txt (صفحة wordpress.org)؛ هذا الملف للمطوّرين.

Accept EDFali, Sadad, MobiCash, the MITF banks, Moamalat and more in a WooCommerce store (classic checkout and the Checkout Block) through DPay's hosted checkout. The merchant-facing description and FAQ are in readme.txt (the wordpress.org listing); this file is for developers. It is not shipped in the plugin zip.

كيف يُعتمد الطلب (How an order settles)

The customer's return (a hint, never trusted), the signed webhook, the five-minute reconciler (Action Scheduler) and the admin "Refresh status" button all call one guarded transition (src/Orders/Transition.php): amount (2 dp), currency LYD and the order reference must equal the order's, and the order is marked paid once (compare-and-set). A mismatch puts the order on hold with a fraud-suspect note and never marks it paid; a second paid checkout on a paid order is a duplicate (note + dpay_wc_duplicate_payment).

التجربة والتشغيل الفعلي (Sandbox and Live)

تُقرأ كل جلسة دفع برمز بيئتها هي — البيئة التي أُنشئت فيها — أيًّا كان وضع المتجر الآن. الدفعة الحقيقية التي تتم والمتجر في الوضع التجريبي تُسوّي الطلب. أما جلسة تجريبية تُدفع والمتجر في الوضع الحقيقي فتُحجز للمراجعة (لم تتحرك أي أموال) ولا تُكمل أي طلب أبدًا.

Each checkout is read with the token of its own environment — the one it was created in (the order's _dpay_mode, the checkout row's live flag) — whatever mode the store is in now. A live payment made while the store is in Sandbox settles the order. A sandbox checkout paid while the store is Live is held for review (no money moved; the order goes On hold with a "sandbox payment on a live store" note and dpay_wc_sandbox_payment_on_live fires) and never completes an order.

التطوير (Development)

composer install        # dev tools + Strauss → vendor-prefixed/ (DPayWC\Vendor\…)
composer lint           # PHPCS: WordPress-Extra + WooCommerce-Core + a VIP-Go subset + PHPCompatibilityWP
composer stan           # PHPStan level 6 with the WordPress and WooCommerce stubs
bin/build.sh            # → dist/dpay-payments-for-woocommerce.zip (no dev files, no token-shaped strings)

The PHPUnit suite runs with the WordPress core test library and WooCommerce, in posts and HPOS order storage. composer test (bin/phpunit.sh) runs it inside the DPay integrations harness's WordPress container; the same suite runs anywhere with a MySQL/MariaDB and a WordPress core + WooCommerce on disk:

WP_CORE_DIR=/path/to/wordpress \
WC_PLUGIN_FILE=/path/to/wordpress/wp-content/plugins/woocommerce/woocommerce.php \
WP_TESTS_DB_HOST=127.0.0.1:3306 WP_TESTS_DB_NAME=wordpress_tests WP_TESTS_DB_USER=wordpress WP_TESTS_DB_PASSWORD=wordpress \
DPAY_WC_TEST_HPOS=0 vendor/bin/phpunit       # DPAY_WC_TEST_HPOS=1: HPOS

bin/plugin-check.sh (Plugin Check on the built zip) and bin/i18n.sh (make-pot → msgmerge → msgfmt) drive the harness's WordPress container.

المستودع المنشور و CI (The published repository and CI)

تُنشر الإضافة في github.com/ditsly/dpay-woocommerce؛ ملف .github/workflows/ci.yml يشغّل على خوادم GitHub: composer validate --strict، وPHPCS، وPHPStan، واختبارات PHPUnit مع مكتبة اختبارات ووردبريس وWooCommerce على MariaDB 11 (PHP 8.1 و8.4، تخزين الطلبات التقليدي وHPOS)، ثم bin/build.sh ويرفع الحزمة وبصمتها. اختبار Playwright الشامل وPlugin Check والقبول من الحزمة تبقى في أدوات تكاملات DPay. البناء قابل لإعادة الإنتاج (bin/reproducible-zip.sh): نسخة نظيفة من وسم الإصدار تعيد بناء الحزمة المنشورة بايتًا ببايت، فبصمة sha256 لحزمة CI هي بصمة الإصدار نفسها.

Published as github.com/ditsly/dpay-woocommerce. Its .github/workflows/ci.yml runs on GitHub-hosted runners: composer validate --strict, PHPCS, PHPStan, the PHPUnit suite with the WordPress core test library and WooCommerce on a MariaDB 11 service (PHP 8.1 and 8.4 × posts and HPOS storage; WordPress 7.1.1 and WooCommerce 11.1.1, sha256-pinned downloads), then bin/build.sh, uploading the zip and its sha256 as an artifact. The Playwright suite (classic and Blocks checkout against the real API and hosted page, webhooks, reconciler, review and duplicate paths), Plugin Check on the zip and the acceptance run from the zip need the real DPay API, the hosted page and a browser: they run in the DPay integrations harness (integrations/tooling in the DPay monorepo), not in CI. The build is reproducible (bin/reproducible-zip.sh): a clean clone of a release tag rebuilds the released zip byte for byte, so the CI artifact's sha256 is the one published with the release.

In the published repository bin/build.sh checks the bundled SDK against composer.lock (bin/check-sdk-license.sh): its LICENSE names Dimensions IT Solutions (DITS), dpay/dpay-php comes from Packagist (never a local path), and its Version::SDK is the locked version (one known exception passes with a warning: the published dpay/dpay-php 1.0.1 still reports 1.0.0; 1.0.2 fixes it, and the plugin re-locks on 1.0.2 once it is on Packagist). composer.lock is re-resolved from Packagist at every release.

الدعم (Support)

Made by DITS — Dimensions IT Solutions, Libya (https://dits.ly).