<?php
require_once ("IpsPay.Config.php");
require_once ("lib/IpsPayNotify.class.php");
?>
<!DOCTYPE HTML>
<html>
<head>
<link href="source/showLoading.css" rel="stylesheet" />
<link href="source/style-05.css" rel="stylesheet" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<?php
$ipspayNotify = new IpsPayNotify($ipspay_config);
$verify_result = $ipspayNotify->verifyReturn();

if ($verify_result) { // 验证成功
    
    $paymentResult = $_REQUEST['paymentResult'];
    $xmlResult = new SimpleXMLElement($paymentResult);
    $merBillNo = $xmlResult->WxPayRsp->body->MerBillno;
    $MerCode = $xmlResult->WxPayRsp->body->MerCode;
    $Account = $xmlResult->WxPayRsp->body->Account;
    $IpsBillNo = $xmlResult->WxPayRsp->body->IpsBillNo;
    $ordAmt = $xmlResult->WxPayRsp->body->OrdAmt;
    $message = "支付成功";
} else {
    $message = "支付失败";
}

?>
 
<title>IPS订单支付接口返回</title>
</head>
<body>
	<form id="form1">
		<div class="roll-out-container">
			<ul>
				<li><span class="set-title">交易结果:</span> 
				<span class="set-label"> <label id="Message"><?php echo $message?></label>
				</span></li>
			</ul>
		</div>
		<div class="roll-out-container">
			<ul>
				<li><span class="set-title">商户号:</span> <span
					class="set-label"> <label id="MerCode"><?php echo $MerCode?></label>
				</span></li>
			</ul>
		</div>
		<div class="roll-out-container">
			<ul>
				<li><span class="set-title">商户账户号:</span> <span class="set-label">
				 <label id="Account"><?php echo $Account?></label>
				</span></li>
			</ul>
		</div>
		<div class="roll-out-container">
			<ul>
				<li><span class="set-title">商户订单号:</span> <span class="set-label"> 
				<label id="MerBillNo"><?php echo $merBillNo?></label>
				</span></li>
			</ul>
		</div>
        <div class="roll-out-container">
			<ul>
				<li><span class="set-title">IPS订单号:</span> <span class="set-label"> 
				<label id="IpsBillNo"><?php echo $IpsBillNo?></label>
				</span></li>
			</ul>
		</div>
		<div class="roll-out-container">
			<ul>
				<li><span class="set-title">金额</span> <span class="set-label"> 
				<label id="OrdAmt"><?php echo $ordAmt?></label>
				</span></li>
			</ul>
		</div>
	</form>
</body>
</html>