Commit Graph

2 Commits

Author SHA1 Message Date
wpdev 50989396a8 fix(2meet-data-optimizer-woocommerce-addon): recompute commission amounts on every tracked status change and refund
- the commission upsert replaces subtotal, commission, vendor_payout and
  commission_rate on conflict (it kept the first amounts, so a partial refund
  before completion never reached the row)
- woocommerce_order_refunded recomputes a tracked or already recorded order;
  a fully refunded order keeps its row at zero, untracked orders get none
- Verify: WCOrdersInterceptorTest (5 new), integration 27, unit 11, phpcs;
  dev36 flow_wc partial refund -> completed
- PR: PR-092
2026-09-27 16:29:28 +08:00
wpdev 094248b75d fix(2meet-data-optimizer-woocommerce-addon): read real Marketplace commission keys
Tests / PHP Lint (pull_request) Successful in 11s
Tests / Integration Tests (pull_request) Successful in 59s
Tests / Unit Tests (pull_request) Successful in 59s
- Marketplace writes hp_vendor / hp_commission_rate / hp_commission_fee (no
  underscore); the _hp_* keys never existed, so no commission was recorded
- Compute subtotal, vendor payout and commission the way
  Marketplace::get_order_profit() does, honouring hp_vendor_include_taxes
- Store the vendor's user ID, the product's parent listing, and the platform
  commission percentage (Marketplace stores the vendor share, e.g. 0.9)

Verify: phpunit-integration --filter WCOrdersInterceptorTest (4 tests);
  WC unit 10 OK, integration 22 OK
PR: PR-012
2026-09-25 22:47:35 +08:00