Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

fix: send payment_received receipt after manual payment confirmation and email verification

未关闭
#2,055 12 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@superdav42 已经在做这个了。

开始于 2026年10月28日。

  • #2064 来自 @superdav42 —— 未关闭

评估

这个 Issue 还没有评估数据。

描述

bug origin:interactive status:in-review tier:standard

Goal

Send the payment_received system email (customer receipt and admin notice) in two cases that currently send nothing:

  1. A network admin confirms a pending manual payment.
  2. 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_received email went to the customer or the admin. Event log rows for this step were changed payment and changed membership only.
  • 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_received email was sent.
  • Both paths are unchanged since v2.17.2, so this is long-standing, not a regression.

How

  • payment_received fires only from Payment_Manager::handle_payment_success() (inc/managers/class-payment-manager.php:109-219), which listens to wu_gateway_payment_processed.
  • wu_gateway_payment_processed comes from Base_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:1074 and :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 a payment_received event 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.php
  • inc/managers/class-customer-manager.php
  • inc/managers/class-payment-manager.php
  • tests/WP_Ultimo/Managers/Payment_Manager_Test.php
  • tests/WP_Ultimo/Managers/Customer_Manager_Test.php

Verification

  • vendor/bin/phpunit --filter 'Payment_Manager_Test|Customer_Manager_Test'
  • vendor/bin/phpcs on 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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Ultimate-Multisite/ultimate-multisite 的其他 Issue

查看 Ultimate-Multisite/ultimate-multisite 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。