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

[Feature] Make the postal code and country/region optional for credit card entry, in new payment sheet ui

Open calvarez-ov opened this issue 3 years ago • 11 comments

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

The prebuilt-ui multi-step: https://stripe.com/docs/payments/accept-a-payment?platform=android&ui=payment-sheet-custom credit card entry form requires country/region and postal code fields. This used to be optional, but now is required. We want it to be optional.

  • In our payment flow, the user already provides their address (including country/region and postal code) in our own form
  • In the old Stripe UI, when adding a card, it was possible to limit the card entry fields to card number, expiration date, cvv
  • In the new payment sheet UI (multi-step), the card entry form has country/region and postal code fields that can't be removed.

Describe the solution you'd like We would like to stay current and use the latest payment sheet UI provided by Stripe, but we don't want to make our users input the postal code and country/region twice.

Describe alternatives you've considered An alternative is to not update to the payment sheet UI and continue using the old UI.

Additional context Our flow using the new payment sheet UI: screens

The flow using the old UI: oldflow

calvarez-ov avatar May 12 '21 08:05 calvarez-ov

Additional info:

The new ui isn't customizable regarding the postal code: https://github.com/stripe/stripe-android/blob/v16.8.0/stripe/src/main/java/com/stripe/android/paymentsheet/ui/BillingAddressView.kt#L290

private fun updatePostalCodeView(countryCode: CountryCode?) {
    val shouldShowPostalCode = countryCode == null ||
        CountryUtils.doesCountryUsePostalCode(countryCode)
    postalCodeLayout.isVisible = shouldShowPostalCode

    val shouldShowPostalCodeContainer =
        level == BillingAddressCollectionLevel.Required || shouldShowPostalCode

It's hardcoded to show the postal code if the provided country is null or if the country itself has postal codes

The old UI is customizable: https://github.com/stripe/stripe-android/blob/v16.8.0/stripe/src/main/java/com/stripe/android/view/PaymentMethodsActivityStarter.kt#L74 To disable the postal code, you can use setBillingAddressFields as follows:

PaymentMethodsActivityStarter.Args.Builder().setBillingAddressFields(BillingAddressFields.None)

calvarez-ov avatar May 12 '21 09:05 calvarez-ov

Thanks for writing in and the feedback. We have this in our backlog and will provide an update when it is ready.

michelleb-stripe avatar May 28 '21 23:05 michelleb-stripe

Hey @calvarez-ov,

We're working on adding the ability for you to pre-fill billing details in the sheet, like country and postal code. This means that when the sheet appears, it will have those fields filled out with the values you provide.

Does that work for your use case? Your feedback is appreciated!

yuki-stripe avatar Jul 28 '21 21:07 yuki-stripe

@yuki-stripe do you have a date on when this feature will be available ?

emmaxCreative avatar Aug 24 '21 14:08 emmaxCreative

@yuki-stripe Sorry I completely missed your question!

I'll get in touch with the PO and report back here.

From my POV, I'm thinking it would be best if we could not show the fields at all, if we're just going to use the values they entered in our own screen. I don't know how we would handle it if the user put different values in the card entry screen compared to our own payment screen. Would really be better to just not have this in the card input screen. A simpler UI would be better for the user.

But i'll come back here with the input from the PO.

calvarez-ov avatar Aug 24 '21 18:08 calvarez-ov

I talked with our PO.

This isn't the ideal solution we were hoping for. But it could be enough.

We could accept showing these fields if they're pre-filled.

However, if the user first enters the card (with these two fields), and then comes back to our own billing screen, we won't retrieve/use the values from the card input. In this case, the user will still have to enter the fields twice.

One thing: We may have some issues if we have different rules enforcing valid postal code formats in our own screen vs the stripe credit card screen.

Could you let us know what is the validation/format for the postal code?

calvarez-ov avatar Sep 03 '21 13:09 calvarez-ov

@yuki-stripe wouldn't it a better if we have the option the disable country and postal code/zip code?

Lab360-inc avatar Sep 10 '21 04:09 Lab360-inc

my customers are in UAE. when the payment sheet opens it displays the UK with postal code text Field. Is it possible to disable it or is it possible to set UAE by default? By the way, I am using flutter_stripe plugin.

bhanuka96 avatar Sep 29 '21 13:09 bhanuka96

Hi, could I add something on the original request? We are a fintech and want to operate in Spain. The Spanish regulator is asking us to request Full Name only (we don't need postal code nor Country). Can the UI be flexible enough so we can configure the data we want to request our users ? (in our case, card details + Full name).

Thanks.

danijorda1 avatar Dec 03 '21 15:12 danijorda1

@yuki-stripe Do you have any update on this request ?

Kang-Kim1 avatar Jan 26 '22 12:01 Kang-Kim1

Still waiting on this. I hope it's not an abandoned request. Anyone any update on how to hide the Country/Region UI?

tnt-ndriqimrr avatar Jul 12 '22 08:07 tnt-ndriqimrr

Hello, this is available as of today on v20.23.

eurias-stripe avatar Apr 17 '23 19:04 eurias-stripe