#ucjonathan-prb

1 messages · Page 1 of 1 (latest)

swift patrol
#

Hi there

floral halo
#

Hey bismarck. Thanks as usual for your teams help.

swift patrol
#

Hmm I'm not sure to be honest. I've never tried this myself

#

Have you attempted it?

floral halo
#

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.

swift patrol
#

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?

floral halo
#

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?

swift patrol
#

Nope that should be fine

floral halo
#

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.

swift patrol
#

Yeah test it out and let me know if you run into any issues

floral halo
#

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.

swift patrol
#

Hmm I really thought this was possible. Give me a moment

floral halo
#

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.

swift patrol
#

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.

floral halo
#

Thanks again for collaborating with me on this one. Take care.