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)

Examples

For more detailed examples, check out the example files in the repository:

Running Examples

# Set your credentials as environment variables
export VBAAS_CONSUMER_KEY="your_consumer_key"
export VBAAS_CONSUMER_SECRET="your_consumer_secret"

# Run the basic usage example
python examples/basic_usage.py

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.2.tar.gz (23.9 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.2-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vbaas_python_sdk-1.0.2.tar.gz
  • Upload date:
  • Size: 23.9 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.2.tar.gz
Algorithm Hash digest
SHA256 bfdc1418cc5585ae63281c8bb16e1ff0875ee3c71a2e8d69af6742f2271cb174
MD5 d48d369d322a5aa4e509b7aaca6be22c
BLAKE2b-256 1b8b0d0d1526495960b08885f59348bc920d46ad0aa3b69c5d4f1416e16ab644

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vbaas_python_sdk-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e90a4964e609cedc30ae718e5d50da9972b7a9e3f8145ba0fab8d2e3f10cde1e
MD5 e4980a35ac5a6b0121371b767253315e
BLAKE2b-256 478978bdd4079c0721b739402558a02e10e0c554c3b7e2790f606296732add66

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