Esempio n. 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;
 }
Esempio n. 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->SetMch_id(WxPayConfig::MCHID);
     //商户号
     $inputObj->SetTime_stamp(time());
     //时间戳
     $inputObj->SetNonce_str(self::getNonceStr());
     //随机字符串
     $inputObj->SetSign();
     //签名
     return $inputObj->GetValues();
 }
Esempio n. 3
0
 /**
  * 
  * 生成二维码规则,模式一生成支付二维码
  * @param WxPayBizPayUrl $inputObj
  * @param int $timeOut
  * @throws WxPayException
  * @return 成功时返回,其他抛异常
  */
 public static function bizpayurl($inputObj, $timeOut = 6)
 {
     $payments = session('paymentinfo');
     self::$appid = $payments['wxappid'];
     self::$mchid = $payments['wxmchid'];
     if (!$inputObj->IsProduct_idSet()) {
         throw new WxPayException("生成二维码,缺少必填参数product_id!");
     }
     $inputObj->SetAppid(self::$appid);
     //公众账号ID
     $inputObj->SetMch_id(self::$mchid);
     //商户号
     $inputObj->SetTime_stamp(time());
     //时间戳
     $inputObj->SetNonce_str(self::getNonceStr());
     //随机字符串
     $inputObj->SetSign();
     //签名
     return $inputObj->GetValues();
 }
Esempio n. 4
0
 /**
  *
  * 生成二维码规则,模式一生成支付二维码
  * appid、mchid、spbill_create_ip、nonce_str不需要填入
  * @param WxPayBizPayUrl $inputObj
  * @throws WxPayException
  * @return mixed 成功时返回,其他抛异常
  */
 public function bizpayurl($inputObj)
 {
     if (!$inputObj->IsProduct_idSet()) {
         throw new WxPayException("生成二维码,缺少必填参数product_id!");
     }
     $inputObj->SetAppid($this->config->getAppId());
     //公众账号ID
     $inputObj->SetMch_id($this->config->getMchId());
     //商户号
     $inputObj->SetTime_stamp(time());
     //时间戳
     $inputObj->SetNonce_str($this->getNonceStr());
     //随机字符串
     $inputObj->SetSign();
     //签名
     return $inputObj->GetValues();
 }
Esempio n. 5
0
 /**
  *
  * 生成二维码规则,模式一生成支付二维码
  * appid、mchid、spbill_create_ip、nonce_str不需要填入
  * @param WxPayBizPayUrl $inputObj
  * @param int $timeOut
  * @throws WxPayException
  * @return 成功时返回,其他抛异常
  */
 public static function bizpayurl($inputObj, $timeOut = 6)
 {
     $inputObj->SetAppid(APPID);
     //公众账号ID
     $inputObj->SetMch_id(MCHID);
     //商户号
     $inputObj->SetTime_stamp(time());
     //时间戳
     $inputObj->SetNonce_str(self::getNonceStr());
     //随机字符串
     $inputObj->SetSign();
     //签名
     return $inputObj->GetValues();
 }
Esempio n. 6
0
 /**
  *
  * 生成二维码规则,模式一生成支付二维码
  * 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();
 }