devadze/laravel-flitt-payment
Composer 安装命令:
composer require devadze/laravel-flitt-payment
包简介
A Laravel package for Flitt Payment API integration
README 文档
README
A simple and elegant Laravel package for integrating the Flitt Payment Gateway into your Laravel application.
🚀 Features
- Seamless Flitt payment integration
- Clean fluent API via Facade (
Flitt::setAmount(...)->redirect()) - Automatic signature generation
- Callback URL handling
- Configurable merchant settings
- Extendable via service class, trait, and contract
📦 Installation
Install the package via Composer:
You can install the package via composer:
composer require devadze/laravel-flitt-payment
You can publish the config file with:
php artisan vendor:publish --provider="Devadze\FlittPayment\FlittPaymentServiceProvider"
Once published, the configuration file will be available at:
config/flitt.php
And run migrations:
php artisan migrate
Environment Variables
Add the following variables to your .env file to configure the package:
FLITT_MERCHANT_ID=your_merchant_id FLITT_SECRET_KEY=your_secret_key FLITT_RESPONSE_URL=https://yourdomain.ge FLITT_CALLBACK_URL=https://yourdomain.ge/flitt/callback # Used only if custom callback is needed
Usage
Usage Example: Simple Payment Processing
To initiate a payment, use the FlittPayment facade to set the order details and redirect:
use Devadze\FlittPayment\Facades\FlittPayment; $response = FlittPayment::setOrderDesc('ბალანსის შევსება')->setAmount(5)->redirect(); return redirect($response['checkout_url']);
Callback Handling
The package handles callback behavior automatically. When a payment is processed, it will send a POST request to your callback URL with the payment details.
Example: Registering a Listener for Flitt Payment Updates Add the following code to your event listener:
namespace App\Listeners; use Devadze\FlittPayment\Events\PaymentReceived; use Illuminate\Support\Facades\Log; class HandleFlittPayment { /** * Create the event listener. */ public function __construct() { // } /** * Handle the event. */ public function handle(PaymentReceived $event): void { // implement your login code Log::info('Flitt payment callback received', $event->response); # you can remove it } }
Setting Up the Event Listener
Setting Up the Event Listener To handle transaction status updates efficiently, you need to register an event listener that listens for the HandleFlittPayment event triggered by the package.
Generating the Listener Automatically You can generate the event listener using the Artisan command:
php artisan make:listener HandleFlittPayment --event=\Devadze\FlittPayment\Events\PaymentReceived
This command will create a listener class at app/Listeners/HandleFlittPayment.php, which you can customize to handle the event logic.
This approach provides flexibility by allowing dynamic event registrations at runtime without modifying the EventServiceProvider.
For more details on event handling in Laravel, refer to the official documentation.
devadze/laravel-flitt-payment 适用场景与选型建议
devadze/laravel-flitt-payment 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 23 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 04 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 devadze/laravel-flitt-payment 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 devadze/laravel-flitt-payment 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 16
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-09