neyric/mangopay-bundle
Composer 安装命令:
composer require neyric/mangopay-bundle
包简介
MangoPay bundle for Symfony
README 文档
README
A Symfony bundle for MangoPay, providing additionnal services on top of the official MangoPay PHP SDK
- Provide a service to access the API for a better Symfony integration
- Add useful commands
- Webhook handler (HTTP controller) + Webhook Event
Requirements
- Php 7.1
- Symfony 4.4
Installation
$ composer require neyric/mangopay-bundle
Load the bundle in your app
$bundles = [ // ... new \Neyric\MangoPayBundle\NeyricMangoPayBundle(), ];
Configuration
The bundle (in particular the MangoPayService), expects those 3 environement variables to be defined
- MANGOPAY_CLIENT_ID
- MANGOPAY_PASSWORD
- MANGOPAY_BASE_URL (should be https://api.sandbox.mangopay.com or https://api.mangopay.com)
Accessing the MangoPay API
Once configured, you can use Symfony dependency injection to access the API from the sdk:
use Neyric\MangoPayBundle\Service\MangoPayService; class MyService { public function __construct(MangoPayService $mangoPayService) { $this->mangoPayService = $mangoPayService; } public function someMethod() { // You can access the public `api` property, which is the // configured instance of MangoPay\MangoPayApi $hooks = $this->mangoPayService->api->Hooks->GetAll(); } }
Symfony Commands
Display a list of installed hooks :
php bin/console neyric_mangopay:hooks:list
Display rate limits (performs 1 api call) :
php bin/console neyric_mangopay:ratelimits
Using the webhook handler
First, setup the route in your routes.yaml file :
neyric_mangopay: path: /mangopay_webook/hook_handler # Customizable url controller: Neyric\MangoPayBundle\Controller\HookController::hookHandlerAction
Then register the webhook, you want using the Mangopay console.
Create a subscriber
use Neyric\MangoPayBundle\Event\MangoPayHookEvent; class MySubscriber implements EventSubscriberInterface { public function onMangopayKycSucceeded(MangoPayHookEvent $event) { // ... } public function onMangopayUboDeclarationValidated(MangoPayHookEvent $event) { // ... } public static function getSubscribedEvents() { return [ 'MANGOPAY_KYC_SUCCEEDED' => ['onMangopayKycSucceeded', 1], 'MANGOPAY_UBO_DECLARATION_VALIDATED' => ['onMangopayUboDeclarationValidated', 1], ]; } }
And eventually declare the service with the kernel.event_subscriber tag :
App\Subscriber\MySubscriber: class: App\Subscriber\MySubscriber tags: - { name: kernel.event_subscriber }
License
neyric/mangopay-bundle is distributed under MIT license, see the LICENSE file.
Contacts
Report bugs or suggest features using issue tracker on GitHub.
neyric/mangopay-bundle 适用场景与选型建议
neyric/mangopay-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 932 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 12 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「symfony」 「mangopay」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 neyric/mangopay-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 neyric/mangopay-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 neyric/mangopay-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel/Lumen wrapper for the office Mangopay SDK library
This Bundle include Mangopay php sdk as a service
The bundle for easy using json-rpc api on your project
Bundle Symfony DaplosBundle
PHP library to communicate with mangopay.com API
Symfony2 bundle to integrate Mangopay
统计信息
- 总下载量: 932
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-12-16