elmmac/ikhokha
Composer 安装命令:
composer require elmmac/ikhokha
包简介
An ElmMac Pty Ltd iKhokha Payment Gateway API Wrapper for Laravel Framework
README 文档
README
Laravel iKhokha Payment Integration API (elmmac/ikhokha) 💳
Official Laravel package to integrate iKhokha Pay Links and Webhooks into your Laravel projects.
📘 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
✅ Webhook listener & 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
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
Step 1: Install via Composer
composer require elmmac/ikhokha
Step 2: Register Service Provider (if needed)
For Laravel < 5.5 or explicit config
'providers' => [ Elmmac\Ikhokha\IkhokhaServiceProvider::class, ],
⚙️ Configuration
Optional: Publish the config
php artisan vendor:publish --tag=ikhokha-config
This publishes: config/ikhokha.php
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)
php artisan vendor:publish --tag=ikhokha-views
Views will be published to: resources/views/ikhokha
Use them as base templates or customize freely.
🗃️ 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 for more.
Use this structure to initiate payment (All iKhokha Requests & 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 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
| Method | URL | Purpose |
|---|---|---|
| POST | /ikhokha-initiate |
Create payment link |
| GET | /ikhokha/success |
Redirect page after payment |
| GET | /ikhokha/failed |
Failed payment view |
| GET | /ikhokha/cancel |
Cancel payment view |
| POST | /api/ikhokha/webhook |
Webhook callback |
📋 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
- Full unit testing with PHPUnit
- Laravel Octane compatibility
- Tokenized card billing
- Refunds & reversals
- Multi-merchant support
- Optional payment UI component scaffolds
iKhokha Subscription Tokenization Eloquent Traits (Billable) Octane compatibility
🤝 Contributing
Pull requests welcome. Open an issue for proposals or fixes.
Make sure tests pass if you're submitting functional changes.
🙏 Credits
Developed with 🚀 by ElmMac Pty Ltd
Maintained by @ElmMac - Misael Cruise Mutege — WhatsApp: +27786411181 Durban, South Africa
Digital Dev | Hustler Mode: ON 💼
📄 License
MIT License © ElmMac " ||| just edit according to the chamges say like the folder structure excluding the package folder, etc depending on what has changed so far.
elmmac/ikhokha 适用场景与选型建议
elmmac/ikhokha 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 07 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「gateway」 「laravel」 「webhooks」 「South Africa」 「ikhokha」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 elmmac/ikhokha 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elmmac/ikhokha 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 elmmac/ikhokha 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
repository php library
Payyo Gateway for the Omnipay payment processing library
Client library to send SMS using Comilio SMS Gateway API (https://www.comilio.it)
Alfabank REST API integration
GovPayNet driver for the Omnipay payment processing library
BlueSnap driver for the Omnipay payment processing library
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-04