Python Library

Business Rest API Library

Paga has made it very easy for businesses to accept payments. Business Service Library is a Python module that helps you make API calls when processing Paga Business Transactions.

1. Installation

Get the file from business_client.py and save it in your project folder

2. Usage

To use business_client, you would need to import it

from paga_business_client import BusinessClientCore

To Initialise the class, use your PAGA api key, credential(password), principal(public id) and PAGA server base url. To get your PAGA API key, click on here

principal = "publicId"
api_key = "apiKey"
credential = "password"
test = True

business_client = BusinessClientCore(principal,password,test,api_key)

📘

Note

Test Server can be true or false. True means you calling PAGA test server while False means you are calling PAGA live Server.

3. Business Service Methods

Register Customer

The Register Customer operation allows third Parties to register customers on Paga. New customers will be contacted to set up their authentication credentials.

response = business_client.register_customer('reference_number',
                                             'customer_firstname',
                          									 'customer_lastname',
                                             'customer_phonenumber',	
                                             'customer_email',
                                             'customer_date_of_birth')

Money Transfer

The Money Transfer operation enables an integrated 3rd party to utilize the Paga platform to transfer funds from a variety of sources to another party. The fund's transfer may be executed from the accounts of the integrated 3rd party themselves, or on behalf of another customer with the appropriate authentication. The source of funds may be the sender's Paga account or another source that the sender has pre-registered on the Paga platform.

response = business_client.money_transfer('reference_number',
                                          'amount',
                                          'currency',
                                          'destination_account', 																													'destination_bank', 
                                          'sender_principal',
                                          'sender_credentials',
                                          'withdrawal_code',
                                          'source_of_funds',                                                               'transaction_reference',
                                          'suppress_recipient_message',
                                          'locale',
                                          'alternate_sender_name',
                                          'mini_recipient_kyc',
                                          'holding_period')

Airtime Purchase

The Airtime Purchase operation enables an integrated 3rd party to utilize the Paga platform to purchase airtime for any phone number on any of the major networks. The purchase can be funded by the integrated 3rd party themselves, or on behalf of another customer with the appropriate authentication. The source of funds may be the purchaser's Paga account or another source that the sender has pre-registered on the Paga platform.
To make use of this method, call the airtimePurchase method inside the BusinessClient Library which will return a Paga Response for the airtime purchased.

response = business_client.airtime_purchase('reference_number', 
                                            'amount',
                                            'currency',
                                            'destination_number',
                                            'purchaser_principal',
                                            'purchaser_credentials',
                                            'source_of_funds',
                                            'locale')

Merchant Payment

The Merchant Payment operation enables an integrated 3rd party to utilize the Paga platform to make payments to registered merchants. The purchase can be funded by the integrated 3rd party themselves, or on behalf of another customer with the appropriate authentication. The source of funds may be the purchaser's Paga account or another source that the sender has pre-registered on the Paga platform. To make use of this method, call the merchantPayment method inside the BusinessClient Library which will return a Paga Response for the merchant payment.

response = business_client.merchant_payment('reference_number',
                                             'amount',
                                             'currency',
                                             'merchant_account',
                                             'merchant_reference_number',
                                             'merchant_service',
                                             'purchaser_principal',
                                             'purchaser_credentials',
                                             'source_of_funds',
                                             'locale')

Validate Deposit To Bank

The Validate Deposit To Bank operation enables an integrated 3rd party to pre-validate a potential deposit to bank operation using similar parameters that would be provided for the actual deposit to bank operation. This will return a result indicating whether the actual deposit to bank operation using the same parameters is likely to be successful or not, and if not, why not. This will also validate the bank account number for the bank provided and return the account holder's name for that account as stored at the bank. This will also return any fees that would be charged as part of the actual deposit to bank operation. To make use of this method, call the validateDepositToBank method inside the BusinessClient Library which will return Paga Response for the validate deposit to the bank.

response = business_client.validate_deposit_to_bank('reference_number',
                                                    'amount',
                                                    'currency',
                                                    'destination_bank_uuid',
                                                    'destination_bank_acct_no',
                                                    'recipient_phone_number',
                                                    'recipient_operator_code',
                                                    'recipient_email',
                                                    'recipient_name',
																										'locale')

Deposit To Bank

The Deposit To Bank operation enables an integrated 3rd party to utilize the Paga platform to deposit funds to any bank account. The funds will be deposited from the businesses Paga account to the bank via the bank account specified in the operation parameters. To make use of this method, call the depositToBank method inside the BusinessClient Library which will return Paga Response for the deposit to the bank.

response = business_client.deposit_to_bank('reference_number',
                                            'amount',
                                            'currency',
                                            'destination_bank_uuid',
                                            'destination_bank_acct_no',
                                            'recipient_phone_number',
                                            'recipient_operator_code',
                                            'recipient_email',
                                            'recipient_name',
                                            'alt_sender_name',
                                            'suppress_recipient_msg',
                                            'remarks',
                                            'locale')

Account Balance

The Account Balance operation enables an integrated 3rd party to utilize the Paga platform to check the balance of a Paga account or any other account type pre-registered on the Paga platform, which supports balance inquiries. The account balance check may be executed for the account(s) of the integrated 3rd party themselves, or on behalf of another customer with the appropriate authentication. To make use of this method, call the accountBalance method inside the BusinessClient Library which will return Paga Response for the account balance method.

response = business_client.get_account_balance('reference_number',
                                               'acct_principal',
                                               'acct_credentials',
                                               'source_of_funds', 
                                               'locale')

Transaction History

The Transaction History operation enables an integrated 3rd party to utilize the Paga platform to check the transaction history of their Paga account between selected date ranges. The transaction history may be executed on the account(s) of the integrated 3rd party, or on behalf of another customer with the appropriate authentication. Transactions results are limited to the most recent 10,000 results. To make use of this method, call the transactionHistory method inside the BusinessClient Library which will return Paga Response for the transaction history.

response = business_client.get_transaction_history('reference_number', 
                                                    'acct_principal',
                                                    'acct_credentials', 
                                                    'start_date', 
                                                    'end_date',
                                                    'locale')

Recent Transaction History

The Recent Transaction History operation enables an integrated 3rd party to utilize the Paga platform to check the last 5 transactions on their Paga account. The recent transaction history may be executed for the account(s) of the integrated 3rd party or on behalf of another customer with the appropriate authentication. To make use of this method, call the recentTransactionHistory method inside the BusinessClient Library which will return Paga Response for the recent transaction history.

response = business_client.get_recent_transaction_history('reference_number', 																														'acct_principal',
                                                          'acct_credentials', 
                                                          "NG")

Get Merchants

The Get Merchants operation enables an integrated 3rd party to utilize the Paga platform to obtain a list of registered merchants on the Paga platform, typically for use in parameterizing the merchant payment operation. To make use of this method, call the getMerchants method inside the BusinessClient Library which will return Paga Response for the get Merchants method.

response = business_client.get_merchants('reference_number', 'locale')

Get Merchant Services

The Get Merchants Services operation enables an integrated 3rd party to utilize the Paga platform to obtain a list of registered services and service details for a given registered merchant on the Paga platform, typically for use in parameterizing the merchant payment operation. To make use of this method, call the getMerchantServices method inside the BusinessClient Library which will return a Paga Response for the get Merchant services method.

response = business_client.get_merchant_services('reference_number',
                                                 'merchant_public_id',
                                                 'locale')

Get Banks

The Get Banks operation enables an integrated 3rd party to utilize the Paga platform to obtain a list of available banks on the Paga platform, typically for use in parameterizing the deposit to bank operation. To make use of this method, call the getBanks method inside the BusinessClient Library which will return Paga Response for the get banks method

response = business_client.get_banks('reference_number', 'locale')

Get Operation Status

The Get Operation Status operation allows an integrated 3rd party to check on the status of a previous operation using the operation's reference number. To make use of this method, call the getOperationStatus method inside the BusinessClient Library which will return Paga Response for the get operation status method.

response = business_client.get_operation_status('reference_number', 'locale')

Get Mobile Operators

The Get Mobile Operators operation enables an integrated 3rd party to utilize the Paga platform to obtain a list of available mobile operators on the Paga platform, typically for use in parameterizing the various operations of the business API. To make use of this method, call the getMobileOperators method inside the BusinessClient Library which will return a Paga Response

response = business_client.get_mobile_operators('reference_number', 'locale')

Onboard Merchant

The Onboard Merchant operation, allows Aggregator Organisations to create sub-organizations on the paga platform.

response = business_client.onboard_merchant('reference_number',
                                            'merchant_external_id',
                                            'name',                                                                           "description",
                                            "address_line1",
                                            "address_line2",
                                            "address_city",
                                            "address_state",
                                            "address_zip",
                                            "address_country",
                                            "first_name",
                                            "last_name",
                                            "date_of_birth",
                                            "phone",
                                            "email",
                                            "established_date",
                                            "website_url",
                                            "display_name",
                                            "type",
                                            "finance_admin_email")

What’s Next