Exemple #1
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();
 }
Exemple #2
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();
 }
Exemple #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();
 }
Exemple #4
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();
 }