stripe / stripe-cli

A command-line tool for Stripe
https://stripe.com/docs/stripe-cli
Apache License 2.0
1.59k stars 374 forks source link

Event Order #1191

Open zhoub opened 4 months ago

zhoub commented 4 months ago

Issue

Using stripe version 1.19.5.

For 2 events, customer.subscription.created and customer.subscription.updated,

2024-05-23 15:54:05   --> customer.subscription.created [evt_1PJVXNBzH5DDPixH6s1mtfkF]
2024-05-23 15:54:05   --> customer.subscription.updated [evt_1PJVXNBzH5DDPixHId5cNSFm]
2024-05-23 15:54:05  <--  [200] POST http://localhost:10000/v1/stripe/webhook/process [evt_1PJVXNBzH5DDPixHId5cNSFm]
2024-05-23 15:54:05  <--  [200] POST http://localhost:10000/v1/stripe/webhook/process [evt_1PJVXNBzH5DDPixH6s1mtfkF]

Strip Cli receives 2 events with correct order, created event then updated event. But it forwards the events with reversed order.

Expected Behavior

Should be

2024-05-23 15:54:05  <--  [200] POST http://localhost:10000/v1/stripe/webhook/process [evt_1PJVXNBzH5DDPixH6s1mtfkF]
2024-05-23 15:54:05  <--  [200] POST http://localhost:10000/v1/stripe/webhook/process [evt_1PJVXNBzH5DDPixHId5cNSFm]

The event order at Dashboard is correct.

Steps to reproduce

Use Stripe Dashboard to create a period product, then use Stripe CLI to listen to the events, create a checkout session from web UI.

Traceback

No

Environment

macOS + stripe version 1.19.5