PHP code example of imactool / jinritemai

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

    

imactool / jinritemai example snippets

js
PHP >= 7.1
PHP cURL 扩展
PHP OpenSSL 扩展



use Imactool\Jinritemai\DouDianApp;

date_default_timezone_set('PRC');

$config = [
    'app_key'       => '你的appkey',
    'app_secret'    => '你的秘钥',
    'service_id'    => '你的服务id' 
];

$servic = new DouDianApp($config);

 
$shopid = 23; //$shopid 为授权方店铺的ID shop_id
try {
    $accessInfo = $servic->Auth->getShopAccessToken($shopid);
    echo "调用结果:";
    var_dump($accessInfo);
}catch (Exception $exception){
    var_dump($exception);
}