Skip to main content

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.

Documentation

The documentation, installation guide, detailed description of the SeerBit API and all of its features is available on the documentation website

Requirements

  • Python 3.9
  • Pip

Installation

Pip

Run this command on the terminal:

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

Using the Library

Initiate Account Option

Instantiate a client and set the parameters.

    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.

    from seerbit.service.authentication import Authentication

    auth_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.

    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": "johndoe@gmail.com",
        "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.

Licence

GNU General Public License. For more information, see the LICENSE file.

Website

Metadata

Release files for seerbit-python-v2 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for seerbit-python-v2 1.0.4
File Size Uploaded
seerbit-python-v2-1.0.4.tar.gz 13.2 kB Details

Release files / seerbit-python-v2-1.0.4.tar.gz

Download URL seerbit-python-v2-1.0.4.tar.gz
Size 13.2 kB
Tags Source
SHA-256 checksum
How to use checksums
c41fc2d8a22ea21bcad11ee7137040b3e687ba01dc22e3f80194dd2f0e41902f
BLAKE2b-256 checksum
How to use checksums
a0701184fbd07d15a48c84b786b5c3ed47265b598465a332629a98af6679cea6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.0

Release history Release notifications | RSS feed

This release

1.0.4 This release

1 release file

1.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page