stripe / stripe-android

Stripe Android SDK
https://stripe.com/docs/mobile/android
MIT License
1.27k stars 643 forks source link

[BUG] Use PaymentSheet on Huawei phone. when selecting region, it only shows chinese region #4524

Closed Crown-23 closed 2 years ago

Crown-23 commented 2 years ago

i use your sdk in my project. When selecting region, it only shows chinese region. i tested your demo, it has the same problem. Some Huawei phones are tested, they both have the problem.

Impacted devices

Huawei phones

Installation method

implementation 'com.stripe:stripe-android:19.0.0'

Screenshot_20220126_164213_com android settings

https://user-images.githubusercontent.com/59108544/151131092-7c5953ed-055f-493a-864c-693fc0d77269.mp4

please help.

Crown-23 commented 2 years ago

when system language is English, it can show all region. But it only show chinese region in Chinese language

michelleb-stripe commented 2 years ago

@Crown-23 I was wondering if you could verify the results of running the following function on your Android phone and report the results back to us.

Locale.getISOCountries()

Crown-23 commented 2 years ago

@michelleb-stripe I ran the function using the following code.

Language

Chinese

Codes

LogUtil.e("ISOCountries = ${Gson().toJson(Locale.getISOCountries())}")

Results

E/MyLog: ISOCountries = ["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"]

can you find out the reason?

michelleb-stripe commented 2 years ago

@Crown-23 Can you check to make sure that you are not pre-populating fields by setting a billing address in the configuration. There is a bug here that if this is set only countries that start with that name can be selected. You can verify this by setting a breakpoint in CardDataCollectionFragment.populateFieldsFromAguments.

Crown-23 commented 2 years ago

The billing address is not pre-populating in my project. XIAOMI/ONEPLUS/HUAWEI phones were tested and only HUAWEI has the problem. Problem exitsts in your github demo too. Can you test your demo on HUAWEI phone? I have set a breakpoint in CardDataCollectionFragment.populateFieldsFromArguments, but i didn't trigger it

michelleb-stripe commented 2 years ago

@Crown-23 Unfortunately I don't have a Huawei phone to test it with. Can you set a breakpoint in CountryUtils.getSortedLocalizedCountries. This is where the CardDataCollectionFragment is using the BillingAddressView to get the list of countries.

michelleb-stripe commented 2 years ago

@Crown-23 Please reopen if you are still experiencing issues.