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 Tests Lint

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/example/vbaas-python-sdk.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.0.tar.gz (23.5 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.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vbaas_python_sdk-1.0.0.tar.gz
  • Upload date:
  • Size: 23.5 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.0.tar.gz
Algorithm Hash digest
SHA256 447dd6c06ec18e2653bc56f18d3f489e669f5765d9c7ead882c7aef651a4e474
MD5 00b15f4f01be4d1f0b0e00b812887664
BLAKE2b-256 1fc4fa9e3d9aa7a4882dfa41043ca7b05dfb0d9d690b315a4117dc2a03cd74e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vbaas_python_sdk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f350d6e8b104192c6143546eddf075852bcd6d6023ddda5dbb20ebf50b6eb365
MD5 3bbdf42397ef2538ab0f5553bc38463d
BLAKE2b-256 09369da7579e5f931ddab1fa04a3e9d34d217cbd7a88c42db34e6d2cc42ea8db

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