#thibaud_.
1 messages · Page 1 of 1 (latest)
can you show me an example of the webhook event where this doesn't happen? like the evt_xxx ID.
you should listen to the checkout.session.completed event really , not the PaymentIntent event.
but in any case, you add metadata to the CheckoutSession object, that doesn't get copied to the PaymentIntent.
basically either you can read the metadata from the checkout.session.completed event, or you can use https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata to have the metadata get added to the PaymentIntent.
$checkout_session = $stripe->checkout->sessions->create(array(
'customer_email' => hs($oUser['Mail']),
'line_items' => array(array('price_data' => array('unit_amount' => $nPrixStripe,'currency' => 'eur','product_data' => array('name' => $sTitre.' - '.$sDescription)), 'quantity' => 1)),
'mode' => 'payment',
'success_url' => URLSITE.''.$sLang.'/checkout_temp.php',
'cancel_url' => URLSITE.''.$sLang.'/checkout.php',
'metadata' => array(
'order_id' => $_SESSION['Connected']['Achat']['KeyGen'],
'idEvent' => $sR['idEvent'],
'idMatch' => $sR['id'],
'idAnnonce' => $_SESSION['Connected']['Achat']['idAnnonce'],
'Quantite' => $_SESSION['Connected']['Achat']['Quantite'],
'idMbr' => $oUser['id'],
'PrixParBillet' => $sRDetail['PrixVente'],
'PrixBillets' => $nPrixBillets,
'TaxeParBillet' => $oUser['PourcentageDossierAchat'],
'PrixDossierParBillet' => $nPrixDossierParBillet,
'PrixDossier' => $nPrixDossier,
'PrixHT' => $nPrixHT,
'TaxeTVA' => $sR['Tva'],
'PrixTVA' => $nPrixTVA,
'PrixTotal' => $nPrixTotal,
),
));
i use this to share the metadata and i wanted to get them on the webhook
it's not possible to do that ?
completely possible
so, i don't understand what i do wrong
it's right here, in the checkout.session.completed event : https://dashboard.stripe.com/events/evt_1NZxrzJigHIRTv19nVZsbgVN
so this is the webhook who was send ?
it wasn't sent.
you have an endpoint for it but it's disabled : https://dashboard.stripe.com/webhooks
i am lost, sorry
i received a "ping" with data
and the event was checkout.session.completed
and what was the event ID?
OH. i have 2 differents webjook.
it's possible it was send on the wrong one ?
if i have one disabled
it wasn't sent at all
you have one endpoint that only listens to payment_intent.succeeded
i received 2 after i pay via checkout
because i receive a mail when i have a probleme
and you have the other endpoint 0_stripe_webhook_checkout.php that is configured to listen to checkout.session.completed, but that endpoint is disabled
okay
as you say, it was probably disabled because you were returning errors from it
so, i pay via the checkout and stripe send me the webhook on the one who is activate
0_stripe_webhook.php
and it's generate me the error
i understand now
my bad. sorry for inconvenience
thanks a lot for your reactivity and the time loose with me 🙂
take care guys
heart on you ❤️