PHP code example of kangdev / fulu

1. Go to this page and download the library: Download kangdev/fulu 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/ */

    

kangdev / fulu example snippets




//此config配置可全局封装
$config = [
    'AppKey'      => 'your-app_key',
    'AppSecret'   => 'your-app_secret',
    'MemberCode'  => 'your-member_code',
    'online'      => 0, //0=沙箱环境,1=线上环境
    'debug' => true,
    'log' => [
        'name' => 'fulu',
        'file' => __DIR__ . '/fulu.log',
        'level' => 'debug',
        'permission' => 0777,
    ],
];
$server = new \Kangdev\Fulu\FuLuServer($config);


// 获取商品列表接口 其中post为请求方式
$server->postData([
    'method' => 'fulu.goods.list.get',
    'product_name' => "腾讯Q币"
],'json');

// 获取商品信息接口
$server->postData([
    'method' => 'fulu.goods.info.get',
    'product_id' => '10000001',
    'detail_format' => 1,
]);