Logo Lanfrica

Ronnie5562/pawapay_python_sdk

Domain:

digital infrastructure

Record type:

software
Creator:
Ron
Host:
PawaPay Python SDK โ€“ Easily integrate, accept, and manage mobile money payments across Africa. # PawaPay Python SDK A comprehensive Python SDK for integrating with the PawaPay mobile money payment platform across Africa. ## Features - **Deposits**: Request payments from customers - **Payouts**: Send payments to recipients - **Payment Pages**: Create hosted payment pages - **Webhook Support**: Handle real-time payment notifications - **Correspondent Prediction**: Automatically detect mobile money operators - **Comprehensive Validation**: Built-in validation for phone numbers, amounts, and currencies - **Error Handling**: Detailed error handling and exceptions - **Async Support**: Built for asynchronous operations with proper polling - **Type Safety**: Full type hints and data classes ## Supported Countries & Currencies - ๐Ÿ‡ฌ๐Ÿ‡ญ Ghana (GHS) - ๐Ÿ‡ฐ๐Ÿ‡ช Kenya (KES) - ๐Ÿ‡บ๐Ÿ‡ฌ Uganda (UGX) - ๐Ÿ‡น๐Ÿ‡ฟ Tanzania (TZS) - ๐Ÿ‡ท๐Ÿ‡ผ Rwanda (RWF) - ๐Ÿ‡จ๐Ÿ‡ฎ Ivory Coast (XOF) - ๐Ÿ‡จ๐Ÿ‡ฒ Cameroon (XAF) - ๐Ÿ‡ฟ๐Ÿ‡ฒ Zambia (ZMW) - ๐Ÿ‡ฒ๐Ÿ‡ผ Malawi (MWK) ## Installation ```bash pip install pawapay-python ``` ## Quick Start ### 1. Environment Setup Create a `.env` file: ```env PAWAPAY_API_TOKEN=your_api_token_here PAWAPAY_ENVIRONMENT=sandbox PAWAPAY_CALLBACK_URL=your-app.com PAWAPAY_CALLBACK_SECRET=your_webhook_secret ``` ### 2. Basic Usage ```python from pawapay import create_client from pawapay.exceptions import PawaPayException # Create client from environment variables client = create_client() # Request a deposit (customer pays you) try: deposit = client.request_deposit( amount="100.00", currency="KES", phone_number="254700000001", statement_description="Payment for order #123" ) print(f"Deposit ID: {deposit.deposit_id}") print(f"Status: {deposit.status.value}") except PawaPayException as e: print(f"Error: {e}") ``` ### 3. Advanced Usage ```python from pawapay import PawaPayClient, PawaPayConfig from pawapay.models import TransactionStatus from pawapay.utils import PawaPayValidator, PawaPayHelper # Manual configuration config = PawaPayConfig( api_token="your_token", base_url="https: โ€ฆ