Skip to main content

Python SDK for VFD Bank as a Service (VBaaS) API

Project description

VFD VBaaS Python SDK

PyPI version Python 3.9+ License: MIT

An unofficial Python SDK for VFD Bank as a Service (VBaaS) API, providing easy integration with VBaaS services including bills payment functionality.

Features

  • Authentication Management: Automatic token generation and refresh
  • Bills Payment API: Complete integration with VBaaS bills payment services
  • Environment Support: Both test and live environment configurations
  • Type Safety: Full type hints for better development experience
  • Error Handling: Comprehensive error handling and response validation

Installation

pip install vbaas-python-sdk

Or install from source:

git clone https://github.com/GiddyNaya/vfd-vbaas.git
cd vbaas-python-sdk
pip install -e .

Quick Start

from vbaas import VBaaSClient

# Initialize client
client = VBaaSClient(
    consumer_key="your_consumer_key",
    consumer_secret="your_consumer_secret",
    environment="test"  # or "live"
)

# Get biller categories
categories = client.get_biller_categories()
print(categories)

# Get billers for a category
billers = client.get_billers("Airtime")
print(billers)

# Make a bill payment
payment_result = client.pay_bill(
    customer_id="09071046909",
    amount="1000",
    division="C",
    payment_item="airtime",
    product_id="423",
    biller_id="airng",
    reference="your-unique-reference",
    phone_number="09000000000"
)
print(payment_result)

# Check transaction status
status = client.get_transaction_status("your-transaction-id")
print(status)

API Reference

VBaaSClient

The main client class for interacting with VBaaS APIs.

Methods

  • get_biller_categories(): Get all available biller categories
  • get_billers(category_name): Get billers for a specific category
  • get_biller_items(biller_id, division_id, product_id): Get items for a biller
  • validate_customer(division_id, payment_item, customer_id, biller_id): Validate customer information
  • pay_bill(**kwargs): Make a bill payment
  • get_transaction_status(transaction_id): Check payment status

Environment Configuration

The SDK supports both test and live environments:

  • Test Environment: Use for development and testing
  • Live Environment: Use for production

Error Handling

The SDK provides comprehensive error handling:

from vbaas import VBaaSClient, VBaaSError

try:
    client = VBaaSClient(consumer_key="key", consumer_secret="secret")
    result = client.pay_bill(...)
except VBaaSError as e:
    print(f"API Error: {e.message}")
    print(f"Status Code: {e.status_code}")

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support and questions, please contact info@vfdtech.ng or visit the documentation.

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

vbaas_python_sdk-1.0.1.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

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

vbaas_python_sdk-1.0.1-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file vbaas_python_sdk-1.0.1.tar.gz.

File metadata

  • Download URL: vbaas_python_sdk-1.0.1.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for vbaas_python_sdk-1.0.1.tar.gz
Algorithm Hash digest
SHA256 bfdfa04f69643a347e50d3b35822feae39d16d2834d8b63fe9efc188dbc54020
MD5 ccaa0a80c28ea2bf184acde075c22c1e
BLAKE2b-256 d44d1ceb2a27b00040e97831cfd89739f0401691db3d5561c8a6cbf65f76d0b4

See more details on using hashes here.

File details

Details for the file vbaas_python_sdk-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for vbaas_python_sdk-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c924cfa7a82a7c8f2a433bedc8542785b35da06de8e44228f9dbfe4a0ec34bc
MD5 1aada522e87c955407ce9fe4d8d889f9
BLAKE2b-256 dea57ada81332da3d7a484a915c1dc8ef00cb384f5b8da7815643954013e0b73

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