From 26419890645299e1850c648ed620f23069949271 Mon Sep 17 00:00:00 2001 From: Anyon Date: Fri, 25 May 2018 10:47:12 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E5=A2=9E=E5=8A=A0=E5=88=B7?= =?UTF-8?q?=E5=8D=A1=E6=94=AF=E4=BB=98=E6=92=A4=E9=94=80=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WePay/Order.php | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/WePay/Order.php b/WePay/Order.php index e9eca12..bed6af6 100644 --- a/WePay/Order.php +++ b/WePay/Order.php @@ -79,18 +79,6 @@ class Order extends BasicPay return $option; } - /** - * 授权码查询openid - * @param string $authCode 扫码支付授权码,设备读取用户微信中的条码或者二维码信息 - * @return array - * @throws \WeChat\Exceptions\InvalidResponseException - */ - public function queryAuthCode($authCode) - { - $url = 'https://api.mch.weixin.qq.com/tools/authcodetoopenid'; - return $this->callPostApi($url, ['auth_code' => $authCode]); - } - /** * 获取支付规则二维码 * @param string $productId 商户定义的商品id或者订单号 @@ -110,7 +98,31 @@ class Order extends BasicPay } /** - * 交易保障 + * 刷卡支付 撤销订单 + * @param array $options + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function reverse(array $options) + { + $url = 'https://api.mch.weixin.qq.com/secapi/pay/reverse'; + return $this->callPostApi($url, $options, true); + } + + /** + * 刷卡支付 授权码查询openid + * @param string $authCode 扫码支付授权码,设备读取用户微信中的条码或者二维码信息 + * @return array + * @throws \WeChat\Exceptions\InvalidResponseException + */ + public function queryAuthCode($authCode) + { + $url = 'https://api.mch.weixin.qq.com/tools/authcodetoopenid'; + return $this->callPostApi($url, ['auth_code' => $authCode]); + } + + /** + * 刷卡支付 交易保障 * @param array $options * @return array * @throws \WeChat\Exceptions\InvalidResponseException