flutter_stripe icon indicating copy to clipboard operation
flutter_stripe copied to clipboard

Support auto-fill hints for CardFormField

Open hcq0618 opened this issue 2 years ago • 19 comments

Is your feature request related to a problem? (please describe)

Could you help to support auto-fill hints for CardFormField like:

图片

Android side can refer to https://developer.android.com/guide/topics/text/autofill-optimize

Describe the solution you'd like just set auto-fill hints to corresponding EditText inside CardFormView like:

图片

Describe alternatives you've considered N/A

Additional context Actually I have already implemented this feature on the Android side locally, but it seems that I have no write access to this repo

hcq0618 avatar Feb 19 '23 11:02 hcq0618

I feel like this should be built in into the stripe-android and https://github.com/stripe/stripe-react-native/ repo - please consider asking there

jonasbark avatar Feb 24 '23 17:02 jonasbark

@jonasbark I believe those already support autofill and we need a fix specific to the flutter implementation

wanderr avatar Feb 26 '23 06:02 wanderr

@jonasbark I believe those already support autofill and we need a fix specific to the flutter implementation

yes that's what I meant, do u have any ETA for this?

hcq0618 avatar Feb 27 '23 06:02 hcq0618

What makes you believe that autofill is already supported and only the flutter side needs implementation of it? If the stripe-android library hasn't enabled it by default then we shouldn't do so either

jonasbark avatar Feb 27 '23 12:02 jonasbark

What makes you believe that autofill is already supported and only the flutter side needs implementation of it? If the stripe-android library hasn't enabled it by default then we shouldn't do so either

could u plz read my descriptions carefully again? so that u can get my points, I already explained and shown how to implementate it on the flutter side LOL

hcq0618 avatar Feb 27 '23 12:02 hcq0618

could u plz read my answer carefully again? so that u can get my points, I already answered and shown my view on it LOL

If the stripe-android library hasn't enabled it by default then we shouldn't do so either

jonasbark avatar Feb 27 '23 12:02 jonasbark

could u plz read my answer carefully again? so that u can get my points, I already answered and shown my view on it LOL

If the stripe-android library hasn't enabled it by default then we shouldn't do so either

u mean that u can not modify https://github.com/flutter-stripe/flutter_stripe/blob/6cdf95e6c0e6772f51fc0a92956174f658278a5c/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/CardFormView.kt ?

hcq0618 avatar Feb 27 '23 13:02 hcq0618

Sure I can, but the fact remains, stated now for the third time: If the stripe-android library hasn't enabled it by default then we shouldn't do so either

https://github.com/flutter-stripe/flutter_stripe/issues/1121#issuecomment-1444051822

jonasbark avatar Feb 27 '23 13:02 jonasbark

Sure I can, but the fact remains, stated now for the third time: If the stripe-android library hasn't enabled it by default then we shouldn't do so either

#1121 (comment)

well, let me try to create another issue into the stripe-android, thanks

hcq0618 avatar Feb 27 '23 14:02 hcq0618

just some additional clarification. The Flutter Stripe library is a Flutter wrapper around the existing Stripe sdks. We only build and maintain the dart layer and the native platform bindings, why not also native SDK? For many reasons most prominent are: security and maintainability. If we would change the native code it would cause an update nightmare with the next Stripe sdk and it is easy to break existing functionality or become incompatible.

That's why we always point to the official Stripe libraries.

remonh87 avatar Feb 27 '23 14:02 remonh87

thanks for the explanation

hcq0618 avatar Feb 27 '23 14:02 hcq0618

hi guys, previously I created another issue into stripe-android https://github.com/stripe/stripe-android/issues/6274 they said that auto-fill has been already supported on the android side,

as well as I looked into it from stripe-android source codes (it's supported indeed): https://github.com/stripe/stripe-android/blob/a7730140b1b457f4f2cb6aad64550b8dfda98afd/payments-core/src/main/java/com/stripe/android/view/CardNumberEditText.kt#L162 https://github.com/stripe/stripe-android/blob/a7730140b1b457f4f2cb6aad64550b8dfda98afd/payments-core/src/main/java/com/stripe/android/view/ExpiryDateEditText.kt#L243 https://github.com/stripe/stripe-android/blob/a7730140b1b457f4f2cb6aad64550b8dfda98afd/payments-core/src/main/java/com/stripe/android/view/CvcEditText.kt#L48 https://github.com/stripe/stripe-android/blob/a7730140b1b457f4f2cb6aad64550b8dfda98afd/payments-core/src/main/java/com/stripe/android/view/PostalCodeEditText.kt#L53

and auto-fill works well in the stripe-android example, but it doesn't work in the flutter-stripe example on the android device, may I know the reason?

hcq0618 avatar Mar 15 '23 06:03 hcq0618

@remonh87 Hi Remon, can you help explain the question above?

shiliuus avatar Mar 18 '23 15:03 shiliuus

Any updates on this? Autofill would be really really nice even if just on Android.

SasLuca avatar Apr 03 '23 22:04 SasLuca

@hcq0618 we are not using the android library wrappers but the react native wrappers. If they incorporate it in their sdk it will be automatically be part of our sdk for free.

remonh87 avatar Apr 04 '23 15:04 remonh87

@remonh87 hey bro, I also post an issue to the RN repo https://github.com/stripe/stripe-react-native/issues/1348, they also said it should be supported already, and I tried the RN's demo, auto-fill works well (just like strip-android demo), but it doesn't work in the flutter-stripe demo on the android device, this is really weird, do u know why?

hcq0618 avatar Apr 18 '23 02:04 hcq0618

We can confirm that we incorporated the latest stripe sdk but it doesn't work. Like @jonasbark said we have no control over the implementation it either works out of the box or it doesn't. The fact it doesn't work is either an issue in Stripe sdk or limitation of Flutter keyboard in relation to native views.

I asked some more info from the stripe team.

remonh87 avatar Apr 18 '23 19:04 remonh87

@remonh87 Any updates from Stripe team?

shiliuus avatar May 03 '23 04:05 shiliuus

Is there any update on this issue?

brokenicedeveloper avatar Jun 09 '23 08:06 brokenicedeveloper

It should work according to Stripe. There is not much that we can do further. I would recommend also using the paymentsheet which has superior UX and features when it comes to accessibility

remonh87 avatar Apr 14 '24 15:04 remonh87