【调度系统】广东民航医疗快线调度系统源代码
wzp
2024-12-06 0df39a8c5a45c6ff25411eace15d40a606f9769c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/* *
 * 功能:支付宝手机网站支付接口(alipay.trade.wap.pay)接口调试入口页面
 * 版本:2.0
 * 修改日期:2016-11-01
 * 说明:
 * 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。
 请确保项目文件有可写权限,不然打印不了日志。
 */
 
header("Content-type: text/html; charset=utf-8");
 
 
require_once dirname ( __FILE__ ).DIRECTORY_SEPARATOR.'service/AlipayTradeService.php';
require_once dirname ( __FILE__ ).DIRECTORY_SEPARATOR.'buildermodel/AlipayTradeWapPayContentBuilder.php';
require dirname ( __FILE__ ).DIRECTORY_SEPARATOR.'./../config.php';
 
//获取订单详情
$ShopOrdID = $_GET["ShopOrdID"];
$key='apivcomcn20170421';
 
$method = "Order_detail";
$arr = array("method"=>$method,"ShopOrdID"=>$ShopOrdID);
ksort($arr);
$i=0;
$stringA='';
foreach($arr as $k=>$v){
    $stringA=$stringA.$k.$v;
}
$stringSignTemp=$stringA.$key;
$stringSignTemp=str_replace(" ", "%20", $stringSignTemp);
 
$sign=MD5($stringSignTemp);
$content = 'method='.$method.'&ShopOrdID='.$ShopOrdID;
$content .= '&Sign='.$sign;
$order_url='http://api.v.com.cn/order/?'.$content;
$order_url=str_replace(" ", "%20", $order_url);
// var_dump($order_url);exit;
$orderinfo=file_get_contents($order_url);
$orderinfo=json_decode($orderinfo,true);
if($orderinfo["result"] == "2" || empty($orderinfo)){
    echo "<script>location.href='orderdlist.php;</script>";exit;
}
$pricefen = $orderinfo["ConsumeMoney"] + $orderinfo["PostageMoney"] - $orderinfo["DiscountMoney"] - $orderinfo["AcceptMoney"];
    if($orderinfo["ProgressM"]=="1" || $orderinfo["ProgressM"]=="4" || $pricefen <= 0){
        echo "<script>location.href='/phpmvcomcn/orderdetail.php?ShopOrdID=$ShopOrdID'</script>";exit;
    }
if($orderinfo["ProgressM"] != "1" && $orderinfo["ProgressM"] != "4"){
    if($pricefen<=0){
        echo "<script>location.href='/phpmvcomcn/orderdetail.php?ShopOrdID=$ShopOrdID'</script>";exit;
    }else{
        $PriceTotal = $pricefen;
    }
    // $PriceTotal = 1;
}
// var_dump($ShopOrdID);exit;
$details = $orderinfo["details"];
if(count($details)>1){
    $subject = $details[0]["strItmName"]."等共".count($details)."件商品";
}else{
    $subject = $details[0]["strItmName"];
}
 
$out_trade_no = $orderinfo["ShopOrdID"];
 
 
//付款金额,必填
$total_amount = $PriceTotal;
//商品描述,可空
$body = $subject;
 
//超时时间
$timeout_express="1m";
 
$payRequestBuilder = new AlipayTradeWapPayContentBuilder();
$payRequestBuilder->setBody($body);
$payRequestBuilder->setSubject($subject);
$payRequestBuilder->setOutTradeNo($out_trade_no);
$payRequestBuilder->setTotalAmount($total_amount);
$payRequestBuilder->setTimeExpress($timeout_express);
 
$payResponse = new AlipayTradeService($config);
$result=$payResponse->wapPay($payRequestBuilder,$config['return_url'],$config['notify_url']);
 
    
 
?>