is it possible to pre-fill those fields automatically?
say for example:
const options = {data: {cardNumber: 'xxxxxxxxxxx', cvc: '123', expiry: '10/20'}}Hi @rheilgm, currently stripe.paymentRequestWithCardForm does not support pre-fill card params.
But you can use your own view with <PaymentCardTextField /> which support setup initial params.
To set inital params you can use
<instance>.setParams(params)method which is available viaref. For example, if you鈥檙e using another library to scan your user鈥檚 credit card with a camera, you can assemble that data into an object and set this property to that object to prefill the fields you鈥檝e collected.
Hi @itsmepetrov,
Sadly the PaymentCardTextField can't set initial params on Android. No setParams function in PaymentCardTextField.android.js. Please add setParams support to Android too! Thanks a lot.
Hi @balesz
Yes, PaymentCardTextField on Android currently does no support setParams, but we have plan to replace CreditCardEntry with the official input widget and also add support for setParams.
@itsmepetrov thanks for the info
yeah figured out i have to use
will it be possible to support this kind of feature in future releases?
@rheilgm
As I said in the previous issue #17:
We use STPAddCardViewController from Stripe iOS API for drawing this view and we can change only those parameters which are provided by Stripe API.
Unfortunately, STPAddCardViewController does not support to pre-fill card fields. It has ability to specify prefilledInformation field, which can contain only email, phone and billingAddress.
To support pre-fill card fields we will need to write our own AddCardViewController, but we do not have plans for that in the near future.
@rheilgm
I think the better way is to create the same issue in stripe-ios. If the Stripe team adds support for this kind of feature, then we can add it too without any problems.
Feel free to reopen this issue if you have any other suggestions.
Most helpful comment
Hi @itsmepetrov,
Sadly the PaymentCardTextField can't set initial params on Android. No setParams function in PaymentCardTextField.android.js. Please add setParams support to Android too! Thanks a lot.