Commit 3e30c89
authored
fix(dashboard): show paid-until-date when subscription is cancelled (#9)
Cancellation in this product is not a self-serve action — users
revoke their auto-pay mandate at the bank or directly inside
Razorpay. That fires subscription.cancelled to us, and our handler
stores current_period_end along with the cancelled status. The
cancellation email already tells the user "Paid access continues
until 2026-05-24" but the in-app banner just said "Cancellation
is in progress." — leaving the date as a thing they'd have to
re-derive from the email.
Banner now reads
Paid access continues until May 24, 2026. After that you're
back on the free tier.
Falls back to the old generic text when current_period_end isn't
populated (rare — happens if Razorpay didn't send current_end on
the cancel webhook). Date formatted via toLocaleDateString in the
visitor's locale.
No API change, no schema change, ~10 lines.1 parent a414e84 commit 3e30c89
1 file changed
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | | - | |
405 | | - | |
406 | | - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
407 | 409 | | |
408 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
409 | 421 | | |
410 | | - | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
411 | 425 | | |
412 | 426 | | |
413 | 427 | | |
| |||
0 commit comments