#lucasnguyen1707
1 messages · Page 1 of 1 (latest)
hello! How are you integrating with Stripe - Payment Element, Checkout Session, or...?
Here's a popup I wanna prevent to open if the Payment form doesn't match some conditions
I'm using Prebuit element of Stripe
and using element called Payment Element
alright, can you elaborate more on what conditions do you want to check for - can you give some examples?
such as case a user needs to check the checkbox of our policy before processing the Payment
for now, even user don't check the box, the Apple popup still open
hmmmm, I can't think of a way to prevent the payment sheet from displaying if you're using Apple Pay or Google Pay in the Payment Element. You can probably prevent the payment from being made but not prevent the payment sheet itself from displaying first. So the user would try to make payment and it would fail.
You could consider a separate element for Google Pay and Apple Pay where you can control when to display the payment sheet instead
So how I do a separate
đź‘‹ Taking over here and to clarify, the sheet displays when you push the "Pay" button, correct?
Exactly
When that happens, can't you catch the timing in the submit event? There you can preventDefaults() if some conditions is not met
I Already set The preventDefault(), all other flow work correct, and not process payment flow.
Just one exception that the Apple Pay popup still try to open
If you put a breakpoint there and a console.log, how does it behave when you click the button?