#xwtk

1 messages ยท Page 1 of 1 (latest)

leaden oreBOT
fierce iris
#

Hey Hanzo.

weary seal
#

Hello ๐Ÿ‘‹
Merchants typically rely on webhooks for real time updates

#

Have you read the doc already?

fierce iris
#

Not fully, read the webhook part but wanted to know if there's an IPN option

#

My checkout system is able to handle simultaneous requests

#

Something like, when payment is complete, Stripe just sends a standard HTTP request to the pre-specified URL

weary seal
#

That's what webhooks do. When the PaymentIntent is created, confirmed, captured etc... you receive a POST request with the PaymentIntent object as a payload on your server-side route.

#

How exactly are you integrated with Stripe? Are you using Stripe Checkout or Elements?

fierce iris
#

Stripe Checkout with PHP library

#

Oh wait a moment

#

// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/apikeys
\Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc');

$endpoint = \Stripe\WebhookEndpoint::create([
'url' => 'https://example.com/my/webhook/endpoint',
'enabled_events' => [
'payment_intent.payment_failed',
'payment_intent.succeeded',
],
]);

#

When I use this, there is no need to enable webhooks from Stripe dashboard correct?

#

Actually nevermind I mixed everything up

weary seal
#

In this case, webhooks would be the best fit.

As you mentioned, customer can quickly exit the browser after paying before success redirect hits. In which case, any code you write client-side isn't going to work.

Webhooks allow you to listen to payment events on server-side, independent of what's happening on client-side

fierce iris
#

Too used to PayPal configuration hahaha

#

I think I got it, so I just register my webhook in Stripe

#

Set to only notify on successful payments, and there should pretty much be nothing else to do

#

Correct?

#

No changes to be done with the checkout initiation?

weary seal
fierce iris
#

Damn sorry for wasting time๐Ÿ˜‚

weary seal
#

All good, happy to help