PHP code example of overnic / qiyuesuo-sdk

1. Go to this page and download the library: Download overnic/qiyuesuo-sdk library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

overnic / qiyuesuo-sdk example snippets



// 初始化
$manager = new OverNick\QiYueSuo\Manager([
    // 沙箱模式,true表示对接到测试地址
    'sandbox' => true,
    'token' => '契约锁开放平台获取的token',
    'secret' => '契约锁开放平台获取的secret',
    'client' => true
])->bootstrapHttpClient();

// 合同
// 实例指向 OverNick\QiYueSuo\Providers\Contract\Client
$manager->contract

// 认证
// 实例指向 OverNick\QiYueSuo\Providers\Auth\Client
$manager->auth
// 印章
// 实例指向 OverNick\QiYueSuo\Providers\Seal\Client
$manager->seal

/**
* 以上对象实例也可以通过数组的方式进行调用,Manager 实现了 ArrayAccess接口和使用了__get,__set方法
* $manager['auth']
* ...
*/