PHPackages                             mak8tech/dpo-payments - 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. mak8tech/dpo-payments

ActiveLibrary[Payment Processing](/categories/payments)

mak8tech/dpo-payments
=====================

Laravel 12 package for DPO Group payment gateway integration with support for African markets

0.0.1(7mo ago)00MITPHPPHP ^8.3

Since Oct 7Pushed 7mo agoCompare

[ Source](https://github.com/Mak8Tech/dpo-payments)[ Packagist](https://packagist.org/packages/mak8tech/dpo-payments)[ RSS](/packages/mak8tech-dpo-payments/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (2)Used By (0)

Mak8Tech DPO Payment Package for Laravel 12
===========================================

[](#mak8tech-dpo-payment-package-for-laravel-12)

A comprehensive Laravel 12 package for integrating DPO (Direct Pay Online) payment gateway with support for African markets, focusing primarily on Zambia but with configurable support for 15+ African countries.

Features
--------

[](#features)

- ✅ **One-time Payments**: Process single transactions with card and mobile money options
- ✅ **Recurring Subscriptions**: Monthly, quarterly, and yearly subscription management
- ✅ **Multi-Country Support**: Pre-configured for 15+ African countries
- ✅ **Multiple Payment Methods**: Credit/debit cards and country-specific mobile money
- ✅ **Admin Dashboard**: Blade components for transaction and subscription management
- ✅ **React Components**: Ready-to-use components for Next.js integration
- ✅ **Comprehensive Logging**: Track all payment activities
- ✅ **Event System**: Hook into payment lifecycle events
- ✅ **Refunds &amp; Cancellations**: Full payment management capabilities

Supported Countries
-------------------

[](#supported-countries)

CountryCurrencyMobile MoneyRecurringZambiaZMWAirtel Money, MTN MoMo, Zamtel Kwacha✅KenyaKESM-Pesa, Airtel Money✅TanzaniaTZSM-Pesa, Airtel Money, Tigo Pesa, HaloPesa✅UgandaUGXMTN MoMo, Airtel Money✅South AfricaZARCard payments only✅RwandaRWFMTN MoMo, Airtel Money✅NigeriaNGNCard payments only✅GhanaGHSMTN MoMo, Vodafone Cash, AirtelTigo Money✅ZimbabweUSDEcoCash, OneMoney✅| And 6+ more countries...

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require mak8tech/dpo-payments
```

### 2. Publish Configuration

[](#2-publish-configuration)

```
php artisan vendor:publish --provider="Mak8Tech\DpoPayments\DpoPaymentServiceProvider"
```

### 3. Configure Environment Variables

[](#3-configure-environment-variables)

Add to your `.env` file:

```
DPO_COMPANY_TOKEN=your-company-token
DPO_SERVICE_TYPE=3854
DPO_TEST_MODE=true
DPO_DEFAULT_COUNTRY=ZM
DPO_DEFAULT_CURRENCY=ZMW
```

### 4. Run Migrations

[](#4-run-migrations)

```
php artisan migrate
```

### 5. (Optional) Publish Assets

[](#5-optional-publish-assets)

For Blade views:

```
php artisan vendor:publish --provider="Mak8Tech\DpoPayments\DpoPaymentServiceProvider" --tag="dpo-views"
```

For React components:

```
php artisan vendor:publish --provider="Mak8Tech\DpoPayments\DpoPaymentServiceProvider" --tag="dpo-react"
```

Quick Start
-----------

[](#quick-start)

### Creating a Payment

[](#creating-a-payment)

```
use Mak8Tech\DpoPayments\Facades\DpoPayment;

// Create a one-time payment
$transaction = DpoPayment::createPayment([
    'amount' => 100.00,
    'currency' => 'ZMW',
    'country' => 'ZM',
    'customer_email' => 'customer@example.com',
    'customer_name' => 'John Doe',
    'description' => 'Purchase of Product X',
]);

// Redirect to payment URL
return redirect($transaction->payment_url);
```

### Creating a Subscription

[](#creating-a-subscription)

```
use Mak8Tech\DpoPayments\Services\SubscriptionService;

$subscriptionService = app(SubscriptionService::class);

$subscription = $subscriptionService->createSubscription([
    'amount' => 50.00,
    'frequency' => 'monthly',
    'currency' => 'ZMW',
    'country' => 'ZM',
    'customer_email' => 'subscriber@example.com',
    'customer_name' => 'Jane Doe',
    'start_date' => now()->addDay(),
]);
```

### Handling Callbacks

[](#handling-callbacks)

The package automatically handles callbacks at `/dpo/callback`. You can listen to events:

```
// In your EventServiceProvider
use Mak8Tech\DpoPayments\Events\PaymentSuccessful;
use Mak8Tech\DpoPayments\Events\PaymentFailed;

protected $listen = [
    PaymentSuccessful::class => [
        SendPaymentConfirmation::class,
        UpdateUserSubscription::class,
    ],
    PaymentFailed::class => [
        NotifyPaymentFailure::class,
    ],
];
```

Blade Components
----------------

[](#blade-components)

### Payment Form Component

[](#payment-form-component)

```

```

### Transaction Table Component

[](#transaction-table-component)

```

```

### Subscription Manager Component

[](#subscription-manager-component)

```

```

React Components for Next.js
----------------------------

[](#react-components-for-nextjs)

### Installation in Next.js

[](#installation-in-nextjs)

1. Copy the React components to your Next.js project:

```
cp -r vendor/mak8tech/dpo-payments/resources/js/components/* components/dpo/
```

2. Install required dependencies:

```
npm install lucide-react
```

### Usage in Next.js

[](#usage-in-nextjs)

```
import { DpoPaymentForm, DpoPaymentStatus, DpoSubscriptionSignup } from '@/components/dpo';

// Payment Form
export default function PaymentPage() {
    return (
         {
                window.location.href = data.payment_url;
            }}
            apiEndpoint="/api/dpo/payments"
        />
    );
}

// Subscription Signup
export default function SubscriptionPage() {
    const plans = [
        { id: 1, name: 'Basic', amount: 50, currency: 'ZMW', features: ['Feature 1', 'Feature 2'] },
        { id: 2, name: 'Pro', amount: 100, currency: 'ZMW', features: ['All Basic', 'Feature 3'] },
    ];

    return (
         console.log('Subscription created:', data)}
        />
    );
}
```

API Endpoints
-------------

[](#api-endpoints)

### Payments

[](#payments)

- `POST /api/dpo/payments` - Create payment
- `GET /api/dpo/payments/{reference}/status` - Get payment status
- `POST /api/dpo/payments/{reference}/refund` - Process refund
- `POST /api/dpo/payments/{reference}/cancel` - Cancel payment

### Subscriptions

[](#subscriptions)

- `POST /api/dpo/subscriptions` - Create subscription
- `GET /api/dpo/subscriptions/{reference}` - Get subscription details
- `PUT /api/dpo/subscriptions/{reference}` - Update subscription
- `POST /api/dpo/subscriptions/{reference}/cancel` - Cancel subscription
- `POST /api/dpo/subscriptions/{reference}/pause` - Pause subscription
- `POST /api/dpo/subscriptions/{reference}/resume` - Resume subscription

### Utility

[](#utility)

- `GET /api/dpo/countries` - Get supported countries

Admin Dashboard
---------------

[](#admin-dashboard)

Access the admin dashboard at `/dpo/admin` (requires authentication).

Features:

- Transaction management with filtering and search
- Subscription overview and management
- Revenue reports by country and currency
- Payment success/failure analytics
- Export capabilities

Artisan Commands
----------------

[](#artisan-commands)

### Check DPO Status

[](#check-dpo-status)

```
php artisan dpo:status
```

### Process Due Subscriptions

[](#process-due-subscriptions)

```
php artisan dpo:status --process-subscriptions
```

Set up a cron job for automatic processing:

```
0 0 * * * cd /path-to-your-app && php artisan dpo:status --process-subscriptions >> /dev/null 2>&1
```

Testing
-------

[](#testing)

### Running Tests

[](#running-tests)

```
composer test
```

### Test Mode

[](#test-mode)

Enable test mode in your `.env`:

```
DPO_TEST_MODE=true
```

This will use DPO's sandbox environment for testing.

Advanced Usage
--------------

[](#advanced-usage)

### Custom Payment Flow

[](#custom-payment-flow)

```
use Mak8Tech\DpoPayments\Services\DpoService;
use Mak8Tech\DpoPayments\Data\TransactionData;

$dpoService = app(DpoService::class);

$transactionData = new TransactionData(
    amount: 150.00,
    currency: 'ZMW',
    reference: 'CUSTOM-REF-123',
    description: 'Custom Payment',
    customerEmail: 'customer@example.com',
    customerName: 'John Doe',
    customerPhone: '+260977123456',
    customerCountry: 'ZM',
    services: [
        ['description' => 'Service 1', 'date' => now()->format('Y/m/d H:i')],
        ['description' => 'Service 2', 'date' => now()->format('Y/m/d H:i')],
    ],
    isRecurring: false
);

$tokenResponse = $dpoService->createToken($transactionData);

if ($tokenResponse->isSuccessful()) {
    // Process payment
}
```

### Multi-Currency Operations

[](#multi-currency-operations)

```
use Mak8Tech\DpoPayments\Services\CountryService;

$countryService = app(CountryService::class);

// Get all countries that support recurring payments
$recurringCountries = $countryService->getRecurringCountries();

// Get currency for a specific country
$currency = $countryService->getCurrencyForCountry('KE'); // Returns 'KES'

// Format currency amount
$formatted = $countryService->formatCurrency(1000.50, 'ZMW'); // Returns 'K 1,000.50'
```

### Webhook Security

[](#webhook-security)

The package automatically validates webhook callbacks. You can add additional IP whitelisting:

```
// config/dpo.php
'allowed_ips' => [
    '41.77.245.104',  // DPO IP addresses
    '41.77.245.105',
],
```

Troubleshooting
---------------

[](#troubleshooting)

### Common Issues

[](#common-issues)

1. **Token Creation Failed**

    - Verify your company token is correct
    - Check if test mode matches your DPO account type
    - Ensure amount is greater than 0
2. **Recurring Payments Not Working**

    - Confirm the country supports recurring payments
    - Verify PaySubs is enabled on your DPO account
    - Check subscription start date is in the future
3. **Mobile Money Not Appearing**

    - Ensure the selected country supports mobile money
    - Verify mobile money is enabled for your merchant account
    - Check that the currency matches the country

### Debug Mode

[](#debug-mode)

Enable detailed logging:

```
// config/dpo.php
'logging' => [
    'enabled' => true,
    'channel' => 'dpo', // Create custom channel in config/logging.php
],
```

Security
--------

[](#security)

- Never expose your company token in frontend code
- Always validate webhook callbacks
- Use HTTPS in production
- Implement rate limiting on payment endpoints
- Regular security updates

Support
-------

[](#support)

For issues and questions:

- GitHub Issues: [github.com/mak8tech/dpo-payments](https://github.com/mak8tech/dpo-payments)
- Email:
- Documentation: [docs.mak8tech.com/dpo-payments](https://docs.mak8tech.com/dpo-payments)

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](LICENSE.md).

Credits
-------

[](#credits)

- Developed by Mak8Tech
- DPO Group for payment gateway services
- Laravel community for framework support

Changelog
---------

[](#changelog)

### v0.0.1 (2025-10-05)

[](#v001-2025-10-05)

- Initial release
- Support for 15+ African countries
- One-time and recurring payments
- Admin dashboard
- React components for Next.js
- Comprehensive test suite

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance64

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

215d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/116803ec73acffc494c4cc854e7bc914891224a72eef6960ce360cd46b234470?d=identicon)[makusa-the](/maintainers/makusa-the)

---

Top Contributors

[![makusa-the](https://avatars.githubusercontent.com/u/24973307?v=4)](https://github.com/makusa-the "makusa-the (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mak8tech-dpo-payments/health.svg)

```
[![Health](https://phpackages.com/badges/mak8tech-dpo-payments/health.svg)](https://phpackages.com/packages/mak8tech-dpo-payments)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.2M720](/packages/statamic-cms)[lemonsqueezy/laravel

A package to easily integrate your Laravel application with Lemon Squeezy.

58596.1k](/packages/lemonsqueezy-laravel)[shetabit/multipay

PHP Payment Gateway Integration Package

291348.2k3](/packages/shetabit-multipay)[imdhemy/google-play-billing

Google Play Billing

491.3M5](/packages/imdhemy-google-play-billing)[glennraya/xendivel

A Laravel package to easily integrate Xendit payment gateway. It supports credit and debit cards, and e-wallet payments and custom invoices, queued notifications, webhook listeners and more.

412.3k](/packages/glennraya-xendivel)[tsaiyihua/laravel-linepay

linepay library for laravel

102.9k](/packages/tsaiyihua-laravel-linepay)

PHPackages © 2026

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