国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.6KB

  1. <?php
  2. namespace WePay;
  3. if (!defined('DEDEINC')) exit('dedebiz');
  4. use WeChat\Contracts\BasicWePay;
  5. /**
  6. * 微信商户打款到零钱
  7. * Class Transfers
  8. * @package WePay
  9. */
  10. class Transfers extends BasicWePay
  11. {
  12. /**
  13. * 企业付款到零钱
  14. * @param array $options
  15. * @return array
  16. * @throws \WeChat\Exceptions\InvalidResponseException
  17. * @throws \WeChat\Exceptions\LocalCacheException
  18. */
  19. public function create(array $options)
  20. {
  21. $this->params->offsetUnset('appid');
  22. $this->params->offsetUnset('mch_id');
  23. $this->params->set('mchid', $this->config->get('mch_id'));
  24. $this->params->set('mch_appid', $this->config->get('appid'));
  25. $url = 'https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/transfers';
  26. return $this->callPostApi($url, $options, true, 'MD5', false);
  27. }
  28. /**
  29. * 查询企业付款到零钱
  30. * @param string $partnerTradeNo 商户调用企业付款API时使用的商户订单号
  31. * @return array
  32. * @throws \WeChat\Exceptions\InvalidResponseException
  33. * @throws \WeChat\Exceptions\LocalCacheException
  34. */
  35. public function query($partnerTradeNo)
  36. {
  37. $this->params->offsetUnset('mchid');
  38. $this->params->offsetUnset('mch_appid');
  39. $this->params->set('appid', $this->config->get('appid'));
  40. $this->params->set('mch_id', $this->config->get('mch_id'));
  41. $url = 'https://api.mch.weixin.qq.com/mmpaymkttransfers/gettransferinfo';
  42. return $this->callPostApi($url, ['partner_trade_no' => $partnerTradeNo], true, 'MD5', false);
  43. }
  44. }