The Perfect Gift Card cli - Display card summary and transaction history.
Built on top of go-theperfectgiftcard library.
go get github.com/rayou/theperfectgiftcard-cli
NAME:
The Perfect Gift Card cli - Display card summary and transaction history
USAGE:
theperfectgiftcard-cli [global options] command [command options] [arguments...]
VERSION:
1.0.0
AUTHOR:
Ray Ou <yuhung.ou@live.com>
COMMANDS:
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--cardno value, -n value Gift card number
--pin value, -p value Gift card pin
--json Display as JSON
--help, -h show help
--version, -v print the version
$ theperfectgiftcard-cli -cardno 5021251000000000000 -pin 0000
The Perfect Gift Card Summary
-----------------------------
Card Number 50211234567890
Account Number 000000000
Loads To Date $100.00
Purchases To Date -$54.32
Available Balance $12.34
Purchased Date 1 Jan 2018
Expiry Date 1 Jan 2021
Transaction History
-------------------
+------------------------+---------------+------------------------+---------+---------+
| DATE | DETAILS | DESCRIPTION | AMOUNT | BALANCE |
+------------------------+---------------+------------------------+---------+---------+
| 1 Jan 2018 12:04:45 PM | Store Address | Refund - Store Address | $100.00 | $100.00 |
| 2 Jan 2018 07:50:53 PM | Store A | Purchase - Store A | $12.34- | $56.78 |
+------------------------+---------------+------------------------+---------+---------+
$ theperfectgiftcard-cli -cardno 5021251000000000000 -pin 0000 -json
{
"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"
}
]
}
PRs are welcome.
Ray Ou - yuhung.ou@live.com
MIT.