當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WxPayOrderQuery::SetTransaction_id方法代碼示例

本文整理匯總了PHP中WxPayOrderQuery::SetTransaction_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP WxPayOrderQuery::SetTransaction_id方法的具體用法?PHP WxPayOrderQuery::SetTransaction_id怎麽用?PHP WxPayOrderQuery::SetTransaction_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WxPayOrderQuery的用法示例。


在下文中一共展示了WxPayOrderQuery::SetTransaction_id方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Queryorder

 public function Queryorder($transaction_id)
 {
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = WxPayApi::orderQuery($input);
     \Log::info("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") {
         // 處理訂單
         $pay = \App\Pay::find($result['out_trade_no']);
         $pay->pay($result['transaction_id']);
         if ($pay->state < 2) {
             $pay->state = '2';
             $pay->bak_id = '0';
             $pay->other_id = $result['transaction_id'];
             $pay->save();
         } else {
             if ($pay->state == 2) {
                 $pay->bak_id++;
                 $pay->save();
             }
         }
         return true;
     }
     return false;
 }
開發者ID:jiangchengbin,項目名稱:weixin,代碼行數:25,代碼來源:notify.php

示例2: Queryorder

 public function Queryorder($transaction_id)
 {
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = WxPayApi::orderQuery($input);
     //		Log::DEBUG("query:" . json_encode($result));
     ilog(iLOG_INFO, 'Queryorder:' . json_encode($result), __LINE__);
     if (array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS") {
         $user_trade_no = $result['out_trade_no'];
         $transaction_id = $result['transaction_id'];
         $info1 = 'wxapp/interface/appnotify.php,operator success,session == trade_no,ordernum:' . $user_trade_no . ',wxno:' . $transaction_id;
         ilog(iLOG_INFO, $info1, __LINE__);
         $body_arr['order_no'] = $user_trade_no;
         $body_arr['pay_result'] = 2;
         //支付成功
         $body_arr['alipay_no'] = $transaction_id;
         //微信流水號
         $body_arr['channel'] = 'wxapp';
         //
         $ret = exec_procedure($body_arr, 'p_order_pay_result');
         if ($ret['status'] == 0 || $ret['status'] == 1040) {
             //成功,返回success
             return true;
         } else {
             //返回錯誤碼,非success
             $info = 'wxapp/interface/appnotify.php,p_order_pay_result failed';
             ilog(iLOG_INFO, $info, __LINE__);
             return false;
         }
     }
     $info = 'wxapp/interface/appnotify.php,operator failed';
     ilog(iLOG_INFO, $info, __LINE__);
     //驗證失敗
     return false;
 }
開發者ID:yonglinchen,項目名稱:shopping,代碼行數:35,代碼來源:appnotify.php

示例3: Queryorder

 public function Queryorder($transaction_id)
 {
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = WxPayApi::orderQuery($input);
     if (array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS") {
         return true;
     }
     return false;
 }
開發者ID:monkeychen,項目名稱:website,代碼行數:10,代碼來源:qrcode_wxpay_notify.php

示例4: Queryorder

 public function Queryorder($mpid, $transaction_id)
 {
     //\TMS_APP::M('log')->log('debug', 'pay-Queryorder', '0');
     $input = new \WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = \WxPayApi::orderQuery($mpid, $input);
     if (array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS") {
         return true;
     }
     //\TMS_APP::M('log')->log('debug', 'pay-Queryorder', 'ok');
     return false;
 }
開發者ID:ahmatjan,項目名稱:xinxintong,代碼行數:12,代碼來源:payok.php

示例5: Queryorder

 public function Queryorder($transaction_id)
 {
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = WxPayApi::orderQuery($input);
     if (array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS") {
         return true;
     }
     $log = Log::factory(NT_LOGS_PATH . 'wxpay_saoma/');
     $log->write('wxpay_saoma_notify_orderQuery', "訂單查詢失敗\n" . json_encode($result) . "\n");
     return false;
 }
開發者ID:lughong,項目名稱:test,代碼行數:12,代碼來源:notify.php

示例6: Queryorder

 public function Queryorder($data)
 {
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($data['transaction_id']);
     $input->SetTradeType($data['trade_type']);
     $result = WxPayApi::orderQuery($input, Config::API_TIMEOUT);
     $this->query_data = $result;
     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") {
         return true;
     }
     return false;
 }
開發者ID:OranTing,項目名稱:gdby_github_repo,代碼行數:13,代碼來源:notify.php

示例7: Queryorder

 public function Queryorder($transaction_id)
 {
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = WxPayApi::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") {
         return true;
         // echo "OK";
     }
     return false;
     // echo "Fail";
 }
開發者ID:king3388,項目名稱:king,代碼行數:13,代碼來源:notify.php

示例8: queryOrder

 public function queryOrder($transaction_id)
 {
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = WxPayApi::orderQuery($input);
     Log::DEBUG("query:" . Tools::jsonEncode($result));
     if (array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS") {
         if (!$this->changeOrderStatus($result['out_trade_no'])) {
             Log::DEBUG("change:5.更改定單狀態失敗");
         }
         return true;
     }
     return false;
 }
開發者ID:yiuked,項目名稱:tmcart,代碼行數:14,代碼來源:notify.php

示例9: Queryorder

 public function Queryorder($transaction_id)
 {
     $input = new \WxPayOrderQuery();
     $input->setWxPayApi($this->wxPayApi);
     $input->SetTransaction_id($transaction_id);
     $result = $this->wxPayApi->orderQuery($input);
     //        if ($this->logger) {
     //            $logContent = static::log_tag . " query:" . json_encode($result);
     //            $this->logger->log($logContent);
     //        }
     if (array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && array_key_exists('trade_state', $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS" && $result['trade_state'] == "SUCCESS") {
         return true;
     }
     return false;
 }
開發者ID:fishlab,項目名稱:wechat-sdk-php,代碼行數:15,代碼來源:WechatPaymentNotifyCallback.php

示例10: Queryorder

 public function Queryorder($transaction_id)
 {
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = WxPayApi::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") {
         //支付成功後 開通相關的操作方法
         require_once dirname(__FILE__) . '/../common.inc.php';
         $url = $_CFG['site_domain'] . $_CFG['site_dir'] . "include/payment/respond_weixinpay.php";
         $return_oid = $this->curl_file_get_contents($url, $result);
         @unlink(QISHI_ROOT_PATH . 'data/wxpay/' . $return_oid . '.tmp');
         return true;
     }
     return false;
 }
開發者ID:winiceo,項目名稱:job,代碼行數:16,代碼來源:notify.php

示例11: Queryorder

 public function Queryorder($transaction_id)
 {
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = WxPayApi::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") {
         $url = "http://" . $_SERVER['SERVER_NAME'] . "/index.php?g=weixin&m=scan&a=notify";
         $post_params = $result;
         $ch = curl_init();
         curl_setopt($ch, CURLOPT_URL, $url);
         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
         curl_setopt($ch, CURLOPT_POST, 1);
         curl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);
         $output = curl_exec($ch);
         curl_close($ch);
         return true;
     }
     return false;
 }
開發者ID:xiaoxianlink,項目名稱:weixin,代碼行數:20,代碼來源:notify.php

示例12: printf_info

error_reporting(E_ERROR);
require_once "../lib/WxPay.Api.php";
require_once 'log.php';
//初始化日誌
$logHandler = new CLogFileHandler("./logs/" . date('Y-m-d') . '.log');
$log = Log::Init($logHandler, 15);
function printf_info($data)
{
    foreach ($data as $key => $value) {
        echo "<font color='#f00;'>{$key}</font> : {$value} <br/>";
    }
}
if (isset($_REQUEST["transaction_id"]) && $_REQUEST["transaction_id"] != "") {
    $transaction_id = $_REQUEST["transaction_id"];
    $input = new WxPayOrderQuery();
    $input->SetTransaction_id($transaction_id);
    printf_info(WxPayApi::orderQuery($input));
    exit;
}
if (isset($_REQUEST["out_trade_no"]) && $_REQUEST["out_trade_no"] != "") {
    $out_trade_no = $_REQUEST["out_trade_no"];
    $input = new WxPayOrderQuery();
    $input->SetOut_trade_no($out_trade_no);
    printf_info(WxPayApi::orderQuery($input));
    exit;
}
?>
<body>  
	<form action="#" method="post">
        <div style="margin-left:2%;color:#f00">微信訂單號和商戶訂單號選少填一個,微信訂單號優先:</div><br/>
        <div style="margin-left:2%;">微信訂單號:</div><br/>
開發者ID:OranTing,項目名稱:gdby_github_repo,代碼行數:31,代碼來源:orderquery.php

示例13: Queryorder

 public function Queryorder($transaction_id)
 {
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = WxPayApi::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") {
         f_log(http_build_query($result), dirname(__FILE__) . '/wzlog.log');
         $result['addtime'] = time();
         $id = M('pay_log')->add($result);
         // 更改order 狀態
         // 更改 hongbao狀態
         $result['out_trade_no'];
         $order = M('zhaopian_order')->where("order_sn='{$result['out_trade_no']}'")->find();
         $user = M('user')->find($order['user_id']);
         if ($order) {
             // 重複操作
             if ($order['state'] > 1) {
                 return true;
             }
             $order_data = array('pay_id' => $id, 'pay_time' => time(), 'transaction_id' => $result['transaction_id'], 'state' => 2);
             M('zhaopian_order')->where("id='{$order['id']}'")->save($order_data);
             $zhaopian = M('zhaopian')->where("id='{$order['hongbao_id']}'")->find();
             if ($zhaopian) {
                 $data = array('update_time' => time(), 'total_num' => $zhaopian['total_num'] + 1, 'total_amount' => $zhaopian['total_amount'] + $order['amount']);
                 // 自動發送紅包
                 if (true) {
                     $bao = array('mch_billno' => get_order_sn('wz'), 'send_name' => '紅包照片', 're_openid' => $zhaopian['openid'], 'total_amount' => floor($order['amount'] * 0.98 * 100), 'wishing' => '恭喜您!您在照片剛剛"' . $user['name'] . '"購買了', 'act_name' => '紅包照片', 'remark' => '紅包照片');
                     $send = $bao;
                     $send['user_id'] = $zhaopian['user_id'];
                     $send['addtime'] = time();
                     $hongbao_id = M('zhaopian_send')->add($send);
                     if ($hongbao_id) {
                         M('zhaopian_order')->where(array("id='{$order['id']}'"))->save(array('send_id' => $hongbao_id, 'send_sn' => $bao['mch_billno'], 'send_time' => time()));
                         $data = sendHongBao($bao);
                         if ($data['result_code'] == 'SUCCESS' && $data['return_code'] == 'SUCCESS') {
                             M('zhaopian_order')->where(array("id='{$order['id']}'"))->save(array('is_send_zhaopian' => 1));
                             M('zhaopian_send')->where(array("id='{$hongbao_id}'"))->save(array('state' => 2, 'send_listid' => $data['send_listid']));
                             $user_amount = number_format($order['amount'] * 0.98, 2);
                             $msg = "你發布的照片有朋友購買了!\n\n照片標題:{$zhaopian['remark']}\n\n支付金額:¥{$order['amount']}元\n\n好友購買照片錢已經通過微信紅包打給你,其中已扣除2%微信支付手續費,扣除後金額為{$user_amount}元";
                             \Wechat\Wxapi::send_wxmsg($zhaopian['openid'], '紅包照片狀態提醒', U('/zhao/zhaopian/detail', array('id' => $zhaopian['number_no']), true, true), $msg);
                         } else {
                             M('hongbao_send')->where(array("id='{$hongbao_id}'"))->save(array('state' => 3));
                             $user_amount = number_format($order['amount'] * 0.98, 2);
                             $msg = "你發布的照片有朋友購買了!\n\n照片標題:{$zhaopian['remark']}\n\n支付金額:¥{$order['amount']}元\n\n紅包將會在1~3個工作內,通過微信紅包打給你,\n其中已扣除2%的微信支付手續費,扣除後金額為{$user_amount}元。\n因為微信支付到我們的賬戶需要1~3個工作日,我們\n的賬戶預存墊付的現金不足,暫時不能實時轉賬,希望\n理解。資金安全請你放心,如果有疑問請聯係客服。";
                             \Wechat\Wxapi::send_wxmsg($zhaopian['openid'], '紅包照片狀態提醒', U('/zhao/zhaopian/detail', array('id' => $zhaopian['number_no']), true, true), $msg);
                             $sys_openid = "obb1AuA79tIJ-BGY7HA38FXAJwoc";
                             $msg = "重要提示! 紅包發送異常!!! 可能餘額不足,或支付金額異常,支付金額:{$user_amount},請及時處理.";
                             \Wechat\Wxapi::send_wxmsg($sys_openid, '紅包照片狀態提醒', "http://{$_SERVER['HTTP_HOST']}", $msg);
                         }
                     }
                 }
             }
         }
         return true;
     }
     return false;
 }
開發者ID:ysc8620,項目名稱:zhima,代碼行數:58,代碼來源:weizhao.php

示例14: Queryorder

 function Queryorder($transaction_id)
 {
     $WxCfg = $this->getWXCfg();
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = WxPayApi::orderQuery($input, $WxCfg);
     Log::DEBUG(" WxPayApi::orderQuery:" . json_encode($result));
     if (array_key_exists("return_code", $result) && array_key_exists("result_code", $result) && $result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS") {
         return true;
     }
     return false;
 }
開發者ID:zhuhank,項目名稱:wechat-payment-for-woocommerce,代碼行數:12,代碼來源:class-wc-wechatpay.php

示例15: Queryorder

 public function Queryorder($transaction_id)
 {
     $input = new WxPayOrderQuery();
     $input->SetTransaction_id($transaction_id);
     $result = WxPayApi::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") {
         f_log(http_build_query($result), dirname(__FILE__) . '/mylog.log');
         $result['addtime'] = time();
         $id = M('pay_log')->add($result);
         // 更改order 狀態
         // 更改 hongbao狀態
         $order_sn = $result['out_trade_no'];
         if (substr($order_sn, 0, 2) == 'HB') {
             $this->bao($result, $id);
             return true;
         }
         if (substr($order_sn, 0, 2) == 'ZP') {
             $this->zhaopian($result, $id);
             return true;
         }
         $order = M('hongbao_order')->where("order_sn='{$result['out_trade_no']}'")->find();
         if ($order) {
             // 重複操作
             if ($order['state'] > 1) {
                 return true;
             }
             $order_data = array('pay_id' => $id, 'pay_time' => time(), 'transaction_id' => $result['transaction_id'], 'state' => 2);
             M('hongbao_order')->where("id='{$order['id']}'")->save($order_data);
             $hongbao = M('hongbao')->where("id='{$order['hongbao_id']}'")->find();
             if ($hongbao) {
                 $data = array('update_time' => time(), 'total_num' => $hongbao['total_num'] + $order['part_num'], 'total_pay_amount' => $hongbao['total_pay_amount'] + $order['total_amount'], 'total_user' => $hongbao['total_user'] + 1);
                 if ($data['total_num'] >= $hongbao['total_part'] || $data['total_pay_amount'] >= $hongbao['total_amount']) {
                     $data['state'] = 2;
                     $data['success_time'] = time();
                 }
                 M('hongbao')->where("id='{$order['hongbao_id']}'")->save($data);
                 if ($hongbao['state'] > 1) {
                     return true;
                 }
                 // 設置幸運星
                 if ($data['state'] == 2) {
                     $list = M('hongbao_order')->where("hongbao_id='{$order['hongbao_id']}' AND state=2")->select();
                     if ($list) {
                         $ids = array();
                         foreach ($list as $r) {
                             $ids[] = $r['id'];
                         }
                         shuffle($ids);
                         $k = array_rand($ids);
                         $id = $ids[$k];
                         if ($id) {
                             $order_info = M('hongbao_order')->find($id);
                             $user_info = M('user')->find($order_info['user_id']);
                             M('hongbao_order')->where("id='{$id}'")->save(array('is_star' => 1));
                         }
                     }
                 }
                 // 自動發送紅包
                 if ($data['state'] == 2) {
                     $bao = array('mch_billno' => get_order_sn(), 'send_name' => '湊紅包', 're_openid' => $hongbao['openid'], 'total_amount' => floor($hongbao['total_amount'] * 0.98 * 100), 'wishing' => '恭喜您!您在湊紅包發起的湊紅包已經完成。', 'act_name' => '湊紅包', 'remark' => '湊紅包');
                     $send = $bao;
                     $send['user_id'] = $hongbao['user_id'];
                     $send['addtime'] = time();
                     $hongbao_id = M('hongbao_send')->add($send);
                     if ($hongbao_id) {
                         M('hongbao')->where(array("id='{$hongbao['id']}'"))->save(array('hongbao_id' => $hongbao_id, 'hongbao_sn' => $bao['mch_billno'], 'hongbao_time' => time()));
                         $data = sendHongBao($bao);
                         if ($data['result_code'] == 'SUCCESS' && $data['return_code'] == 'SUCCESS') {
                             M('hongbao')->where(array("id='{$hongbao['id']}'"))->save(array('is_send_hongbao' => 1));
                             M('hongbao_send')->where(array("id='{$hongbao_id}'"))->save(array('state' => 2, 'send_listid' => $data['send_listid']));
                             $user_amount = number_format($hongbao['total_amount'] * 0.98, 2);
                             $msg = "你發起的湊紅包成功啦!\n\n眾籌標題:{$hongbao['remark']}\n\n眾籌進度:¥{$hongbao['total_amount']}已成功!\n\n幸運星:{$user_info['name']}\n\n紅包已經通過微信紅包打給你,其中已扣除2%微信支付手續費,扣除後金額為{$user_amount}元";
                             \Wechat\Wxapi::send_wxmsg($hongbao['openid'], '眾籌狀態提醒', U('/cou/hongbao/detail', array('id' => $hongbao['number_no']), true, true), $msg);
                             $msg = "幸運星就是你!沒想到吧\n\n眾籌標題:{$hongbao['remark']}\n\n眾籌進度:¥{$hongbao['total_amount']}已成功!\n\n快找發起人要福利吧 :D";
                             \Wechat\Wxapi::send_wxmsg($user_info['openid'], '眾籌狀態提醒', U('/cou/hongbao/detail', array('id' => $hongbao['number_no']), true, true), $msg);
                         } else {
                             M('hongbao_send')->where(array("id='{$hongbao_id}'"))->save(array('state' => 3));
                             $user_amount = number_format($hongbao['total_amount'] * 0.98, 2);
                             $msg = "你發起的湊紅包成功啦!\n\n眾籌標題:{$hongbao['remark']}\n\n眾籌進度:¥{$hongbao['total_amount']}已成功!\n\n幸運星:{$user_info['name']}\n\n紅包將會在1~3個工作內,通過微信紅包打給你,\n其中已扣除2%的微信支付手續費,扣除後金額為{$user_amount}元。\n因為微信支付到我們的賬戶需要1~3個工作日,我們\n的賬戶預存墊付的現金不足,暫時不能實時轉賬,希望\n理解。資金安全請你放心,如果有疑問請聯係客服。";
                             \Wechat\Wxapi::send_wxmsg($hongbao['openid'], '眾籌狀態提醒', U('/cou/hongbao/detail', array('id' => $hongbao['number_no']), true, true), $msg);
                             $sys_openid = "oV3oMxP5wdTR8BpptzNq2tDdGtLk";
                             $msg = "重要提示! 紅包發送異常!!!";
                             \Wechat\Wxapi::send_wxmsg($sys_openid, '眾籌狀態提醒', "http://{$_SERVER['HTTP_HOST']}", $msg);
                         }
                     }
                 }
             }
         }
         return true;
     }
     return false;
 }
開發者ID:ysc8620,項目名稱:zhima,代碼行數:93,代碼來源:weixin.php


注:本文中的WxPayOrderQuery::SetTransaction_id方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。