From aacd8a4563f7d97c90b9601b4c9c6c44d8b67bee Mon Sep 17 00:00:00 2001 From: Anyon Date: Fri, 25 May 2018 10:28:02 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E5=A2=9E=E5=8A=A0=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E5=95=86=E6=88=B7=E4=BB=A3=E9=87=91=E5=88=B8=E7=B1=BB?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- We.php | 1 + WePay/Coupon.php | 62 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 WePay/Coupon.php diff --git a/We.php b/We.php index 4acafaf..9b982cb 100644 --- a/We.php +++ b/We.php @@ -54,6 +54,7 @@ use WeChat\Exceptions\InvalidInstanceException; * @method \WePay\Bill WePayBill($options = []) static 微信商户账单及评论 * @method \WePay\Order WePayOrder($options = []) static 微信商户订单 * @method \WePay\Refund WePayRefund($options = []) static 微信商户退款 + * @method \WePay\Coupon WePayCoupon($options = []) static 微信商户代金券 * @method \WePay\Redpack WePayRedpack($options = []) static 微信红包支持 * @method \WePay\Transfers WePayTransfers($options = []) static 微信商户打款到零钱 * @method \WePay\TransFresBank WePayTransFresBank($options = []) static 微信商户打款到银行卡 diff --git a/WePay/Coupon.php b/WePay/Coupon.php new file mode 100644 index 0000000..3281048 --- /dev/null +++ b/WePay/Coupon.php @@ -0,0 +1,62 @@ +callPostApi($url, $options, true); + } + + /** + * 查询代金券批次 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function queryStock(array $options) + { + $url = "https://api.mch.weixin.qq.com/mmpaymkttransfers/query_coupon_stock"; + return $this->callPostApi($url, $options, false); + } + + /** + * 查询代金券信息 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function queryInfo(array $options) + { + $url = "https://api.mch.weixin.qq.com/mmpaymkttransfers/query_coupon_stock"; + return $this->callPostApi($url, $options, false); + } + +} \ No newline at end of file