|
...
|
...
|
@@ -7,21 +7,89 @@ 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']
|
|
|
|
->asQuery()
|
|
|
|
->asForm()
|
|
|
|
->withSession()
|
|
|
|
//->signVia(new LifeSigner())
|
|
|
|
->get('/goodlife/v1/fulfilment/certificate/prepare/', ['encrypted_data' => $encryptedData, 'code' => $code]);
|
|
|
|
->signVia(new LifeSigner())
|
|
|
|
->post('/goodlife/v1/fulfilment/certificate/prepare/',
|
|
|
|
['encrypted_data' => $encryptedData, 'code' => $code]);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 验券
|
|
|
|
*
|
|
|
|
* @param array $body
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function verify(array $body = [])
|
|
|
|
{
|
|
|
|
return $this->app['client']
|
|
|
|
->asForm()
|
|
|
|
->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]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function verify(array $params)
|
|
|
|
/**
|
|
|
|
* 券状态批量查询
|
|
|
|
*
|
|
|
|
* @param string $encryptedCode
|
|
|
|
* @param string $orderId
|
|
|
|
*
|
|
|
|
* @return mixed
|
|
|
|
*/
|
|
|
|
public function query(string $encryptedCode = '', string $orderId = '')
|
|
|
|
{
|
|
|
|
return $this->app['client']
|
|
|
|
->asJson()
|
|
|
|
->asForm()
|
|
|
|
->withSession()
|
|
|
|
->signVia(new LifeSigner())
|
|
|
|
->post('goodlife/v1/fulfilment/certificate/verify/', $params);
|
|
|
|
->get('/goodlife/v1/fulfilment/certificate/query/',
|
|
|
|
['encrypted_code' => $encryptedCode, 'order_id' => $orderId]);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|