ovac/laravel-hubtel-payment
Composer 安装命令:
composer require ovac/laravel-hubtel-payment
包简介
A Laravel package for consuming the Hubtel Payment Api
README 文档
README
Laravel Hubtel Payment
A Laravel 5.5 integration for the OVAC Hubtel Payment package.
Follow me anywhere @ovac4u | GitHub _________ _________ | Twitter | ___ |.-----.--.--.---.-.----.| | |.--.--. | Facboook | | _ || _ | | | _ | __||__ | | | | Instagram | |______||_____|\___/|___._|____| |__||_____| | Github + @ovac |_________| www.ovac4u.com | Facebook + @ovacposts
Introduction.
Laravel Hubtel Payment is a Laravel 5.5 seamless integration of the OVAC Hubtel Payment php client for consuming the Hubtel Payment API and processing mobile-money transactions in a Laravel application.
With this package, it is easy to process mobile money transactions and automate Mobile Money payment from and to any mobile money subscriber in Ghana from any laravel controller.
Installation
This packages utilize Composer, for more information on how to install Composer please read the Composer Documentation.
Install via composer
composer require ovac/laravel-hubtel-payment
Register Service Provider
Note! This and next step are optional if you use laravel>=5.5 with package auto discovery feature.
Add service provider to config/app.php in providers section
OVAC\LaravelHubtelPayment\ServiceProvider::class,
Register Facade
Register package facade in config/app.php in aliases section
'HubtelPayment' => OVAC\LaravelHubtelPayment\Facades\LaravelHubtelPayment::class,
Publish Configuration File
php artisan vendor:publish --provider="OVAC\LaravelHubtelPayment\ServiceProvider" --tag="config"
Edit .env
Add these lines in the application .env and use your Hubtel Merchant Account Number, ClentID, ClientSecret and callback as shown below.
Don't know what this is? checkout this documentation
HUBTEL_ACCOUNT_NUMBER=HM00000 #Your Hubtel Merchant Account Number HUBTEL_CLIENT_ID=XXXXXXXX #Your Hubtel Merchant Client ID HUBTEL_CLIENT_SECRET=XXXXXXXX #Your Hubtel Merchant Client Secret. HUBTEL_CALLBACK_URL=https://example.com/payment_success #Default Callback URL HUBTEL_SECONDARY_CALLBACK_URL=https://example.com/error
Basic Usage
This library exposes a handfull of facade that seamlessly interfaces with the hubtel-payment php client main classes for basic usage in order to make local configuration optional.
Note: For advance usage, please refer to the OVAC Hubtel Payment documentation, located here.
Just use the Laravel facade alias HubtelPayment:: instead of the native calls.
Enjoy :)
The ReceiveMoney facade may be used to send a prompt to the customer's phone to receive money like a mobile-money agent as follows:
<?php use OVAC\LaravelHubtelPayment\Facades\HubtelPayment; // NOTE: The phone number must be of type string as Laravel considers all numbers with a leading 0 to be a hex number. $payment = HubtelPayment::ReceiveMoney() ->from('0553577261') //- The phone number to send the prompt to. ->amount(100.00) //- The exact amount value of the transaction ->description('Online Purchase') //- Description of the transaction. ->customerName('Ariama Victor') //- Name of the person making the payment.callback after payment. ->channel('mtn-gh') //- The mobile network Channel.configuration ->run(); //- Run the transaction after required data.
The SendMoney facade may also be used to send money to any mobile money customer as follows:
<?php use OVAC\LaravelHubtelPayment\Facades\HubtelPayment; // NOTE: The phone number must be of type string as Laravel considers all numbers with a leading 0 to be a hex number. $payment = HubtelPayment::SendMoney() ->to('0553577261') //- The phone number to send the prompt to. ->amount(100.00) //- The exact amount value of the transaction ->description('Online Purchase') //- Description of the transaction. ->customerEmail('admin@ovac4u.com') //- Name of the person making the payment. ->channel('mtn-gh') //- The mobile network Channel. ->run(); //- Run the transaction after required data.
The Refund Facade may also refund money a customer paid in a previous transaction:
<?php use OVAC\LaravelHubtelPayment\Facades\HubtelPayment; $payment = HubtelPayment::Refund() ->transactionId(1234) //- The ID of the transaction to refund. ->amount(100.00) //- The exact amount value of the transaction ->clientReference('#11212') //- A refeerence on your end. ->description('Useless Purchase') //- Description of the transaction. ->reason('No longer needs a pen') //- Name of the person making the payment. ->full() //- Full or partial refund. ->run(); //- Run the transaction after required data.
Contributing
Thank you for considering contributing to Laravel Hackathon Starter. The contribution guide can be found in the Contribution File
Security
If you discover any security related issues, please email instead of using the issue tracker.
Credits
Reference
- Documentation/Official Page
- Official Repo: Github
- Hubtel Merchant Payment Reference
- Laravel framework
- LICENCE: MIT
- CHANGELOG
How can I thank you?
Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!
Don't forget to follow me on instagram and twitter
Thanks! Ariama Victor (ovac4u).
ovac/laravel-hubtel-payment 适用场景与选型建议
ovac/laravel-hubtel-payment 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 648 次下载、GitHub Stars 达 12, 最近一次更新时间为 2017 年 09 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payment」 「laravel」 「hubtel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ovac/laravel-hubtel-payment 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ovac/laravel-hubtel-payment 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ovac/laravel-hubtel-payment 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Alfabank REST API integration
Hubtel SMS Channel for Laravel ^11|^122
An unofficial php library for processing Hubtel USSD requests
Laravel Hubtel Merchant Account integration (Pure Laravel CediBet)
Laravel package for Accurate Online API integration.
TrinkPOS Sanal POS (Virtual POS) API client for PHP
统计信息
- 总下载量: 648
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-17