An open API service indexing awesome lists of open source software.

https://github.com/ledccn/wechat-express-intracity

微信小程序同城配送
https://github.com/ledccn/wechat-express-intracity

Last synced: about 1 year ago
JSON representation

微信小程序同城配送

Awesome Lists containing this project

README

          

# 说明

## 安装

`composer require ledc/intra-city`

## 使用说明

开箱即用,只需要传入一个配置,初始化一个实例即可:

```php
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));
```

在创建实例后,所有的方法都可以有IDE自动补全;例如:

```php
//开通门店权限(无加密,可直接调用)
$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();
```

## 二次开发

配置管理类:`Ledc\IntraCity\Config`

同城配送API:`Ledc\IntraCity\ExpressApi`

你可以继承`Ledc\IntraCity\Config`或`Ledc\IntraCity\ExpressApi`,扩展您需要的功能。

## 捐赠

![reward](reward.png)