PHPackages                             paychangu/laravel - 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. paychangu/laravel

ActiveLibrary[API Development](/categories/api)

paychangu/laravel
=================

Laravel SDK for integrating PayChangu payment services into PHP applications

v1.0.3(4mo ago)818↓50%MITPHPPHP ^8.1 || ^8.2 || ^8.3CI passing

Since Jan 9Pushed 2mo agoCompare

[ Source](https://github.com/Mzati1/PaychanguLaravelSDK)[ Packagist](https://packagist.org/packages/paychangu/laravel)[ Docs](https://github.com/Mzati1/PaychanguLaravelSDK)[ GitHub Sponsors](https://github.com/:vendor_name)[ RSS](/packages/paychangu-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (14)Versions (3)Used By (0)

PayChangu Laravel SDK
=====================

[](#paychangu-laravel-sdk)

[![Latest Version](https://camo.githubusercontent.com/658987bfc623caa4e7439edf5b5f74c54ba0e03341e0c5b5e4135a5d726be321/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7061796368616e67752f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/paychangu/laravel)[![Total Downloads](https://camo.githubusercontent.com/24e1ebf9d0b44d10648eac0d4398c3cbd3f55c574847508c8359a8c83aa3d7fd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7061796368616e67752f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/paychangu/laravel)[![GitHub stars](https://camo.githubusercontent.com/538a1065c6b4d8f6840d63d389386f752c8221b3a8fb670c4c982cfc707b4aa6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f4d7a617469312f5061796368616e67754c61726176656c53444b3f7374796c653d666c61742d737175617265)](https://github.com/Mzati1/PaychanguLaravelSDK)[![License](https://camo.githubusercontent.com/59dea8dcc6c809c52b9ce0a7461263c816ec7ed642077945f89975be33a3927f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7061796368616e67752f6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/paychangu/laravel)

A Laravel SDK for integrating PayChangu payment services. This package simplifies the process of initializing payments (Hosted Checkout, Mobile Money, Card, Bank) and managing payouts, bill payments, and airtime.

> **📚 API Reference**: For complete API documentation, visit [PayChangu Developer Docs](https://developer.paychangu.com/docs/welcome)

Features
--------

[](#features)

- **Hosted Checkout**: Generate checkout URLs for easy payments.
- **Mobile Money**: Charge mobile money wallets (Airtel Money, Mpamba) directly.
- **Card Payments**: Charge cards, verify transactions, and process refunds.
- **Direct Charge (Bank)**: Initiate bank transfers.
- **Payouts**: Send money to mobile money wallets and bank accounts.
- **Bill Payments**: Validate and pay bills (LWB, ESCOM, etc.).
- **Airtime**: Recharge airtime (TNM, Airtel).
- **Verification**: Verify transactions across all services.
- **Virtual Accounts (USD)**: Manage customers and US virtual accounts.

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

[](#installation)

You can install the package via composer:

```
composer require paychangu/laravel
```

Publish the config file:

```
php artisan vendor:publish --tag="paychangu-config"
```

This is the contents of the published config file:

```
return [
    /*
    |--------------------------------------------------------------------------
    | PayChangu API Private Key
    |--------------------------------------------------------------------------
    |
    | This is the private key used to authenticate with the PayChangu API.
    |
    */
    'private_key' => env('PAYCHANGU_API_PRIVATE_KEY'),

    /*
    |--------------------------------------------------------------------------
    | PayChangu API Base URL
    |--------------------------------------------------------------------------
    |
    | This is the root URL for the PayChangu API.
    | Specific endpoints (checkout, mobile-money) will be constructed from this.
    |
    */
    'api_base_url' => env('PAYCHANGU_API_BASE_URL', 'https://api.paychangu.com/'),
];
```

Configuration
-------------

[](#configuration)

Add the following variables to your `.env` file:

```
PAYCHANGU_API_PRIVATE_KEY=your_private_key_here
# Optional: Override Base URL (Defaults to https://api.paychangu.com/)
PAYCHANGU_API_BASE_URL=https://api.paychangu.com/
```

Usage
-----

[](#usage)

### 1. Hosted Checkout (Payment Link)

[](#1-hosted-checkout-payment-link)

Use this to redirect users to a PayChangu hosted page. Required fields: amount, callback\_url, return\_url.

```
use Paychangu\Laravel\Facades\Paychangu;

$response = Paychangu::create_checkout_link([
    'amount' => 5000,
    'currency' => 'MWK',
    'return_url' => 'https://yoursite.com/success',
    'callback_url' => 'https://yoursite.com/callback',
    'email' => 'customer@example.com',
    'first_name' => 'John',
    'last_name' => 'Doe',
    'meta' => ['order_id' => '123']
]);

if ($response['success']) {
    return redirect($response['data']['checkout_url']);
}
```

**Verify Checkout Transaction:**

```
$verification = Paychangu::verify_checkout('TXN_1234567890');
```

---

### 2. Mobile Money Payments

[](#2-mobile-money-payments)

**Get Supported Operators:**

```
$operators = Paychangu::mobile_money_operators();
```

**Charge Mobile Money Wallet:**

```
$response = Paychangu::create_mobile_money_payment([
    'mobile' => '0999123456', // Phone number in format 265... or 099...
    'mobile_money_operator_ref_id' => 'mpamba_ref_id', // Get from mobile_money_operators()
    'amount' => 1000,
    'charge_id' => 'unique_charge_id_123', // Must be unique for every transaction
]);
```

**Verify Payment:**

```
$verification = Paychangu::verify_mobile_money_payment('unique_charge_id_123');
```

**Get Payment Details:**

```
$details = Paychangu::get_mobile_money_payment_details('unique_charge_id_123');
```

---

### 3. Direct Charge (Bank Transfer)

[](#3-direct-charge-bank-transfer)

**Initiate Bank Charge:**

```
$response = Paychangu::create_direct_charge_payment([
    'currency' => 'MWK', // Currency code (e.g., 'MWK', 'USD')
    'amount' => 50000,
    'payment_method' => 'mobile_bank_transfer',
    'charge_id' => 'bank_charge_001', // Must be unique for every transaction
]);
```

**Get Transaction Details:**

```
$details = Paychangu::get_direct_charge_details('bank_charge_001');
```

---

### 4. Card Payments

[](#4-card-payments)

**Charge Card:**

```
$response = Paychangu::create_card_payment([
    'card_number' => '4000123456789010',
    'expiry' => '12/25', // Format: MM/YY
    'cvv' => '123',
    'cardholder_name' => 'John Doe',
    'amount' => 5000,
    'currency' => 'MWK',
    'charge_id' => 'card_charge_001', // Must be unique for every transaction
    'redirect_url' => 'https://yoursite.com/card-callback', // URL to redirect after payment
]);
```

**Verify Card Charge:**

```
$verification = Paychangu::verify_card_payment('card_charge_001');
```

**Refund Card Charge:**

```
$refund = Paychangu::refund_card_payment('card_charge_001');
```

---

### 5. Mobile Money Payouts

[](#5-mobile-money-payouts)

**Get Payout Operators:**

```
$operators = Paychangu::mobile_money_payout_operators();
```

**Initialize Payout:**

```
$response = Paychangu::create_mobile_money_payout([
    'mobile' => '0888123456', // Phone number in format 265... or 088...
    'mobile_money_operator_ref_id' => 'airtel_money_ref_id', // Get from mobile_money_payout_operators()
    'amount' => 2000,
    'charge_id' => 'payout_001', // Must be unique for every transaction
    // Optional fields:
    // 'email' => 'customer@example.com',
    // 'first_name' => 'John',
    // 'last_name' => 'Doe',
]);
```

**Get Payout Details:**

```
$details = Paychangu::get_mobile_money_payout_details('payout_001');
```

---

### 6. Bank Payouts

[](#6-bank-payouts)

**Get Supported Banks:**

```
$banks = Paychangu::get_supported_banks_for_payout('MWK');
```

**Initialize Bank Payout:**

```
$response = Paychangu::create_bank_payout([
    'bank_uuid' => 'bank_uuid_here', // Get from get_supported_banks_for_payout()
    'amount' => 100000,
    'charge_id' => 'bank_payout_001', // Must be unique
    'bank_account_name' => 'Jane Doe',
    'bank_account_number' => '100200300',
    // Optional fields:
    // 'payout_method' => 'bank_transfer', // Defaults to 'bank_transfer' if not provided
    // 'email' => 'customer@example.com',
    // 'first_name' => 'Jane',
    // 'last_name' => 'Doe',
]);
```

**Get Payout Details:**

```
$details = Paychangu::get_bank_payout_details('bank_payout_001');
```

**List All Bank Payouts:**

```
$allPayouts = Paychangu::get_all_bank_payouts();
```

---

### 7. Bill Payments

[](#7-bill-payments)

**Get Billers:**

```
$billers = Paychangu::get_billers();
```

**Get Biller Details:**

```
$billerDetails = Paychangu::get_biller_details('ESCOM');
```

**Validate Bill:**

```
$validation = Paychangu::validate_bill([
    'biller' => 'ESCOM',
    'account' => '123456789',
]);
```

**Pay Bill:**

```
$payment = Paychangu::pay_bill([
    'biller' => 'ESCOM',
    'account' => '123456789',
    'amount' => 5000,
    'reference' => 'bill_payment_001',
]);
```

Some billers may accept optional amount/reference fields depending on bill type.

**Get Transaction Details:**

```
$details = Paychangu::get_bill_transaction('bill_payment_001');
```

**Get Statistics:**

```
$stats = Paychangu::get_bill_statistics();
```

---

### 8. Airtime

[](#8-airtime)

**Buy Airtime:**

```
$airtime = Paychangu::buy_airtime([
    'phone' => '0888123456',
    'amount' => 1000,
    'reference' => 'airtime_ref_001',
]);
```

reference is optional.

---

### 9. Virtual Accounts (USD)

[](#9-virtual-accounts-usd)

**Create Customer:**

```
$customer = Paychangu::create_virtual_account_customer([
    'email' => 'john@example.com',
    'first_name' => 'John',
    'last_name' => 'Banda',
]);
```

**List Customers:**

```
$customers = Paychangu::get_virtual_account_customers([
    'page' => 1,
    'per_page' => 20,
]);
```

**Get Customer:**

```
$customer = Paychangu::get_virtual_account_customer('customer_id_here');
```

**Update Customer:**

```
$updated = Paychangu::update_virtual_account_customer('customer_id_here', [
    'email' => 'new-email@example.com',
]);
```

**Delete Customer:**

```
$deleted = Paychangu::delete_virtual_account_customer('customer_id_here');
```

**Create US Account (Virtual IBAN):**

```
$account = Paychangu::create_us_account('customer_id_here');
```

**Deactivate/Reactivate US Account:**

```
$deactivated = Paychangu::deactivate_us_account('customer_id_here');
$reactivated = Paychangu::reactivate_us_account('customer_id_here');
```

**US Account Activity:**

```
$activity = Paychangu::us_account_activity('customer_id_here');
```

Testing
-------

[](#testing)

```
composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Mzati](https://github.com/Mzati1)

Support
-------

[](#support)

For support, email  or visit our [support page](https://devs.paychangu.com/support).

License
-------

[](#license)

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

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance81

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57% 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 ~0 days

Total

2

Last Release

130d ago

### Community

Maintainers

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

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (378 commits)")[![mvdnbrk](https://avatars.githubusercontent.com/u/802681?v=4)](https://github.com/mvdnbrk "mvdnbrk (46 commits)")[![Mzati1](https://avatars.githubusercontent.com/u/106585054?v=4)](https://github.com/Mzati1 "Mzati1 (39 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (28 commits)")[![Nielsvanpach](https://avatars.githubusercontent.com/u/10651054?v=4)](https://github.com/Nielsvanpach "Nielsvanpach (23 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (19 commits)")[![pforret](https://avatars.githubusercontent.com/u/474312?v=4)](https://github.com/pforret "pforret (16 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (14 commits)")[![AlexVanderbist](https://avatars.githubusercontent.com/u/6287961?v=4)](https://github.com/AlexVanderbist "AlexVanderbist (12 commits)")[![patinthehat](https://avatars.githubusercontent.com/u/5508707?v=4)](https://github.com/patinthehat "patinthehat (10 commits)")[![riasvdv](https://avatars.githubusercontent.com/u/3626559?v=4)](https://github.com/riasvdv "riasvdv (10 commits)")[![AdrianMrn](https://avatars.githubusercontent.com/u/12762044?v=4)](https://github.com/AdrianMrn "AdrianMrn (8 commits)")[![crynobone](https://avatars.githubusercontent.com/u/172966?v=4)](https://github.com/crynobone "crynobone (8 commits)")[![thecaliskan](https://avatars.githubusercontent.com/u/13554944?v=4)](https://github.com/thecaliskan "thecaliskan (5 commits)")[![irfanm96](https://avatars.githubusercontent.com/u/42065936?v=4)](https://github.com/irfanm96 "irfanm96 (5 commits)")[![IGedeon](https://avatars.githubusercontent.com/u/694313?v=4)](https://github.com/IGedeon "IGedeon (4 commits)")[![abenerd](https://avatars.githubusercontent.com/u/7523903?v=4)](https://github.com/abenerd "abenerd (3 commits)")[![jessarcher](https://avatars.githubusercontent.com/u/4977161?v=4)](https://github.com/jessarcher "jessarcher (3 commits)")[![koossaayy](https://avatars.githubusercontent.com/u/6431084?v=4)](https://github.com/koossaayy "koossaayy (3 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (3 commits)")

---

Tags

fintechlaravelmalawimalawi-techpackagistpaychangupayment-gatewaypayment-integrationphppluginphpapilaravelsdkpayment processingpaymentpaymentspayment gatewaymobile-moneycard-paymentsfintechafricaonline paymentslaravel-paymentsmalawipaychangupaychangu-sdkpaychangu-php

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/paychangu-laravel/health.svg)

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

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k7.6M74](/packages/openai-php-laravel)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[mozex/anthropic-laravel

Anthropic PHP for Laravel is a supercharged PHP API client that allows you to interact with the Anthropic API

71226.4k1](/packages/mozex-anthropic-laravel)

PHPackages © 2026

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