#lschirfteachable_35505
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- lschirf-paymentelement-address, 1 hour ago, 14 messages
Hello! Happy to continue here.
You can listen for a variety of different events, including onChange(), related to the Payment Element: https://stripe.com/docs/js/element/events
oh i see-- how does this api interface with the react stripe api?
would we set the callback on the result of this call? elements.getElement('payment')
I'm not sure I understand the question. You configure an event listener the same way you would with any non-Stripe Element for the most part
if we've initialised the PaymentElement using the react lib, how do we then grab the element object to attach the listener to? through the useElements() hook?
If you're using something like let paymentElement = elements.getElement('payment'), then you could just add something like this right below it:
paymentElement.on('change', (event) => { //do a thing };
got it-- that was my inarticulate original question 🙂 thank you!