NGNT

The NGNT class is responsible for handling the creation of new virtual deposit accounts.

To use the NGNT class, import it from the buycoins package:

ngnt.py
from buycoins import NGNT

You can use the class directly using NGNT().method_name or instantiate the class into a variable and use:

ngnt = NGNT()
ngnt.method_name(**args)

create_deposit_account(account_name)

This method does not work currently as the API endpoint has been temporarily disabled.

This method creates a virtual deposit account under the account name from the method argument and returns a JSON object containing the details of the newly created account.

Example

ngnt.py
ngnt = NGNT()

created_deposit_account = ngnt.create_deposit_account("BuyCoins Africa")

print(created_deposit_account)

In the example above, a new virtual deposit account under the name BuyCoins Africa is created and output stored in the create_deposit_account variable.

The response printed from line 5 is:

{
    'accountNumber': '12345678901',
    'accountName': 'Buycoins Africa',
    'accountType': 'deposit',
    'bankName': 'Providus Bank',
    'accountReference': '445efd1b-a902-4a4b-8e57-28d5bedf364d'
}

Error Responses

An error message is sent as a response In an event where an empty argument is passed.

Example request:

ngnt.py
ngnt = NGNT()

created_deposit_account = ngnt.create_deposit_account("")

print(created_deposit_account)

Response:

{
    "status": "error",
    "name": "AccountError",
    "code": 400,
    "message": "Invalid account name passed"
}

Last updated