cviebrock/laravel-mangopay
Composer 安装命令:
composer require cviebrock/laravel-mangopay
包简介
Laravel/Lumen wrapper for the office Mangopay SDK library
README 文档
README
This package makes it easier (hopefully!) to integrate the official Mangopay SDK into your Laravel and Lumen applications.
⚠️ This Package Will Be Abandoned
Due to several factors, including the fact that I no longer use Mangopay, I will be ceasing development on this package. If you are interested in taking over this project, please reach out to me here in the Issues board.
Installation
Depending on your version of Laravel, you should install a different version of the package. NOTE: As of version 6.0, the package's version should match the Laravel version.
| Laravel Version | Package Version |
|---|---|
| 9.0 | ^9.0 |
| 8.0 | ^8.0 |
| 7.0 | ^7.0 |
| 6.0 | ^6.0 |
| 5.* | ^0.9 |
Laravel
-
Install the package via composer:
composer require cviebrock/laravel-mangopay
After updating composer, the package will automatically register its service provider.
-
Publish the configuration file:
php artisan vendor:publish --provider="Cviebrock\LaravelMangopay\ServiceProvider" -
Finally, generate the required temporary directories:
php artisan mangopay:mkdir
Lumen
-
Install the package via composer:
composer require cviebrock/laravel-mangopay:^6.0
-
Copy the configuration file to your
configfolder and enable everything inbootstrap/app.php:$app->configure('mangopay'); $app->register(Cviebrock\LaravelMangopay\ServiceProvider::class);
-
Generate the required temporary directories:
php artisan mangopay:mkdir
Configuration
This package supports authentication configuration through the services configuration file located
in config/services.php. Add the following block to that file, and set the appropriate
values in your .env file:
'mangopay' => [ 'env' => env('MANGOPAY_ENV', 'sandbox'), // or "production" 'key' => env('MANGOPAY_KEY'), // your Mangopay client ID 'secret' => env('MANGOPAY_SECRET'), // your Mangopay client password ],
The configuration file you can publish to config/mangopay.php provides additional
properties that can be passed to the MangopayAPI object when it is instantiated. In
most cases, you won't need to change anything here, so you can choose to not publish this
configuration, or have it simply return an empty array.
If you do use this file, see the SDK documentation for the various properties that can be set
(basically any public property on the MangoPay\Libraries\Configuration class).
Usage
All this package really does is make instantiating the MangopayAPI easy by
putting the configuration into Laravel/Lumen's config system.
Using it is now as easy as injecting Mangopay into your controller, and then
using it the same way you would use the MangopayAPI class:
class MyController extends Illuminate\Routing\Controller { /** * @var \MangoPay\MangoPayApi */ private $mangopay; public function __construct(\MangoPay\MangoPayApi $mangopay) { $this->mangopay = $mangopay; } public function doStuff($someId) { // get some user by id $john = $this->mangopay->Users->Get($someId); // change and update some of his data $john->LastName .= " - CHANGED"; $this->mangopay->Users->Update($john); // get his bank accounts $pagination = new MangoPay\Pagination(1, 10); // get 1st page, 10 items per page $accounts = $this->mangopay->Users->GetBankAccounts($john->Id, $pagination); // etc. } }
Bugs, Suggestions and Contributions
Thanks to everyone who has contributed to this project! Special thanks to JetBrains for their Open Source License Program ... and the excellent PHPStorm IDE, of course!
Please use Github for reporting bugs, and making comments or suggestions.
See CONTRIBUTING.md for how to contribute changes.
Copyright and License
laravel-mangopay was written by Colin Viebrock and released under the MIT License. See LICENSE.md file for details.
Copyright (c) 2016 Colin Viebrock
cviebrock/laravel-mangopay 适用场景与选型建议
cviebrock/laravel-mangopay 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 73.16k 次下载、GitHub Stars 达 19, 最近一次更新时间为 2016 年 04 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「payments」 「laravel」 「mangopay」 「lumen」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cviebrock/laravel-mangopay 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cviebrock/laravel-mangopay 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cviebrock/laravel-mangopay 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This Bundle include Mangopay php sdk as a service
Dealing with payments through the Egyptian payment gateway PayMob
Librería para la gestión sencilla de pagos mediante TPV Redsys y Paypal
PHP library to communicate with mangopay.com API
Symfony2 bundle to integrate Mangopay
MangoPay bundle for Symfony
统计信息
- 总下载量: 73.16k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 19
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-04-13