changecoins/http-client 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

changecoins/http-client

最新稳定版本:1.0.9

Composer 安装命令:

composer require changecoins/http-client

包简介

Changecoins' PHP SDK for merchant REST API

README 文档

README

Client usage

To initialize http-client you should provide your secretKey and publicKey. If you do not have them, you can connect with us tech@changecoins.io.

To initialize http-client you should provide your secretKey and publicKey.

<?php

declare(strict_types=1);

namespace App;

use ChangeCoins\ClientFacade;
use ChangeCoins\Factory\RequestConfig;

...

$clientFacade = new ClientFacade(new RequestConfig('secretKey', 'publicKey'));
$client       = $clientFacade->createClient();

Request examples

<?php

...

$balanceDto = new BalanceDto();
$balanceDto->setNonce(time());

$result = $client->getBalance($balanceDto)->toArray();

All request examples you can find here.

Validation errors

Please, note, that current API doesn't correspond to all existing RESTFull API requirements. The responses are unusual (not HTTP status codes) when an error occurs as a result of validation. Response HTTP status code will be 200 and the response body:

{
    "err_code": 102,
    "err_description": "error description"
}

If the server will return a validation error, the client will throw ResponseValidationException. This type of exception extends \RuntimeException class You can find out how does our API works here.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2021-07-22