File tree Expand file tree Collapse file tree
components/AddMoney/consts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -143,6 +143,7 @@ export interface CountryData {
143143 currency ?: string
144144 description ?: string
145145 path : string
146+ iso2 ?: string
146147}
147148
148149export interface DepositMethods extends CountryData {
@@ -777,6 +778,7 @@ export const countryData: CountryData[] = [
777778 title : 'United Kingdom' ,
778779 currency : 'GBP' ,
779780 path : 'united-kingdom' ,
781+ iso2 : 'GB' ,
780782 } ,
781783 {
782784 id : 'GD' ,
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export const getCountryFromIban = (iban: string): string | null => {
1313 const countryCode = cleanIban . substring ( 0 , 2 )
1414
1515 // Try to find country by 2-letter code directly in countryData
16- let country = countryData . find ( ( c ) => c . type === 'country' && c . id === countryCode )
16+ let country = countryData . find ( ( c ) => c . type === 'country' && ( c . id === countryCode || c . iso2 === countryCode ) ) // @dev TODO - fix the UK issue properly
1717
1818 // If not found, get the 3-letter code and try that
1919 if ( ! country ) {
@@ -23,7 +23,7 @@ export const getCountryFromIban = (iban: string): string | null => {
2323 }
2424 }
2525
26- return country ? country . title : null
26+ return country ? country . path : null
2727}
2828
2929/**
You can’t perform that action at this time.
0 commit comments