https://github.com/promptapi/bin-checker-go
Golang wrapper for Prompt API's BIN Checker API
https://github.com/promptapi/bin-checker-go
api-marketplace api-wrapper bin-checker bin-database bin-lookup bin-number bincheck-api binlookup credit-card credit-card-bin creditcardfrauddetection golang golang-package promptapi
Last synced: 27 days ago
JSON representation
Golang wrapper for Prompt API's BIN Checker API
- Host: GitHub
- URL: https://github.com/promptapi/bin-checker-go
- Owner: promptapi
- License: mit
- Created: 2020-08-29T07:01:51.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-09-08T17:23:15.000Z (over 5 years ago)
- Last Synced: 2024-06-20T06:24:53.049Z (over 1 year ago)
- Topics: api-marketplace, api-wrapper, bin-checker, bin-database, bin-lookup, bin-number, bincheck-api, binlookup, credit-card, credit-card-bin, creditcardfrauddetection, golang, golang-package, promptapi
- Language: Ruby
- Homepage: https://promptapi.com/marketplace/description/bincheck-api
- Size: 17.6 KB
- Stars: 5
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README


[](https://pkg.go.dev/github.com/promptapi/bin-checker-go)
[](https://goreportcard.com/report/github.com/promptapi/bin-checker-go)
[](https://travis-ci.org/promptapi/bin-checker-go)
# Prompt API - BIN Checker - Golang Package
`binchecker` is a simple golang wrapper for [bincheck-api][bincheck-api].
## Requirements
1. You need to signup for [Prompt API][promptapi-signup]
1. You need to subscribe [bincheck-api][bincheck-api], test drive is **free!!!**
1. You need to set `PROMPTAPI_TOKEN` environment variable after subscription.
---
## Installation
```go
$ go get -u github.com/promptapi/bin-checker-go
```
## Example Usage
```go
// main.go
package main
import (
"fmt"
"os"
binchecker "github.com/promptapi/bin-checker-go"
)
func main() {
result := new(binchecker.Result)
if err := binchecker.BinChecker("302596", result); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
fmt.Printf("%+v\n", result)
fmt.Printf("BankName: %s\n", result.BankName)
fmt.Printf("Country: %s\n", result.Country)
fmt.Printf("URL: %s\n", result.URL)
fmt.Printf("Type: %s\n", result.Type)
fmt.Printf("Scheme: %s\n", result.Scheme)
fmt.Printf("Bin: %s\n", result.Bin)
}
```
Run from cli:
```bash
$ PROMPTAPI_TOKEN="YOUR-PROMPTAPI-TOKEN" go run main.go
&{BankName:Diners Club International Country:United States Of America URL:www.dinersclub.com Type:Credit Scheme:Discover Bin:302596}
BankName: Diners Club International
Country: United States Of America
URL: www.dinersclub.com
Type: Credit
Scheme: Discover
Bin: 302596
```
---
## Development
Create a fake web-server under `/tmp/`;
```bash
$ mkdir /tmp/server/
$ cp test.json /tmp/server/
$ cd /tmp/server/
$ python -m http.server 8000
```
And use:
```bash
$ PROMPTAPI_TOKEN="fake" \
PROMPTAPI_TEST_ENDPOINT="http://localhost:8000/test.json" \
go run main.go
```
User rake tasks:
```bash
$ rake
rake default # Default task, show avaliable tasks
rake release:check # Do release check
rake release:publish[revision] # Publish project with revision: major,minor,patch, default: patch
rake serve_doc[port] # Run doc server
rake test[verbose] # Run tests
```
- Run tests: `rake test` or `rake test[-v]`
- Run doc server: `rake serve_doc` or `rake serve_doc[9000]`
Release package (*if you have write access*):
1. Commit your changes
1. Run `rake release:check`
1. If all goes ok, run `rake release:publish`
---
## License
This project is licensed under MIT
---
## Contributer(s)
* [Prompt API](https://github.com/promptapi) - Creator, maintainer
---
## Contribute
All PR’s are welcome!
1. `fork` (https://github.com/promptapi/bin-checker-go/fork)
1. Create your `branch` (`git checkout -b my-feature`)
1. `commit` yours (`git commit -am 'Add awesome features...'`)
1. `push` your `branch` (`git push origin my-feature`)
1. Than create a new **Pull Request**!
This project is intended to be a safe,
welcoming space for collaboration, and contributors are expected to adhere to
the [code of conduct][coc].
---
[bincheck-api]: https://promptapi.com/marketplace/description/bincheck-api
[promptapi-signup]: https://promptapi.com/#signup-form
[coc]: https://github.com/promptapi/bin-checker-go/blob/main/CODE_OF_CONDUCT.md