Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Fill in a Stripe Elements ( credit card field using capybara
def fill_stripe_elements(card)
using_wait_time(15) { within_frame('stripeField_card_element0') do
card.to_s.chars.each do |piece|
find_field('cvc').send_keys '123'
find_field('postal').send_keys '19335'
end }
Copy link

ashkan18 commented May 2, 2018

This is great! thanks for sharing!

Copy link

Thanks for this, Great help! We've just switched over to using Elements and was a bit puzzled at first how to handle this.

Copy link

Thanks @kfrz. 👍

Copy link

thijsc commented Sep 10, 2019

Thanks all, this was very helpful to me just now.

Copy link

rajat2797 commented Sep 27, 2019

Can you help me with the implementation in case of javascript? Also is there a way to fetch contents out of stripe elements?
I am new to both javascript and stripe. @thijsc?

Copy link

excid3 commented Oct 24, 2019

I added another couple helpers to this to handle Stripe SCA in Capybara in case anyone is interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment