开发/fastbill-bundle

为调用 fastbill.com API 的 Symfony2 扩展包

安装: 56

依赖: 0

建议者: 0

安全: 0

星标: 0

关注者: 2

分支: 1

开放问题: 0

类型:symfony-bundle

dev-master 2013-11-26 09:28 UTC

This package is not auto-updated.

Last update: 2024-09-23 16:21:42 UTC


README

Symfony 2 扩展包,将 DVelopment/FastBill 库注册为服务。

安装

使用 composer 安装扩展包(有关 composer 的更多信息,请参阅 https://composer.php.ac.cn/

composer require dvelopment/fastbill-bundle dev-master

或直接将包添加到您的 composer.json 文件中,并运行 composer update

然后只需将扩展包添加到您的 AppKernel.php 文件中

<?php
// in AppKernel::registerBundles()
$bundles = array(
    // ...
    new DVelopment\FastBillBundle\DVelopmentFastBillBundle(),
    // ...
);

配置

您需要在 config.yml 中配置 FastBill API 凭据(您可以在 my.fastbill.com 的账户设置中的设置区域找到 API 密钥)

d_velopment_fast_bill:
    # the username is your e-mail address
    # used to sign up to FastBill
    username: %fast_bill_username%
    apiKey:   %fast_bill_api_key%

用法

API 包装器作为 d_velopment_fast_bill.api 服务可用

<?php
$api = $container->get('d_velopment_fast_bill.api');
$customers = $api->getCustomers();