#hemal_webhooks

1 messages ¡ Page 1 of 1 (latest)

harsh canopyBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1326807478171598869

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

eternal pelican
#

If the payment is successful, checkout.session.completed event will be sent for synchronous payment method and checkout.session.async_payment_succeeded event for asynchronous payment method

brisk depot
#

Okay so I just need to listen checkout.session.completed for the successful payments? and what about payment fail event?

eternal pelican
#

Checkout Session allows customer to retry payment until he/she succeeds. Prior to the successful payments, Stripe doesn't send failed events for Checkout Session related events

#

Is there any reason why you would like to subscribe to payment failure event?

brisk depot
eternal pelican
#

If it's only for papertrail / logging purpose, you can listen to payment_intent.payment_failed event for any failed payment attempts

brisk depot
#

but I want to use stripe's hosted payment flow, which is only available in checkout session right? and I guess payment_intent method don't supports the stripe hosted payment

eternal pelican
#

Checkout Session uses Payment Intent under the hood. Failed payment attempts on the Checkout Session will send payment_intent.payment_failed event. I'd recommend testing this out using declined test cards: https://docs.stripe.com/testing#declined-payments

Use test cards to validate your Stripe integration without moving real money. Test a variety of international scenarios, including successful and declined payments, card errors, disputes, and bank authentication. You can also test non-card payment methods and redirects.

brisk depot
#

Okay let me check

#

I am getting the payment_intent.payment_failed event, In Case of failures.

brisk depot
eternal pelican
#

Yes, that's right!

brisk depot
#

Okay

#

thank you so much