|
@@ -7,21 +7,89 @@ use Lackoxygen\TiktokOpen\Base\Signer\LifeSigner; |
|
@@ -7,21 +7,89 @@ use Lackoxygen\TiktokOpen\Base\Signer\LifeSigner; |
|
7
|
|
7
|
|
|
8
|
class Coupon extends ServiceManager
|
8
|
class Coupon extends ServiceManager
|
|
9
|
{
|
9
|
{
|
|
|
|
10
|
+ /**
|
|
|
|
11
|
+ * 验券准备
|
|
|
|
12
|
+ *
|
|
|
|
13
|
+ * @param string $encryptedData
|
|
|
|
14
|
+ * @param string $code
|
|
|
|
15
|
+ *
|
|
|
|
16
|
+ * @return mixed
|
|
|
|
17
|
+ */
|
|
10
|
public function prepare(string $encryptedData = '', string $code = '')
|
18
|
public function prepare(string $encryptedData = '', string $code = '')
|
|
11
|
{
|
19
|
{
|
|
12
|
return $this->app['client']
|
20
|
return $this->app['client']
|
|
13
|
- ->asQuery()
|
21
|
+ ->asForm()
|
|
14
|
->withSession()
|
22
|
->withSession()
|
|
15
|
- //->signVia(new LifeSigner())
|
|
|
|
16
|
- ->get('/goodlife/v1/fulfilment/certificate/prepare/', ['encrypted_data' => $encryptedData, 'code' => $code]);
|
23
|
+ ->signVia(new LifeSigner())
|
|
|
|
24
|
+ ->post('/goodlife/v1/fulfilment/certificate/prepare/',
|
|
|
|
25
|
+ ['encrypted_data' => $encryptedData, 'code' => $code]);
|
|
|
|
26
|
+ }
|
|
|
|
27
|
+
|
|
|
|
28
|
+ /**
|
|
|
|
29
|
+ * 验券
|
|
|
|
30
|
+ *
|
|
|
|
31
|
+ * @param array $body
|
|
|
|
32
|
+ *
|
|
|
|
33
|
+ * @return mixed
|
|
|
|
34
|
+ */
|
|
|
|
35
|
+ public function verify(array $body = [])
|
|
|
|
36
|
+ {
|
|
|
|
37
|
+ return $this->app['client']
|
|
|
|
38
|
+ ->asForm()
|
|
|
|
39
|
+ ->withSession()
|
|
|
|
40
|
+ ->signVia(new LifeSigner())
|
|
|
|
41
|
+ ->post('/goodlife/v1/fulfilment/certificate/verify/', $body);
|
|
|
|
42
|
+ }
|
|
|
|
43
|
+
|
|
|
|
44
|
+ /**
|
|
|
|
45
|
+ * 撤销核销
|
|
|
|
46
|
+ *
|
|
|
|
47
|
+ * @link https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/life-service-open-ability/life.capacity/life.capacity.fulfilment/certificate.verify
|
|
|
|
48
|
+ *
|
|
|
|
49
|
+ * @param array $body
|
|
|
|
50
|
+ *
|
|
|
|
51
|
+ * @return mixed
|
|
|
|
52
|
+ */
|
|
|
|
53
|
+ public function cancel(array $body = [])
|
|
|
|
54
|
+ {
|
|
|
|
55
|
+ return $this->app['client']
|
|
|
|
56
|
+ ->asForm()
|
|
|
|
57
|
+ ->withSession()
|
|
|
|
58
|
+ ->signVia(new LifeSigner())
|
|
|
|
59
|
+ ->post('/goodlife/v1/fulfilment/certificate/cancel/', $body);
|
|
|
|
60
|
+ }
|
|
|
|
61
|
+
|
|
|
|
62
|
+ /**
|
|
|
|
63
|
+ * 券状态查询
|
|
|
|
64
|
+ *
|
|
|
|
65
|
+ * @param string $encryptedCode
|
|
|
|
66
|
+ *
|
|
|
|
67
|
+ * @return mixed
|
|
|
|
68
|
+ */
|
|
|
|
69
|
+ public function get(string $encryptedCode)
|
|
|
|
70
|
+ {
|
|
|
|
71
|
+ return $this->app['client']
|
|
|
|
72
|
+ ->asForm()
|
|
|
|
73
|
+ ->withSession()
|
|
|
|
74
|
+ ->signVia(new LifeSigner())
|
|
|
|
75
|
+ ->get('/goodlife/v1/fulfilment/certificate/get/', ['encrypted_code' => $encryptedCode]);
|
|
17
|
}
|
76
|
}
|
|
18
|
|
77
|
|
|
19
|
- public function verify(array $params)
|
78
|
+ /**
|
|
|
|
79
|
+ * 券状态批量查询
|
|
|
|
80
|
+ *
|
|
|
|
81
|
+ * @param string $encryptedCode
|
|
|
|
82
|
+ * @param string $orderId
|
|
|
|
83
|
+ *
|
|
|
|
84
|
+ * @return mixed
|
|
|
|
85
|
+ */
|
|
|
|
86
|
+ public function query(string $encryptedCode = '', string $orderId = '')
|
|
20
|
{
|
87
|
{
|
|
21
|
return $this->app['client']
|
88
|
return $this->app['client']
|
|
22
|
- ->asJson()
|
89
|
+ ->asForm()
|
|
23
|
->withSession()
|
90
|
->withSession()
|
|
24
|
->signVia(new LifeSigner())
|
91
|
->signVia(new LifeSigner())
|
|
25
|
- ->post('goodlife/v1/fulfilment/certificate/verify/', $params);
|
92
|
+ ->get('/goodlife/v1/fulfilment/certificate/query/',
|
|
|
|
93
|
+ ['encrypted_code' => $encryptedCode, 'order_id' => $orderId]);
|
|
26
|
}
|
94
|
}
|
|
27
|
} |
95
|
} |