/** * * 生成二维码规则,模式一生成支付二维码 * appid、mchid、spbill_create_ip、nonce_str不需要填入 * @param WxPayBizPayUrl $inputObj * @param int $timeOut * @throws WxPayException * @return 成功时返回,其他抛异常 */ public function bizpayurl($inputObj, $timeOut = 6) { if (!$inputObj->isProductIdSet()) { throw new WxPayException("生成二维码,缺少必填参数product_id!"); } $inputObj->setAppid($this->apiConfig->appid); //公众账号ID $inputObj->setMchId($this->apiConfig->mchid); //商户号 $inputObj->setMchKey($this->apiConfig->mchkey); //商户密钥 $inputObj->setTimeStamp(time()); //时间戳 $inputObj->setNonceStr($this->getNonceStr()); //随机字符串 $inputObj->setSign(); //签名 return $inputObj->getValues(); }