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

Webhooks: checkout.session.completed not being sent by stripe trigger #1110

Closed m4hdin4 closed 10 months ago

m4hdin4 commented 1 year ago

Issue

Webhooks: checkout.session.completed not being sent by stripe trigger

Expected Behavior

I expect to be able to use the command $ stripe trigger checkout.session.completed

Steps to reproduce

Open two shells and enter the following two commands: $ stripe listen --forward-to 0.0.0.0:8080/api/v1/payment/complete/webhook (my endpoint URL) $ stripe trigger checkout.session.completed

Traceback

$ stripe trigger checkout.session.completed

Setting up fixture for: product Running fixture for: product Setting up fixture for: price Running fixture for: price Setting up fixture for: checkout_session Running fixture for: checkout_session Setting up fixture for: payment_page Running fixture for: payment_page Setting up fixture for: payment_method Running fixture for: payment_method Setting up fixture for: payment_page_confirm Running fixture for: payment_page_confirm Trigger succeeded! Check dashboard for event details.

$ stripe listen --forward-to 0.0.0.0:8080/api/v1/payment/complete/webhook --skip-verify

Ready! You are using Stripe API Version [2022-11-15]. Your webhook signing secret is whsec_9fc62d0bd1acfec1641b57b334a7b77d812f34e5d1df0230a7acc2a324cacbdb (^C to quit) 2023-07-26 16:15:33 --> product.created [evt_1NY75tI3B5SCAq4BzciQVGlf] 2023-07-26 16:15:33 <-- [400] POST http://0.0.0.0:8080/api/v1/payment/complete/webhook [evt_1NY75tI3B5SCAq4BzciQVGlf] 2023-07-26 16:15:34 --> price.created [evt_1NY75uI3B5SCAq4BgAdH4MEi] 2023-07-26 16:15:34 <-- [400] POST http://0.0.0.0:8080/api/v1/payment/complete/webhook [evt_1NY75uI3B5SCAq4BgAdH4MEi] 2023-07-26 16:15:39 --> payment_intent.requires_action [evt_3NY75zI3B5SCAq4B0O66qnfy] 2023-07-26 16:15:39 <-- [400] POST http://0.0.0.0:8080/api/v1/payment/complete/webhook [evt_3NY75zI3B5SCAq4B0O66qnfy] 2023-07-26 16:15:39 --> payment_intent.created [evt_3NY75zI3B5SCAq4B0fi3b7ya] 2023-07-26 16:15:39 <-- [400] POST http://0.0.0.0:8080/api/v1/payment/complete/webhook [evt_3NY75zI3B5SCAq4B0fi3b7ya]

Environment

macOS

stripe version: 1.17.0

etsai-stripe commented 10 months ago

i tried it with v1.18.0 and had it working. could you please upgrade your stripe CLI and try again

$ stripe --version
stripe version 1.18.0
st-etsai2:pay-server etsai$ stripe trigger checkout.session.completed
Setting up fixture for: product
Running fixture for: product
Setting up fixture for: price
Running fixture for: price
Setting up fixture for: checkout_session
Running fixture for: checkout_session
Setting up fixture for: payment_page
Running fixture for: payment_page
Setting up fixture for: payment_method
Running fixture for: payment_method
Setting up fixture for: payment_page_confirm
Running fixture for: payment_page_confirm
Trigger succeeded! Check dashboard for event details.
2023-11-30 10:19:42   --> product.created [evt_1OIEpuB7Y77i2nzMBPMwEj52]
2023-11-30 10:19:42   --> price.created [evt_1OIEpuB7Y77i2nzMnV3Iv13h]
2023-11-30 10:19:43  <--  [200] POST https://postman-echo.com/post [evt_1OIEpuB7Y77i2nzMBPMwEj52]
2023-11-30 10:19:43  <--  [200] POST https://postman-echo.com/post [evt_1OIEpuB7Y77i2nzMnV3Iv13h]
2023-11-30 10:19:43   --> payment_intent.created [evt_3OIEpvB7Y77i2nzM01idcEvH]
2023-11-30 10:19:43  <--  [200] POST https://postman-echo.com/post [evt_3OIEpvB7Y77i2nzM01idcEvH]
2023-11-30 10:19:45   --> customer.created [evt_1OIEpxB7Y77i2nzMmoDF32hf]
2023-11-30 10:19:45  <--  [200] POST https://postman-echo.com/post [evt_1OIEpxB7Y77i2nzMmoDF32hf]
2023-11-30 10:19:45   --> payment_intent.succeeded [evt_3OIEpvB7Y77i2nzM0L571WVW]
2023-11-30 10:19:45   --> charge.succeeded [evt_3OIEpvB7Y77i2nzM03wd2ggc]
2023-11-30 10:19:45  <--  [200] POST https://postman-echo.com/post [evt_3OIEpvB7Y77i2nzM0L571WVW]
2023-11-30 10:19:46  <--  [200] POST https://postman-echo.com/post [evt_3OIEpvB7Y77i2nzM03wd2ggc]
2023-11-30 10:19:46   --> checkout.session.completed [evt_1OIEpyB7Y77i2nzMfAQg0zwv]
2023-11-30 10:19:46  <--  [200] POST https://postman-echo.com/post [evt_1OIEpyB7Y77i2nzMfAQg0zwv]