#ucjonathan-prb
1 messages · Page 1 of 1 (latest)
Hey bismarck. Thanks as usual for your teams help.
I've inspected down to the prButton object in the console to see what all is exposed on it. As one would expect it's pretty complex. I know the button is handling the click inside the iframe on a different src domain so I can't use javascript to reach into the iframe and click the button.
Yeah that checks out. Thinking through this more I don't think it would be possible.
Let's back up though
Why do you need to have it programmatically clicked?
Well maybe I should step back and ask the question, is there a problem having two of these buttons on the same page as long as I initialize them against unique element ids in the DOM?
Nope that should be fine
ok, then I need to take a step back in my code and get rid of the hard coded #stripe-payment-request-button which is limiting me to one instance and see how things behave. Thank you for your time.
Yeah test it out and let me know if you run into any issues
IntegrationError: This Element is already mounted. Use unmount() to unmount the Element before re-mounting.
the SDK gets mad if you try to create a second one of those buttons with the error above.
Hmm I really thought this was possible. Give me a moment
I think I've figured out a workable solution.
paymentRequest.show() will initiate the display.
So if they put two of the element on the page then I'll work to make the secondary ones "clones" which just display the proper apple/google image then mesage the primary element and have it execute that.
Okay so I hadn't messed with this in a while, but this does work but you have to initialize Stripe twice
Ah okay yeah that should work too
Forgot about doing that with your own button.
Thanks again for collaborating with me on this one. Take care.