#thibaud_.

1 messages · Page 1 of 1 (latest)

trim flintBOT
pastel heron
#

can you show me an example of the webhook event where this doesn't happen? like the evt_xxx ID.

queen oyster
#

evt_3NZxqpJigHIRTv191vxKSWWd

#

it's related to : pi_3NZxqpJigHIRTv191PsQpFso

pastel heron
#

you should listen to the checkout.session.completed event really , not the PaymentIntent event.

queen oyster
#

if($event->type == 'checkout.session.completed') {

#

it's what i do

pastel heron
#

but in any case, you add metadata to the CheckoutSession object, that doesn't get copied to the PaymentIntent.

queen oyster
#
$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 ?

pastel heron
#

completely possible

queen oyster
#

so, i don't understand what i do wrong

trim flintBOT
pastel heron
queen oyster
#

so this is the webhook who was send ?

pastel heron
#

it wasn't sent.

queen oyster
#

i am lost, sorry

#

i received a "ping" with data

#

and the event was checkout.session.completed

pastel heron
#

and what was the event ID?

queen oyster
#

OH. i have 2 differents webjook.

it's possible it was send on the wrong one ?

#

if i have one disabled

pastel heron
#

it wasn't sent at all

#

you have one endpoint that only listens to payment_intent.succeeded

queen oyster
#

i received 2 after i pay via checkout

#

because i receive a mail when i have a probleme

pastel heron
#

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

queen oyster
#

okay

pastel heron
#

as you say, it was probably disabled because you were returning errors from it

queen oyster
#

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 ❤️