paymint/paymint-laravel
Composer 安装命令:
composer require paymint/paymint-laravel
包简介
The official Laravel wrapper for PayMint Africa
README 文档
README
The official Laravel wrapper for PayMint Africa. Seamlessly integrate PayMint into your Laravel application with zero configuration and elegant syntax.
Installation
Install the package via Composer:
composer require paymint/paymint-laravel
Configuration
Add your PayMint API keys to your .env file:
PAYMINT_SECRET_KEY=sk_live_your_secret_key # Optional: Set a custom base URL for testing or sandbox # PAYMINT_BASE_URL=https://sandbox.api.paymint.africa/v1/
That's it! The package will automatically load your configuration. You do not need to publish any config files.
Usage
Use the elegant PayMint Facade to interact with the API anywhere in your application.
use PayMint\Laravel\Facades\PayMint; // Create a Virtual Account $account = PayMint::virtualAccounts()->create([ 'name' => 'Jane Doe', 'email' => 'jane@example.com', 'phone' => '08123456789' ]); return response()->json($account);
Webhook Verification
Verify incoming webhooks directly inside your Laravel controllers or routes to ensure the payload is securely coming from PayMint.
use Illuminate\Http\Request; use PayMint\Laravel\Facades\PayMint; use Illuminate\Support\Facades\Route; Route::post('/webhook/paymint', function (Request $request) { // 1. Get raw payload and signature $payload = $request->getContent(); $signature = $request->header('X-Paymint-Signature'); // 2. Verify securely if (!PayMint::webhooks()->verifySignature($payload, $signature)) { return response()->json(['error' => 'Invalid signature detected.'], 401); } // 3. Process webhook safely! $event = $request->input('event'); if ($event === 'payment.success') { // Credit the customer's wallet here... } return response()->json(['status' => 'success']); });
License
MIT License
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2026-06-25