#Emmanuel G. - payment element clearing
1 messages · Page 1 of 1 (latest)
I'm not sure what that file is. Is there a helpful traceback in the error message? If not, are you able to step through the code and find out why e.paymentElement.form[n].values is not an object?
Unfortunately that doesn't really help much. Can you step through your code and figure out why that needs to be an object and what is causing it to not be an object?
Ya. It happens when certain states are set, which aren't really a part of the payment element. I wonder if there is just something happening thats causing those values to become undefined when the states are set and the component goes through a "rerender" type deal.
Ill look into it and if anything comes up Ill try to update the thread.
Figured out the issue happening I beleieve. I am calling .clear() on the payment element before the form can set the payment method type, and it tries to clear the card element when wechat is actually selected.
@glossy tapir Just to ask, is it recommended to call clear on the form if a failure occurs?
Ahhhh okay. I'm not sure if that's the recommended action in that case, I think it depends more on what your desired outcome is for that particular case.
Emmanuel G. - payment element clearing