dizda/coinegger-client-bundle
最新稳定版本:0.0.12
Composer 安装命令:
composer require dizda/coinegger-client-bundle
包简介
A Symfony2 bundle to interoperate with the Bitdepot bitcoin wallet.
README 文档
README
When bitcoin meet Arnold Schwarzenegger.
See the API Project.
Setup
Install with Composer
composer require dizda/bitdepot-client-bundle
Configuration
To active hooks, you must update your routing.yml:
dizda_bitdepot_client: resource: "@DizdaBitdepotClientBundle/Resources/config/routing.yml" prefix: /callback # don't forget to restrict the path you specify in your security.yml
Add this to your config.yml:
dizda_bitdepot_client: base_url: %bitdepot_endpoint% # Correspond to the bitdepot api server app_id: %bitdepot_app_id% app_secret: %bitdepot_app_secret%
Listeners
You probably want to listening all interactions that are made on/by your addresses? It's simple.
DepositListener
An event dizda_bitdepot_client.deposit_callback is dispatched everytime a deposit is made (and reached confirmations you specified).
So, for example, you could create a listener:
<?php // AdvertisingBundle/EventListener/DepositListener.php namespace Dizda\Bundle\AdvertisingBundle\EventListener; use Dizda\BitdepotClientBundle\Event\CallbackEvent; /** * Class DepositListener */ class DepositListener { /** * When a deposit is made, the listener will trigger this hook * * @param CallbackEvent $event */ public function onDepositCallback(CallbackEvent $event) { $data = $event->getData(); if ($data['is_fulfilled'] === false) { // The case when the deposit were not sufficient return; } if ($data['is_overfilled'] === true) { // do something } // The deposit was notified to be successful, so you can do your stuff there $advertiser = $this->em ->getRepository('DizdaAdvertisingBundlee:Advertiser') ->findOneByDepositAddress($data['address_external']['value']) ; // Activate the campaign $advertiser->activate(); // [...] } }
And add the listener to services.xml:
<service id="dizda_advertising.listener.deposit" class="Dizda\Bundle\AdvertisingBundle\EventListener\DepositListener"> <tag name="kernel.event_listener" event="dizda_bitdepot_client.deposit_callback" method="onDepositCallback" /> </service>
That's it!
License
MIT Licensed, see LICENSE.
dizda/coinegger-client-bundle 适用场景与选型建议
dizda/coinegger-client-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 951 次下载、GitHub Stars 达 2, 最近一次更新时间为 2015 年 01 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「bitcoin」 「wallet」 「bitdepot」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dizda/coinegger-client-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dizda/coinegger-client-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dizda/coinegger-client-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
The BlockTrail PHP SDK, for integration of Bitcoin functionality through the BlockTrail API
A Symfony2 bundle to interoperate with the Bitdepot bitcoin wallet.
Library for validation of cryptocoin wallets
CoinDesk Bitcoin Price Index API for Laravel
Yoke: SSH Connection Manager/Wallet
Skrill gateway for Omnipay payment processing library
统计信息
- 总下载量: 951
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-14