本文整理汇总了PHP中WxPayOrderQuery类的典型用法代码示例。如果您正苦于以下问题:PHP WxPayOrderQuery类的具体用法?PHP WxPayOrderQuery怎么用?PHP WxPayOrderQuery使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了WxPayOrderQuery类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: query
/**
*
* 查询订单情况
* @param string $out_trade_no 商户订单号
* @param int $succCode 查询订单结果
* @return 0 订单不成功,1表示订单成功,2表示继续等待
*/
public function query($out_trade_no, &$succCode)
{
$queryOrderInput = new WxPayOrderQuery();
$queryOrderInput->SetOut_trade_no($out_trade_no);
$result = WxPayApi::orderQuery($queryOrderInput);
if ($result["return_code"] == "SUCCESS" && $result["result_code"] == "SUCCESS") {
//支付成功
if ($result["trade_state"] == "SUCCESS") {
$succCode = 1;
return $result;
} else {
if ($result["trade_state"] == "USERPAYING") {
$succCode = 2;
return false;
}
}
}
//如果返回错误码为“此交易订单号不存在”则直接认定失败
if ($result["err_code"] == "ORDERNOTEXIST") {
$succCode = 0;
} else {
//如果是系统错误,则后续继续
$succCode = 2;
}
return false;
}
开发者ID:noikiy,项目名称:wowewe,代码行数:33,代码来源:MicroPay.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);
\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
示例4: queryByOutTradeNo
/**
* 查询订单根据out_trade_no
*/
public function queryByOutTradeNo($out_trade_no)
{
$input = new WxPayOrderQuery();
$input->setConfig($this->config);
$input->SetOut_trade_no($out_trade_no);
\Common\Api\Wxpay\WxPayApi::setConfig($this->config);
return \Common\Api\Wxpay\WxPayApi::orderQuery($input);
}
开发者ID:h136799711,项目名称:201507banma,代码行数:11,代码来源:OrderQuery.class.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;
}
return false;
}
开发者ID:monkeychen,项目名称:website,代码行数:10,代码来源:qrcode_wxpay_notify.php
示例6: 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
示例7: 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
示例8: 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
示例9: 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
示例10: queryOrder
private function queryOrder($out_trade_no, $inStatus = '')
{
if (isset($out_trade_no) && $out_trade_no != "") {
$input = new WxPayOrderQuery();
$input->SetOut_trade_no($out_trade_no);
$info = WxPayApi::orderQuery($input);
if ($inStatus == 'code') {
return $info['trade_state'];
}
$status = orderState($info['trade_state']);
}
return $status;
}
开发者ID:aising,项目名称:ding,代码行数:13,代码来源:OrderController.php
示例11: 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
示例12: 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
示例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") {
//支付成功后 开通相关的操作方法
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
示例14: orderQuery
/**
*
* 查询订单,WxPayOrderQuery中out_trade_no、transaction_id至少填一个
* appid、mchid、spbill_create_ip、nonce_str不需要填入
* @param WxPayOrderQuery $inputObj
* @param int $timeOut
* @throws WxPayException
* @return 成功时返回,其他抛异常
*/
public static function orderQuery($mpid, $inputObj, $timeOut = 6)
{
$wxPayConfig = new \WxPayConfig($mpid);
$url = "https://api.mch.weixin.qq.com/pay/orderquery";
//检测必填参数
if (!$inputObj->IsOut_trade_noSet() && !$inputObj->IsTransaction_idSet()) {
throw new WxPayException("订单查询接口中,out_trade_no、transaction_id至少填一个!");
}
$inputObj->SetAppid($wxPayConfig->APPID);
//公众账号ID
$inputObj->SetMch_id($wxPayConfig->MCHID);
//商户号
$inputObj->SetNonce_str(self::getNonceStr());
//随机字符串
$inputObj->SetSign($mpid);
//签名
$xml = $inputObj->ToXml();
$startTimeStamp = self::getMillisecond();
//请求开始时间
$response = self::postXmlCurl($xml, $url, false, $timeOut);
$result = WxPayResults::Init($mpid, $response);
self::reportCostTime($url, $startTimeStamp, $result);
//上报请求花费时间
return $result;
}
开发者ID:ahmatjan,项目名称:xinxintong,代码行数:34,代码来源:WxPay.Api.php
示例15: queryOrder
public function queryOrder($out_trade_no)
{
$input = new \WxPayOrderQuery();
$input->setWxPayApi($this->wxPayApi);
$input->SetOut_trade_no($out_trade_no);
$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 $result;
}
开发者ID:fishlab,项目名称:wechat-sdk-php,代码行数:17,代码来源:WechatPaymentSupport.php
示例16: orderQuery
/**
*
* 查询订单,WxPayOrderQuery中out_trade_no、transaction_id至少填一个
* appid、mchid、spbill_create_ip、nonce_str不需要填入
*
* @param WxPayOrderQuery $inputObj
* @param int $timeOut
* @throws WxPayException
* @return 成功时返回,其他抛异常
*/
public static function orderQuery($inputObj, $timeOut = 30)
{
$url = "https://api.mch.weixin.qq.com/pay/orderquery";
// 检测必填参数
if (!$inputObj->IsOut_trade_noSet() && !$inputObj->IsTransaction_idSet()) {
throw new WxPayException("订单查询接口中,out_trade_no、transaction_id至少填一个!");
}
$inputObj->SetSign();
// 签名
$xml = $inputObj->ToXml();
$startTimeStamp = self::getMillisecond();
// 请求开始时间
$response = self::postXmlCurl($xml, $url, false, $timeOut);
$result = WxPayResults::Init($response, $inputObj->wx_config);
self::reportCostTime($url, $startTimeStamp, $result);
// 上报请求花费时间
return $result;
}
开发者ID:beauty-x,项目名称:wx-pay-sdk,代码行数:28,代码来源:WxPay.Api.php
示例17: 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
示例18: orderQuery
/**
*
* 查询订单,WxPayOrderQuery中out_trade_no、transaction_id至少填一个
* appid、mchid、spbill_create_ip、nonce_str不需要填入
* @param WxPayOrderQuery $inputObj
* @param int $timeOut
* @throws WxPayException
* @return 成功时返回,其他抛异常
*/
public static function orderQuery($inputObj, $timeOut = 6)
{
$url = "https://api.mch.weixin.qq.com/pay/orderquery";
$inputObj->SetAppid(APPID);
//公众账号ID
$inputObj->SetMch_id(MCHID);
//商户号
$inputObj->SetNonce_str(self::getNonceStr());
//随机字符串
$inputObj->SetSign();
//签名
$xml = $inputObj->ToXml();
$startTimeStamp = self::getMillisecond();
//请求开始时间
$response = self::postXmlCurl($xml, $url, false, $timeOut);
$result = WxPayResults::Init($response);
return $result;
}
开发者ID:Alpha2016,项目名称:wxpay,代码行数:27,代码来源:WxPay.Api.php
示例19: queryOrder
private function queryOrder($out_trade_no = '', $inStatus = 0)
{
if ($inStatus == 4) {
return $status = '已经申请退款';
}
if (isset($out_trade_no) && $out_trade_no != "") {
$input = new WxPayOrderQuery();
$input->SetOut_trade_no($out_trade_no);
$info = WxPayApi::orderQuery($input);
if (isset($info['err_code']) && $info['err_code'] == 'ORDERNOTEXIST') {
$trade_state = 'NOTPAY';
} else {
$trade_state = $info['trade_state'];
}
// $status = orderState($trade_state);
}
return $trade_state;
}
开发者ID:aising,项目名称:ding,代码行数:18,代码来源:HomeController.php
示例20: printf_info
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/>
<input type="text" style="width:96%;height:35px;margin-left:2%;" name="transaction_id" /><br /><br />
<div style="margin-left:2%;">商户订单号:</div><br/>
<input type="text" style="width:96%;height:35px;margin-left:2%;" name="out_trade_no" /><br /><br />
<div align="center">
<input type="submit" value="查询" style="width:210px; height:50px; border-radius: 15px;background-color:#FE6714; border:0px #FE6714 solid; cursor: pointer; color:white; font-size:16px;" type="button" onclick="callpay()" />
</div>
开发者ID:OranTing,项目名称:gdby_github_repo,代码行数:31,代码来源:orderquery.php
注:本文中的WxPayOrderQuery类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论