The Paga Developer Documentation

Welcome to the Paga API documentation. Our APIs and libraries are written to help you integrate payment in your products in matter of minutes. We have step by step guides to enable you get started.

Get Started    

PHP Library

Merchant Service

Merchant Service is a PHP module that helps you make API calls when processing Paga Transactions.

1. Create Paga account

You need to create a Paga business account

2. Installation

 composer require paga/paga-merchant

3. Usage

To use MerchantServiceClient, you would need to import it

require_once __DIR__ .'/vendor/autoload.php

To Initialize the class, use your Paga api key, secret(password), clientId(public id) and isTest flag (true or false). To get your Paga API key, click on Getting started

use PagaMerchant\PagaMerchantServiceClient;
$merchantServiceClient = PagaMerchantServiceClient::builder()
    ->setApiKey("<apiKey>")
    ->setPrincipal("<clientId>")
    ->setCredential("<password>")
    ->setTest(true)
    ->build();

📘

Note

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

4. Merchant Service Method

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 function in PagaMerchantServiceClient and it returns a JSON.

$response=$merchantServiceClient -> getTransactionDetails("<referenceNumber>");

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 getTransactionDetailsByInvoiceNumber method in PagaMerchantServiceClient and it returns a JSON.

$response=$merchantServiceClient -> getTransactionDetailsByInvoiceNumber("<invoice_Number>");

Get Process Details

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

$response=$merchantServiceClient -> getProcessDetails("<process_code>");

Reconciliation Report

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

$response=$merchantServiceClient -> reconciliationReport('2015-01-30','2016-01-30');

Get Foreign Exchange Rate

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

$response=$merchantServiceClient -> getForeignExchangeRate('NGN','USD');

Refund Bill Pay

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

$response=$merchantServiceClient -> refundBillPay('<reference_Number>','<refund_amount','<customerPhoneNumber>');

Get Transaction Details By Merchant Reference Number

To verify the status and details of an executed transaction or to determine if a transaction was indeed executed on the system using the merchant reference number call getTransactionDetailsByMerchantReference method in PagaMerchantServiceClient and it returns a JSON.

$response = $merchantServiceClient -> 
    getTransactionDetailsByMerchantReferenceNumber('<merchantReference>');

Updated 8 months ago

PHP Library


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.