#AlphaRyze-checkout

1 messages · Page 1 of 1 (latest)

molten crescent
#

Hi! We know nothing about discord.js, but we can help on the Stripe part.

vital lance
#

thanks

molten crescent
#

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)

vital lance
#

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

vital lance
#

quick question:

#

if i do it using the paymentLinks can i still handle events like a successful payment right?

molten crescent
#

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.

vital lance
#

perfect

vital lance
#

but still i'm in dubt on how to link a webhook into this payment link =\

molten crescent
#

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.

vital lance
molten crescent
vital lance
#

yea

#

that's what i followed

molten crescent
#

So you do get the checkout.session.completed event? Then what is your question exactly? What information are you looking for?

vital lance
#

i get it on the online CLI

#

but while in the local server it doesnt recieve events

molten crescent
#

So you are using something like stripe listen --forward-to localhost:4242/stripe_webhooks?

vital lance
#

yep

molten crescent
#

And does your server receives the events?

vital lance
#

nop

molten crescent
#

Can you add some logs to your server to check if its at least called?

vital lance
#

ok

#

gimme a sec

molten crescent
#

Otherwise double check that you used the correct url in the stripe listen command and that your server is actually running.

vital lance
#

when i'll try it into the live mode

#

i'll have to change only the endpoint secret right?

molten crescent
#

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.

vital lance
#

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?

molten crescent
#

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