#rooter-paymentelement-paymentmethodtypes
1 messages · Page 1 of 1 (latest)
Hi 👋
For the payment element you can do this by setting up a listener for the change event.
https://stripe.com/docs/js/element/events/on_change?type=paymentElement
@elfin shoal please use this thread to talk about your question/needs instead of the main channel and we can help (I deleted your other message)
okay, so I do I need to type all that in again?
yes if possible let's keep the whole conversation here
Okay, that was a different question. But I thought of something else about the first one. When that event fires and I change the price of the items in the cart, is there a way to update the price in the payment intent right there? If I make a new payment intent, does it reset the form?
You shouldn't make a new PaymentIntent, you should update it server-side via https://stripe.com/docs/api/payment_intents/update and then you can use https://stripe.com/docs/js/elements_object/fetch_updates to "refresh" the UI with the new updated details on the PaymentIntent
Perfect. And that won't deselect anything they filled in, right? If they pick AfterPay and I fetch updates, they will still be on AfterPay right? Otherwise they will be in a loop.
Not sure, I'd recommend trying in Test mode to confirm quickly!
okay then. Are there enums to turn on Google Pay and Apple Pay? https://stripe.com/docs/api/payment_intents/create?lang=dotnet#create_payment_intent-payment_method_data
They work with Card, you can look at https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#apple-pay-and-google-pay
rooter-paymentelement-paymentmethodtypes
So there is no way to accept only a credit card for one user and only google pay for another?
not with PaymentElement no, and it's usually a bad idea to do this for conversions. But you can use https://stripe.com/docs/stripe-js/elements/payment-request-button if you only want to accept Google Pay for example
Okay thanks. You are super helpful. Have a good one!