Serreau Jovann 62718b5942 feat: sync automatique Stripe pour les tarifs + boutons sync admin
src/Service/StripePriceService.php (nouveau):
- Utilise Stripe SDK v20 (StripeClient) avec STRIPE_SK
- syncPrice(): pour chaque PriceAutomatic, cree ou retrouve le produit
  Stripe via metadata price_auto_type, puis cree le Stripe Price
  (unique et/ou recurrent selon monthPrice)
- ensureProduct(): cherche un produit existant par metadata, le cree
  sinon, met a jour nom/description si modifies
- createStripePrice(): cree un prix Stripe en centimes, avec
  tax_behavior=exclusive, recurring si monthPrice > 0 avec
  interval=month (ou year si period >= 12)
- updateStripePriceIfNeeded(): si le montant a change, archive l'ancien
  prix Stripe et en cree un nouveau (Stripe ne permet pas de modifier
  le montant d'un prix existant)
- syncAll(): synchronise tous les tarifs, retourne synced + errors

src/Service/TarificationService.php:
- Injection optionnelle de StripePriceService
- ensureDefaultPrices(): apres creation des tarifs, sync automatique
  avec Stripe (cree produits + prix) en plus de Meilisearch

src/Controller/Admin/TarificationController.php:
- edit(): apres mise a jour d'un tarif, sync automatique avec Stripe
  (cree/archive/recree les prix si montant change) et Meilisearch
- Flash d'erreur si Stripe echoue, les modifs locales sont sauvegardees

src/Controller/Admin/SyncController.php:
- Nouvelle route POST /admin/sync/stripe/prices: synchronise tous
  les tarifs avec Stripe via StripePriceService::syncAll()

templates/admin/sync/index.html.twig:
- Section "Stripe" avec bouton "Synchroniser Stripe" (violet)
  pour les tarifs, avec confirmation avant execution
- Section Meilisearch tarifs renommee "Tarifs - Meilisearch"

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 22:50:27 +02:00
2026-03-30 18:52:03 +02:00
2026-03-30 18:52:03 +02:00
2026-03-30 18:51:57 +02:00
2026-03-30 18:51:57 +02:00
2026-03-30 18:52:03 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
2026-04-01 15:42:52 +02:00
Description
No description provided
9.6 MiB
Languages
PHP 66.2%
Twig 28.7%
JavaScript 4%
Jinja 0.5%
Makefile 0.3%
Other 0.2%