A WooCommerce payment gateway for Payflex, letting shoppers pay in interest-free instalments. The plugin handles the checkout redirect to Payflex, the payment callback, refunds, and order status reconciliation.
This README is for developers working on the repo. The public WordPress.org
listing lives in readme.txt. Deeper documentation (test suite internals,
release recovery, known defects) lives in AGENTS.md; neither file
ships in the WordPress.org release.
- PHP 8.1+
- Composer
- A WordPress + WooCommerce install to run the plugin itself. The test suite needs neither.
composer install
composer test # PHPUnit: no database, WordPress install, or network needed
composer lint # syntax-check every shipped PHP file (same as CI's lint job)The suite runs against custom WordPress and WooCommerce stubs, so it finishes in under a second. To run a single suite or test, use PHPUnit's filter:
vendor/bin/phpunit --filter RefundTestIf the output contains "Payflex: orderId2..." lines, those are not failures. They come from known leftover debug logging in the refund path, and a test tracks their removal.
partpay.php- plugin entry point; WordPress reads the version from its headerincludes/- the gateway class and supporting codeconfig/- API environment configurationassets/- checkout and widget JS/CSStests/- PHPUnit suite and its WordPress/WooCommerce stubsreadme.txt- the WordPress.org listing
The version appears in three places, and the tests fail if they disagree: the
Version: header in partpay.php, private $version in
includes/class-wc-gateway-payflex.php, and Stable tag: in readme.txt.
- Update all three, and add a changelog entry to
readme.txt. - Run
composer testlocally, merge tomain, and confirm the Tests workflow is green. - Publish a GitHub release tagged
vx.y.z(orx.y.z).
Publishing the release triggers the deploy to WordPress.org. The deploy job is skipped if the tests fail or the tag doesn't match the plugin version, so a failed release publishes nothing. Recovery steps are in AGENTS.md.
- New tests extend
PF_TestCaseand live intests/*Test.php. Name them as sentences:test_a_declined_payment_fails_the_order, nottestDecline. - Prefer behavioural assertions (order status, request body, the notice the shopper sees) over mock expectations.
- The suite fails on PHP warnings, notices, and deprecations. Keep it clean; a new warning on a payment path is a real bug.
Test suite conventions and helpers are documented in AGENTS.md.