Banking library for Go. This is a fork of the Banking library for Go. It adds IBAN validation support for partial IBAN countries.
go get github.com/kappapay/banking
http://godoc.org/github.com/kappapay/banking
package main
import (
"fmt"
"log"
"github.com/kappapay/banking/iban"
)
var (
testIban = iban.MustParse("BE68539007547034")
)
func main() {
ibn, err := iban.Parse("BE68539007547034")
if err != nil {
log.Fatal(err)
}
fmt.Println(ibn.BankCode())
fmt.Println(ibn.AccountNumber())
err = iban.Validate("BE68539007547034")
if err != nil {
log.Fatal(err)
}
}
package main
import (
"fmt"
"log"
"github.com/kappapay/banking/swift"
)
var (
testSwift = swift.MustParse("DEUTDEFF500")
)
func main() {
swft, err := swift.Parse("DEUTDEFF500")
if err != nil {
log.Fatal(err)
}
fmt.Println(swft.BankCode())
fmt.Println(swft.CountryCode())
err = swift.Validate("DEUTDEFF500")
if err != nil {
log.Fatal(err)
}
}