[更新]修正微信红包签名及简化查询接口参数

This commit is contained in:
邹景立 2018-05-27 21:54:20 +08:00
parent 9d9a94593b
commit cf8eb26a0a

View File

@ -35,7 +35,7 @@ class Redpack extends BasicPay
$this->params->offsetUnset('appid'); $this->params->offsetUnset('appid');
$this->params->set('wxappid', $this->config->get('appid')); $this->params->set('wxappid', $this->config->get('appid'));
$url = "https://api.mch.weixin.qq.com/mmpaymkttransfers/sendredpack"; $url = "https://api.mch.weixin.qq.com/mmpaymkttransfers/sendredpack";
return $this->callPostApi($url, $options, true); return $this->callPostApi($url, $options, true, 'MD5', false);
} }
/** /**
@ -49,21 +49,21 @@ class Redpack extends BasicPay
$this->params->offsetUnset('appid'); $this->params->offsetUnset('appid');
$this->params->set('wxappid', $this->config->get('appid')); $this->params->set('wxappid', $this->config->get('appid'));
$url = "https://api.mch.weixin.qq.com/mmpaymkttransfers/sendgroupredpack"; $url = "https://api.mch.weixin.qq.com/mmpaymkttransfers/sendgroupredpack";
return $this->callPostApi($url, $options, true); return $this->callPostApi($url, $options, true, 'MD5', false);
} }
/** /**
* 查询红包记录 * 查询红包记录
* @param array $options * @param array $mch_billno 商户发放红包的商户订单号
* @return array * @return array
* @throws \WeChat\Exceptions\InvalidResponseException * @throws \WeChat\Exceptions\InvalidResponseException
*/ */
public function query(array $options) public function query($mch_billno)
{ {
$this->params->offsetUnset('wxappid'); $this->params->offsetUnset('wxappid');
$this->params->set('appid', $this->config->get('appid')); $this->params->set('appid', $this->config->get('appid'));
$url = "https://api.mch.weixin.qq.com/mmpaymkttransfers/gethbinfo"; $url = "https://api.mch.weixin.qq.com/mmpaymkttransfers/gethbinfo";
return $this->callPostApi($url, $options, true); return $this->callPostApi($url, ['mch_billno' => $mch_billno, 'bill_type' => 'MCHT'], true, 'MD5', false);
} }
} }