|
|
@ -13,9 +13,33 @@ import Foundation |
|
|
|
return R.drawable.flag_belarus; |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Mongolia(MNT) 2,000,000, not possible this time, may be next version, |
|
|
|
//Country Default Receiving Amount |
|
|
|
//azerbaijan 1,000 |
|
|
|
//Bangladesh 100,000 |
|
|
|
//Belarus 1,000 |
|
|
|
//Cambodia 500 |
|
|
|
//Georgia 1,000 |
|
|
|
//India 100,000 |
|
|
|
//Indonesia 15,000,000 |
|
|
|
//Kazakhstan 1,000 |
|
|
|
//Kyrgyzstan 1,000 |
|
|
|
//Malaysia 10,000 |
|
|
|
//Moldova 1,000 |
|
|
|
//Mongolia(USD) 1,000 |
|
|
|
//Mongolia(MNT) 2,000,000 |
|
|
|
//Myanmar 1,500,000 |
|
|
|
//Nepal 100,000 |
|
|
|
//Pakistan 100,000 |
|
|
|
//Philippines 500 |
|
|
|
//Russian Federation 1,000 |
|
|
|
//Singapore 2,000 |
|
|
|
//Sri Lanka(LKR) 100,000 |
|
|
|
//Sri Lanka(USD) 1,000 |
|
|
|
//Tajikistan 1,000 |
|
|
|
//Thailand(THB) 30,000 |
|
|
|
//Uzbekistan 1,000 |
|
|
|
//Vietnam(VND) 50,000,000 |
|
|
|
//Vietnam(USD) 2,000 |
|
|
|
|
|
|
|
|
|
|
|
class CountryInfo { |
|
|
@ -51,8 +75,8 @@ class CountryInfo { |
|
|
|
"mn" : #imageLiteral(resourceName: "flag_mongolia") // Mongolia |
|
|
|
] |
|
|
|
|
|
|
|
var defaultCountries = ["Nepal", "Cambodia", "Philipinnes", "Sri Lanka", "Vietnam", "India", "Pakistan", "azerbaijan", "Bangladesh", "Belarus", "Georgia", "Indonesia", "Kazakhstan", "Kyrgyzstan", "Malaysia", "Moldova", "Mongolia", "Myanmar", "Philippines", "Russian Federation", "Singapore", "Tajikistan", "Thailand", "Uzbekistan", "Vietnam"] |
|
|
|
var defaultCountryCodes = ["np", "kh", "ph", "lk", "vn", "in", "pk", "az", "bd", "by", "ge", "id", "kz", "kg", "my", "md", "mn", "mm", "ph", "ru", "sg", "tj", "th", "uz", "vn"] |
|
|
|
var defaultCountries = ["Nepal", "Cambodia", "Philipinnes", "Sri Lanka", "Vietnam", "India", "Pakistan", "azerbaijan", "Bangladesh", "Belarus", "Georgia", "Indonesia", "Kazakhstan", "Kyrgyzstan", "Malaysia", "Moldova", "Mongolia", "Myanmar", "Russian Federation", "Singapore", "Tajikistan", "Thailand", "Uzbekistan"] |
|
|
|
var defaultCountryCodes = ["np", "kh", "ph", "lk", "vn", "in", "pk", "az", "bd", "by", "ge", "id", "kz", "kg", "my", "md", "mn", "mm", "ru", "sg", "tj", "th", "uz"] |
|
|
|
|
|
|
|
private var defaultSendingAmount: [String: String] = |
|
|
|
[ |
|
|
@ -60,7 +84,7 @@ class CountryInfo { |
|
|
|
"kh" : "500", // cambodia |
|
|
|
"ph" : "50000", // philipines |
|
|
|
"lk" : "100,000", // sri lanka |
|
|
|
"vn" : "20000000", // vietnam |
|
|
|
"vn" : "50000000", // Vietnam |
|
|
|
"in" : "50000", // india |
|
|
|
"pk" : "100000", // pakistan |
|
|
|
"az" : "1000", // azerbaijan |
|
|
@ -74,13 +98,11 @@ class CountryInfo { |
|
|
|
"md" : "1000", // Moldova |
|
|
|
"mn" : "1000", // Mongolia |
|
|
|
"mm" : "1500000", // Myanmar |
|
|
|
"ph" : "500", // Philippines |
|
|
|
"ru" : "1000", // Russian Federation |
|
|
|
"sg" : "2000", // Singapore |
|
|
|
"tj" : "1000", // Tajikistan |
|
|
|
"th" : "30000", // Thailand |
|
|
|
"uz" : "1000", // Uzbekistan |
|
|
|
"vn" : "50000000", // Vietnam |
|
|
|
"default": "1000000" |
|
|
|
] |
|
|
|
|
|
|
@ -95,6 +117,7 @@ class CountryInfo { |
|
|
|
"pk" : "PKR", // pakistan |
|
|
|
"az" : "USD", // azerbaijan |
|
|
|
"bd" : "USD", // Bangladesh |
|
|
|
"by" : "USD", // Belarus |
|
|
|
"ge" : "USD", // Georgia |
|
|
|
"id" : "IDR", // Indonesia |
|
|
|
"kz" : "USD", // Kazakhstan |
|
|
@ -103,17 +126,30 @@ class CountryInfo { |
|
|
|
"md" : "USD", // Moldova |
|
|
|
"mn" : "USD", // Mongolia |
|
|
|
"mm" : "MMK", // Myanmar |
|
|
|
"ph" : "PHP", // Philippines |
|
|
|
"ru" : "USD", // Russian Federation |
|
|
|
"sg" : "SGD", // Singapore |
|
|
|
"tj" : "USD", // Tajikistan |
|
|
|
"th" : "THB", // Thailand |
|
|
|
"uz" : "USD", // Uzbekistan |
|
|
|
"vn" : "VND", // Vietnam |
|
|
|
"default": "KRW" |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
private var secondarySendingCurrency: [String: String] = |
|
|
|
[ |
|
|
|
"vn" : "USD", // vietnam |
|
|
|
"mn" : "MNT", // Mongolia |
|
|
|
"lk" : "USD", // sri lanka |
|
|
|
] |
|
|
|
|
|
|
|
private var secondarySendingAmount: [String: String] = |
|
|
|
[ |
|
|
|
"vn" : "2000", // Vietnam |
|
|
|
"lk" : "1000", // sri lanka |
|
|
|
"mn" : "2000000", // Mongolia |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
func getFlag(for countryCode: String) -> UIImage? { |
|
|
|
return flag[countryCode.lowercased()] |
|
|
|
} |
|
|
@ -130,5 +166,17 @@ class CountryInfo { |
|
|
|
return defaultSendingAmount["default"] |
|
|
|
} |
|
|
|
|
|
|
|
func doesCountryCodeHasDefined(country: String, currency: String) -> Bool { |
|
|
|
return defaultSendingCurrency[country.lowercased()]?.contains(currency) ?? false |
|
|
|
} |
|
|
|
|
|
|
|
func doesSecondaryOptiopsHasDefined(country: String, currency: String) -> Bool { |
|
|
|
return secondarySendingCurrency[country.lowercased()]?.contains(currency) ?? false |
|
|
|
} |
|
|
|
|
|
|
|
func getSecondarySendingAmount(for countryCode: String) -> String? { |
|
|
|
return secondarySendingAmount[countryCode.lowercased()] |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|