GithubHelp home page GithubHelp logo

rayou / theperfectgiftcard-cli Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 1.36 MB

The Perfect Gift Card cli - Display card summary and transaction history.

License: MIT License

Go 100.00%
golang go cli

theperfectgiftcard-cli's Introduction

theperfectgiftcard-cli

GoDoc Go Report Card Coverage Status

The Perfect Gift Card cli - Display card summary and transaction history.

Built on top of go-theperfectgiftcard library.

Install

go get github.com/rayou/theperfectgiftcard-cli

Usage

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 <[email protected]>

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

Example

Fetch card summary and transaction detail

$ 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  |
+------------------------+---------------+------------------------+---------+---------+

Fetch card summary and transaction detail and print as JSON

$ 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"
    }
  ]
}

Contributing

PRs are welcome.

Author

Ray Ou - [email protected]

Donation

License

MIT.

theperfectgiftcard-cli's People

Contributors

rayou avatar

Stargazers

Roman avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.