fix(stripe): cancel_url /tarifs → /plan

La route /tarifs n'existe pas côté frontend (route réelle: /plan).
Cancellation Stripe Checkout aboutissait sur un 404. Bug détecté lors
du Sprint 5c frontend (gestion des retours post-Checkout).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hermann_Kitio 2026-04-26 05:13:37 +03:00
parent 6671bac347
commit 28f8373f5d
3 changed files with 100 additions and 65 deletions

View file

@ -23,6 +23,10 @@ Format basé sur [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/).
- `src/routes/__tests__/stripe.test.ts` — 5 nouveaux tests (2 idempotency webhook + 3 customer-portal route).
- `docs/ARCHITECTURE-backend.md` — §3 commentaire `plans.ts` corrigé (`POST /plans/upgrade-prorata` au lieu de `POST /plans/upgrade` qui n'existait pas) ; §6 retrait de la ligne dupliquée `POST /plans/upgrade` (la création d'abonnement passe par `POST /stripe/checkout`) ; §6 ajout `POST /stripe/customer-portal`.
### Fixed
- `src/lib/stripe.ts``cancel_url` Stripe Checkout corrigé : `${APP_URL}/tarifs?upgrade=cancelled``${APP_URL}/plan?upgrade=cancelled`. La route `/tarifs` n'existe pas côté frontend (route réelle : `/plan`) ; les checkouts annulés aboutissaient sur un 404. Bug détecté lors du Sprint 5c frontend (gestion des retours post-Checkout) et corrigé en cross-repo.
### Resolved
- **TD-13 🔴 → Résolu** : Webhook Stripe idempotent (table `stripe_webhook_events` + helpers + wiring route + 10 tests).
@ -30,7 +34,7 @@ Format basé sur [Keep a Changelog](https://keepachangelog.com/fr/1.1.0/).
### Notes
- Tests : 261 → 278 verts (+17).
- Aucun changement frontend dans ce sprint — Sprint 5b (frontend billing) à venir.
- Aucun changement code frontend dans ce sprint — Sprint 5b/5c/5d (frontend billing) livrés en parallèle.
---