Python Admin SDK

To install the Python Admin SDK you must follow the code below :

#Initialize a virtual environment with python3 
python3 -m venv venv

#Install the SDK Admin
pip install kkiapay

Status of a transaction

KKiaPay allow you to retrieve all the information related to a transaction. To do this, you will need to fill in the following fields:

  • Your public, private and secret API keys

  • The reference of the operation (see the image below)

Example

You can use the following code to test this feature :

#Create an instance of KKiaPay
from kkiapay import Kkiapay
k = Kkiapay('public_key', 'private_key', 'secret', sandbox=True)

#Initialize the process of verification
transaction = k.verify_transaction('LVFNrK1nx')
#Where LVFNrK1nx is the reference of the transaction

print(transaction)

# => KkiapayTransaction(
#       performed_at='2019-07-11T11:24:42.687Z',
#       type='DEBIT',
#       status='FAILED',
#       source='MOBILE_MONEY',
#       amount=1,
#       fees=0,
#       country='BJ',
#       reason='invalid_number',
#       transactionId='LVFNrK1nx',
#       performedAt='07/11/2019'
#   )

print(transaction.status)
# => FAILED
print(transaction.amount)
# => 1

Find here our source code initiated by the PythonBenin community !

Last updated