panther
panther copied to clipboard
How to send keys in Stripe element field ?
I am trying to complete a Stripe payment form using Panther.
For my form, I am using Stripe Elements, which initializes the fields.
But strangely, it is impossible for me to be able to interact with one of these fields. Has anyone already succeeded?
We have an example here of the implementation of a Stripe form: https://stripe.dev/elements-examples/
On the first example, how could I, with Panther, complete the fields? It seems impossible to do this on this type of form
@bastien70 It is simple
$('#example1-name').value = 'MyName';
Execute this JS in Chrome
I think it might be tricky if those fields are in an iframe. Stripe adds fields in a special iframe, or sometimes even iframe in iframe
@bocharsky-bw Why tricky ? If we select by Id ? I did not selected anything in iframe, however if we use Chrome as client it seems to be like User Interface without exception
If the iFrame is included from the same host - it's not a problem, yeah. But if we're talking about Stripe elements - it's tricky because Stripe loads the form in iFrame on your website, and the iFrame is from another host - Stripe host, not your host - so you can't modify with JS any iFrame HTML included from another host for security reasons.
@bocharsky-bw maybe sometime when time goes to my side i wil understand a problem :) Thank you for reply and clear explanation
https://github.com/symfony/panther/issues/453