示例#1
0
 /**
  *
  * 生成扫描支付URL,模式一
  * @param BizPayUrlInput $bizUrlInfo
  */
 public function GetPrePayUrl($productId)
 {
     $biz = new WxPayBizPayUrl();
     $biz->SetProduct_id($productId);
     $values = WxpayApi::bizpayurl($biz);
     $url = "weixin://wxpay/bizpayurl?" . $this->ToUrlParams($values);
     return $url;
 }
示例#2
0
 /**
  *
  * 生成二维码规则,模式一生成支付二维码
  * appid、mchid、spbill_create_ip、nonce_str不需要填入
  * @param WxPayBizPayUrl $inputObj
  * @param int $timeOut
  * @throws WxPayException
  * @return 成功时返回,其他抛异常
  */
 public static function bizpayurl($inputObj, $timeOut = 6)
 {
     if (!$inputObj->IsProduct_idSet()) {
         throw new WxPayException("生成二维码,缺少必填参数product_id!");
     }
     // $inputObj->SetAppid(WxPayConfig::APPID);//公众账号ID
     $inputObj->SetAppid(WxPayConfig::$appId);
     $inputObj->SetMch_id(WxPayConfig::$mchId);
     //商户号
     $inputObj->SetTime_stamp(time());
     //时间戳
     $inputObj->SetNonce_str(self::getNonceStr());
     //随机字符串
     $inputObj->SetSign();
     //签名
     return $inputObj->GetValues();
 }