Skip to main content

A Seerbit API Library for Python

Reason this release was yanked:

new version available

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

seerbit-python-v2-1.0.3.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

seerbit_python_v2-1.0.3-py3-none-any.whl (26.1 kB view details)

Uploaded Python 3

File details

Details for the file seerbit-python-v2-1.0.3.tar.gz.

File metadata

  • Download URL: seerbit-python-v2-1.0.3.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.5

File hashes

Hashes for seerbit-python-v2-1.0.3.tar.gz
Algorithm Hash digest
SHA256 d83ead1468323f0e60603a27dbaa58e6d67125e038a7e22a9148cfa6c653d03e
MD5 6fdeef64ed81f5c7a238c86d45f48d25
BLAKE2b-256 a93a0aaf2db8a905b0fa4fe87d84737a98f76a2afa03e4e6cb622aca601509ae

See more details on using hashes here.

File details

Details for the file seerbit_python_v2-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: seerbit_python_v2-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 26.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.5

File hashes

Hashes for seerbit_python_v2-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8ee9150087b70c2f69a99188625cf1646ec73e18deb70c3f9881c6b9bb8c55d8
MD5 e955922fa0334baf139d07535b10d45a
BLAKE2b-256 90b5232bbecb47f3fc378b1ca4213f422a5fc636f65e1bb8d845a49482f22abc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page