#Ryan Turnbull (Eucalyptus)
1 messages · Page 1 of 1 (latest)
hello! can you explain more on what you're looking to do when you know if it's card or apple pay?
For apple pay, I need to call confirmSetup concurrently with other requests, otherwise apple will block the payment
For card payment, that operates under a redirect and I need my other requests to finish before inacting that redirect
(When crawling the docs, I found applePay doesn't go through payment intent)
umm, it does, what docs are you referring to that it says Apple Pay is not supported on PaymentIntent?
that doesn't say that we don't support Apple Pay for PaymentIntent. A customer can make payment via the Payment Element using Apple Pay, i'd suggest you test it out
Yeah I've got that working - but I need to know if the purchase is being completed with apple pay
Before calling confirmSetup
Apple pay = user stays on the same screen, so I can run my 2 concurrent queries while the payment is being captured
Card = the page is redirected, so I need to wait for my 2 concurrent queries to finish before redirecting
i think what you need is this beta? https://stripe.com/docs/payments/run-custom-actions-before-confirmation
that sends me to page-not-found
hrm, alright, lets put that link aside. If you're using the Payment Element, and you're using cards / wallets with SetupIntents, you can set redirect=if_required
what this means is that, even if it's a normal card, it also won't redirect
that'd give you enough time to handle all of your scripts before redirecting
Is there a reason why you want to wait for your queries to finish running synchronously? In most cases, these processes should be handled asynchronously
they essentially save a user's profile on the same screen as the payment. - and need to occur before we attempt the charge. The apple payment (see thread I replied to in my OG message) popup must be opened synchronously, so while for card payments I can run these async and wait for them to finish, that won't work for apple
Interesting, the redirect=if_required produces this error
I'm assuming there's no way to tell what payment method you've selected within the PaymentElement at the point of calling confirmSetup?
you may be able to : https://stripe.com/docs/js/element/events/on_change?type=paymentElement
i'm not 100% sure what would be that value if you select Apple Pay or Google Pay off the top of my head
I suggest testing it to check
this might also work : https://stripe.com/docs/payments/build-a-two-step-confirmation