示例#1
0
 /**
  * 
  * 生成直接支付url,支付url有效期为2小时,模式二
  * @param UnifiedOrderInput $input
  */
 public function GetPayUrl($input)
 {
     if ($input->GetTrade_type() == "NATIVE") {
         $result = PayApi::unifiedOrder($input);
         return $result;
     }
 }
示例#2
0
 /**
  * 
  * 回复通知
  * @param bool $needSign 是否需要签名输出
  */
 private final function ReplyNotify($needSign = true)
 {
     //如果需要签名
     if ($needSign == true && $this->GetReturn_code($return_code) == "SUCCESS") {
         $this->SetSign();
     }
     PayApi::replyNotify($this->ToXml());
 }
 public function Queryorder($transaction_id)
 {
     $input = new OrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = PayApi::orderQuery($input);
     Log::debug('query:' . json_encode($result));
     if (array_key_exists('return_code', $result) && array_key_exists('result_code', $result) && $result['return_code'] == 'SUCCESS' && $result['result_code'] == 'SUCCESS') {
         $this->updateOrder($result, 1);
         return true;
     }
     $this->updateOrder($result, 2);
     return false;
 }