Don't want to build your own payment UI? Use the SDK to generate a Hosted Payment Page URL. Redirect your user there, and PawaPay handles the mobile money prompts securely.
import asyncio
from pawapay_sdk import ApiClient
# 1. Initialize Client
config = {
'api_token': , # Use Your Own Sandbox Account Token
'environment': 'sandbox',
'api_version': # toggle v1/v2
}
client = ApiClient(config)
# 2. Build Checkout Parameters
params = {
'depositId': 'auto_generated_uuid',
'amount': , # update as you wish
'currency': , # see `SDK Config` below
'country': ,
'phoneNumber': , # see `Open Docs` below
'returnUrl': 'https://example.com/payment-success'# success page
}
# 3. Create Session
response = await client.create_payment_page_session(params)
print(f"Redirecting User to: {response.redirectUrl}")
$ Awaiting execution...