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

ActiveLibrary[Payment Processing](/categories/payments)

cashkdiopen/payments
====================

Laravel package for unified payment integration with Orange Money, MTN MoMo, and Bank Cards in Africa

04PHP

Since Sep 3Pushed 8mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Cashkdiopen Payments Package
============================

[](#cashkdiopen-payments-package)

[![Latest Version](https://camo.githubusercontent.com/e4e69f4ba966cff882db4ae5892bb57bd04ccbbef7fca27d10511ae1c0c23a04/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636173686b64696f70656e2f7061796d656e74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cashkdiopen/payments)[![Total Downloads](https://camo.githubusercontent.com/2ed6530075b618cb456de191e946c3ec8384d7c2039ac8ef14f0752cb38e6db5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636173686b64696f70656e2f7061796d656e74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/cashkdiopen/payments)[![Tests](https://camo.githubusercontent.com/25f8fbf75c29885e3f4d9c708a0a214e3172c4a2161005bedaefcc6a8b52b3a8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f636173686b64696f70656e2f7061796d656e74732f74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/cashkdiopen/payments/actions)[![License](https://camo.githubusercontent.com/a8580487c49bbacd0cebf5108a49bc3aa454b8ce02a477675fcd8c45d96ee1c2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636173686b64696f70656e2f7061796d656e74732e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

A modern Laravel package for unified payment integration with African mobile money providers and bank cards. Supports Orange Money, MTN Mobile Money, and major card networks with a single, elegant API.

🚀 Features
----------

[](#-features)

- **Unified API** for multiple payment providers
- **Laravel Native** with ServiceProvider, Artisan commands, and migrations
- **Secure Webhooks** with HMAC signature validation
- **Comprehensive Testing** with PHPUnit and Pest
- **Type Safety** with full PHP 8.2+ support
- **Production Ready** with monitoring and error handling

📋 Supported Providers
---------------------

[](#-supported-providers)

ProviderStatusMethods**Orange Money**✅Mobile Money**MTN Mobile Money**✅Mobile Money**Bank Cards**✅Visa, Mastercard**Moov Money**🔄Coming Soon📦 Installation
--------------

[](#-installation)

Install the package via Composer:

```
composer require cashkdiopen/payments
```

Publish the configuration and run migrations:

```
php artisan vendor:publish --provider="Cashkdiopen\\Payments\\CashkdiopenServiceProvider"
php artisan migrate
```

⚙️ Configuration
----------------

[](#️-configuration)

Configure your environment variables in `.env`:

```
# API Configuration
CASHKDIOPEN_API_KEY=ck_live_your_api_key_here
CASHKDIOPEN_WEBHOOK_SECRET=whk_your_webhook_secret_here
CASHKDIOPEN_ENVIRONMENT=production

# Provider Settings
ORANGE_MONEY_CLIENT_ID=your_client_id
ORANGE_MONEY_CLIENT_SECRET=your_client_secret
ORANGE_MONEY_WEBHOOK_SECRET=your_webhook_secret

MTN_MOMO_API_USER=your_api_user
MTN_MOMO_API_KEY=your_api_key
MTN_MOMO_SUBSCRIPTION_KEY=your_subscription_key
```

🎯 Quick Start
-------------

[](#-quick-start)

### Create a Payment

[](#create-a-payment)

```
use Cashkdiopen\\Payments\\Facades\\Cashkdiopen;

$payment = Cashkdiopen::createPayment([
    'amount' => 10000, // Amount in cents (100.00 XOF)
    'currency' => 'XOF',
    'method' => 'orange_money',
    'customer_phone' => '+22607123456',
    'description' => 'Order #12345',
    'callback_url' => route('webhooks.cashkdiopen'),
    'return_url' => route('payment.success'),
    'metadata' => [
        'order_id' => '12345',
        'customer_id' => '67890',
    ]
]);

// Redirect user to payment page
return redirect($payment->redirect_url);
```

### Handle Webhooks

[](#handle-webhooks)

```
// routes/web.php
Route::post('/webhooks/cashkdiopen', [WebhookController::class, 'handle'])
    ->name('webhooks.cashkdiopen')
    ->withoutMiddleware(['web', 'csrf']);

// app/Http/Controllers/WebhookController.php
use Cashkdiopen\\Payments\\Http\\Middleware\\ValidateWebhookSignature;

class WebhookController extends Controller
{
    public function __construct()
    {
        $this->middleware(ValidateWebhookSignature::class);
    }

    public function handle(Request $request)
    {
        $payload = $request->all();

        switch ($payload['event']) {
            case 'payment.succeeded':
                $this->handlePaymentSuccess($payload['data']);
                break;

            case 'payment.failed':
                $this->handlePaymentFailure($payload['data']);
                break;
        }

        return response('OK', 200);
    }

    private function handlePaymentSuccess($paymentData)
    {
        $orderId = $paymentData['metadata']['order_id'];

        // Update your order status
        Order::where('id', $orderId)->update([
            'status' => 'paid',
            'payment_reference' => $paymentData['provider_reference'],
            'paid_at' => now(),
        ]);

        // Send confirmation email, etc.
    }
}
```

### Check Payment Status

[](#check-payment-status)

```
$payment = Cashkdiopen::getPayment('txn_01J5XYZABC123');

if ($payment->status === 'success') {
    // Payment confirmed
    $this->fulfillOrder($payment->metadata['order_id']);
}
```

🛠️ Advanced Usage
-----------------

[](#️-advanced-usage)

### Custom Provider Configuration

[](#custom-provider-configuration)

```
// config/cashkdiopen.php
return [
    'default_provider' => 'orange_money',

    'providers' => [
        'orange_money' => [
            'base_url' => env('ORANGE_MONEY_BASE_URL'),
            'client_id' => env('ORANGE_MONEY_CLIENT_ID'),
            'client_secret' => env('ORANGE_MONEY_CLIENT_SECRET'),
            'timeout' => 30,
        ],

        'mtn_momo' => [
            'base_url' => env('MTN_MOMO_BASE_URL'),
            'api_user' => env('MTN_MOMO_API_USER'),
            'api_key' => env('MTN_MOMO_API_KEY'),
            'subscription_key' => env('MTN_MOMO_SUBSCRIPTION_KEY'),
            'timeout' => 30,
        ],
    ],
];
```

### Event Listeners

[](#event-listeners)

```
// app/Providers/EventServiceProvider.php
use Cashkdiopen\\Payments\\Events\\PaymentSucceeded;
use App\\Listeners\\SendPaymentConfirmation;

protected $listen = [
    PaymentSucceeded::class => [
        SendPaymentConfirmation::class,
    ],
];
```

### Artisan Commands

[](#artisan-commands)

```
# Generate API key for a user
php artisan cashkdiopen:generate-key user@example.com --name="Production API" --environment=production

# Clean up expired transactions
php artisan cashkdiopen:cleanup --days=30

# Sync payment statuses
php artisan cashkdiopen:sync-status --provider=orange_money
```

🧪 Testing
---------

[](#-testing)

The package includes comprehensive tests. Run them with:

```
# Run all tests
composer test

# Run with coverage
composer test-coverage

# Run specific test suite
vendor/bin/pest --filter=PaymentCreationTest
```

### Mock Payments in Tests

[](#mock-payments-in-tests)

```
use Cashkdiopen\\Payments\\Testing\\CashkdiopenFake;

public function test_payment_creation()
{
    CashkdiopenFake::fake();

    $payment = Cashkdiopen::createPayment([
        'amount' => 1000,
        'currency' => 'XOF',
        'method' => 'orange_money',
        // ... other parameters
    ]);

    CashkdiopenFake::assertPaymentCreated($payment->id);
}
```

🚀 Production Deployment
-----------------------

[](#-production-deployment)

### Security Checklist

[](#security-checklist)

- Store API keys in environment variables
- Use HTTPS for all webhooks
- Validate webhook signatures
- Implement proper error logging
- Set up monitoring and alerts

### Performance Optimization

[](#performance-optimization)

```
// Cache payment status for 5 minutes
$status = Cache::remember("payment_status_{$paymentId}", 300, function () use ($paymentId) {
    return Cashkdiopen::getPaymentStatus($paymentId);
});

// Queue webhook processing
dispatch(new ProcessPaymentWebhookJob($webhookPayload));
```

📚 Documentation
---------------

[](#-documentation)

- [Installation Guide](https://docs.cashkdiopen.com/installation)
- [API Reference](https://docs.cashkdiopen.com/api)
- [Webhook Guide](https://docs.cashkdiopen.com/webhooks)
- [Testing Guide](https://docs.cashkdiopen.com/testing)
- [Migration Guide](https://docs.cashkdiopen.com/migration)

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please read our [Contributing Guide](CONTRIBUTING.md) for details.

### Development Setup

[](#development-setup)

```
git clone https://github.com/cashkdiopen/payments.git
cd payments
composer install
cp .env.example .env
vendor/bin/pest
```

📄 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

💬 Support
---------

[](#-support)

- **Documentation**: [docs.cashkdiopen.com](https://docs.cashkdiopen.com)
- **Issues**: [GitHub Issues](https://github.com/cashkdiopen/payments/issues)
- **Discussions**: [GitHub Discussions](https://github.com/cashkdiopen/payments/discussions)
- **Email**:

🙏 Credits
---------

[](#-credits)

- **Cashkdi Team** - *Initial work* - [Cashkdi](https://github.com/cashkdi)
- **All Contributors** - [Contributors](https://github.com/cashkdiopen/payments/contributors)

---

Made with ❤️ by [Cashkdi](https://cashkdi.com) for African developers

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance43

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![fokouarnaud](https://avatars.githubusercontent.com/u/30840421?v=4)](https://github.com/fokouarnaud "fokouarnaud (12 commits)")

### Embed Badge

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

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

###  Alternatives

[omnipay/paypal

PayPal gateway for Omnipay payment processing library

3156.8M53](/packages/omnipay-paypal)[eduardokum/laravel-boleto

Biblioteca com boletos para o laravel

626351.9k2](/packages/eduardokum-laravel-boleto)[tbbc/money-bundle

This is a Symfony bundle that integrates moneyphp/money library (Fowler pattern): https://github.com/moneyphp/money.

1961.9M](/packages/tbbc-money-bundle)[2checkout/2checkout-php

2Checkout PHP Library

83740.3k2](/packages/2checkout-2checkout-php)[smhg/sepa-qr-data

Generate QR code data for SEPA payments

61717.2k5](/packages/smhg-sepa-qr-data)[omnipay/dummy

Dummy driver for the Omnipay payment processing library

271.2M33](/packages/omnipay-dummy)

PHPackages © 2026

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