#ludvig-paymentelement
1 messages · Page 1 of 1 (latest)
you can't today, but having a function to reload the Element is on the roadmap, as you say, it's needed if you want to change the amount of the PaymentIntent
basically you have to entirely destroy the component and create it anew
Okay, yeah. I hope we get it soon 🙂 Could you give an example of how your proposed solution could be done?
I don't have one no
AFAIK you have to use https://stripe.com/docs/js/element/other_methods/destroy and then just repeat the code for creating/mounting the Element
Alright. Thank you for your answer.
About the reload/update amount function on the roadmap - Do you have any clue on how far away or how prioritized it is?
Btw - Can you send a message to the devs that they need to update an error message?
elements.getElement("").destroy()
IntegrationError: A valid Element name must be provided. Valid Elements are: card, cardNumber, cardExpiry, cardCvc, postalCode, paymentRequestButton, iban, idealBank, p24Bank, auBankAccount, fpxBank, afterpayClearpayMessage; you passed: .
There is no such thing as payment element?
This works though: elements.getElement("payment").destroy()
Which is why they need to add "payment" to that error message of valid element names