readme
This commit is contained in:
parent
521a41d68c
commit
4ded99e581
1 changed files with 45 additions and 0 deletions
45
README.md
45
README.md
|
@ -0,0 +1,45 @@
|
||||||
|
# Credit card validator
|
||||||
|
|
||||||
|
Luhn algorithm and basic expiration dates checks for credit cards.
|
||||||
|
|
||||||
|
## Installaiton
|
||||||
|
|
||||||
|
```
|
||||||
|
go get git.tertyshny.dev/fotonmoton/cards/validation
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"git.tertyshny.dev/fotonmoton/cards/validation"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
result := validation.Validate(validation.Card{"4111111111111111", "01", "29"})
|
||||||
|
|
||||||
|
fmt.Printf("%v", result)
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## API
|
||||||
|
|
||||||
|
clone this repo and run:
|
||||||
|
```
|
||||||
|
docker build . -t validate:latest && \
|
||||||
|
docker run --rm --name validator --publish 8080:8080 validate:latest
|
||||||
|
```
|
||||||
|
|
||||||
|
to check:
|
||||||
|
```
|
||||||
|
curl -X POST --data '{"pan":"4111111111111111","year":"27","month":"12"}' localhost:8080/validate
|
||||||
|
```
|
||||||
|
|
||||||
|
or online:
|
||||||
|
```
|
||||||
|
curl -X POST --data '{"pan":"4111111111111111","year":"27","month":"12"}' cards.tertyshny.dev/validate
|
||||||
|
```
|
Loading…
Add table
Reference in a new issue