Test des Webhooks Stripe¶
Problème résolu¶
✅ Correction du webhook: Le payload est maintenant correctement récupéré en format brut pour la vérification de signature Stripe.
Comment tester les webhooks Stripe en développement¶
Option 1: Stripe CLI (Recommandée)¶
1 2 3 4 5 6 7 8 9 10 11 | |
Option 2: ngrok (Alternative)¶
1 2 3 4 5 6 7 8 | |
Option 3: Test sur serveur de production¶
Configurer le webhook directement sur https://api-housing.boaz-study.tech/api/souscriptions/webhook/stripe
Configuration Stripe Dashboard¶
Dans votre tableau de bord Stripe (https://dashboard.stripe.com/test/webhooks):
- Créer un endpoint webhook
- URL:
https://api-housing.boaz-study.tech/api/souscriptions/webhook/stripe(production) ou l'URL ngrok/Stripe CLI - Événements à écouter:
checkout.session.completedpayment_intent.payment_failed
- Copier le secret de signature et le mettre dans
STRIPE_WEBHOOK_SECRET
Variables d'environnement actuelles¶
STRIPE_SECRET_KEY: ✅ ConfiguréSTRIPE_PUBLISHABLE_KEY: ✅ ConfiguréSTRIPE_WEBHOOK_SECRET: ✅ ConfiguréFRONTEND_URL: ✅ Configuré (https://housing.boaz-study.tech)
Test de paiement¶
- Créer un paiement: ✅ Fonctionne
- Redirection Stripe: ✅ Fonctionne
- Webhook de confirmation: ⚠️ Nécessite Stripe CLI ou serveur accessible
Cartes de test Stripe¶
- Succès:
4242424242424242 - Échec:
4000000000000002 - 3D Secure:
4000000000003220