<?php
/*
* 说明: 179查询时会通过该接口来抓取订单信息,从数据库读出,组装信息返回
* 请求方式: post
* 参数: orderNo
* 返回: json字符串
* 参数解释:
* 接口在以下地址检测通过
* http://wyb.qdhuaxun.cn/179/quanneng.php#step2
* >>下载Demo
*/
$orderno = $_POST['orderNo'];
if(empty($orderno)){
exit('[]');
} /////实现以下方法,从数据库读取数据,组装数据 $order = T('order')->select('orderno="'.$orderno.'"');
if(empty($order)){
exit('[]');
}
$pay_info = T('pay_info')->select('order_id='.$order['id']);
$goods = T('order_goods')->where('order_id='.$order['id'])->all();
foreach($goods as $v){
$goods_list[] = array(
'gname' => $v['goods_name'],
'itemLink' => 'http:///?a=viewgoods&id='.$v['id'],
);
}
////////实现以上方法//////////
$resp = array(
'initalRequest' => $pay_info['request'], //发送给支付企业的原始请求,微信xml,支付宝url
'initalResponse' => $pay_info['response'], //支付成功后回调的原始请求 //交易流水号(支付报关时有返回,微信:verify_department_trade_id,支付宝:pay_transaction_id)
'payTransactionId' => $pay_info['pay_transaction_id'], //参数:verDept,填:1,2,3;支付报关返回,支付宝参数直接用:ver_dept, //微信参数名:verify_department,需要转换:'UNIONPAY'=>1,'NETSUNION'=> 2,'OTHERS'=>3
'verDept' => $pay_info['ver_dept'],
'totalAmount' => $order['order_money'],
'tradingTime' => $order['pay_time'], //时间格式,date('YmdHis'),例子:20181212041803
'goods' => $goods_list,
'ebpCode' => 'ABCDE12345', //电商平台十位海关编码
'payCode' => '31222699S7', //支付企业十位海关编码,微信:4403169D3W,支付宝:31222699S7,其他的按实际填
'currency' => 142, //币种,只能填142
'recpAccount' => '6222024563566666666', //公司对公银行卡号(最终收款的卡号)
'recpName' => '收款企业名称', //电商平台海关备案名称 );
echo json_encode($resp);