Skip to content

Commit

Permalink
added list of supported countries
Browse files Browse the repository at this point in the history
  • Loading branch information
SamueleA committed Apr 30, 2024
1 parent 0fa2d5c commit d581ca7
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
104 changes: 104 additions & 0 deletions packages/checkout/src/api/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,3 +255,107 @@ export const fetchSardineOrderStatus = async (orderId: string, isDev: boolean) =
console.log('json:', json)
return json
}

export interface Country {
code: string,
}

export const fetchSupportedCountryCodes = async (): Promise<Country[]> => {
// Can also be fetches from sardine api
const supportedCountries = [
'AL',
'AO',
'AT',
'BB',
'BE',
'BZ',
'BJ',
'BO',
'BR',
'BG',
'KH',
'KY',
'CL',
'CO',
'KM',
'CR',
'HR',
'CY',
'CZ',
'DK',
'DM',
'DO',
'EC',
'EG',
'SV',
'GQ',
'EE',
'FO',
'FI',
'FR',
'GF',
'DE',
'GR',
'GN',
'GW',
'GY',
'HT',
'HN',
'HU',
'IS',
'ID',
'IE',
'IL',
'IT',
'JM',
'JP',
'KG',
'LA',
'LV',
'LI',
'LT',
'LU',
'MG',
'MY',
'MV',
'MT',
'MR',
'MX',
'MN',
'MZ',
'NL',
'NO',
'OM',
'PA',
'PY',
'PE',
'PH',
'PL',
'PT',
'RO',
'KN',
'MF',
'SA',
'SC',
'SG',
'SK',
'SI',
'KR',
'ES',
'LK',
'SE',
'CH',
'TZ',
'TH',
'TT',
'TR',
'AE',
'GB',
'UY',
'UZ',
'VU',
'VN',
]

return supportedCountries.map(countryCode => ({ code: countryCode }))
}
1 change: 1 addition & 0 deletions packages/checkout/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './hooks'
export * from './contexts'
export * from './shared/components'
export * from './api'

0 comments on commit d581ca7

Please sign in to comment.