本文整理匯總了PHP中Wechat::orderquery方法的典型用法代碼示例。如果您正苦於以下問題:PHP Wechat::orderquery方法的具體用法?PHP Wechat::orderquery怎麽用?PHP Wechat::orderquery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Wechat
的用法示例。
在下文中一共展示了Wechat::orderquery方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: Wechat
<?php
/**
* 訂單查詢
* @author www.linauror.com
* @copyright 2014
*/
include 'config.php';
include 'lib.php';
$wechat = new Wechat();
$result = $wechat->orderquery($config, $out_trade_no);
// 這裏僅需要本站訂單號
print_r($result);
示例2: orderWxQuery
public function orderWxQuery($num = "")
{
$num = $num == "" ? $_GET['orderId'] : $num;
$zhifuhao = M('order_merge')->where(array('orderid' => $num))->getField('mergeid');
if ($zhifuhao != "") {
header('Content-Type:text/html;charset=utf-8');
$wetallroute = dirname(dirname(dirname(dirname(dirname(__FILE__)))));
include $wetallroute . "/wxpay/config.php";
//dump($config);exit;
include $wetallroute . "/wxpay/lib.php";
$wechat = new Wechat();
$result = $wechat->orderquery($config, $zhifuhao);
if ($result['errcode'] == 0 && $result['errmsg'] == 'ok') {
//成功返回
if ($result['order_info']['ret_code'] == 0 && $result['order_info']['trade_state'] == "0") {
$this->success('該訂單已支付成功!');
} else {
$this->error('該訂單支付失敗!' . '[' . $result['order_info']['ret_code'] . ']' . $result['order_info']['ret_msg']);
}
} else {
$this->error('該訂單查詢失敗!' . '[' . $result['errcode'] . ']' . $result['errmsg']);
}
} else {
$this->error("沒有取到訂單號!");
}
}