Search code examples
stripe-payments

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


Solution

  • To set the country in the Stripe Payment Sheet using the Flutter SDK, you have two options:

    1. Set the Country Code

    You can specify the country code directly. Note that for Dubai, the country code 'UAE' might not work as expected. Instead, use 'AE':

    billingDetails: BillingDetails(
      address: Address(
        country: 'AE', 
        city: 'Dubai', 
        line1: '', 
        line2: '', 
        postalCode: '', 
        state: ''
      )
    ),
    

    2. Completely Remove Country Selection

    You can also configure the billing details to never prompt for a country:

    billingDetailsCollectionConfiguration: BillingDetailsCollectionConfiguration(
      address: AddressCollectionMode.never
    ),
    

    This should help you set the country correctly or remove the country selection in the Stripe Payment Sheet.