{"id":31589428,"url":"https://github.com/elmmac/ikhokha","last_synced_at":"2026-05-03T22:32:26.600Z","repository":{"id":302623653,"uuid":"1013066890","full_name":"ElmMac/ikhokha","owner":"ElmMac","description":"ElmMac Laravel iKhokha Payment Integration API 💳 | ElmMac Pty Ltd | Websites . Mobile Apps \u0026 Software Developers","archived":false,"fork":false,"pushed_at":"2025-07-03T11:33:18.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-03T11:36:24.278Z","etag":null,"topics":["composer-package","ecommerce","ecommerce-api","ecommerce-application","ecommerce-website","elmmac","ikhokha","laravel","laravelecomm","laravelecommerce","payments","php","saas","webhooks"],"latest_commit_sha":null,"homepage":"https://elmmac.co.za","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ElmMac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-03T09:59:53.000Z","updated_at":"2025-07-03T11:20:44.000Z","dependencies_parsed_at":"2025-07-03T11:37:25.822Z","dependency_job_id":"cf898d9b-05e3-4f0c-8593-487311e37bea","html_url":"https://github.com/ElmMac/ikhokha","commit_stats":null,"previous_names":["elmmac/ikhokha"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ElmMac/ikhokha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElmMac%2Fikhokha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElmMac%2Fikhokha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElmMac%2Fikhokha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElmMac%2Fikhokha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ElmMac","download_url":"https://codeload.github.com/ElmMac/ikhokha/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ElmMac%2Fikhokha/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278551493,"owners_count":26005388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["composer-package","ecommerce","ecommerce-api","ecommerce-application","ecommerce-website","elmmac","ikhokha","laravel","laravelecomm","laravelecommerce","payments","php","saas","webhooks"],"created_at":"2025-10-06T02:52:45.389Z","updated_at":"2026-05-03T22:32:26.593Z","avatar_url":"https://github.com/ElmMac.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [ElmMac](https://elmmac.co.za/) - Laravel iKhokha Payment Integration API 💳\n\n# Laravel iKhokha Payment Integration API (elmmac/ikhokha) 💳\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/elmmac/ikhokha.svg?style=flat-square)](https://packagist.org/packages/elmmac/ikhokha)\n[![Total Downloads](https://img.shields.io/packagist/dt/elmmac/ikhokha.svg?style=flat-square)](https://packagist.org/packages/elmmac/ikhokha)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)\n[![Laravel](https://img.shields.io/badge/Laravel-9%2F10-orange.svg)](https://laravel.com)\n[![GitHub Repo stars](https://img.shields.io/github/stars/ElmMac/ikhokha?style=social)](https://github.com/ElmMac/ikhokha/stargazers)\n\n\nOfficial Laravel package to integrate [iKhokha](https://www.ikhokha.com/) Pay Links and Webhooks into your Laravel projects.\n\n---\n\n## 📘 ElmMac iKhokha Laravel Package API\n\nThis Laravel package provides a native iKhokha payment integration layer, complete with:\n\n-   Webhook handling\n-   Database logging\n-   API client functionality\n-   Optional UI blade views for frontend integration\n-   Paylink creation\n-   Easily extendable API client\n\nPerfect for:\n\n✔ SaaS platforms\n✔ Marketplaces\n✔ Payment-based apps\n✔ Donation systems\n✔ Subscription-like flows\n\n🔒 Secure, scalable, and modular — ideal for custom Laravel SaaS and marketplaces.\n\n---\n\n## 🛆 Features\n\n✅ Webhook listener \u0026 processor\\\n✅ Auto-persist `IkhokhaPayment` records\\\n✅ Extendable `IkhokhaClient` for outbound API calls\\\n✅ Built for Laravel 9/10+\\\n✅ Clean PSR-4 package structure\\\n✅ Optional config, views, and migration publishing\\\n✅ Optional UI views included (Blade templates)\n\n#### Current Package Structure\n\n```\n\nelmmac/ikhokha/\n│\n├── composer.json\n│\n├── config/\n│   └── ikhokha.php\n│\n├── database/\n│   └── migrations/\n│       └── 2025_06_30_130134_create_ikhokha_payments_table.php\n│\n├── resources/\n│   └── views/\n│       └── ikhokha/\n│           ├── success.blade.php\n│           ├── failed.blade.php\n│           └── cancel.blade.php\n│\n├── src/\n│   ├── Http/\n│   │   └── Controllers/\n│   │       └── IkhokhaPaymentController.php\n│   │\n│   ├── Models/\n│   │   └── IkhokhaPayment.php\n│   │\n│   ├── Services/\n│   │   └── IkhokhaClient.php\n│   │\n│   ├── routes/                     ← **ROUTES ARE HERE**\n│   │   ├── api.php\n│   │   └── web.php\n│   │\n│   └── IkhokhaServiceProvider.php\n│\n└── README.md\n\n\n\n```\n\n---\n\n## 🛆 Installation\n\n### Step 1: Install via Composer\n\n```bash\ncomposer require elmmac/ikhokha\n```\n\n### Step 2: Register Service Provider (if needed)\n\n\u003e For Laravel \u003c 5.5 or explicit config\n\n```php\n'providers' =\u003e [\n    Elmmac\\Ikhokha\\IkhokhaServiceProvider::class,\n],\n```\n\n---\n\n## ⚙️ Configuration\n\n### Optional: Publish the config\n\n```bash\nphp artisan vendor:publish --tag=ikhokha-config\n```\n\nThis publishes: `config/ikhokha.php`\n\n### Edit your `.env` file:\n\n```dotenv\nIKHOKHA_APP_ID=YOUR_APP_ID\nIKHOKHA_SIGN_SECRET=YOUR_SECRET\nIKHOKHA_WEBHOOK_URL=https://yourdomain.com/api/ikhokha/callback\n```\n\n---\n\n## 📄 Publish Views (Optional UI)\n\n```bash\nphp artisan vendor:publish --tag=ikhokha-views\n```\n\nViews will be published to: `resources/views/ikhokha`\n\nUse them as base templates or customize freely.\n\n---\n\n## 🗃️ Migrations\n\n### Optional: Publish Migrations\n\n```bash\nphp artisan vendor:publish --tag=ikhokha-migrations\n```\n\nMigration will be published to: `database/migrations/`\n\nThen run:\n\n```bash\nphp artisan migrate\n```\n\nModel:\n\n```php\nElmmac\\Ikhokha\\Models\\IkhokhaPayment\n```\n\nTable: `ikhokha_payments`\n\nAdd relationship in your `User.php`:\n\n```php\npublic function ikhokha_payments()\n{\n    return $this-\u003ehasMany(IkhokhaPayment::class);\n}\n```\n\nAnd in `IkhokhaPayment.php`:\n\n```php\npublic function user()\n{\n    return $this-\u003ebelongsTo(\\App\\Models\\User::class, 'user_id');\n}\n```\n\n🛆 Example Manual Entry:\n\n```php\nIkhokhaPayment::create([\n    'user_id' =\u003e $user-\u003eid ?? null,\n    'customer_email' =\u003e $user-\u003eemail ?? $request-\u003einput(key: 'customer_email', default: 'misael@elmmac.co.za'),\n    'transaction_id' =\u003e $externalTransactionID,\n    'description' =\u003e $request-\u003einput('description', 'Payment'),\n    'paylink_id' =\u003e $data['paylinkID'] ?? null,\n    'amount' =\u003e $amount,\n    'currency' =\u003e $currency,\n    'status' =\u003e 'pending',\n    'payment_url' =\u003e $data['paylinkUrl'] ?? null,\n    'webhook_signature' =\u003e $ikSign,\n    'metadata' =\u003e $data,\n]);\n```\n---\n\n## 🔗 Create Payment Link Payload - REQUEST | Refer to 🔗 [iKhokha API Overview](https://dev.ikhokha.com/overview) for more.\n\nUse this structure to initiate payment (All iKhokha Requests \u0026 Responses MUST be in JSON format):\n\n```php Request Object\n$payload = [\n    \"entityID\" =\u003e $appID,\n    \"amount\" =\u003e (int) $amount * 100,\n    \"currency\" =\u003e $currency,\n    \"requesterUrl\" =\u003e url()-\u003ecurrent(),\n    \"mode\" =\u003e $mode,\n    \"externalTransactionID\" =\u003e $externalTransactionID,\n    \"urls\" =\u003e [\n        \"callbackUrl\" =\u003e route(name: 'ikhokha.webhook'),\n        \"successPageUrl\" =\u003e route(name: 'ikhokha.success'),\n        \"failurePageUrl\" =\u003e route(name: 'ikhokha.failed'),\n        \"cancelUrl\" =\u003e route(name: 'ikhokha.cancel'),\n    ]\n];\n```\nCreate Paylink/Payment Link Response Object\n```\nCREATE PAYMENT LINK - RESPONSE\n{\n    \"responseCode\": \"00\",\n    \"message\": \"\",\n    \"paylinkUrl\": \"https://securepay.ikhokha.red/2zh1zj6y8xpb0g3\",\n    \"paylinkID\": \"2zh1zj6y8xpb0g3\",\n    \"externalTransactionID\": \"TRANS789\" // $transactionId\n}\n```\n\n\n---\n\n## 🔁 Webhook Setup | Refer to 🔗 [iKhokha API Overview](https://dev.ikhokha.com/overview) for more.\n\n\n📬 Webhook URL:\n\n```\nPOST /api/ikhokha/webhook\n```\n\nRequired headers:\n\n```\nik-appid\nik-sign\nContent-Type: application/json\n```\n\n📨 Sample Payload:\n\n```json\n{\n    \"paylinkID\": \"2zh1zj6y8xpb0g3\", // Gotten from Create Payment Link Response\n    \"status\": \"SUCCESS\",\n    \"externalTransactionID\": \"IKH_REF_CODE_9911\",\n    \"responseCode\": \"00\"\n}\n```\n\n---\n\n## 🚦 Route Summary\n\n| Method | URL                    | Purpose                     |\n| ------ | ---------------------- | --------------------------- |\n| POST   | `/ikhokha-initiate`    | Create payment link         |\n| GET    | `/ikhokha/success`     | Redirect page after payment |\n| GET    | `/ikhokha/failed`      | Failed payment view         |\n| GET    | `/ikhokha/cancel`      | Cancel payment view         |\n| POST   | `/api/ikhokha/webhook` | Webhook callback            |\n\n\n---\n\n## 📋 Artisan Helper Tags (Optional)\n\nFor dev reminders:\n\n```bash\nphp artisan vendor:publish --tag=ikhokha-config      # Publish config\nphp artisan vendor:publish --tag=ikhokha-views       # Publish views\nphp artisan vendor:publish --tag=ikhokha-migrations  # Publish migrations\n```\n\nUse only the ones you need! 💡\n\n---\n\n## 🧠 Roadmap\n\n-   Full unit testing with PHPUnit\n-   Laravel Octane compatibility\n-   Tokenized card billing\n-   Refunds \u0026 reversals\n-   Multi-merchant support\n-   Optional payment UI component scaffolds\n***********\niKhokha Subscription Tokenization\nEloquent Traits (Billable)\nOctane compatibility\n\n---\n\n## 🤝 Contributing\n\nPull requests welcome. Open an issue for proposals or fixes.\\\nMake sure tests pass if you're submitting functional changes.\n\n---\n\n## 🙏 Credits\n\nDeveloped with 🚀 by **ElmMac Pty Ltd**\\\nMaintained by @ElmMac - **Misael Cruise Mutege** — [WhatsApp: +27786411181](https://web.whatsapp.com/send?phone=27786411181)  Durban, South Africa\\\nDigital Dev | Hustler Mode: `ON 💼`\n\n---\n\n## 📄 License\n\nMIT License © [ElmMac](https://elmmac.co.za/)\n\"  ||| just edit according to the chamges say like the folder structure excluding the package folder, etc depending on what has changed so far.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmmac%2Fikhokha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felmmac%2Fikhokha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felmmac%2Fikhokha/lists"}