PER — Payment And Redistribution (DirectPay)
The PER API (also called DirectPay) allows you to transfer funds from your PayDunya account to another PayDunya account (identified by email or phone number).
Use cases include marketplace payouts, supplier payments, or building your own payment solution on top of PayDunya.
!!! warning The DirectPay service must be explicitly enabled in your application configuration in the PayDunya dashboard.
Usage
from paydunya import DirectPay, PaydunyaClient
client = PaydunyaClient(
master_key="your-master-key",
private_key="your-private-key",
token="your-token",
mode="live",
)
direct_pay = DirectPay(client)
response = direct_pay.pay(
account_alias="774563209", # recipient's PayDunya email or phone
amount=6500, # amount in FCFA
)
print(response["response_text"]) # "Transaction completed successfully"
print(response["transaction_id"]) # e.g., "TEST000001"
Response
On success (response_code: "00"):
{
"response_code": "00",
"response_text": "Transaction completed successfully",
"description": "Success! Amount of 6500 FCFA has been transfered to ...",
"transaction_id": "TEST000001"
}