#MorenoMdz-payout-event-testing

1 messages ยท Page 1 of 1 (latest)

whole boltBOT
clear lantern
#

Hi there,
What webhook event are you listening to ?

junior musk
#

The payout created one

#

when that happens I need to get all the transfers that payout contained and save to our system

snow inlet
#

Hi there ๐Ÿ‘‹ I'm jumping in as my teammate needs to step away soon. I don't think it's possible to simulate this scenario from Stripe without allowing an automatic payout to naturally occur.

The Stripe CLI triggers various events by taking action on the account to trigger those events, which is why I believe you're seeing a manual payout when you try to trigger the event from the CLI.

The only approach that readily comes to mind for you to send a test event to your endpoint where you can control the event contents, is to use a tool to make the request to your endpoint yourself. Generating the request yourself would allow you to control the contents that you provide your endpoint, though you'll likely want to bypass event verification for that to avoid needing to recalculate signatures.

junior musk
#

Hey Toby, not sure I follow, when you say sending a test event is just calling a normal http request, not using the stripe CLI?

#

Can we edit what times the daily payouts go out in the test environment in Stripe? If so I could use that to test it a bit faster

snow inlet
#

Correct, that is what I was suggesting. No, Payout timing cannot be adjusted beyond frequency (but I believe that is a global setting, meaning live and testmode share those payout settings, so I advise caution when adjusting those).

One other thing that might be possible, if there is an event that was automatically generated recently (within the last 30 days) that contains information that would work for your test, is to use the stripe events resend command to resend a previously created Event to your endpoint.
https://stripe.com/docs/cli/events/resend

junior musk
#

Oh good call, I will try that

#

in case I do need to call our endpoint directly, any suggestion on how to mimic the verification step? Other than commenting it in code to test locally

snow inlet
#

I would personally skip it for the test. If you wanted to leave the verification step in there, but allow the test request to go around it, then you could add some logic to check for a special header or query param that you include in your test request.

If you wanted to fully test this with the signature verification step, then you would need to manually calculate the correct signature value and provide that in your request. This section walks through how to manually calculate those signature values:
https://stripe.com/docs/webhooks/signatures#verify-manually

junior musk
#

Gotcha

#

Where do I see the list of events the system sent?

snow inlet
#

You can find them in your dashboard:
https://dashboard.stripe.com/test/events
Or you can list them via the API:
https://stripe.com/docs/api/events/list

Both approaches allow you to provide filtering criteria to make it easier to find what you're looking for.

junior musk
#

alright I think I got a few paths to test this, thanks!!

snow inlet
#

MorenoMdz-payout-event-testing