panther icon indicating copy to clipboard operation
panther copied to clipboard

How to send keys in Stripe element field ?

Open bastien70 opened this issue 3 years ago • 6 comments

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 avatar Apr 06 '21 15:04 bastien70

@bastien70 It is simple

$('#example1-name').value = 'MyName';

Execute this JS in Chrome

Mepcuk avatar May 31 '21 13:05 Mepcuk

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 avatar May 31 '21 19:05 bocharsky-bw

@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

Mepcuk avatar Jun 04 '21 10:06 Mepcuk

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 avatar Jun 04 '21 14:06 bocharsky-bw

@bocharsky-bw maybe sometime when time goes to my side i wil understand a problem :) Thank you for reply and clear explanation

Mepcuk avatar Jun 04 '21 15:06 Mepcuk

https://github.com/symfony/panther/issues/453

ehibes avatar Oct 27 '21 12:10 ehibes