Skip to main content

A1 Huakunjingxiu Billing SDK

Python SDK for interacting with the A1 Huakunjingxiu Billing API.

项目结构

billing-sdk/
├── billing/                      # 主应用目录
│   ├── product/                 # 产品模块
│   │   ├── __init__.py
│   │   └── schemas.py
│   ├── transaction/             # 交易模块
│   │   ├── __init__.py
│   │   └── schemas.py
│   ├── __init__.py
│   ├── exceptions.py
│   ├── http.py
│   └── schemas.py
├── tests/                       # 测试目录
│   └── test_transaction_create.py
├── docs/                        # 文档目录
├── examples/                    # 示例目录
│   ├── product/                 # 产品示例
│   │   ├── __init__.py
│   │   └── create_token_example.py
│   ├── transaction/             # 交易示例
│   │   ├── __init__.py
│   │   └── create_transaction_example.py
│   ├── __init__.py
│   └── README.md
├── .clinerules
├── .cursorrules
├── .gitignore
├── .pre-commit-config.yaml
├── LICENSE
├── pyproject.toml
├── README.md
└── uv.lock

运行示例

运行示例代码前需要设置PYTHONPATH环境变量:

$env:PYTHONPATH=$PWD
uv run examples/product/create_token_example.py
export PYTHONPATH=$(pwd)
uv run examples/product/create_token_example.py

Installation

pip install billing-sdk

Usage

from billing import Client

# Initialize client
client = Client(api_key="your_api_key")

# Create an invoice
invoice = client.create_invoice(
    amount=100.00,
    description="Monthly subscription"
)

# Get invoice details
invoice_details = client.get_invoice(invoice["id"])

# List invoices
invoices = client.list_invoices(limit=10)

Error Handling

The SDK provides several exception types:

from billing import (
    BillingError,
    AuthenticationError,
    InvalidRequestError,
    APIError
)

try:
    # API calls
except AuthenticationError as e:
    print("Invalid API key")
except InvalidRequestError as e:
    print("Invalid request parameters")
except APIError as e:
    print("Server error occurred")
except BillingError as e:
    print("General billing error")

Development

Install development dependencies:

pip install -e ".[dev]"

Run tests:

pytest

License

MIT

Metadata

Release files for hkjx-billing-sdk 0.2.7

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

Source distribution (sdist)

Source distribution for hkjx-billing-sdk 0.2.7
File Size Uploaded
hkjx_billing_sdk-0.2.7.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hkjx-billing-sdk 0.2.7
File Interpreter ABI Platform
hkjx_billing_sdk-0.2.7-py3-none-any.whl Python 3 none any Details

Total release size: 16.4 kB

Release files / hkjx_billing_sdk-0.2.7.tar.gz

Download URL hkjx_billing_sdk-0.2.7.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a4ad07f729062eb174e8b9eafb8eca2c2d941d661b0da320abce00845a174307
BLAKE2b-256 checksum
How to use checksums
2f36926d6a028c0ea3cf282ca617d14693c85fc2e9fa956ced049d45878f9240
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.4

Release files / hkjx_billing_sdk-0.2.7-py3-none-any.whl

Download URL hkjx_billing_sdk-0.2.7-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f27865b67bcf3b0f468f1b13eea3aeb034500a5fab506f2ebaae3083e1f5828b
BLAKE2b-256 checksum
How to use checksums
376151fce626e4e920ba8f64493b7b863640289cd125e1408abd88bc692a616c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.4

Release history Release notifications | RSS feed

This release

0.2.7 This release

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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