ddmc / invoice-bw-openapi-php-sdk
invoice-bw-openapi-php-sdk
1.1.0
2018-12-08 10:31 UTC
Requires
- php: >=5.4.0
- ddmc/core-openapi-php-sdk: >1.0,<2.0
README
接入指南
- PHP version >= 5.4 & curl extension support
- 通过composer安装SDK
- 创建Config配置类,填入key,secret和sandbox参数
- 使用sdk提供的接口进行开发调试
- 线上环境将Config中$sandbox值设为false
安装
php
composer require ddxq/invoice-bw-openapi-php-sdk
基本用法
php
use CoreOpenApi\Config\Config;
use InvoiceOpenApi\Api\InvoiceService;
use InvoiceOpenApi\Protocol\InvoiceClient;
//实例化一个配置类
$config = new Config($app_key, $app_secret, []);
$client = new InvoiceClient($token, $config);
//使用config和token对象,实例化一个服务对象
$invoiceservice = new InvoiceService($client);
//调用服务方法,获取资源
$resp = $invoiceservice->openInovice([]);