bcloudone/sdk-php

There is no license information available for the latest version (v1.0.4) of this package.

php sdk for bcloud.one

v1.0.4 2020-06-15 09:13 UTC

This package is not auto-updated.

Last update: 2024-10-01 06:02:49 UTC


README

基于PHP的BCloud平台SDK

安装方法

$ composer require bcloudone/sdk-php 

使用方法

use BCloudOne\PaymentService

try {
    //传入RSA公私钥以及秘钥ID
    $PaymentService = new PaymentService($publicKey, $privateKey, $accessId);
    $address_info = $PaymentService->getNewWalletAddress($coin, $user_tag);
    if(!$address_info || $address_info['code'] != 0){
        $this->fail($address_info['code'], $address_info['message']);
    }
} catch (BCloudException $e) {
    //异常处理
    $this->fail(ResponseService::ERROR_MISSING_PARAM, $e->getMessage());
}
//返回数据
$address_info  = [
    'code'    => 0,
    'message' => '成功',
    'data'    => [
        "address"=> "0x9787Bb1dfa0C9b74a0ECe2b116c2a61Efc46069b",
        "address_tag"=> ""
    ]
  ];

链接