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).
Package info
github.com/BrianHenryIE/bh-wp-order-email-reconcile
Type:wordpress-library
pkg:composer/brianhenryie/bh-wp-order-email-reconcile
Requires
- php: >=8.4
- ext-json: *
- brianhenryie/bh-wp-mailboxes: dev-master
- psr/log: *
Requires (Dev)
- ext-dom: *
- 10up/wp_mock: *
- antecedent/patchwork: ^2.1
- brianhenryie/bh-wc-logger: dev-master as 0.1.0 || dev-master || >=0.1.0
- brianhenryie/bh-wp-cli-logger: dev-master as 1.0 || dev-master || >=1.0
- brianhenryie/bh-wp-logger: >=0.4.0 || dev-master
- brianhenryie/bh-wp-private-uploads: dev-master as 0.5.1 || dev-master || >=0.5.1
- brianhenryie/color-logger: *
- dealerdirect/phpcodesniffer-composer-installer: *
- johnpbloch/wordpress: *
- lucatume/wp-browser: *
- mockery/mockery: *
- php-stubs/woocommerce-stubs: *
- phpcompatibility/phpcompatibility-wp: *
- phpstan/extension-installer: *
- phpstan/phpstan-mockery: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpcov: *
- rector/rector: ^2.4
- squizlabs/php_codesniffer: *
- szepeviktor/phpstan-wordpress: *
- vlucas/phpdotenv: *
- wp-coding-standards/wpcs: *
- wpackagist-plugin/give: ^4.15
- wpackagist-plugin/woocommerce: *
- wpackagist-plugin/wp-crontrol: ^1.21
- wpackagist-theme/storefront: *
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-10 17:43:55 UTC
README
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.
Usage
$settings = new My_Reconcile_Settings(); // implements Email_Reconcile_Settings_Interface $logger = Logger::instance( $settings ); BH_WP_Order_Email_Reconcile::make( $settings, $logger );
Call make() when your plugin file loads. It only registers hooks: the integrations (WooCommerce,
GiveWP) are checked for availability at query time, so it does not matter whether those plugins
have loaded yet. Do not defer instantiation past plugins_loaded — the cron jobs are
(un)scheduled from plugins_loaded callbacks, which would then never run.
Email accounts (address, display name, filters) and their credentials are owned by BH WP Mailboxes, which stores credentials encrypted through the WordPress Secrets API; this library never handles them.
To let store owners manage the mailbox, append the library's settings fields to a WooCommerce payment gateway's form fields:
$this->form_fields = ( new Credentials_Settings_Fields() )->append_imap_reconcile_fields( $this->form_fields );
This adds an "Add account" button to the gateway's settings screen, which opens BH WP Mailboxes' add/edit IMAP account modal (credentials are saved by that library and the connection is tested), plus a "Manage accounts" link to the emails list screen. That screen's accounts table is where accounts are enabled/disabled, edited, checked now, or deleted, and where recent login failures are flagged.
Development
See CONTRIBUTING.md.