#AlphaRyze-checkout
1 messages · Page 1 of 1 (latest)
thanks
Do you want to use PaymentLinks (a single link can be send to multiple customers, can be done without code), or Checkout Session (each customer gets a custom link, requires some code)
for the discord.js part isn't a problem as i work with it for over 1.5 yrs xD
so i'm able to take all the data
i can do both i have no limitations
quick question:
if i do it using the paymentLinks can i still handle events like a successful payment right?
If you are using PaymentLink, it's actually using Checkout Session behind the scene. So in both case you would listen to webhook events like checkout.session.completed.
perfect
sorry to bother you again,
so i've created the payment link and i've setup the code taken from the dashboard webhook creation page
but still i'm in dubt on how to link a webhook into this payment link =\
what do you mean by "link"? what exact info are you looking for? In the checkout.session.completed you should get a Checkout Session object.
basically i have this test product:
https://buy.stripe.com/test_dR64k95L275OcSs4gg
and i wanna setup an event listener with a local server with it but i'm not understanding how
Have you followed this guide: https://stripe.com/docs/webhooks/quickstart
And do you receive the checkout.session.completed event?
So you do get the checkout.session.completed event? Then what is your question exactly? What information are you looking for?
So you are using something like stripe listen --forward-to localhost:4242/stripe_webhooks?
yep
And does your server receives the events?
nop
Can you add some logs to your server to check if its at least called?
Otherwise double check that you used the correct url in the stripe listen command and that your server is actually running.
ok so i've done some tests and now i was able to link my local server to a payment
when i'll try it into the live mode
i'll have to change only the endpoint secret right?
I see "404" errors in your screenshot, it means the url you passed in the Stripe CLI in not the correct one.
But yes once you stop using the Stripe CLI, you will need to create a webhook endpoint in the dashboard, and use the new endpoint secret.
theoically
if i plan to host like the discord bot locally then i'm able to continue to use the CLI to recieve events even in the Live Mode?
I wouldn't recommend using the Stripe CLI in live mode, and instead use a real webhook endpoint. However yes it's possible by using the --live flag
You can see all options for the listen command here: https://stripe.com/docs/cli/listen