PHP code example of isadmin / jinritemai

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

    

isadmin / jinritemai example snippets




use isadmin\Jinritemai\Enum\AppType;

return [
    'app_key' => '',
    'app_secret' => '',
    'app' => [
        // 默认
        'version' => '2',
        // 应用类型,AppType::SELF_APP为自用型应用,AppType::TOOL_APP为工具型应用
        'type'    => AppType::TOOL_APP,
    ],
    'request' => [
        'timeout' => 30.0,
        'base_uri' => 'https://openapi-fxg.jinritemai.com',
    ],
    'oauth' => [
        'url' => 'https://fxg.jinritemai.com/index.html#/ffa/open/applicationAuthorize',
    ],
];

use isadmin\Jinritemai\Application;

$app = new Application($config);

// 显示商品列表,实际调用的方法是GET /product/list
$app->product->list();
// 显示商品详情,实际调用的方法是/product/detail
$app->product->detail($product_id);