Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stripe Does Not Attempt to Contact My Webhook

I am building my first Stripe integration with a Wordpress plugin and cannot get Stripe to attempt to contact my webhook. I have followed the instructions at https://stripe.com/docs/checkout/integration-builder and successfully made some test payments. Then I copied and pasted the sample code at https://stripe.com/docs/payments/checkout/fulfill-orders into a file named webhook.php and configured the CLI stripe listen setting with that URL except instead of localhost mine starts with 127.0.0.1. Then I pasted the webhook authentication code into the webhook.php file and made another test payment. It worked fine, but there was no attempt to access the webhook.

What am I missing, is there something I need to add to the sample app from the first URL I listed to instruct the checkout process to ping my server? The sample app does not include a webhook and the page with the fulfillment instructions has no link to any sample app, so I can't tell if I need to add anything more to my create-checkout-session.php file. The Stripe instructions are not very good.

There is also no way to type anything into cmd.exe after it gives me my webhook signing secret. It just has a blinking _ character underneath the line with the secret and anything I try to type anything nothing appears on the screen.

I checked my account on the Stripe website and under the checkout.session.completed event it says "No recent webhook attempts"

like image 639
WannabePuppetMaster Avatar asked Sep 05 '25 03:09

WannabePuppetMaster


1 Answers

My problem was that there are two types of webhook listeners. One is called Direct en the other Connect.

When you create a webhook you can select the box: Listen to events on Connected accounts. Tick it and you create a Connect listener. Don't tick and it's a Direct one.

In my case a charge.succeeded was only listened to in the Direct version of the listener.

Exactly why eludes me. But the support said:

"The first webhook [the Connected type] that you create will inform you regarding the connected accounts." "And the second one [the Direct type] from your platform"

like image 76
smoquet Avatar answered Sep 11 '25 10:09

smoquet