定制 pandagrouppl/subuno-php-api 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pandagrouppl/subuno-php-api

最新稳定版本:1.0.3

Composer 安装命令:

composer require pandagrouppl/subuno-php-api

包简介

Minimal software development kit for connecting with Subuno API in PHP applications.

README 文档

README

How to use Subuno SDK:

1. Create configuration class that implements ConfigInterface
class TestConfig implements \PandaGroup\SubunoApi\Contract\ConfigInterface

You can save your api keys in database, env file, and wherever you want - the most important is to return it in the Configuration class.

2. Create new client:
$config = new TestConfig();
$client = new \PandaGroup\SubunoApi\Client($config)
3. Invoke method execute on client with selected params in argument 'query':
$client->execute(['t_id' => 213]);
4. Using QueryBuilder and DataObjects

You can also use QueryBuilder and DataObjects (which is recommended) to build request that will be send to Subuno API. There are three types of data objects that represents different types of information proceed by Subuno API:

\PandaGroup\SubunoApi\DataObject\BillingInformation
\PandaGroup\SubunoApi\DataObject\OrderInformation
\PandaGroup\SubunoApi\DataObject\ShippingInformation

Use Factory class to create new data objects:

/** @var \PandaGroup\SubunoApi\DataObject\Factory\Factory $factory*/
$orderInfo = $factory->create(\PandaGroup\SubunoApi\DataObject\OrderInformation::class, ['transactionId' => 123]);

And pass data objects to query builder:

/** @var \PandaGroup\SubunoApi\Request\Builder\QueryBuilder $queryBuilder */
$queryBuilder->add($orderInfo)
$query = $queryBuilder->build()

Variable $query pass to execute method in client object.

$response = $client->execute($query);

统计信息

  • 总下载量: 74
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2022-06-24