PHPackages                             paga/paga-collect - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. paga/paga-collect

ActiveLibrary[Payment Processing](/categories/payments)

paga/paga-collect
=================

This document lists the different RESTful web services Paga offers allowing anyone (payment request initiator) to initiate a payment request to a third party and automatically get notified when the payment request is fulfilled

v1.1.2(4y ago)01.6k3[1 PRs](https://github.com/Paga-Developer-Community/paga-collect-php-lib/pulls)MITPHPPHP &gt;=5.3.3

Since May 20Pushed 3y agoCompare

[ Source](https://github.com/Paga-Developer-Community/paga-collect-php-lib)[ Packagist](https://packagist.org/packages/paga/paga-collect)[ Docs](https://github.com/Paga-Developer-Community/paga-collect-php-lib)[ RSS](/packages/paga-paga-collect/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (7)Used By (0)

Paga Collect PHP API Library v1.1.2
===================================

[](#paga-collect-php-api-library-v112)

Business Services exposed by the library
----------------------------------------

[](#business-services-exposed-by-the-library)

- paymentRequest
- getBanks
- paymentStatus
- paymentHistory
- registerPersistentPaymentAccount
- updatePersistentPaymentAccount
- deletePersistentPaymentAccount
- paymentRequestFund
- getPersistentPaymentAccount

For more information on the services listed above, visit the [Paga DEV website](https://developer-docs.paga.com/docs/php-library-1)

How to use
----------

[](#how-to-use)

`composer require paga/paga-collect`

```
require_once __DIR__ .'/vendor/autoload.php'

$collectClient = PagaCollectClient::builder()
                ->setApiKey("")
                ->setClientId("")
                ->setPassword("")
                ->setTest(true)
                ->build();

```

As shown above, you set the publicId, apiKey, password given to you by Paga, If you pass true as the value for setIsTest(), the library will use the test url as the base for all calls. Otherwise setting it to false will use the live url value you **pass** as the base.

### Paga Collect Service Functions

[](#paga-collect-service-functions)

**Request Payment**

Registers a new request for payment between a payer and a payee. Once a payment request is initiated successfully, the payer is notified by the platform (this can be suppressed) and can proceed to authorize/execute the payment. Once the payment is fulfilled, a notification is sent to the supplied callback URL.

To make use of this function, call the **paymentRequest** inside PagaCollectClient which will return a JSONObject.

```
$data = ["referenceNumber" => "908w1111000001129",
    "amount" => 200,
    "callBackUrl" => "http://localhost:5000/core/webhook/paga",
    "currency" => "NGN",
    "expiryDateTimeUTC" => "2021-05-20T19:35:47",
    "isAllowPartialPayments" => false,
    "isSuppressMessages" => false,
    "payee" => ["bankAccountNumber"=>"XXXXXXXXX",
              "bankId" => "XXXXX-XXX-XXX-XXX-XXXXXX",
              "name" => "John Doe",
              "phoneNumber" => "XXXXXXXXXXX",
            "accountNumber" => "XXXXXXXXXXX"],
    "payer" => ["email" => "johndoe@gmail.com",
                "name"=> "Foo Bar",
                "bankId"=> "XXXXX-XXX-XXX-XXX-XXXXXX",
      ],
    "payerCollectionFeeShare"=> 1.0,
    "recipientCollectionFeeShare"=> 0.0,
    "paymentMethods"=> ["BANK_TRANSFER", "FUNDING_USSD"]
    ];

$paymentRequest = $collectClient->paymentRequest($data);$response =

```

**Get Banks**

Retrieve a list of supported banks and their complementary unique ids on the bank. This is required for populating the payer (optional) and payee objects in the payment request model. To make use of this function, call the **getBanks** inside PagaCollectClient which will return a JSONObject.

```
$data = ['referenceNumber' => "234455555"];
$getBanks = $collectAPI ->getBanks($data);

```

**Query Payment Request Status**

Query the current status of a submitted payment request. To make use of this function, call the **paymentStatus** inside PagaCollectClient which will return a JSONObject.

```
$data = ['referenceNumber' => "234455555"];
$paymentStatus = $collectAPI ->paymentStatus($data);

```

**Payment Request History**

Get payment requests for a period between to give start and end dates. The period window should not exceed 1 month. To make use of this function, call the **paymentHistory** inside PagaCollectClient which will return a JSONObject.

```
$data = [
    "referenceNumber" => "8235346400000099",
    "startDateTimeUTC" => "2021-04-21T19:15:22",
    "endDateTimeUTC" => "2021-05-18T19:15:22"
];
$paymentStatus = $collectAPI ->paymentHistory($data);

```

**Register Persistent Payment Account**

An operation for business to create Persistent Payment Account Numbers that can be assigned to their customers for payment collection. To make use of this function, call the **registerPersistentPaymentAccount** inside PagaCollectClient which will return a JSONObject.

```
$data= [
    'referenceNumber'=>"47575685389595",
    'phoneNumber'=>"07048576234",
    'firstName'=>"Ian",
    'lastName'=>"Lankansa",
    'accountName'=>"Ian Lankansa",
    'financialIdentificationNumber'=>"12345484326",
    'accountReference'=>"123407891334",
    'callbackUrl' => "http://localhost:9091/test-callback"
];
$registerPersistentPaymentAccount = $collectAPI ->registerPersistentPaymentAccount($data);

```

**Update Persistent Payment Account**

This endpoint allows for changing any of the account properties except the **accountNumber (NUBAN)** and the **accounReference** properties which cannot be changed. To make use of this function, call the **updatePersistentPaymentAccount** inside PagaCollectClient which will return a JSONObject.

```
$data= [
    'referenceNumber'=>"47575685389595",
    'phoneNumber'=>"07048576234",
    'firstName'=>"Ian",
    'lastName'=>"Lankansa",
    'accountName'=>"Ian Lankansa",
    'accountIdentifier'=>"12345484326",
    'callbackUrl' => "http://localhost:9091/test-callback"
];
$registerPersistentPaymentAccount = $collectAPI ->updatePersistentPaymentAccount($data);

```

**Delete Persistent Payment Account**

This endpoint allows for deleting a persistent payment account. To make use of this function, call the **deletePersistentPaymentAccount** inside PagaCollectClient which will return a JSONObject.

```
$data= [
    'referenceNumber'=>"47575685389595",
    'accountIdentifier'=>"12345484326"
];
$registerPersistentPaymentAccount = $collectAPI ->deletePersistentPaymentAccount($data);

```

**Payment Request Fund**

This end-point can be used to either cancel or initiate a refund if we were unable to fulfill the request for one reason or the other To make use of this function, call the **paymentRequestFund** inside PagaCollectClient which will return a JSONObject.

```
$data= [
    'referenceNumber'=>"47575685389595",
    'accountIdentifier'=>"12345484326"
    'refundAmount'=>500,
    'currency'=> "NGN",
];
$registerPersistentPaymentAccount = $collectAPI ->paymentRequestRefund($data);

```

Changelog
=========

[](#changelog)

\[1.0.0\] - 2021-05-20
----------------------

[](#100---2021-05-20)

### Added

[](#added)

- Implemented endpoints for paga-collect

\[1.0.1\] - 2021-05-25
----------------------

[](#101---2021-05-25)

### Bug fix

[](#bug-fix)

- Updated dependecies
- Removed php-console dependencies

\[1.1.2\] - 2021-10-03
----------------------

[](#112---2021-10-03)

### Added

[](#added-1)

- Implemented updatePersistentPaymentAccount, getPersistentPaymentAccount, deletePersistentPaymentAccount, paymentRequestRefund etc.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~33 days

Total

5

Last Release

1679d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ea84e8167f6558633336e2ade013a53c9e47b7233e3f232ecd6f2c718974b9ff?d=identicon)[pagadevcomm](/maintainers/pagadevcomm)

---

Top Contributors

[![nnamdi16](https://avatars.githubusercontent.com/u/22728994?v=4)](https://github.com/nnamdi16 "nnamdi16 (12 commits)")[![wapnen](https://avatars.githubusercontent.com/u/18328614?v=4)](https://github.com/wapnen "wapnen (2 commits)")

---

Tags

payment-gatewayphppaymentPagapaga-collect

### Embed Badge

![Health badge](/badges/paga-paga-collect/health.svg)

```
[![Health](https://phpackages.com/badges/paga-paga-collect/health.svg)](https://phpackages.com/packages/paga-paga-collect)
```

###  Alternatives

[cybersource/rest-client-php

Client SDK for CyberSource REST APIs

39881.3k6](/packages/cybersource-rest-client-php)[flutterwavedev/flutterwave-v3

A simple SDK for integrating to Flutterwave Payment

24174.1k6](/packages/flutterwavedev-flutterwave-v3)[paymentsuite/paymentsuite

PaymentSuite is an easy implementation for lot of Payment Methods for Symfony projects

2715.5k2](/packages/paymentsuite-paymentsuite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
