#myz123

1 messages · Page 1 of 1 (latest)

pseudo riverBOT
mint yacht
#

Which type of integration do you use? Checkout Session or Payment Intent with Payment Element?

graceful crag
#

Hi river, I want to listen to if the payment is successful from both web and mobile

#

@mint yacht I am not sure what are the difference between Checkout Session or Payment Intent with Payment Element

#

@mint yacht sorry, I think I use checkout session for my web checkout page, but I build a flutter mobile app. I think I have to use payment intent with payment element now.

mint yacht
graceful crag
#

@mint yacht So can I listen to both of them? I use built-in checkout page for my web page and also listen to payment_intent.succeeded for successful payments from mobile?

#

@mint yacht Sorry, I don't understand what you mean. I use both mobile and web checkout. For mobile, I use flutter-stripe. For web, I use built-in checkout page. It will redirect users to the checkout page. What should I do to listen to both payment status from them?

mint yacht
#

If the web uses Checkout Session integration, you'd listen to checkout.session.completed, checkout.session.async_payment_succeeded and checkout.session.async_payment_failed as suggested in the doc: https://stripe.com/docs/payments/checkout/fulfill-orders#delayed-notification

If the mobile like flutter uses elements integration, then payment_intent.succeeded, payment_intent.processing and payment_intent.payment_failed events can be listened: https://stripe.com/docs/payments/accept-a-payment?platform=ios&ui=payment-sheet#ios-post-payment

graceful crag
#

@mint yacht Do i need to listen to both of them? like checkout.session.completed for web and payment_intent.succeeded for mobile? Will the update be triggered twice after a payment?

#

For example, I listen to both checkout.session.completed and payment_intent.succeeded, a payment from web will trigger both of them.

mint yacht
#

Do i need to listen to both of them? like checkout.session.completed for web and payment_intent.succeeded for mobile?

Not necessary. If you don't need the information from Checkout Session, you can listen to payment_intent.succeeded only.

Will the update be triggered twice after a payment?
It might be possible depending on your system integration

graceful crag
#

@mint yacht I think if I use pre-built, hosted pyament page, it will only triggers the checkout.session.commpleted event

#

Not payment_intent.succeeded event, this event is triggered from payment intent api. Am I right? I will test it.

mint yacht
#

If you use Checkout Session (Stripe hosted payment page) integration, payment_intent.succeeded event will be sent as well as it uses Payment Intent under the hood

graceful crag
#

@mint yacht So a success payment will trigger both payment_intent.succeeded and checkout.session.commpleted

#

Should I only listen to payment_intent.succeeded in this case?

mint yacht
#

You can if you're able to link the payment intent to your order

graceful crag
#

Thanks. I will try to see if it works