#mathieu-events

1 messages · Page 1 of 1 (latest)

chilly thicket
#

heya @normal owl! unfortunately not, you can't trigger payment_intent.succeeded on a given PaymentIntent.

normal owl
#

and on invoice.payment_succeeded ?

chilly thicket
#

it's not possible to pass in a specific object id and attempt to trigger an event for that specific object id

#

what you can do though, is to resend a specific event id

normal owl
#

how can i do that ?

chilly thicket
#

i think this is what you're looking for?

normal owl
#

For context i'm trying to test delivering licence product to my user which have a subscription being paid but i'm feeling a bit lost at the moment with the webhook.

I want to be able to test the webhook in real situation and having stripe calling my localhost endpoint.

I'm using sepa test integration number to test the PaymentIntent going from processing to succeeded after 3 min AT321904300235473204 from this guide https://stripe.com/docs/billing/subscriptions/sepa-debit?platform=web#test-integration

And what i dont understand is how to tell stripe to trigger the event on my localhost after i init this scenario going through my subscription workflow ?

normal owl
#

ok i think i get it now after some testing.

here is what i do :

  1. listen to event with cli with this :
    stripe listen --forward-to=api.localhost/v1/stripe-webhook -e invoice.payment_succeeded
  2. run the subscription workflow on my app on localhost
  3. wait for the event to trigger on the dashboard on https://dashboard.stripe.com/test/events
  4. find it, copy paste his id and then use the CLI resend
    stripe events resend evt_1JrfXeD9WJsCYyaSOrvjDuRf
  5. and now my localhost webhook seems to be hit, according to my log :
    NOTICE: PHP message: invoice.payment_succeeded in_1JrfXbD9WJsCYyaSkWWp9GTj

Does it looks like i'm testing this the right way to you or am i doing it wrong ?

chilly thicket
#

give me a second to catch up, i was a little tied up with something else earlier

#

you shouldn't need to resend it, if you're already listening for it (unless you want to test something more than once)

#

but yep, your flow is correct!

normal owl
#

ok i'm gonna do more debugging to see if i really need to resend it, thanks