PHP code example of ledc / intra-city

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

    

ledc / intra-city example snippets


use Ledc\IntraCity\Config;
use Ledc\IntraCity\ExpressApi;

//更多配置项,可以查看 配置管理类的属性 Ledc\IntraCity\Config
$config = [
    'appid' => '',
    'token' => '',
    'access_token' => function (string $appid) use ($miniProgramAccessToken) {
          return $miniProgramAccessToken->getToken();
     },
    'aes_sn' => '',
    'aes_key' => '',
    'rsa_sn' => '',
    'rsa_public_key' => '',
    'rsa_private_key' => '',
    'cert_sn' => '',
    'cert_key' => '',
    'callback_url' => '',
    'wx_store_id' => '',
    'order_detail_path' => '',
    'enable' => true,
    'use_sandbox' => true,
];

$api = new ExpressApi(new Config($config));

//开通门店权限(无加密,可直接调用)
$api->apply();

//创建门店
$api->createStore();

//查询门店
$api->queryStore();

//更新门店
$api->updateStore();

//门店运费充值
$api->storeCharge();

//门店运费退款
$api->storeRefund();

//门店运费流水查询
$api->queryFlow();

//门店余额查询
$api->balanceQuery();

//查询运费
$api->previewAddOrder();

//创建配送单
$api->addOrder();

//查询配送单
$api->queryOrder();

//取消配送单
$api->cancelOrder();

//模拟回调接口
$api->mockNotify();