Skip to content

Commit b17547c

Browse files
authored
Merge pull request #1 from gray-adeyi/v0.2.0
V0.2.0
2 parents b10c09a + 5462242 commit b17547c

38 files changed

Lines changed: 375 additions & 661 deletions

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
buy_me_a_coffee: jigani

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.pyc
22
.idea/
33
build/
4-
dist/
4+
dist/
5+
paystack.spec

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.11.1
1+
3.12.2

CHANGELOG.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.2.0] - May 11, 2024
11+
12+
### Fixed
13+
14+
- All request errors exits gracefully with exit code 1.
15+
16+
### Changed
17+
18+
- `--data-only` flag of all sub-commands now return json data
19+
- Upgrade `pypaystack2` to `2.0.3`
20+
- Upgrade `typer` to `0.12.3`
21+
- Switched from poetry to rye
22+
23+
## [0.1.4] - Dec 1, 2023
24+
25+
### Fixed
26+
27+
- Incorrect project versioning
28+
29+
## [0.1.3] - Jul 29, 2023
30+
31+
### Fixed
32+
33+
- Incorrect binary link
34+
35+
## [0.1.2] - Jul 26, 2023
36+
37+
### Fixed
38+
39+
- Missing options for `paystack misc get-providers` sub-command
40+
- Missing options for `paystack misc get-banks` sub-command
41+
- Missing options for `paystack misc get-states` sub-command
42+
- Missing options for `paystack transfer-ctrl resend-otp` sub-command
43+
44+
## [0.1.1] - Jul 24, 2023
45+
46+
### Added
47+
48+
- License to project
49+
- Source code link to README
50+
51+
### Changed
52+
53+
- Binary download link
54+
55+
## [0.1.0] - Jul 24, 2023
56+
57+
### Added
58+
59+
- Commands and sub-commands for all methods supported by `pypaystack2`
60+
61+
[unreleased]: https://github.com/gray-adeyi/paystack-cli/compare/v0.1.4...HEAD
62+
63+
[0.2.0]: https://github.com/gray-adeyi/paystack-cli/compare/v0.1.4...v0.2.0
64+
65+
[0.1.4]: https://github.com/gray-adeyi/paystack-cli/compare/0.1.3...v0.1.4
66+
67+
[0.1.3]: https://github.com/gray-adeyi/paystack-cli/compare/0.1.2...0.1.3
68+
69+
[0.1.2]: https://github.com/gray-adeyi/paystack-cli/compare/0.1.1...0.1.2
70+
71+
[0.1.1]: https://github.com/gray-adeyi/paystack-cli/compare/0.1.0...0.1.1
72+
73+
[0.1.0]: https://github.com/gray-adeyi/paystack-cli/releases/tag/0.1.0

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
build-linux:
22
echo "building for linux..."
3-
pyinstaller --onefile paystack_cli/main.py --name paystack
3+
pyinstaller --onefile src/paystack_cli/__main__.py --name paystack

README.md

Lines changed: 85 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
A command line app for interacting with [Paystack's](https://paystack.com/) API. Built with
44
[Typer](https://typer.tiangolo.com/) and [Pypaystack2](https://gray-adeyi.github.io/pypaystack2/)
55

6-
![utility in use](./paystack-cli.png)
6+
![a picture of the utility in use](./paystack-cli.png)
77

88
## Installation
99

10-
Binaries of paystack cli be found [here](https://github.com/gray-adeyi/paystack-cli/releases/tag/v0.1.4).
10+
Binaries of paystack cli be found [here](https://github.com/gray-adeyi/paystack-cli/releases/tag/v0.2.0).
1111
Alternatively, Paystack cli can be installed from pypi with pip as shown below.
1212

1313
```bash
@@ -16,7 +16,7 @@ pip install paystack-cli
1616

1717
## First time configurations
1818

19-
You're required to add your paystack auth_key on first use as shown below
19+
You're required to add your paystack integration secret key as your auth_key for the cli on first use as shown below
2020

2121
```bash
2222
paystack config AUTH_KEY
@@ -25,6 +25,88 @@ paystack config AUTH_KEY
2525
This sets up your paystack cli for use in development mode if the test secret key is used. This auth_key can be
2626
removed with `paystack reset`. Run `paystack --help` to see available commands
2727

28+
## Examples
29+
30+
### Retrieve a single transaction from your integration
31+
32+
```bash
33+
paystack txn get-txns --pagination 1
34+
```
35+
36+
Running the command above should yield a result similar to the dump shown below
37+
38+
```bash
39+
Response(
40+
status_code=200,
41+
status=True,
42+
message='Transactions retrieved',
43+
data=[
44+
{
45+
'id': 3785557723,
46+
'domain': 'test',
47+
'status': 'success',
48+
'reference': '2769088ddc23d52947c8e845f6a6bbdebd987f457e97f71c',
49+
'amount': 30000,
50+
'message': None,
51+
'gateway_response': 'Approved',
52+
'paid_at': '2024-05-11T10:00:29.000Z',
53+
'created_at': '2024-05-11T10:00:27.000Z',
54+
'channel': 'card',
55+
'currency': 'NGN',
56+
'ip_address': None,
57+
'metadata': {'invoice_action': 'create'},
58+
'log': None,
59+
'fees': 450,
60+
'fees_split': None,
61+
'customer': {'id': 47948280, 'first_name': 'Gbenga', 'last_name': 'Adeyi', 'email': 'coyotedevmail@gmail.com', 'phone': '', 'metadata': None, 'customer_code': 'CUS_73cb3biedlkbe4a', 'risk_action': 'default'},
62+
'authorization': {
63+
'authorization_code': 'AUTH_w1renosr9o',
64+
'bin': '408408',
65+
'last4': '4081',
66+
'exp_month': '12',
67+
'exp_year': '2030',
68+
'channel': 'card',
69+
'card_type': 'visa ',
70+
'bank': 'TEST BANK',
71+
'country_code': 'NG',
72+
'brand': 'visa',
73+
'reusable': True,
74+
'signature': 'SIG_JOdryeujwrsZryg0Lkrg',
75+
'account_name': None
76+
},
77+
'plan': {},
78+
'split': {},
79+
'subaccount': {},
80+
'order_id': None,
81+
'paidAt': '2024-05-11T10:00:29.000Z',
82+
'createdAt': '2024-05-11T10:00:27.000Z',
83+
'requested_amount': 30000,
84+
'source': {'source': 'merchant_api', 'type': 'api', 'identifier': None, 'entry_point': 'charge'},
85+
'connect': None,
86+
'pos_transaction_data': None
87+
}
88+
]
89+
)
90+
```
91+
92+
By default, the results you get from the cli is a `Response` object which is a `NamedTuple` returned
93+
by [Pypaystack2](https://gray-adeyi.github.io/pypaystack2/). To get a json result, use the `--data-only`
94+
flag.
95+
96+
```bash
97+
paystack txn get-txns --pagination 1 --data-only
98+
```
99+
100+
Running the command above should yield a result similar to the dump shown below
101+
102+
```bash
103+
[{"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":
104+
"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":
105+
"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",
106+
"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":
107+
"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}]
108+
```
109+
28110
## Source code
29111

30112
[https://github.com/gray-adeyi/paystack-cli](https://github.com/gray-adeyi/paystack-cli)

paystack.spec

Lines changed: 0 additions & 44 deletions
This file was deleted.

paystack_cli/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)