phobetor/billomat-bundle
Composer 安装命令:
composer require phobetor/billomat-bundle
包简介
A Symfony 2 bundle around the Billomat API client
README 文档
README
A Symfony 2 bundle for the Billomat API client.
Installation
Add bundle via command line
php composer.phar require phobetor/billomat-bundle
or manually to composer.json file
{ "require": { "phobetor/billomat-bundle": "~1.3" } }
Fetch the needed files:
$ php composer.phar update phobetor/billomat-bundle
This will install the bundle and the client to your project’s vendor directory.
Add the bundle to your project’s AppKernel:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // […] new PhobetorBillomatBundle\PhobetorBillomatBundle() ); }
Configuration
Add your credentials to app/config/config.yml:
# app/config/config.yml phobetor_billomat: id: 'my-id' # your Billomat id (required) api_key: 'my-key' # your Billomat API key (required) application: # your Billomat API application credentials # (if you have a registered application) id: 'my-app-id' # your Billomat API application’s id secret: 'my-app-secret' # your Billomat API application’s secret
Using the Billomat API with a registered app is highly recommended due to higher rate limits.
Usage
Get client from Symfony’s DI container:
$billomat = $this->get('phobetor_billomat')->getClient();
Automatic rate limit handling
If this client is used in asynchronous processes or CLI commands you can activate automatic waiting for rate limit reset.
In that mode all method calls that would otherwise throw a \Phobetor\Billomat\Exception\TooManyRequestsException will wait for the rate limit reset and retry automatically.
You SHOULD NOT use this in synchronous request (e. g. a website request) because all method calls in that mode can last very long and most likely longer than your server’s gateway timeout.
There are two ways to do this.
In configuration:
# app/config/config.yml phobetor_billomat: # […] wait_for_rate_limit_reset: true
After fetching from container:
$billomat = $this->get('phobetor_billomat')->getClient(); $billomat->setDoWaitForRateLimitReset(true);
Multiple configurations
You can add multiple configurations to your app/config/config.yml. This allows you to configure multiple users, apps or combinations.
# app/config/config.yml phobetor_billomat: id: 'my-id' api_key: 'my-key' clients: cli: id: 'my-id' api_key: 'my-key' application: id: 'my-app-id' secret: 'my-app-secret' wait_for_rate_limit_reset: true
This example configures the default client without an app (which grants requests up to the standard user rate limit of 300 requests) and without automatic rate limit handling.
In addition another cli client is configured with an app (which grants requests up to the standard app rate limit of 1000 requests) and with automatic rate limit handling.
In that way you can use a client with automatic rate limit handling in you asynchronous (and most likely long running) cli commands:
$billomat = $this->get('phobetor_billomat')->getClient('cli'); // e. g. create a huge bunch of invoices
In parallel, you can use a client without a configured app (which gives you a lower, but separate rate limit) to use in your application’s requests:
$billomat = $this->get('phobetor_billomat')->getClient(); // e. g. fetch and show a list of invoices in your internal application
phobetor/billomat-bundle 适用场景与选型建议
phobetor/billomat-bundle 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 124 次下载、GitHub Stars 达 0, 最近一次更新时间为 2014 年 02 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Symfony2」 「invoice」 「billing」 「billomat」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 phobetor/billomat-bundle 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 phobetor/billomat-bundle 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 phobetor/billomat-bundle 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easy invoice generation using Laravel Eloquent
Laravel Cashier provides an expressive, fluent interface to Braintree's subscription billing services.
Metamel Addresses is a polymorphic Laravel package, for address book management. You can add addresses to any eloquent model with ease.
Laravel MPdf : Easily generate PDF files with arabic support
Szamlazz.hu integration for Laravel
统计信息
- 总下载量: 124
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-02-17