Python Library

Merchant Service Library

Merchant Services is a Python module that helps you make API calls when processing Paga Transactions.

1. Installation

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

2. Usage

To use merchant_client, you would need to import it

import merchant_rest_service

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 Getting started

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

merchant_client = MerchantClientCore(principal, api_key, credential,test)

📘

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. Merchant Service Methods

Get Transaction Details

To verify the status and details of an executed process or to determine if a transaction was indeed executed on the system using the pre-shared transaction reference number, you call getTransactionDetails method in merchant_client and it returns a JSON.

response = merchant_client.get_transaction_details("reference_number")

Get Transaction Details by Invoice Number

To verify the status and details of an executed process or to determine if a transaction was indeed executed on the system using the pre-shared transaction invoice number, call getTransactionDetailByInvoiceNumber method in merchant_client and it returns a JSON.

response = merchant_client.get_transaction_details_by_invoice_number("invoice_number")

Get Process Details

To determine if a process was indeed executed on the system using the pre-shared process code, call getProcessDetail method in merchant_client and it returns a JSON.

response = merchant_client.get_process_details("process_code")

Reconciliation Report

To retrieve reconciled reports on the date range provided containing a list of processes and transactions call getReconcilationReport method in merchant_client and it returns a JSON.

response = merchant_client.get_reconciliation_report("start_date", "end_date")

Get Foreign Exchange Rate

To determine the exchange rate call getForeignExchange method in merchant_client and it returns a JSON.

response = merchant_client.get_foreign_exchange("base_currency","foreign_currency")

Refund Bill Pay

To fully or partially refund bill payment previously made by a customer call refundBillPay method in merchant_client and it returns a JSON.

response = merchant_client.refund_bill("reference_number", "include_customer_fee", "full_refund","refund_amount", "currency_code","reason", "customer_phone_number")

What’s Next