brianhenryie/bh-wp-order-email-reconcile

Mark orders as paid by reconciling payment-confirmation emails. WooCommerce supported; designed to be extensible to other order sources (e.g. GiveWP).

Maintainers

Package info

github.com/BrianHenryIE/bh-wp-order-email-reconcile

Type:wordpress-library

pkg:composer/brianhenryie/bh-wp-order-email-reconcile

Transparency log

Statistics

Installs: 35

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 6

dev-master 2026-07-10 03:29 UTC

This package is auto-updated.

Last update: 2026-07-10 03:29:58 UTC


README

PHPCS WPCS

BH WP Order Email Reconcile

Mark orders as paid by reconciling payment-confirmation emails against unpaid orders.

Emails are fetched and stored by BH WP Mailboxes. When new emails arrive, this library parses them and matches them to unpaid orders by order id (from the payment note), customer payment id (e.g. Venmo/$CashTag), email address, then name.

The core is integration-agnostic: it deals only with Unpaid_Order objects supplied by an Unpaid_Orders_Provider_Interface. WooCommerce is supported today; GiveWP is scaffolded as a second integration. See ARCHITECTURE.md and PLAN.md.

Usagew

add_action( 'plugins_loaded', function () {
    $settings = new My_Reconcile_Settings(); // implements Email_Reconcile_Settings_Interface
    $logger   = Logger::instance( $settings );
    BH_WP_Order_Email_Reconcile::make( $settings, $logger );
} );

Email accounts (server, credentials, filters) are configured through the BH WP Mailboxes API; this library never stores credentials.

Development

composer install
composer dump-autoload          # after adding/renaming classes

# Lint + static analysis
composer lint                   # phpcbf + phpcs + phpstan

# Unit + wpunit tests (needs the wp-env DB on port 33066)
npm install
npm run wp-env:start
vendor/bin/codecept run unit
vendor/bin/codecept run wpunit

# End-to-end (Playwright, against wp-env on :8888)
npm run test:e2e

The development plugin provides a fake WooCommerce gateway, places a fake order, configures the library with test mailbox credentials, and sends a fake payment email to verify reconciliation.