fix: send payment_received receipt after manual payment confirmation and email verification
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
Goal
Send the payment_received system email (customer receipt and admin notice) in two cases that currently send nothing:
- A network admin confirms a pending manual payment.
- A free signup becomes active after its customer verifies their email address.
Evidence
Release 2.18.0 smoke test on a fresh dev network at origin/main c8b5ffe8 (2026-10-28), with mail captured by Mailpit:
- Manual payment: Premium checkout with the Manual gateway left payment #1 and membership #1 pending, as expected. An admin then set the payment to Completed with "Activate membership?" on. The membership became active and the site was published, and "Your site is ready!" was sent. No
payment_receivedemail went to the customer or the admin. Event log rows for this step werechanged paymentandchanged membershiponly. - Free signup with email verification: the thank-you page says "a receipt for your purchase has been emailed to you". After the customer followed the verification link, the site went READY and "Your site is ready!" was sent. No "Your free membership is active" /
payment_receivedemail was sent. - Both paths are unchanged since v2.17.2, so this is long-standing, not a regression.
How
payment_receivedfires only fromPayment_Manager::handle_payment_success()(inc/managers/class-payment-manager.php:109-219), which listens towu_gateway_payment_processed.wu_gateway_payment_processedcomes fromBase_Gateway::trigger_payment_processed()(inc/gateways/class-base-gateway.php:901). The checkout calls it for free/trial orders only when email verification is not pending (inc/checkout/class-checkout.php:1074and:1108). Gateways call it on gateway-confirmed payments.- Manual confirmation path:
Payment_Edit_Admin_Page::handle_save()(inc/admin-pages/class-payment-edit-admin-page.php:1458+) activates the membership but never triggers payment processed. - Verification path:
Customer_Manager::maybe_verify_email_address()/transition_customer_email_verification()(inc/managers/class-customer-manager.php:183,:245) publish the deferred free signup but never trigger payment processed. - Trigger it once in each path, with the payment's gateway (
wu_get_gateway($payment->get_gateway())) or the manual/free gateway. Guard against duplicate events, for example by checking whether apayment_receivedevent already exists for the payment, so a repeated save or verification can't send twice.
Files Scope
inc/admin-pages/class-payment-edit-admin-page.phpinc/managers/class-customer-manager.phpinc/managers/class-payment-manager.phptests/WP_Ultimo/Managers/Payment_Manager_Test.phptests/WP_Ultimo/Managers/Customer_Manager_Test.php
Verification
vendor/bin/phpunit --filter 'Payment_Manager_Test|Customer_Manager_Test'vendor/bin/phpcson the changed files.- Dev site with Mailpit: (1) a manual Premium checkout, then admin Completed + "Activate membership?", sends exactly one customer receipt and one admin notice; (2) a free signup with verification sends "Your free membership is active" once, after verification; (3) re-saving the completed payment sends nothing further.
aidevops.sh v3.39.49 plugin for OpenCode
- 主要语言
- PHP
- 星标
- 218
- 派生
- 87
- 平均合并
- 1 天 2 小时
- 30 天内合并 PR
- 109
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Ultimate-Multisite/ultimate-multisite 的其他 Issue
-
perf: lazy-load the top My Sites toolbar and defer initial site-list hydration可能重新可做 关联的 PR 已关闭且未合并。 未关闭enhancement origin:worker priority:medium source:conflict-feedback status:available tier:standard
难度 5/5 一周以上 新手友好度 25/100
Ultimate-Multisite/ultimate-multisite#2015 · 65 条评论 ·
维护者通常 1 天内回复
-
auto-dispatch needs-investigation origin:worker security status:available tier:standard type:bug
难度 3/5 半天 新手友好度 30/100
Ultimate-Multisite/ultimate-multisite#1930 ·
维护者通常 1 天内回复
-
hold-for-review no-auto-dispatch origin:interactive status:available type:bug
难度 5/5 一周以上 新手友好度 25/100
Ultimate-Multisite/ultimate-multisite#1892 ·
维护者通常 1 天内回复
-
auto-dispatch hold-for-review origin:worker review-followup source:review-scanner status:available tier:standard
难度 3/5 1-2 天 新手友好度 48/100
Ultimate-Multisite/ultimate-multisite#1867 · 7 条评论 ·
维护者通常 1 天内回复
-
auto-dispatch needs-investigation origin:worker security status:available tier:standard type:bug
难度 4/5 3-5 天 新手友好度 45/100
Ultimate-Multisite/ultimate-multisite#1753 ·
维护者通常 1 天内回复
查看 Ultimate-Multisite/ultimate-multisite 的全部 Issue
相似的 Issue
-
bug review needed
难度 1/5 1 小时以内 新手友好度 86/100
OpenMage/magento-lts#5816 ·
维护者通常 2 天内回复
-
priority:low type:docs
难度 2/5 1-3 小时 新手友好度 84/100
crazy-goat/rabbit-stream#958 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
nextcloud/richdocuments#6250 ·
维护者通常 1 天内回复
-
sync-en
难度 1/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
sync-en
难度 1/5 1 小时以内 新手友好度 75/100
维护者通常 1 天内回复