- Bill calculator
- Digits
- Validate Bank card number.
- Find Bank's name by Card number.
- Check Iranian Sheba(IBAN) validation and recognize bank information by sheba code.
- Add and remove commas to numbers.
- Find city and province name by national code(code-e Melli).
- Validate Iranian national number(code-e Melli).
- Validate phone number and get Iranian phone number details.
first we have to create our request :
bills "github.com/h-varmazyar/gopet/bills"
.
.
.
currencyParam := bills.Currency{false, false}
params := bills.BillParams{1117753200140, 12070160, currency_param, "1"}
And pass it
result := bills.GetBillType(params) // تلفن ثابت
amount := bills.GetCurrency(params) //120000
barcode := bills.GetBarCode(params) // 111775320014000012070160
verify := bills.VerifyBillID(params) //true
num2wordFa := digits.DigitToWord("۱۵۶۷۸۹") // صد پنجاه و شش هزار هفتصد هشتاد و نه
num2wordEn := digits.DigitToWord("156789") // صد پنجاه و شش هزار هفتصد هشتاد و نه
Negative := digits.DigitToWord("-156789") // منفی صد پنجاه و شش هزار هفتصد هشتاد و نه
phone, err := phone.GetPhoneNumberDetails("0930740741") // {011 33001112 01133001112 1133001112 مخابرات ایران [مازندران] ثابت} , nil
mobile, err := phone.GetPhoneNumberDetails("00989307407541") //{099913 07541 09991307541 9991307541 آپتل [همه استانها] دائمی} , nil
Method has one entry card number and return bank name and error.
bank,error := CardInfo("") // "", error
bank,error := CardInfo("345345") // "", error
bank,error := CardInfo("6219861034529008") // "", error
bank,error := CardInfo("6037701689095443") // keshavarzi, nil
bank,error := CardInfo("6219861034529007") // saman, nil
The types of results are :
type shebaResultHash struct {
Name string
Code string
NickName string
PersianName string
AccountNumber string
AccountNumberAvailable bool
FormattedAccountNumber string
Process func(str string) ShebaProcess
}
shebaCode := bank.ShebaCode{"IR820540102680020817909002"}
sheba := shebaCode.IsSheba() // {Parsian Bank 054 parsian بانک پارسیان true 0x4c69f0}
shebaCode.Code= "IR820540102680020817909003"
sheba := shebaCode.IsSheba() // { false }
addComma := digits.AddCommas(14555478854)
removeComma := digits.RemoveCommas("4,555,522,212,12")
fmt.Printf("\n ADD COMMA : %v \n", addComma) // 14,555,478,854
fmt.Printf("\n REMOVE COMMA : %v \n", removeComma)// 455552221212
getPlaceByIranNationalId := city.GetPlaceByIranNationalId("0499370899")
fmt.Printf("\n Result : %v \n", getPlaceByIranNationalId)
verifyIranianNationalId := national_id.Validate("0067749828")
verifyIranianNationalIdFalse := national_id.Validate("0684159415")
fmt.Printf("\n Validate NationalID : %v \n", verifyIranianNationalId) // true
fmt.Printf("\n Validate NationalIDFalse : %v \n", verifyIranianNationalIdFalse) // false