PHP code example of abbotton / meituan-takeaway
1. Go to this page and download the library: Download abbotton/meituan-takeaway 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/ */
abbotton / meituan-takeaway example snippets
use Abbotton\MeituanTakeaway\Application;
......
$config = [
'app_id' => 'xxx',
'app_secret' => 'xxx',
'request_url' => '', // 默认 `https://waimaiopen.meituan.com/api/v1/`
];
$app = new Application($config);
$params = ['order_id' => '27061900338318741', 'is_mt_logistics' => 1];
$orderDetail = $app->order->getOrderDetail($params);
print_r(json_decode($orderDetail, true));
// 商品类、活动类接口支持异步队列
$app->goods->async()->create([]);
......