# paystack cli
[![Downloads](https://static.pepy.tech/badge/paystack-cli)](https://pepy.tech/project/paystack-cli)
[![Downloads](https://static.pepy.tech/badge/paystack-cli/month)](https://pepy.tech/project/paystack-cli)
[![Downloads](https://static.pepy.tech/badge/paystack-cli/week)](https://pepy.tech/project/paystack-cli)
A command line app for interacting with [Paystack's](https://paystack.com/) API. Built with
[Typer](https://typer.tiangolo.com/) and [Pypaystack2](https://gray-adeyi.github.io/pypaystack2/)
![a picture of the utility in use](./paystack-cli.png)
## Installation
Binaries of paystack cli be found [here](https://github.com/gray-adeyi/paystack-cli/releases/tag/v0.2.1).
Alternatively, Paystack cli can be installed from pypi with pip as shown below.
```bash
pip install paystack-cli
```
## First time configurations
You're required to add your paystack integration secret key as your auth_key for the cli on first use as shown below
```bash
paystack config AUTH_KEY
```
This sets up your paystack cli for use in development mode if the test secret key is used. This auth_key can be
removed with `paystack reset`. Run `paystack --help` to see available commands
## Examples
### Retrieve a single transaction from your integration
```bash
paystack txn get-txns --pagination 1
```
Running the command above should yield a result similar to the dump shown below
```bash
Response(
status_code=200,
status=True,
message='Transactions retrieved',
data=[
{
'id': 3785557723,
'domain': 'test',
'status': 'success',
'reference': '2769088ddc23d52947c8e845f6a6bbdebd987f457e97f71c',
'amount': 30000,
'message': None,
'gateway_response': 'Approved',
'paid_at': '2024-05-11T10:00:29.000Z',
'created_at': '2024-05-11T10:00:27.000Z',
'channel': 'card',
'currency': 'NGN',
'ip_address': None,
'metadata': {'invoice_action': 'create'},
'log': None,
'fees': 450,
'fees_split': None,
'customer': {'id': 47948280, 'first_name': 'Gbenga', 'last_name': 'Adeyi', 'email': 'coyotedevmail@gmail.com', 'phone': '', 'metadata': None, 'customer_code': 'CUS_73cb3biedlkbe4a', 'risk_action': 'default'},
'authorization': {
'authorization_code': 'AUTH_w1renosr9o',
'bin': '408408',
'last4': '4081',
'exp_month': '12',
'exp_year': '2030',
'channel': 'card',
'card_type': 'visa ',
'bank': 'TEST BANK',
'country_code': 'NG',
'brand': 'visa',
'reusable': True,
'signature': 'SIG_JOdryeujwrsZryg0Lkrg',
'account_name': None
},
'plan': {},
'split': {},
'subaccount': {},
'order_id': None,
'paidAt': '2024-05-11T10:00:29.000Z',
'createdAt': '2024-05-11T10:00:27.000Z',
'requested_amount': 30000,
'source': {'source': 'merchant_api', 'type': 'api', 'identifier': None, 'entry_point': 'charge'},
'connect': None,
'pos_transaction_data': None
}
]
)
```
By default, the results you get from the cli is a `Response` object which is a `NamedTuple` returned
by [Pypaystack2](https://gray-adeyi.github.io/pypaystack2/). To get a json result, use the `--json`
flag.
```bash
paystack txn get-txns --pagination 1 --json
```
Running the command above should yield a result similar to the dump shown below
```bash
[{"id": 3785557723, "domain": "test", "status": "success", "reference": "2769088ddc23d52947c8e845f6a6bbdebd987f457e97f71c", "amount": 30000, "message": null, "gateway_response": "Approved", "paid_at": "2024-05-11T10:00:29.000Z", "created_at":
"2024-05-11T10:00:27.000Z", "channel": "card", "currency": "NGN", "ip_address": null, "metadata": {"invoice_action": "create"}, "log": null, "fees": 450, "fees_split": null, "customer": {"id": 47948280, "first_name": "John", "last_name": "Doe", "email":
"johndoe@example.com", "phone": "", "metadata": null, "customer_code": "CUS_73cb3biedlkbe4a", "risk_action": "default"}, "authorization": {"authorization_code": "AUTH_w1renosr9o", "bin": "408408", "last4": "4081", "exp_month": "12", "exp_year": "2030",
"channel": "card", "card_type": "visa ", "bank": "TEST BANK", "country_code": "NG", "brand": "visa", "reusable": true, "signature": "SIG_JOdryeujwrsZryg0Lkrg", "account_name": null}, "plan": {}, "split": {}, "subaccount": {}, "order_id": null, "paidAt":
"2024-05-11T10:00:29.000Z", "createdAt": "2024-05-11T10:00:27.000Z", "requested_amount": 30000, "source": {"source": "merchant_api", "type": "api", "identifier": null, "entry_point": "charge"}, "connect": null, "pos_transaction_data": null}]
```
## Source code
[https://github.com/gray-adeyi/paystack-cli](https://github.com/gray-adeyi/paystack-cli)
## Videos
* [Installing paystack cli on windows from binaries](https://youtu.be/N8TfuJJ9ycI?si=oFJM4hZQSbl5QBuH)
* [Installing paystack cli via pip on windows](https://youtu.be/JWWkTwER9xg?si=ZEdnFwSgaShkj7_H)
* [How to use paystack cli](https://youtu.be/GuYtyh1Ew5E?si=WQaBQshViLjawUft)
Raw data
{
"_id": null,
"home_page": null,
"name": "paystack-cli",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "paystack, paystack-python, paystackapi, pypaystack",
"author": null,
"author_email": "Gbenga Adeyi <adeyigbenga005@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/70/ef/27b5266feadd3cf1091cfa5dc366ea0fa1be1ee263de8212936597b52986/paystack_cli-0.2.1.tar.gz",
"platform": null,
"description": "# paystack cli\n\n[![Downloads](https://static.pepy.tech/badge/paystack-cli)](https://pepy.tech/project/paystack-cli)\n[![Downloads](https://static.pepy.tech/badge/paystack-cli/month)](https://pepy.tech/project/paystack-cli)\n[![Downloads](https://static.pepy.tech/badge/paystack-cli/week)](https://pepy.tech/project/paystack-cli)\n\nA command line app for interacting with [Paystack's](https://paystack.com/) API. Built with\n[Typer](https://typer.tiangolo.com/) and [Pypaystack2](https://gray-adeyi.github.io/pypaystack2/)\n\n![a picture of the utility in use](./paystack-cli.png)\n\n## Installation\n\nBinaries of paystack cli be found [here](https://github.com/gray-adeyi/paystack-cli/releases/tag/v0.2.1).\nAlternatively, Paystack cli can be installed from pypi with pip as shown below.\n\n```bash\npip install paystack-cli\n```\n\n## First time configurations\n\nYou're required to add your paystack integration secret key as your auth_key for the cli on first use as shown below\n\n```bash\npaystack config AUTH_KEY\n```\n\nThis sets up your paystack cli for use in development mode if the test secret key is used. This auth_key can be\nremoved with `paystack reset`. Run `paystack --help` to see available commands\n\n## Examples\n\n### Retrieve a single transaction from your integration\n\n```bash\npaystack txn get-txns --pagination 1\n```\n\nRunning the command above should yield a result similar to the dump shown below\n\n```bash\nResponse(\n status_code=200,\n status=True,\n message='Transactions retrieved',\n data=[\n {\n 'id': 3785557723,\n 'domain': 'test',\n 'status': 'success',\n 'reference': '2769088ddc23d52947c8e845f6a6bbdebd987f457e97f71c',\n 'amount': 30000,\n 'message': None,\n 'gateway_response': 'Approved',\n 'paid_at': '2024-05-11T10:00:29.000Z',\n 'created_at': '2024-05-11T10:00:27.000Z',\n 'channel': 'card',\n 'currency': 'NGN',\n 'ip_address': None,\n 'metadata': {'invoice_action': 'create'},\n 'log': None,\n 'fees': 450,\n 'fees_split': None,\n 'customer': {'id': 47948280, 'first_name': 'Gbenga', 'last_name': 'Adeyi', 'email': 'coyotedevmail@gmail.com', 'phone': '', 'metadata': None, 'customer_code': 'CUS_73cb3biedlkbe4a', 'risk_action': 'default'},\n 'authorization': {\n 'authorization_code': 'AUTH_w1renosr9o',\n 'bin': '408408',\n 'last4': '4081',\n 'exp_month': '12',\n 'exp_year': '2030',\n 'channel': 'card',\n 'card_type': 'visa ',\n 'bank': 'TEST BANK',\n 'country_code': 'NG',\n 'brand': 'visa',\n 'reusable': True,\n 'signature': 'SIG_JOdryeujwrsZryg0Lkrg',\n 'account_name': None\n },\n 'plan': {},\n 'split': {},\n 'subaccount': {},\n 'order_id': None,\n 'paidAt': '2024-05-11T10:00:29.000Z',\n 'createdAt': '2024-05-11T10:00:27.000Z',\n 'requested_amount': 30000,\n 'source': {'source': 'merchant_api', 'type': 'api', 'identifier': None, 'entry_point': 'charge'},\n 'connect': None,\n 'pos_transaction_data': None\n }\n ]\n)\n```\n\nBy default, the results you get from the cli is a `Response` object which is a `NamedTuple` returned\nby [Pypaystack2](https://gray-adeyi.github.io/pypaystack2/). To get a json result, use the `--json`\nflag.\n\n```bash\npaystack txn get-txns --pagination 1 --json\n```\n\nRunning the command above should yield a result similar to the dump shown below\n\n```bash\n[{\"id\": 3785557723, \"domain\": \"test\", \"status\": \"success\", \"reference\": \"2769088ddc23d52947c8e845f6a6bbdebd987f457e97f71c\", \"amount\": 30000, \"message\": null, \"gateway_response\": \"Approved\", \"paid_at\": \"2024-05-11T10:00:29.000Z\", \"created_at\": \n\"2024-05-11T10:00:27.000Z\", \"channel\": \"card\", \"currency\": \"NGN\", \"ip_address\": null, \"metadata\": {\"invoice_action\": \"create\"}, \"log\": null, \"fees\": 450, \"fees_split\": null, \"customer\": {\"id\": 47948280, \"first_name\": \"John\", \"last_name\": \"Doe\", \"email\": \n\"johndoe@example.com\", \"phone\": \"\", \"metadata\": null, \"customer_code\": \"CUS_73cb3biedlkbe4a\", \"risk_action\": \"default\"}, \"authorization\": {\"authorization_code\": \"AUTH_w1renosr9o\", \"bin\": \"408408\", \"last4\": \"4081\", \"exp_month\": \"12\", \"exp_year\": \"2030\", \n\"channel\": \"card\", \"card_type\": \"visa \", \"bank\": \"TEST BANK\", \"country_code\": \"NG\", \"brand\": \"visa\", \"reusable\": true, \"signature\": \"SIG_JOdryeujwrsZryg0Lkrg\", \"account_name\": null}, \"plan\": {}, \"split\": {}, \"subaccount\": {}, \"order_id\": null, \"paidAt\": \n\"2024-05-11T10:00:29.000Z\", \"createdAt\": \"2024-05-11T10:00:27.000Z\", \"requested_amount\": 30000, \"source\": {\"source\": \"merchant_api\", \"type\": \"api\", \"identifier\": null, \"entry_point\": \"charge\"}, \"connect\": null, \"pos_transaction_data\": null}]\n```\n\n## Source code\n\n[https://github.com/gray-adeyi/paystack-cli](https://github.com/gray-adeyi/paystack-cli)\n\n## Videos\n\n* [Installing paystack cli on windows from binaries](https://youtu.be/N8TfuJJ9ycI?si=oFJM4hZQSbl5QBuH)\n* [Installing paystack cli via pip on windows](https://youtu.be/JWWkTwER9xg?si=ZEdnFwSgaShkj7_H)\n* [How to use paystack cli](https://youtu.be/GuYtyh1Ew5E?si=WQaBQshViLjawUft)",
"bugtrack_url": null,
"license": "MIT",
"summary": "A command line app for interacting with Paystack's API",
"version": "0.2.1",
"project_urls": null,
"split_keywords": [
"paystack",
" paystack-python",
" paystackapi",
" pypaystack"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "6244832d30ba0c4553114c1cb36627c4ac920c32b770782dd05dbc8844d57ec5",
"md5": "6eaebe0d04b5cd3daf5a2fa71c9db88f",
"sha256": "99676a51a6ffd16c472a0272ed18a7fce40de0d3fac6b30bb2cd8cbac2537335"
},
"downloads": -1,
"filename": "paystack_cli-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6eaebe0d04b5cd3daf5a2fa71c9db88f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 27255,
"upload_time": "2024-12-10T14:28:19",
"upload_time_iso_8601": "2024-12-10T14:28:19.137853Z",
"url": "https://files.pythonhosted.org/packages/62/44/832d30ba0c4553114c1cb36627c4ac920c32b770782dd05dbc8844d57ec5/paystack_cli-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "70ef27b5266feadd3cf1091cfa5dc366ea0fa1be1ee263de8212936597b52986",
"md5": "cbfd0c2f9e1122cf405a6e4d71241705",
"sha256": "8173e0c2d7bf99e749541da15f3ade6c1f0c65cbc4e1756328f684deca2aba44"
},
"downloads": -1,
"filename": "paystack_cli-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "cbfd0c2f9e1122cf405a6e4d71241705",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 142080,
"upload_time": "2024-12-10T14:28:22",
"upload_time_iso_8601": "2024-12-10T14:28:22.456074Z",
"url": "https://files.pythonhosted.org/packages/70/ef/27b5266feadd3cf1091cfa5dc366ea0fa1be1ee263de8212936597b52986/paystack_cli-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-10 14:28:22",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "paystack-cli"
}