1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Abbotton\DouDian\Api; |
4
|
|
|
|
5
|
|
|
use Illuminate\Http\Client\RequestException; |
6
|
|
|
use Psr\SimpleCache\InvalidArgumentException; |
7
|
|
|
|
8
|
|
|
class Coupons extends BaseRequest |
9
|
|
|
{ |
10
|
|
|
/** |
11
|
|
|
* 卡券取消核销接口. |
12
|
|
|
* |
13
|
|
|
* @param array $params |
14
|
|
|
* |
15
|
|
|
* @throws RequestException |
16
|
|
|
* @throws InvalidArgumentException |
17
|
|
|
* |
18
|
|
|
* @return array |
19
|
|
|
*/ |
20
|
|
|
public function cancelVerify(array $params): array |
21
|
|
|
{ |
22
|
|
|
return $this->httpPost('coupons/cancelVerify', $params); |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* 卡券废弃接口. |
27
|
|
|
* |
28
|
|
|
* @param array $params |
29
|
|
|
* |
30
|
|
|
* @throws RequestException |
31
|
|
|
* @throws InvalidArgumentException |
32
|
|
|
* |
33
|
|
|
* @return array |
34
|
|
|
*/ |
35
|
|
|
public function abandon(array $params): array |
36
|
|
|
{ |
37
|
|
|
return $this->httpPost('coupons/abandon', $params); |
38
|
|
|
} |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* 卡券同步. |
42
|
|
|
* |
43
|
|
|
* @param array $params |
44
|
|
|
* |
45
|
|
|
* @throws RequestException |
46
|
|
|
* @throws InvalidArgumentException |
47
|
|
|
* |
48
|
|
|
* @return array |
49
|
|
|
*/ |
50
|
|
|
public function syncV2(array $params): array |
51
|
|
|
{ |
52
|
|
|
return $this->httpPost('coupons/syncV2', $params); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* 卡券核销接口V2版本. |
57
|
|
|
* |
58
|
|
|
* @param array $params |
59
|
|
|
* |
60
|
|
|
* @throws RequestException |
61
|
|
|
* @throws InvalidArgumentException |
62
|
|
|
* |
63
|
|
|
* @return array |
64
|
|
|
*/ |
65
|
|
|
public function verifyV2(array $params): array |
66
|
|
|
{ |
67
|
|
|
return $this->httpPost('coupons/verifyV2', $params); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* 卡券核销接口. |
72
|
|
|
* |
73
|
|
|
* @param array $params |
74
|
|
|
* |
75
|
|
|
* @throws RequestException |
76
|
|
|
* @throws InvalidArgumentException |
77
|
|
|
* |
78
|
|
|
* @return array |
79
|
|
|
*/ |
80
|
|
|
public function verify(array $params): array |
81
|
|
|
{ |
82
|
|
|
return $this->httpPost('coupons/verify', $params); |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* 卡券核销次数更新. |
87
|
|
|
* |
88
|
|
|
* @param array $params |
89
|
|
|
* |
90
|
|
|
* @throws RequestException |
91
|
|
|
* @throws InvalidArgumentException |
92
|
|
|
* |
93
|
|
|
* @return array |
94
|
|
|
*/ |
95
|
|
|
public function certVerifyUpdate(array $params): array |
96
|
|
|
{ |
97
|
|
|
return $this->httpPost('coupons/certVerifyUpdate', $params); |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* 三方卡券列表查询. |
102
|
|
|
* |
103
|
|
|
* @param array $params |
104
|
|
|
* |
105
|
|
|
* @return array |
106
|
|
|
* @throws InvalidArgumentException |
107
|
|
|
* |
108
|
|
|
* @throws RequestException |
109
|
|
|
*/ |
110
|
|
|
public function list(array $params): array |
111
|
|
|
{ |
112
|
|
|
return $this->httpPost('coupons/list', $params); |
113
|
|
|
} |
114
|
|
|
} |
115
|
|
|
|