hellofromsteve/hubtel
最新稳定版本:v1.1.0
Composer 安装命令:
composer require hellofromsteve/hubtel
包简介
A Laravel Package for Hubtel payment integration for laravel 11 and above
README 文档
README
A simple Laravel package for integrating Hubtel payments into your Laravel 11 and Above application.
Installation
composer require hellofromsteve/hubtel
Configuration
Publish the configuration file:
php artisan vendor:publish --tag=hubtel-config
Add your hubtel credentials to your .env file:
HUBTEL_API_KEY=************ HUBTEL_API_SECRET=**************** HUBTEL_MERCHANT_ACCOUNT_ID=************** # Local Testing Callback LOCAL_HUBTEL_CALLBACK_URL="(you can use webhook.site to get a url for local testing)" #Recommended HUBTEL_CALLBACK_URL="${APP_URL}/payment/callback" HUBTEL_RETURN_URL="${APP_URL}/payment/return" HUBTEL_CANCELLED_URL="${APP_URL}/payment/cancel"
You can set the endpoints in the config after publishing there
Usage
Using the Helper Function
// Or use helper function and chain methods directly hubtel() $transaction = hubtel()->initialize([ 'totalAmount' => 100, 'description' => 'payment for service', ]);
// These defaults are set in the initialize() method and then merged to your $payload
// The can be overwritten
$defaults = [ 'callbackUrl' => config('hubtel.callback_url'), 'returnUrl' => config('hubtel.return_url'), 'cancellationUrl' => config('hubtel.cancelled_url'), 'merchantAccountNumber' => config('hubtel.merchant_account_number'), 'clientReference' => (string) \Illuminate\Support\Str::uuid(), ];
## Available Methods - `initialize(array $finalPayload)` - Initiate a payment - `status(array $payload)` - Get transaction status ## More Methods More methods will be updated soon ## License MIT
统计信息
- 总下载量: 307
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-10