Coupon.php
2.3 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
namespace Lackoxygen\TiktokOpen\Wap\Life;
use Lackoxygen\TiktokOpen\Base\ServiceManager;
use Lackoxygen\TiktokOpen\Base\Signer\LifeSigner;
class Coupon extends ServiceManager
{
/**
* 验券准备
*
* @param string $encryptedData
* @param string $code
*
* @return mixed
*/
public function prepare(string $encryptedData = '', string $code = '')
{
return $this->app['client']->withSession()
->signVia(new LifeSigner())
->get('/goodlife/v1/fulfilment/certificate/prepare/',
['encrypted_data' => $encryptedData, 'code' => $code]);
}
/**
* 验券
*
* @param array $body
*
* @return mixed
*/
public function verify(array $body = [])
{
return $this->app['client']->asJson()
->withSession()
->signVia(new LifeSigner())
->post('/goodlife/v1/fulfilment/certificate/verify/', $body);
}
/**
* 撤销核销
*
* @link https://developer.open-douyin.com/docs/resource/zh-CN/dop/develop/openapi/life-service-open-ability/life.capacity/life.capacity.fulfilment/certificate.verify
*
* @param array $body
*
* @return mixed
*/
public function cancel(array $body = [])
{
return $this->app['client']->asForm()
->withSession()
->signVia(new LifeSigner())
->post('/goodlife/v1/fulfilment/certificate/cancel/', $body);
}
/**
* 券状态查询
*
* @param string $encryptedCode
*
* @return mixed
*/
public function get(string $encryptedCode)
{
return $this->app['client']->asForm()
->withSession()
->signVia(new LifeSigner())
->get('/goodlife/v1/fulfilment/certificate/get/', ['encrypted_code' => $encryptedCode]);
}
/**
* 券状态批量查询
*
* @param string $encryptedCode
* @param string $orderId
*
* @return mixed
*/
public function query(string $encryptedCode = '', string $orderId = '')
{
return $this->app['client']->asForm()
->withSession()
->signVia(new LifeSigner())
->get('/goodlife/v1/fulfilment/certificate/query/',
['encrypted_code' => $encryptedCode, 'order_id' => $orderId]);
}
}