|
1 | 1 | # paystack |
2 | | -The OpenAPI specification of the Paystack API that merchants and developers can harness to build financial solutions in Africa. |
3 | 2 |
|
4 | | -This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: |
| 3 | +A Python client library for consuming the Paystack API. |
5 | 4 |
|
6 | | -- API version: 1.0.0 |
7 | | -- Package version: 0.1.0 |
8 | | -- Build package: org.openapitools.codegen.languages.PythonLegacyClientCodegen |
| 5 | +## Prerequisite |
| 6 | +This library is supported on Python 2.7 and 3.4+. Also, you need to [create a Paystack account](https://dashboard.paystack.com/#/signup), if you don't have one already, to get your test and |
| 7 | +live secret keys. |
9 | 8 |
|
10 | | -## Requirements. |
11 | | - |
12 | | -Python 2.7 and 3.4+ |
13 | | - |
14 | | -## Installation & Usage |
15 | | -### pip install |
16 | | - |
17 | | -If the python package is hosted on a repository, you can install directly using: |
18 | | - |
19 | | -```sh |
20 | | -pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git |
21 | | -``` |
22 | | -(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`) |
23 | | - |
24 | | -Then import the package: |
25 | | -```python |
26 | | -import paystack |
| 9 | +## Installation |
27 | 10 | ``` |
28 | | - |
29 | | -### Setuptools |
30 | | - |
31 | | -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). |
32 | | - |
33 | | -```sh |
34 | | -python setup.py install --user |
35 | | -``` |
36 | | -(or `sudo python setup.py install` to install the package for all users) |
37 | | - |
38 | | -Then import the package: |
39 | | -```python |
40 | | -import paystack |
| 11 | +pip install paystacksdk |
41 | 12 | ``` |
| 13 | +You may need to run `pip` with root permission: `sudo pip install` |
42 | 14 |
|
43 | 15 | ## Getting Started |
44 | 16 |
|
45 | | -Please follow the [installation procedure](#installation--usage) and then run the following: |
46 | | - |
47 | 17 | ```python |
48 | | -from __future__ import print_function |
49 | | - |
50 | | -import time |
51 | 18 | import paystack |
52 | | -from paystack.rest import ApiException |
53 | 19 | from pprint import pprint |
54 | 20 |
|
55 | | -# Defining the host is optional and defaults to https://api.paystack.co |
56 | | -# See configuration.py for a list of all supported configuration parameters. |
57 | | -configuration = paystack.Configuration( |
58 | | - host = "https://api.paystack.co" |
59 | | -) |
60 | | - |
61 | | -# The client must configure the authentication and authorization parameters |
62 | | -# in accordance with the API server security policy. |
63 | | -# Examples for each auth method are provided below, use the example that |
64 | | -# satisfies your auth use case. |
| 21 | +paystack.api_key = 'sk_domain_xxxxx' |
65 | 22 |
|
66 | | -# Configure Bearer authorization: bearerAuth |
67 | | -configuration = paystack.Configuration( |
68 | | - access_token = 'YOUR_BEARER_TOKEN' |
69 | | -) |
70 | | - |
71 | | - |
72 | | -# Enter a context with an instance of the API client |
73 | | -with paystack.ApiClient(configuration) as api_client: |
74 | | - # Create an instance of the API class |
75 | | - api_instance = paystack.Balance(api_client) |
76 | | - |
77 | | - try: |
78 | | - # Fetch Balance |
79 | | - api_response = api_instance.fetch() |
80 | | - pprint(api_response) |
81 | | - except ApiException as e: |
82 | | - print("Exception when calling Balance->fetch: %s\n" % e) |
83 | | - |
| 23 | +response = paystack.Customer.create( |
| 24 | + |
| 25 | + first_name="Larry", |
| 26 | + last_name="James" |
| 27 | + ) |
| 28 | +pprint(response) |
84 | 29 | ``` |
85 | 30 |
|
86 | 31 | ## Documentation for API Endpoints |
@@ -270,16 +215,9 @@ Class | Method | HTTP request | Description |
270 | 215 | - [VerificationBVNMatch](docs/VerificationBVNMatch.md) |
271 | 216 |
|
272 | 217 |
|
273 | | -## Documentation For Authorization |
274 | | - |
275 | | - |
276 | | -## bearerAuth |
277 | | - |
278 | | -- **Type**: Bearer authentication |
279 | | - |
280 | | - |
281 | | -## Author |
282 | | - |
283 | | - |
284 | 218 |
|
| 219 | +## Issues |
| 220 | +Kindly [open an issue](https://github.com/PaystackOSS/paystack-python/issues) if you discover any bug or have problems using this library. |
285 | 221 |
|
| 222 | +## License |
| 223 | +This repository is made available under the MIT license. Kindly read the [LICENSE](https://github.com/PaystackOSS/paystack-python/blob/main/LICENSE) file for more information. |
0 commit comments