Esempio n. 1
0
 public function sendRedPack($data)
 {
     $data['mch_billno'] = time();
     $data['mch_id'] = c('weixin.mch_id');
     $data['wxappid'] = c('weixin.appid');
     $data['total_num'] = "1";
     //红包发放总人数
     $data['client_ip'] = Request::ip();
     $data['nonce_str'] = $this->getRandStr(16);
     $data['sign'] = $this->makeSign($data);
     $xml = Xml::toSimpleXml($data);
     $res = $this->curl_post_ssl("https://api.mch.weixin.qq.com/mmpaymkttransfers/sendredpack", $xml);
     return Xml::toSimpleArray($res);
 }
Esempio n. 2
0
 protected function unifiedorder($data)
 {
     $data['appid'] = c('weixin.appid');
     $data['mch_id'] = c('weixin.mch_id');
     $data['notify_url'] = c('weixin.notify_url');
     $data['nonce_str'] = $this->getRandStr(16);
     $data['trade_type'] = 'JSAPI';
     $data['openid'] = Weixin::instance('oauth')->snsapiBase();
     $data['sign'] = $this->makeSign($data);
     $xml = Xml::toSimpleXml($data);
     $res = Curl::post("https://api.mch.weixin.qq.com/pay/unifiedorder", $xml);
     return Xml::toSimpleArray($res);
 }