ashin33/qn-api

1.4.1 2024-01-25 05:38 UTC

This package is auto-updated.

Last update: 2024-12-25 07:44:19 UTC


README

清宁云服api接口SDK

安装

$ composer require ashin33/qn-api -vvv

请求可用方法

响应可用方法

用法示例

具体使用请参考 调用示例,支持使用request方法发起SDK中未定义的接口请求

$host = '清宁云服分配的实际请求域名';
$qnPublicKey = '***.key';//清波公钥(文件路径或行内秘钥字符串)
$merchantPrivateKey = '***.key';//商户私钥(文件路径或行内秘钥字符串)
$instId = '********';//清波分配的商户id
$secret = '*************************';//清波分配的秘钥
$api = new Ashin33\QnApi\QnApi(
    $instId, 
    $secret,
    $qnPublicKey,
    $merchantPrivateKey,
    $host
);

$data = [
    "customer_name" => "安*",
    "cert_no" => "1301****7389",
    "customer_mobile" => "156****6907",
    "bank_card_no" => "6215****4390",
    "bank_phone" => "156****6907"
];
$res = $api->register($data);
var_dump($res->isSuccess());//判断接口请求是否成功

在laravel中使用

发布配置文件

执行 php artisan vendor:publish --tag=qn-api 命令,在configs目录下生成qn-api.php文件,按需修改参数

使用

use Ashin33\QnApi\Facades\QnApi;

$data = [
    "customer_name" => "安*",
    "cert_no" => "1301****7389",
    "customer_mobile" => "156****6907",
    "bank_card_no" => "6215****4390",
    "bank_phone" => "156****6907"
];
$res = QnApi::register($data);
var_dump($res->isSuccess());

更新扩展包

$ composer update ashin33/qn-api

贡献

您可以通过以下三种方式之一做出贡献:

  1. 使用 issue tracker 上报bug.
  2. issue tracker 中回复问题或bug.
  3. 贡献新功能或更新 wiki.

The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

证书

MIT