#lujie-payment-element
1 messages Β· Page 1 of 1 (latest)
Hi river, the user can close Wechat QR Code, so we need cancel page to redirect
other pay can redirect to new page, but wechat qr code show in same page
if i close the QR Code, the return_url will be redirected
When the user cancels a payment method such as WeChat Pay, user will be redirected back to the redirect URL with appended payment_intent and payment_intent_client_secret in the query. You can query the status using payment_intent_client_secret to display the status: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#qr-codes
let me try, thank you very much
No problem. Happy to help π
payment_intent=pi_3L6UXGHm9lqBSyxX19fEDBLf&payment_intent_client_secret=pi_3L6UXGHm9lqBSyxX19fEDBLf_secret_XTlqeVGKdVqABd4vQQHcnraGq&redirect_status=succeeded
hi river, when i close it ,the redirect_status is succeeded, how to check if it is canceled
redirect_status is not the payment status. You should query the payment intent status with either:
- payment_intent_client_secret at frontend: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-collect-payment-details; OR
- payment_intent at backend: https://stripe.com/docs/api/payment_intents/retrieve
got it
To handle users closing QR Code modals, at the server-side handler for your return_url, inspect the Payment Intentβs status to see if itβs succeeded or still requires_action (meaning the user has closed the modal without paying), dealing with each case as needed.
No problem! Glad to hear that it works π