PHPackages                             radioafricagroup/direct-pay-online-php - 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. [API Development](/categories/api)
4. /
5. radioafricagroup/direct-pay-online-php

ActiveLibrary[API Development](/categories/api)

radioafricagroup/direct-pay-online-php
======================================

Unofficial Updated Direct Pay Online API Wrapper

v5.5(2y ago)01.1k—0%MITPHPPHP &gt;=5.6.36

Since Nov 9Pushed 2y agoCompare

[ Source](https://github.com/Radioafricagroup/direct-pay-online-php)[ Packagist](https://packagist.org/packages/radioafricagroup/direct-pay-online-php)[ Docs](https://radioafricagroup.co.ke)[ RSS](/packages/radioafricagroup-direct-pay-online-php/feed)WikiDiscussions main Synced today

READMEChangelog (1)DependenciesVersions (24)Used By (0)

Direct Pay Online API Wrapper for PHP
=====================================

[](#direct-pay-online-api-wrapper-for-php)

[![Latest Stable Version](https://camo.githubusercontent.com/1c937ae04fa042da469853632598498884a33ddeb390c598aea148b49cf193bc/68747470733a2f2f706f7365722e707567782e6f72672f7261672f6469726563742d7061792d6f6e6c696e652d7068702f76)](https://packagist.org/packages/rag/direct-pay-online-php)[![Total Downloads](https://camo.githubusercontent.com/cb402e5703768b53059c904a01eeb9ef596ffcdc6470e51677181a62cc546390/68747470733a2f2f706f7365722e707567782e6f72672f7261672f6469726563742d7061792d6f6e6c696e652d7068702f646f776e6c6f616473)](https://packagist.org/packages/rag/direct-pay-online-php)

Unofficial PHP wrapper for [Direct Pay Online API](https://directpayonline.atlassian.net/wiki/spaces/API/overview)

Inspired by [dipnot/direct-pay-online-php](https://github.com/radioafricagroup/direct-pay-online-php)

Dependencies
------------

[](#dependencies)

- PHP 5.6.36 or higher
- ext-curl
- ext-simplexml
- ext-json

Installation
------------

[](#installation)

You can install via [Composer](https://getcomposer.org/).

```
composer require radioafricagroup/direct-pay-online-php

```

Usage
-----

[](#usage)

You can see the full example in [examples](https://github.com/radioafricagroup/direct-pay-online-php/tree/main/examples) folder.

### Config

[](#config)

All request are needs a Config.

```
use Rag\DirectPayOnline\Config;

$config = new Config();
$config->setCompanyToken("9F416C11-127B-4DE2-AC7F-D5710E4C5E0A");
$config->setTestMode(true);
```

### Transaction

[](#transaction)

```
use Rag\DirectPayOnline\Model\Transaction;

$transaction = new Transaction(100, "USD");
```

### Service

[](#service)

```
use Rag\DirectPayOnline\Model\Service;

$service = new Service("Test Product", 3854, "2020/02/12 11:21");
```

### "createToken" Request

[](#createtoken-request)

Create a token to start payment process.

```
use Rag\DirectPayOnline\Request\CreateTokenRequest;

$createTokenRequest = new CreateTokenRequest($config);
$createTokenRequest->setTransaction($transaction);
$createTokenRequest->addService($service1);
$createTokenRequest->addService($service2);
$createToken = $createTokenRequest->execute();
print_r($createToken);
```

### "verifyToken" Request

[](#verifytoken-request)

Get the payment result by using VerifyTokenRequest.

```
use Rag\DirectPayOnline\Request\VerifyTokenRequest;

$verifyTokenRequest = new VerifyTokenRequest($config);
$verifyTokenRequest->setTransactionToken($_GET["TransactionToken"]);
$verifyToken = $verifyTokenRequest->execute();
print_r($verifyToken);
```

### Getting the payment URL

[](#getting-the-payment-url)

Get the payment URL with the created token to redirect the user to the payment page.

```
$paymentUrl = $createTokenRequest->getPaymentUrl($createToken["TransToken"]);
print_r($paymentUrl);
```

### Recurrent Payments

[](#recurrent-payments)

### Step 1

[](#step-1)

Fetch subscription tokens for users.

```
$getSubscriptionTokenRequest = new GetSubscriptionTokenRequest($config);
$getSubscriptionTokenRequest->setSearchCriteria($searchCriteriaSearch);
$getSubscriptionTokenRequest->setSearchCriteriaValue($searchCriteriaSearchValue);
$getSubscriptionToken = $getSubscriptionTokenRequest->execute();
print_r($getSubscriptionToken);
```

Test values
-----------

[](#test-values)

You can fill the personal info randomly in the payment page.

ValueCompany token9F416C11-127B-4DE2-AC7F-D5710E4C5E0ACard number5436886269848367Card expiry date (Month/Year)12/22Card CVV123License
-------

[](#license)

[![License: MIT](https://camo.githubusercontent.com/9d5d73228024488e29bb85f36ef2cd3c20dba1cd3b66b02fda3d53148f48d575/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d253233326664636666)](https://github.com/radioafricagroup/direct-pay-online-php/blob/main/LICENSE)

###  Health Score

29

—

LowBetter than 63% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 54.4% 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 ~47 days

Recently: every ~0 days

Total

23

Last Release

914d ago

Major Versions

v1.0 → v2.02020-11-09

v2.1 → v3.02021-12-16

v3.0 → v4.02022-12-20

v4.12 → v5.02023-09-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/fdfe5ac9f2d186e2c61c692c3719afad6baa01ad0afdccb3835a285aba66abaa?d=identicon)[digital.developer@radioafricagroup.co.ke](/maintainers/digital.developer@radioafricagroup.co.ke)

---

Top Contributors

[![ozgurg](https://avatars.githubusercontent.com/u/6717356?v=4)](https://github.com/ozgurg "ozgurg (31 commits)")[![tirasmuturi](https://avatars.githubusercontent.com/u/20064049?v=4)](https://github.com/tirasmuturi "tirasmuturi (26 commits)")

---

Tags

apidpopayment systemdirect pay onlinerecurrent payments

### Embed Badge

![Health badge](/badges/radioafricagroup-direct-pay-online-php/health.svg)

```
[![Health](https://phpackages.com/badges/radioafricagroup-direct-pay-online-php/health.svg)](https://phpackages.com/packages/radioafricagroup-direct-pay-online-php)
```

###  Alternatives

[m165437/laravel-blueprint-docs

API Blueprint Renderer for Laravel

22778.7k](/packages/m165437-laravel-blueprint-docs)

PHPackages © 2026

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