I am trying to use my own input form to get credit card information and then use it to generate a token. In Stripe.js 3 this is apparently hard to achieve since it uses iframes to mount input fields to each div
element. Apparently there is an update()
function with which you could take the values from somewhere else (my own UI), but I cannot get it working. Does anyone have an idea on how to implement this?
var cardNumber = elements.create('cardNumber');
cardNumber.mount('#number');
var cardExpiry = elements.create('cardExpiry');
cardExpiry.mount('#example2-card-expiry');
var cardCvc = elements.create('cardCvc');
cardCvc.mount('#example2-card-cvc');
https://jsfiddle.net/507oh942/2/
https://stripe.com/docs/stripe.js#other-methods
I am also not sure that Stripe.js 2, which supports this is still active. Does anyone have a working fiddle utilizing the older version?