Yabetoo Python SDK
Project description
YabetooPy
A Python SDK for integrating with the Yabetoo Payment API. This library provides a simple interface for processing payments, creating checkout sessions, handling disbursements, and managing remittances.
Installation
pip install yabetoo-sdk
Quick Start
from yabetoo import YabetooSDK
from models.payment import CreateIntentRequest, PaymentMethodData, MomoData
# Initialize the SDK with your secret key
sdk = YabetooSDK("your_secret_key")
# Create a payment intent
intent_data = CreateIntentRequest(
amount=1000,
currency="xaf",
description="Test payment",
metadata={"order_id": "123"}
)
intent = sdk.payments.create(intent_data)
# Confirm the payment intent
confirm_data = ConfirmIntentRequest(
client_secret=intent.client_secret,
payment_method_data=PaymentMethodData(
type='momo',
momo=MomoData(
country='cg',
msisdn='+242XXXXXXXXX',
operator_name="mtn"
)
)
)
result = sdk.payments.confirm(intent.id, confirm_data)
Features
- Payment Processing
- Create and confirm payment intents
- Handle mobile money transactions
- Checkout Sessions
- Create hosted checkout pages
- Handle success/cancel redirects
- Disbursements
- Send money to recipients
- Track disbursement status
- Remittances
- Create and manage remittance transactions
- Real-time status updates
Documentation
Initialization
from yabetoo import YabetooSDK
sdk = YabetooSDK(
secret_key="your_secret_key", # Starts with sk_test for sandbox
options=HttpClientOptions(
timeout=30,
max_retries=3
)
)
Payments
# Create payment intent
intent = sdk.payments.create(CreateIntentRequest(
amount=5000,
currency="xaf",
description="Product purchase"
))
# Retrieve payment
payment = sdk.payments.retrieve("payment_id")
# List payments
payments = sdk.payments.get_page(page=1, per_page=10)
Checkout Sessions
# Create checkout session
session = sdk.sessions.create(CreateCheckoutSession(
account_id="account_123",
total=10000,
currency="xaf",
success_url="https://example.com/success",
cancel_url="https://example.com/cancel",
items=[
CheckoutItem(
product_id="prod_123",
product_name="Product Name",
quantity=1,
price=10000
)
]
))
Disbursements
# Create disbursement
disbursement = sdk.disbursements.create(CreateDisbursementRequest(
amount=5000,
currency="xaf",
first_name="John",
last_name="Doe",
payment_method_data=PaymentMethodData(
type="momo",
momo=MomoData(
country="cg",
msisdn="+242XXXXXXXXX",
operator_name="mtn"
)
)
))
Remittances
# Create remittance
remittance = sdk.remittances.create(CreateRemittanceRequest(
amount=5000,
currency="xaf",
first_name="John",
last_name="Doe",
payment_method_data=PaymentMethodData(
type="momo",
momo=MomoData(
country="cg",
msisdn="+242XXXXXXXXX",
operator_name="mtn"
)
)
))
Error Handling
The SDK throws YabetooError for all API-related errors:
from yabetoo import YabetooError
try:
payment = sdk.payments.retrieve("invalid_id")
except YabetooError as e:
print(f"Error: {e.message}")
if e.code:
print(f"Error code: {e.code}")
if e.errors:
print("Validation errors:", e.errors)
Development
# Clone the repository
git clone https://github.com/yabetoo/sdk-py.git
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yabetoo_sdk-0.1.0.tar.gz.
File metadata
- Download URL: yabetoo_sdk-0.1.0.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25e73bf35acd9b8a4ace7e9f653ed8eb62d30954e59c7525c2e2e9d96d33e2e4
|
|
| MD5 |
67c317aec647d21d5e5b5bde02d4b4d9
|
|
| BLAKE2b-256 |
ea47527b734e0e5d6a44da79f6e374f7f980d1d5e1581b4f34efc97581148f33
|
Provenance
The following attestation bundles were made for yabetoo_sdk-0.1.0.tar.gz:
Publisher:
publish.yml on yabetoo/sdk-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yabetoo_sdk-0.1.0.tar.gz -
Subject digest:
25e73bf35acd9b8a4ace7e9f653ed8eb62d30954e59c7525c2e2e9d96d33e2e4 - Sigstore transparency entry: 781161142
- Sigstore integration time:
-
Permalink:
yabetoo/sdk-py@5528e793b6f7a0e4d4bd9dd9311c0713722a679b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/yabetoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5528e793b6f7a0e4d4bd9dd9311c0713722a679b -
Trigger Event:
push
-
Statement type:
File details
Details for the file yabetoo_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: yabetoo_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c414f363d4f38d98e41117eb912fd60c3ef350692541832bd548f4b51ed67752
|
|
| MD5 |
2cbf124d27da646bd581e51976b3c60e
|
|
| BLAKE2b-256 |
d4a23ccfdc44296e486449b77a86838b8119e5bc1bf2208eec0e45a6d6b5e9c3
|
Provenance
The following attestation bundles were made for yabetoo_sdk-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on yabetoo/sdk-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yabetoo_sdk-0.1.0-py3-none-any.whl -
Subject digest:
c414f363d4f38d98e41117eb912fd60c3ef350692541832bd548f4b51ed67752 - Sigstore transparency entry: 781161146
- Sigstore integration time:
-
Permalink:
yabetoo/sdk-py@5528e793b6f7a0e4d4bd9dd9311c0713722a679b -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/yabetoo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5528e793b6f7a0e4d4bd9dd9311c0713722a679b -
Trigger Event:
push
-
Statement type: