Skip to content

The Perfect Gift Card API - Fetch your card summary and transaction history via an API.

License

Notifications You must be signed in to change notification settings

rayou/theperfectgiftcard-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

theperfectgiftcard-api

GoDoc Go Report Card Coverage Status

The Perfect Gift Card API - Fetch your card summary and transaction history via an API.

Built on top of go-theperfectgiftcard library.

Example

# Change card_no and pin to yours.
$ curl --request POST \
  --url https://theperfectgiftcard-api-lhsiiccogb.now.sh/card \
  --data '{
	"card_no": "50211234567890",
	"pin": "0000"
}'

{
  "CardNo": "50211234567890",
  "AccountNo": "000000000",
  "LoadsToDate": "$100.00",
  "PurchasesToDate": "-$54.32",
  "AvailableBalance": "$12.34",
  "PurchasedDate": "1 Jan 2018",
  "ExpiryDate": "1 Jan 2021",
  "Transactions": [
    {
      "Date": "1 Jan 2018 12:04:45 PM",
      "Details": "Store Address",
      "Description": "Refund - Store Address",
      "Amount": "$100.00",
      "Balance": "$100.00"
    },
    {
      "Date": "2 Jan 2018 07:50:53 PM",
      "Details": "Store A",
      "Description": "Purchase - Store A",
      "Amount": "$12.34-",
      "Balance": "$56.78"
    }
  ]
}

How To Use

Run in docker

# Clone this repo and switch working folder
$ git clone https://github.com/rayou/theperfectgiftcard-api.git
$ cd theperfectgiftcard-api/

# build docker image
$ docker build -t rayou/theperfectgiftcard-api ./ 

# run in docker
$ docker run --rm -it -p 8000:8000 rayou/theperfectgiftcard-api

# test 
$ curl --request POST \
  --url localhost:8000/card \
  --data '{
	"card_no": "50211234567890",
	"pin": "0000"
}'

Deploy to Now

# Clone this repo and switch working folder
$ git clone https://github.com/rayou/theperfectgiftcard-api.git
$ cd theperfectgiftcard-api/ 

# install Now cli
$ npm install -g now 

# deploy to Now
$ now

# test
$ curl --request POST \
  --url https://{YOUR_NOW_APP_URL}/card \
  --data '{
	"card_no": "50211234567890",
	"pin": "0000"
}'

Contributing

PRs are welcome.

Author

Ray Ou - [email protected]

Donation

License

MIT.

About

The Perfect Gift Card API - Fetch your card summary and transaction history via an API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published