/
CrowdSourcing.php
55 lines (47 loc) · 1.45 KB
/
CrowdSourcing.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
declare(strict_types=1);
namespace EasyMeiTuan\Services;
use EasyMeiTuan\Client;
use EasyMeiTuan\Support\Validator;
use Symfony\Contracts\HttpClient\ResponseInterface;
// 众包
class CrowdSourcing extends Client
{
/**
* 批量查询众包配送费
* https://developer.waimai.meituan.com/home/docDetail/151
*/
public function shippingFee(string $orderIds): ResponseInterface
{
return $this->get('order/zhongbao/shippingFee', ['order_ids' => $orderIds]);
}
/**
* 众包发配送
* https://developer.waimai.meituan.com/home/docDetail/154
*
* @throws \EasyMeiTuan\Exceptions\InvalidParamsException
*/
public function dispatch(array $params): ResponseInterface
{
Validator::verify($params, [
'order_id' => 'required|integer',
'shipping_fee' => 'required|numeric',
'tip_amount' => 'required|numeric',
]);
return $this->get('order/zhongbao/dispatch', $params);
}
/**
* 众包配送单追加小费
* https://developer.waimai.meituan.com/home/docDetail/157
*
* @throws \EasyMeiTuan\Exceptions\InvalidParamsException
*/
public function additionalTip(array $params): ResponseInterface
{
Validator::verify($params, [
'order_id' => 'required|integer',
'tip_amount' => 'required|numeric',
]);
return $this->get('order/zhongbao/update/tip', $params);
}
}