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"
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With