Référence — base.py¶
Ce module définit le contrat commun à tous les providers.
Protocol Transaction¶
Décrit l'interface attendue pour l'objet transaction passé à initiate_payment.
Grâce à @runtime_checkable, la conformité peut être vérifiée à l'exécution.
from paygate_africa.base import Transaction
isinstance(my_obj, Transaction) # True si tous les attributs sont présents
paygate_africa.base.Transaction
¶
Bases: Protocol
Protocol defining the required interface for a transaction object. Any object that implements these attributes can be used as a transaction.
Source code in src/paygate_africa/base.py
Classe abstraite PaymentProvider¶
Tout provider doit hériter de cette classe et implémenter les deux méthodes.
paygate_africa.base.PaymentProvider
¶
Bases: ABC
Abstract base class for payment providers.
Source code in src/paygate_africa/base.py
initiate_payment(tx)
abstractmethod
async
¶
verify_payment(transaction_id)
abstractmethod
async
¶
Verify the status of a transaction. Returns a dictionary with: - "status": "SUCCESS", "FAILED", or "PENDING" - "raw_data": The original response from the provider's API