stripe-ios
stripe-ios copied to clipboard
There's no way to filter out countries
Hi
I noticed we have an option availableCountries in source codes. I tried to use it via but obviously does not work
var configuration = PaymentSheet.Configuration()
configuration.customer = .init(
id: params["customerId"]!, ephemeralKeySecret: params["customerEphemeralKeySecret"]!
)
configuration.returnURL = paymentSuccessRedirectStr
configuration.availableCountries // this does not exist
What's the right way to configure the available country list in SwiftUI?
Thank you
Hi @skywalkerlw,
We don't offer this configuration today. Can you tell us more your use case to help us evaluate adding this? Thank you!
We are developing a SwiftUI based app and payment only supports the Australian region. Currently, there comes a country list as shown below, which confuses end-users. The possible worse thing is the finance issue if users select the unexpected country, making things more complicated.
So in short, our expectation is to have a function to show the country list that we support, rather than all.
By the way, we are following your SwiftUI guideline here: https://stripe.com/docs/payments/accept-a-payment?platform=ios

any release date planned?
Appreicate so much
Hi @skywalkerlw,
I can't share a timeline but we've heard this request from other users too, and are prioritizing support for this!
@yuki-stripe is there some workaround for now? For example, can I by default select Australia region?
@skywalkerlw If your iPhone region is set to Australia, it will default to that. Unfortunately there's no workaround at this time.
@yuki-stripe
If we added a configuration (ex. availableCountries) to PaymentSheet.Configuration and then fed that value into CountryPickerDataSource, would that be sufficient?
The one problem I see is that the value (availableCountries) has to travel through a lot of different initializers - it gets a little hairy.
For context, I can open a PR to add this feature.
That would be a perfect @kgaidis Thanks :)