PHPackages                             elmmac/ikhokha - 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. elmmac/ikhokha

ActiveLibrary[Payment Processing](/categories/payments)

elmmac/ikhokha
==============

An ElmMac Pty Ltd iKhokha Payment Gateway API Wrapper for Laravel Framework

v1.1.0(6mo ago)11MITPHPPHP ^7.4|^8.0|^8.1|^8.2|^8.3CI failing

Since Jul 3Pushed 5mo agoCompare

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

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

[ElmMac](https://elmmac.co.za/) - Laravel iKhokha Payment Integration API 💳
===========================================================================

[](#elmmac---laravel-ikhokha-payment-integration-api-)

Laravel iKhokha Payment Integration API (elmmac/ikhokha) 💳
==========================================================

[](#laravel-ikhokha-payment-integration-api-elmmacikhokha-)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7f4ac5f5adedfb0f68417a8f6d39488d7add5dcd9371593199166f4352a6bb11/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c6d6d61632f696b686f6b68612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elmmac/ikhokha)[![Total Downloads](https://camo.githubusercontent.com/deeca8a3ed296ccc28e32609bb8f778dec2353bb0ccacdc86a7a6b17b171ba62/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656c6d6d61632f696b686f6b68612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elmmac/ikhokha)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![Laravel](https://camo.githubusercontent.com/e1af57cbb52efe1bd87d6102f183b829c346b09579e9b28b9308b45af61df238/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d3925324631302d6f72616e67652e737667)](https://laravel.com)[![GitHub Repo stars](https://camo.githubusercontent.com/520cbbb20bf34bf2f20cba3f63050b7fe8487db29316c6c308aee4ec200aad0c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f456c6d4d61632f696b686f6b68613f7374796c653d736f6369616c)](https://github.com/ElmMac/ikhokha/stargazers)

Official Laravel package to integrate [iKhokha](https://www.ikhokha.com/) Pay Links and Webhooks into your Laravel projects.

---

📘 ElmMac iKhokha Laravel Package API
------------------------------------

[](#-elmmac-ikhokha-laravel-package-api)

This Laravel package provides a native iKhokha payment integration layer, complete with:

- Webhook handling
- Database logging
- API client functionality
- Optional UI blade views for frontend integration
- Paylink creation
- Easily extendable API client

Perfect for:

✔ SaaS platforms ✔ Marketplaces ✔ Payment-based apps ✔ Donation systems ✔ Subscription-like flows

🔒 Secure, scalable, and modular — ideal for custom Laravel SaaS and marketplaces.

---

🛆 Features
----------

[](#-features)

✅ Webhook listener &amp; processor
✅ Auto-persist `IkhokhaPayment` records
✅ Extendable `IkhokhaClient` for outbound API calls
✅ Built for Laravel 9/10+
✅ Clean PSR-4 package structure
✅ Optional config, views, and migration publishing
✅ Optional UI views included (Blade templates)

#### Current Package Structure

[](#current-package-structure)

```

elmmac/ikhokha/
│
├── composer.json
│
├── config/
│   └── ikhokha.php
│
├── database/
│   └── migrations/
│       └── 2025_06_30_130134_create_ikhokha_payments_table.php
│
├── resources/
│   └── views/
│       └── ikhokha/
│           ├── success.blade.php
│           ├── failed.blade.php
│           └── cancel.blade.php
│
├── src/
│   ├── Http/
│   │   └── Controllers/
│   │       └── IkhokhaPaymentController.php
│   │
│   ├── Models/
│   │   └── IkhokhaPayment.php
│   │
│   ├── Services/
│   │   └── IkhokhaClient.php
│   │
│   ├── routes/                     ← **ROUTES ARE HERE**
│   │   ├── api.php
│   │   └── web.php
│   │
│   └── IkhokhaServiceProvider.php
│
└── README.md

```

---

🛆 Installation
--------------

[](#-installation)

### Step 1: Install via Composer

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

```
composer require elmmac/ikhokha
```

### Step 2: Register Service Provider (if needed)

[](#step-2-register-service-provider-if-needed)

> For Laravel &lt; 5.5 or explicit config

```
'providers' => [
    Elmmac\Ikhokha\IkhokhaServiceProvider::class,
],
```

---

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

[](#️-configuration)

### Optional: Publish the config

[](#optional-publish-the-config)

```
php artisan vendor:publish --tag=ikhokha-config
```

This publishes: `config/ikhokha.php`

### Edit your `.env` file:

[](#edit-your-env-file)

```
IKHOKHA_APP_ID=YOUR_APP_ID
IKHOKHA_SIGN_SECRET=YOUR_SECRET
IKHOKHA_WEBHOOK_URL=https://yourdomain.com/api/ikhokha/callback
```

---

📄 Publish Views (Optional UI)
-----------------------------

[](#-publish-views-optional-ui)

```
php artisan vendor:publish --tag=ikhokha-views
```

Views will be published to: `resources/views/ikhokha`

Use them as base templates or customize freely.

---

🗃️ Migrations
-------------

[](#️-migrations)

### Optional: Publish Migrations

[](#optional-publish-migrations)

```
php artisan vendor:publish --tag=ikhokha-migrations
```

Migration will be published to: `database/migrations/`

Then run:

```
php artisan migrate
```

Model:

```
Elmmac\Ikhokha\Models\IkhokhaPayment
```

Table: `ikhokha_payments`

Add relationship in your `User.php`:

```
public function ikhokha_payments()
{
    return $this->hasMany(IkhokhaPayment::class);
}
```

And in `IkhokhaPayment.php`:

```
public function user()
{
    return $this->belongsTo(\App\Models\User::class, 'user_id');
}
```

🛆 Example Manual Entry:

```
IkhokhaPayment::create([
    'user_id' => $user->id ?? null,
    'customer_email' => $user->email ?? $request->input(key: 'customer_email', default: 'misael@elmmac.co.za'),
    'transaction_id' => $externalTransactionID,
    'description' => $request->input('description', 'Payment'),
    'paylink_id' => $data['paylinkID'] ?? null,
    'amount' => $amount,
    'currency' => $currency,
    'status' => 'pending',
    'payment_url' => $data['paylinkUrl'] ?? null,
    'webhook_signature' => $ikSign,
    'metadata' => $data,
]);
```

---

🔗 Create Payment Link Payload - REQUEST | Refer to 🔗 [iKhokha API Overview](https://dev.ikhokha.com/overview) for more.
-----------------------------------------------------------------------------------------------------------------------

[](#-create-payment-link-payload---request--refer-to--ikhokha-api-overview-for-more)

Use this structure to initiate payment (All iKhokha Requests &amp; Responses MUST be in JSON format):

```
$payload = [
    "entityID" => $appID,
    "amount" => (int) $amount * 100,
    "currency" => $currency,
    "requesterUrl" => url()->current(),
    "mode" => $mode,
    "externalTransactionID" => $externalTransactionID,
    "urls" => [
        "callbackUrl" => route(name: 'ikhokha.webhook'),
        "successPageUrl" => route(name: 'ikhokha.success'),
        "failurePageUrl" => route(name: 'ikhokha.failed'),
        "cancelUrl" => route(name: 'ikhokha.cancel'),
    ]
];
```

Create Paylink/Payment Link Response Object

```
CREATE PAYMENT LINK - RESPONSE
{
    "responseCode": "00",
    "message": "",
    "paylinkUrl": "https://securepay.ikhokha.red/2zh1zj6y8xpb0g3",
    "paylinkID": "2zh1zj6y8xpb0g3",
    "externalTransactionID": "TRANS789" // $transactionId
}

```

---

🔁 Webhook Setup | Refer to 🔗 [iKhokha API Overview](https://dev.ikhokha.com/overview) for more.
-----------------------------------------------------------------------------------------------

[](#-webhook-setup--refer-to--ikhokha-api-overview-for-more)

📬 Webhook URL:

```
POST /api/ikhokha/webhook

```

Required headers:

```
ik-appid
ik-sign
Content-Type: application/json

```

📨 Sample Payload:

```
{
    "paylinkID": "2zh1zj6y8xpb0g3", // Gotten from Create Payment Link Response
    "status": "SUCCESS",
    "externalTransactionID": "IKH_REF_CODE_9911",
    "responseCode": "00"
}
```

---

🚦 Route Summary
---------------

[](#-route-summary)

MethodURLPurposePOST`/ikhokha-initiate`Create payment linkGET`/ikhokha/success`Redirect page after paymentGET`/ikhokha/failed`Failed payment viewGET`/ikhokha/cancel`Cancel payment viewPOST`/api/ikhokha/webhook`Webhook callback---

📋 Artisan Helper Tags (Optional)
--------------------------------

[](#-artisan-helper-tags-optional)

For dev reminders:

```
php artisan vendor:publish --tag=ikhokha-config      # Publish config
php artisan vendor:publish --tag=ikhokha-views       # Publish views
php artisan vendor:publish --tag=ikhokha-migrations  # Publish migrations
```

Use only the ones you need! 💡

---

🧠 Roadmap
---------

[](#-roadmap)

- Full unit testing with PHPUnit
- Laravel Octane compatibility
- Tokenized card billing
- Refunds &amp; reversals
- Multi-merchant support
- Optional payment UI component scaffolds

---

iKhokha Subscription Tokenization Eloquent Traits (Billable) Octane compatibility

---

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

[](#-contributing)

Pull requests welcome. Open an issue for proposals or fixes.
Make sure tests pass if you're submitting functional changes.

---

🙏 Credits
---------

[](#-credits)

Developed with 🚀 by **ElmMac Pty Ltd**
Maintained by @ElmMac - **Misael Cruise Mutege** — [WhatsApp: +27786411181](https://web.whatsapp.com/send?phone=27786411181) Durban, South Africa
Digital Dev | Hustler Mode: `ON 💼`

---

📄 License
---------

[](#-license)

MIT License © [ElmMac](https://elmmac.co.za/)" ||| just edit according to the chamges say like the folder structure excluding the package folder, etc depending on what has changed so far.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance71

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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

Every ~137 days

Total

2

Last Release

182d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/821d4ffcbbdaf291a6f2d2bf1d66a2279e3f432684eeb5dae0543b67934aa884?d=identicon)[ElmMac](/maintainers/ElmMac)

---

Top Contributors

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

---

Tags

composer-packageecommerceecommerce-apiecommerce-applicationecommerce-websiteelmmacikhokhalaravellaravelecommlaravelecommercepaymentsphpsaaswebhookslaravelwebhookspaymentgatewaySouth AfricaikhokhaelmMac

### Embed Badge

![Health badge](/badges/elmmac-ikhokha/health.svg)

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

###  Alternatives

[sebdesign/laravel-viva-payments

A Laravel package for integrating the Viva Payments gateway

4845.9k](/packages/sebdesign-laravel-viva-payments)[dena-a/iran-payment

a Laravel package to handle Internet Payment Gateways for Iran Banking System

312.4k1](/packages/dena-a-iran-payment)[parsisolution/gateway

A Laravel package for connecting to all Iraninan payment gateways

231.7k](/packages/parsisolution-gateway)[sostheblack/moip

Laravel Package for Moip.

171.9k](/packages/sostheblack-moip)

PHPackages © 2026

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