#Vankesh-autofill

1 messages · Page 1 of 1 (latest)

ancient wadi
#

Hi @timid umbra ! Could you clarify exactly what you are trying to accomplish, and share the "js example" you are mentioning?

timid umbra
#

Hello @ancient wadi ! thanks for your help. Sure, i try to autofill credit card number on the stripe js credit card form from browser saved payment method (google chrome for instance).

For now i have an error output (not sure if it comes from Stripe or directly from chrome).

I used this example as adviced by @frank lance yesterday :

const element = elements.create('card', {
style: {
base: {
iconColor: '#c4f0ff',
color: '#fff',
fontWeight: '500',
fontFamily: 'Roboto, Open Sans, Segoe UI, sans-serif',
fontSize: '16px',
fontSmoothing: 'antialiased',
':-webkit-autofill': {
color: '#fce883',
},
'::placeholder': {
color: '#87BBFD',
},
},
invalid: {
iconColor: '#FFC7EE',
color: '#FFC7EE',
},
},
});

ancient wadi
#

So you would like the Stripe Element form to be automatically pre-filled with the user's card saved in their browser?

timid umbra
#

exactly (sorry if i'm not clear 😦 )

ancient wadi
#

Thanks for the clarification! But I don't think that can be done automatically. It's the end user who needs to select the card they want to auto-fill. And when that happens, the code you shared above will only change the style of the input.

timid umbra
#

ok understood. But even if i want to manually select my saved payment method i cant make it work.

To clarify even more i use a password manager and it's working as expected with the pasword manager (Dashlane). But not with the payment method saved in google chrome.

#

Ok my bad i'm an idiot, i did try on local env and obviously its not plugged 😦 Sorry for the loss of time

ancient wadi
#

Ah yes, you need to be on an HTTPS URL for this to work.

#

No worries, I'm glad you figured it out!