Files
WashCar/src/Action/CouponAction.php
2021-06-10 10:29:16 +08:00

95 lines
1.9 KiB
PHP

<?php
namespace XuanChen\WashCar\Action;
class CouponAction extends Init
{
/**
* Notes: 跳转到下单url
* @Author: 玄尘
* @Date : 2021/6/4 14:11
*/
public function getOrderUrl()
{
$url = $this->config['baseUri'] . '/v2/h5/redirect/autoLogin/returnUrl';
$this->params = array_merge($this->params, [
'urlKey' => $this->config['urlKey'],
]);
$params = $this->getParams();
$this->http($url, $params);
return $this->getResponse();
}
/**
* Notes: 发券
* @Author: 玄尘
* @Date : 2021/6/4 14:26
*/
public function grant()
{
$url = $this->config['baseUri'] . '/v2/rights/coupon/getCoupon';
$params = $this->getParams();
$this->http($url, $params);
return $this->getResponse();
}
/**
* Notes: 查询优惠券状态
* @Author: 玄尘
* @Date : 2021/6/4 14:28
*/
public function query()
{
$url = $this->config['baseUri'] . '/v2/rights/coupon/getCouponStatus';
$params = $this->getParams();
$this->http($url, $params);
return $this->getResponse();
}
/**
* Notes: 查询优惠券信息
* @Author: 玄尘
* @Date : 2021/6/9 15:22
* @return array
*/
public function info()
{
$url = $this->config['baseUri'] . '/v2/rights/coupon/getCouponInfo';
$params = $this->getParams();
$this->http($url, $params);
return $this->getResponse();
}
/**
* Notes: 取消优惠券
* @Author: 玄尘
* @Date : 2021/6/4 14:29
*/
public function cancel()
{
$url = $this->config['baseUri'] . '/v2/rights/coupon/recedeCoupon';
$params = $this->getParams();
$this->http($url, $params);
return $this->getResponse();
}
}