Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seerbit/seerbit-python-api-library
https://github.com/seerbit/seerbit-python-api-library
cardservice fintech payment-gateway payment-integration python python-3 python-library seerbit-api
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/seerbit/seerbit-python-api-library
- Owner: seerbit
- License: other
- Created: 2020-08-04T11:03:29.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-14T16:18:32.000Z (over 2 years ago)
- Last Synced: 2024-10-01T19:17:34.667Z (4 months ago)
- Topics: cardservice, fintech, payment-gateway, payment-integration, python, python-3, python-library, seerbit-api
- Language: Python
- Homepage:
- Size: 2.38 MB
- Stars: 4
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
seerbit-python-v2
A SeerBit API Library for Python (Version 2)## Features
The Library supports all APIs under the following services:
* Payments via API (mobile money, cards, account, etc.)
* Recurring Payments
* Transaction Status## Getting Started
A full getting started guide for integrating SeerBit can be found at [getting started docs](https://doc.seerbit.com).
## Documentation
The documentation, installation guide, detailed description of the SeerBit API and all of its features is [available on the documentation website](https://doc.seerbit.com/api/library)
## Requirements
* Python 3.9
* Pip## Installation
### Pip
Run this command on the terminal:
```code
pip install seerbit-python-v2
```## Contributing
You can contribute to this repository so that anyone can benefit from it:
* Improved features
* Resolved bug fixes and issues## Examples
You can also check the [demos](https://github.com/seerbit/seerbit-python-api-library/tree/master/demos)
## Using the Library
Initiate Account Option
Instantiate a client and set the parameters.```python
from seerbit.client import Client
from seerbit.enums import EnvironmentEnum
from seerbit.seerbitlib import SeerBit
client = Client()
client.api_base = SeerBit.LIVE_API_BASE
client.environment = EnvironmentEnum.LIVE.value
client.private_key = "private_key"
client.public_key = "public_key"
client.timeout = 20
```To initiate a transaction request you need to perform authentication operation and acquire a token.
```python
from seerbit.service.authentication import Authenticationauth_service = Authentication(client)
auth_service.auth()
token = auth_service.get_token()
```After you have retrieved your token, pass it to the AccountService constructor along with your client object. You can then construct your payload and call the
authorize()
method of the AccountService class.
```python
from random import randint
from seerbit.service.account_service import AccountService
random_number = randint(10000000, 99999999)
payment_ref = "SBT_" + str(random_number)
account_payload = {
"publicKey": client.public_key,
"amount": "100.00",
"fee": "10",
"fullName": "John Doe",
"mobileNumber": "08037456590",
"currency": "NGN",
"country": "NG",
"paymentReference": payment_ref,
"email": "[email protected]",
"productId": "Foods",
"productDescription": "Uba Account Transaction ",
"clientAppCode": "kpp64",
"channelType": "BANK_ACCOUNT",
"redirectUrl": "https://checkout.seerbit.com",
"deviceType": "Apple Laptop",
"sourceIP": "127.0.0.1:3456",
"accountName": "John S Doe",
"accountNumber": "1234567890",
"bankCode": "033",
"bvn": "12345678901",
"dateOfBirth": "04011984",
"retry": "false",
"invoiceNumber": "1234567891abc123ac"
}
account_service = AccountService(client, token)
json_response = account_service.authorize(account_payload)
```Find more examples [here](https://github.com/seerbit/seerbit-python-api-library/tree/master/demos).
## Licence
GNU General Public License. For more information, see the LICENSE file.## Website
* https://seerbit.com