PHP code example of onecoder / easytaoke

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

    

onecoder / easytaoke example snippets



$config = [
    'key'             => '',  //美团联盟key
    'secret'          => '',  //美团联盟secret
    'callback_secret' => '',  //美团联盟callback_secret
];

//实例化美团联盟应用
$meiTuanUnion = \OneCoder\EasyTaoKe\Factory::meiTuanUnion($config);
$startTime = date('Y-m-d H:i:s', time() - 24 * 60 * 60);
$endTime   = date('Y-m-d H:i:s');

//获取美团联盟订单
$data = $meiTuanUnion->getOrderList($startTime, $endTime);

//回调验证,返回true验证通过
$callBackResult = $meiTuanUnion->validateCallback($params);