Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to STPPaymentConfiguration to filter the country list #1327

Merged
merged 3 commits into from
Sep 9, 2019

Conversation

davidme-stripe
Copy link
Contributor

Summary

Add a new availableCountries property to STPPaymentConfiguration, allowing a developer to filter the list of countries.

This is nil, displaying all countries, by default. It can be set to a list of ISO country codes, which will filter our UI to only display those countries.

  • If the user locale's country code is in that list, it will be selected by default. If not, the country field will be empty.
  • If setAddress is called with a country code outside of this list, that country code will be added to the UI.

Motivation

Fixes #1314 and many other out-of-band requests for this feature.

Testing

Updated some related tests, though I'm going to write a specific UI test before shipping.

Stripe/STPAddressViewModel.m Outdated Show resolved Hide resolved
Stripe/STPAddressViewModel.m Outdated Show resolved Hide resolved
@davidme-stripe davidme-stripe merged commit 20008f2 into master Sep 9, 2019
@davidme-stripe davidme-stripe deleted the davidme/filter-countries branch September 9, 2019 19:13
ramont-stripe added a commit that referenced this pull request Aug 15, 2022
* Constraint to safe area

* Migrate all constraints to safeaAreaLayoutGuide
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limit country list in STPShippingAddressViewController
4 participants