Skip to content

Correct README inaccuracies around Stripe lapsing and plugin structure#10

Merged
conatus merged 6 commits into
mainfrom
docs/correct-readme-stripe-details
May 1, 2026
Merged

Correct README inaccuracies around Stripe lapsing and plugin structure#10
conatus merged 6 commits into
mainfrom
docs/correct-readme-stripe-details

Conversation

@conatus
Copy link
Copy Markdown
Member

@conatus conatus commented Apr 19, 2026

Summary

Sweeps the README for stale or inaccurate claims about the Stripe lapsing subsystem — most of which pre-date the move off Action Network — and tightens a few other documentation gaps. Split into one atomic commit per discrete correction.

  • Identification method (ab55c86) — replaced the stale `id = "join-gmtu"` charge-metadata story with the actual mechanism: match subscription line-item product IDs against configured membership plans read from the `ck_join_flow_membership_plan_*` `wp_options` rows.
  • Stripe API reference (`9f52a32`) — replaced "Stripe Charges API" with the actual API set: Customers, Subscriptions, Invoices. There is no Charges call anywhere in the codebase.
  • Paid-invoice criterion (`fb26db2`) — replaced the imprecise "failed and refunded payments do not count" with an accurate description of the `status=paid` filter, and noted the refund caveat (refunded invoices keep their `paid` status and will still count).
  • Structure listing (`05204f3`) — `src/StripePaymentHistory.php` was missing from the Structure block; added it.
  • Provider gating (`0a194c9`) — the lapse/unlapse filters only run their custom logic when `context['provider'] === 'stripe'`; previously undocumented.
  • Hook table row 3 (`a0318a8`) — caught during the follow-up coherence audit: the table said `ck_join_flow_pre_handle_join` only writes `$data["branch"]`, but the filter also writes `$data["customFields"]["branch"]` and a `customFieldsConfig` entry. Brought the table in line with the code and with the already-accurate `join-gmtu.php` docblock.

Test plan

  • Read through the Membership Lapsing Override section of the rendered README and confirm each claim against `src/StripePaymentHistory.php` and `src/LapsingOverride.php`
  • Confirm `src/StripePaymentHistory.php` now appears in the Structure listing
  • Confirm the hook-lifecycle table row 3 matches the behaviour in `src/BranchAssignment.php`
  • Run `composer test` — 233 tests, all green

Notes

Branch is based on `main`, independent of PR #9 (`fix/zetkin-branch-assignment-invalid-parameter`). When PR #9 merges, the hook-table row 3 wording here will need a follow-up tweak (the `customFields` writes will no longer happen), but the two PRs touch different lines so no textual conflict is expected.

conatus added 6 commits April 19, 2026 11:09
The README claimed payments were identified by Stripe charge metadata
`id = "join-gmtu"` — a pre-Stripe Action Network hangover. The actual
code in StripePaymentHistory.php matches subscription line items'
product IDs against configured membership plan product IDs read from
the `ck_join_flow_membership_plan_*` wp_options rows.
The README said the payment history came from the Stripe Charges API.
StripePaymentHistory.php actually uses the Customers, Subscriptions,
and Invoices APIs; there is no Charges call anywhere in the codebase.
The README said "failed and refunded payments do not count". Failed
payments never produce a paid invoice so they're correctly excluded,
but refunded invoices keep their `paid` status in Stripe — the code
does not detect refunds. Replace with an accurate description of the
`status=paid` filter and note the refund caveat.
The Structure block in the README was missing the file that actually
talks to Stripe, leaving the lapsing subsystem's description of
"fetches payment history" with no entry pointing at the fetcher.
LapsingOverride.php returns the incoming decision unchanged if the
context's `provider` is anything other than 'stripe'. The README
described only the Stripe path and did not record that non-Stripe
providers fall through untouched — worth making explicit so readers
don't assume the override applies universally.
The hook table said the filter only injects `$data["branch"]`, but
BranchAssignment.php also writes `$data["customFields"]["branch"]`
and ensures a `$data["customFieldsConfig"]` entry for branch. The
join-gmtu.php docblock already described both writes; the README
table was the only place the full behaviour was understated.
@conatus conatus merged commit 1bbc188 into main May 1, 2026
1 check passed
@conatus conatus deleted the docs/correct-readme-stripe-details branch May 1, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant