stripe-ios icon indicating copy to clipboard operation
stripe-ios copied to clipboard

[Feature] Allow more detailed customisation in `STPCardFormView`

Open le-tyang opened this issue 2 years ago • 6 comments

Is your feature request related to a problem? Please describe.

We are looking at to build a component which allows user to enter credit card details in a form like way. 😉 not the STPPaymentCardTextField. We looked into STPCardFormView and found out it can support most of our requirements. Until we want to start doing customisation.

Few things we were hoping that this component can support:

  • Hide billing address fields
  • Enable card scanning
  • Be able to change font color
  • Be able to adjust spacing between fields.

But due to STPCardFormView only expose init(style:) constructor as public, there is not much we can do :( image

Describe the solution you'd like

We went through the source code for STPCardFormView, and found out most items in our wanted list are already supported, just not exposed for public usage.

Would be good if we can make these constructors public, so we can start customising it. Constructors include:

convenience init(
        billingAddressCollection: PaymentSheet.BillingAddressCollectionLevel,
        includeCardScanning: Bool = true,
        mergeBillingFields: Bool = false,
        style: STPCardFormViewStyle = .standard,
        postalCodeRequirement: STPPostalCodeRequirement = .standard,
        prefillDetails: PrefillDetails? = nil,
        inputMode: STPCardNumberInputTextField.InputMode = .standard
    )

    required init(numberField: STPCardNumberInputTextField,
                  cvcField: STPCardCVCInputTextField,
                  expiryField: STPCardExpiryInputTextField,
                  billingAddressSubForm: BillingAddressSubForm,
                  includeCardScanning: Bool,
                  mergeBillingFields: Bool,
                  style: STPCardFormViewStyle = .standard,
                  postalCodeRequirement: STPPostalCodeRequirement = .standard,
                  prefillDetails: PrefillDetails? = nil,
                  inputMode: STPCardNumberInputTextField.InputMode = .standard
    )

Describe alternatives you've considered

We also looked into PaymentSheet as what we actually wanted is just like how this component looks like in PaymentSheet. image

But due to UX preference and our user flow definition, we can't use a bottom sheet for this feature.

And, we also considered forking the SDK, but I guess no one likes that idea 😉

Additional context

We've attached screenshots in above description.

le-tyang avatar Mar 01 '22 05:03 le-tyang

Hello @le-tyang,

Thank you for the detailed ticket. I've added this to our internal tracker, but note that feature development on CardFormView isn't on our immediate roadmap.

But due to UX preference and our user flow definition, we can't use a bottom sheet for this feature.

We're super focused on getting PaymentSheet to support more use cases and customization, however - so we'd love to hear more about how we could support you. Feel free to send me an email ([email protected]) if you don't want to share publicly.

yuki-stripe avatar Mar 03 '22 19:03 yuki-stripe

Hello @le-tyang,

Thank you for the detailed ticket. I've added this to our internal tracker, but note that feature development on CardFormView isn't on our immediate roadmap.

But due to UX preference and our user flow definition, we can't use a bottom sheet for this feature.

We're super focused on getting PaymentSheet to support more use cases and customization, however - so we'd love to hear more about how we could support you. Feel free to send me an email ([email protected]) if you don't want to share publicly.

Thanks @yuki-stripe !

Since we want to support other payment gateway/provider as well in our app, we would like to provide a similar but also can be customised flow for user who want to add a credit card.

The PaymentSheet is indeed powerful and pretty, but unfortunately it does not fit into the user flow we are designed right now.

Having the ability to separate the card form from the PaymentSheet and being able to customise it, so we can be using the good card validation from this SDK can be super helpful for us.

I know this question is probably too much to ask, but possible for us to get a rough estimation on whether or when may this be available in SDK? That would be again helpful for us to make a decision.

Thanks!!!

le-tyang avatar Mar 03 '22 22:03 le-tyang

I see 👍 - unfortunately I don't have a timeline to share for CardFormView customization.

yuki-stripe avatar Mar 07 '22 17:03 yuki-stripe

Is there any updated timeline on this?

dqii avatar May 05 '22 18:05 dqii

Would love an update on this if possible.

bhayatus avatar Jun 21 '22 15:06 bhayatus

@yuki-stripe just checking if this feature is on any roadmap?

dqii avatar Jul 20 '22 04:07 dqii

Yes i agree that this is an important feature to add. Especially in order to allow iOS and Android to be similar. Android has CardMultilineWidget and there is no iOS equivalent

mikeandike avatar Nov 02 '22 14:11 mikeandike

Also on Android it is possible to supply a country code that makes sure you can prefill the localisation and country for the user. Would be great if you can take it along with this.

remonh87 avatar Nov 29 '22 20:11 remonh87

Hi all! We will not be adding further functionality to STPCardFormView or STPPaymentCardTextField. We encourage you to check out our modern replacement, the Mobile Payment Element, and send us any feedback you have! Thank you

sfriedman-stripe avatar Dec 24 '23 06:12 sfriedman-stripe

@sfriedman-stripe good to know will this element considered to be deprecated? Reason I ask is that we will follow your direction when it comes to our Flutter lib

remonh87 avatar Dec 26 '23 08:12 remonh87