flutter-stripe / flutter_stripe

Flutter SDK for Stripe.
https://pub.dev/packages/flutter_stripe
947 stars 522 forks source link

Cards have brand names format inconsistent with Stripe's API #1092

Closed MrLightful closed 1 year ago

MrLightful commented 1 year ago

Describe the bug CardFieldInputDetails returns brand name inconsistent with Stripe's API.

To Reproduce Steps to reproduce the behavior:

  1. Place a CardField widget on screen;
  2. Define onCardChanged callback which will print card's brand (card.brand);
  3. Run app, enter a mastercard card into the field;
  4. Observe that the brand is rendered as MasterCard.

Expected behavior Stripe's API operates with brand names as lowercased names ("Card brand. Can be amex, diners, discover, jcb, mastercard, unionpay, visa, or unknown" - Stripe API Docs).

Smartphone / tablet

remonh87 commented 1 year ago

I agree it is not consistent with the API docs, however the brand mappers are coming from the Stripe native sdks and are out of our control. See https://github.com/flutter-stripe/flutter_stripe/blob/eab98c0d22d5d349f400008096831aaffaf8cf4a/packages/stripe_android/android/src/main/kotlin/com/reactnativestripesdk/Mappers.kt#L89

So closing this issue .