PHP code example of kylin987 / meituan-sdk

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

    

kylin987 / meituan-sdk example snippets



$meituan = new Meituan([
    'developer_id' => '',
    'sign_key' => '',
    'debug' => true, // 输出日志
    'log' => [
        'name' => 'meituan',
        'file' => storage_path('logs/meituan.log'),
        'level'      => 'debug',
        'permission' => 0777,
    ]
]);

$response = $meituan->store->callback();

if (empty($response)) {
    return false;
}

$authToken = $response['appAuthToken'];

// 获取门店信息
$info = $meituan->createAuthorizer($authToken)->waimai->poi->queryPoiInfo($response['ePoiId']);