Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to set by default country to stripe payment sheet?

I want to set by default country as UAE. is it possible to set it? and also is it possible to set it server-side?

All the time it's set United State. But this problem is only on Android and Ios SDK. It's automatically set UAE on web.

check this country and religion section in this screenshot

like image 830
BIS Tech Avatar asked Oct 19 '25 16:10

BIS Tech


2 Answers

Specify default values for billing details collected in the payment sheet by setting defaultBillingDetails. PaymentSheet pre-populates its fields with the values provided.

for iOS Swift

var configuration = PaymentSheet.Configuration()
configuration.defaultBillingDetails.address.country = "US"
configuration.defaultBillingDetails.email = "[email protected]"

for Android Kotlin:

var configuration = PaymentSheet.Configuration(...)
configuration.defaultBillingDetails.address.country = "US"
configuration.defaultBillingDetails.email = "[email protected]"
like image 85
mohsen Avatar answered Oct 21 '25 14:10

mohsen


For React Native, please provide the defaultBillingDetails when initPaymentSheet

You can refer below example

  const {error} = await initPaymentSheet(  
   {
     defaultBillingDetails: {
       address: {
        country: 'HK',
       },
     }
   }
  );

like image 44
rayhk6 Avatar answered Oct 21 '25 12:10

rayhk6



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!