Decide: should confirming a manual payment renew an active membership?

オープン
#2,137 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
15/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
活発
技術スタック
php, wordpress
領域
payments

調査の方向性

Start with the confirm_membership toggle's v-if in inc/admin-pages/class-payment-edit-admin-page.php (around line 1193) and the renewal branch in handle_save() in the same file. The active renewal row of test_manual_confirmation_period shows the current behaviour. This is a maintainer decision, so the work is done only once the desired rule for active memberships is settled; any build must extend the period exactly once.

索引モデルが issue の本文から書いたものです。

説明

enhancement hold-for-review no-auto-dispatch origin:interactive status:available

Decision needed

Should confirming a pending payment renew an active manual membership?

Source: review comment on PR #2133 by @coderabbitai. Not a defect in that PR; main behaves the same way.

Premise check

Correct. An administrator cannot renew an active manually billed membership by confirming its payment in the UI. The "Activate Membership?" toggle in the payment editor is hidden when the membership is active or trialing, so the renewal branch of handle_save() is never reached from the page for those memberships.

  • Toggle visibility: inc/admin-pages/class-payment-edit-admin-page.php, the confirm_membership field's v-if (around line 1193).
  • Renewal branch: handle_save() in the same file calls $membership->renew(false, Membership_Status::ACTIVE) for a non-initial payment.
  • The branch works when confirm_membership is posted: the active renewal row of Payment_Edit_Admin_Page_Test::test_manual_confirmation_period passes.
  • On main the toggle is shown for pending memberships only, so this is not new.

Analysis

  • Manual-gateway renewal payments are created by an administrator (inc/admin-pages/class-payment-list-admin-page.php:208 and :461). Nothing creates them at expiry. The only automatic creators are the Stripe and PayPal webhooks and the migrator.
  • Showing the toggle for active memberships would let one confirmation extend the plan's period by a billing cycle. If the administrator has also moved the expiration by hand, that extends it twice.
  • A pending payment is not necessarily a renewal. An administrator can create one with custom line items for something else, and confirming it with the toggle on would still renew. The cart type that identifies add-ons and upgrades is stored only for payments created by checkout, so it cannot tell these apart.
  • Add-on payments already lift a hold without extending the period (#2133), so any new rule must keep that.

Recommended path

Keep today's behaviour and document that an active manual membership is extended by editing its expiration. If maintainers want one-click renewal, show the toggle for an active membership only when the payment has a plan line item, and require the administrator to confirm the new expiration date in the same form.

Verification, if this is built

  • A pending payment with a plan line item on an active membership: the toggle appears, confirming extends the expiration by one cycle exactly once, and a repeated save does not extend again.
  • A pending payment with only custom line items: no toggle.
  • Existing rows of test_manual_confirmation_period keep passing.

aidevops.sh v3.39.189 plugin for OpenCode

主要言語
PHP
スター
219
フォーク
88
平均マージ
1日 7時間
マージ済み PR(30日)
58

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Ultimate-Multisite/ultimate-multisite のほかの issue

Ultimate-Multisite/ultimate-multisite の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。