Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
xiaozhan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
冷斌
xiaozhan
Commits
9fa28db3
Commit
9fa28db3
authored
Mar 22, 2020
by
冷斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4a677c49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
+23
-23
alipay/alipay_app/notify_url.php
+23
-23
No files found.
alipay/alipay_app/notify_url.php
View file @
9fa28db3
...
...
@@ -23,16 +23,16 @@ require_once("lib/alipay_notify.class.php");
$alipayNotify
=
new
AlipayNotify
(
$alipay_config
);
$verify_result
=
$alipayNotify
->
verifyNotify
();
if
(
$verify_result
)
{
//验证成功
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//请在这里加上商户的业务逻辑程序代
//——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
//获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表
//商户订单号
$out_trade_no
=
$_POST
[
'out_trade_no'
];
...
...
@@ -43,7 +43,7 @@ if($verify_result) {
//交易状态
$trade_status
=
$_POST
[
'trade_status'
];
//交易金额
$total_fee
=
(
int
)
$_POST
[
'total_fee'
];
...
...
@@ -52,20 +52,20 @@ if($verify_result) {
//判断该笔订单是否在商户网站中已经做过处理
//如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
//如果有做过处理,不执行商户的业务程序
//注意:
//退款日期超过可退款期限后(如三个月可退款),支付宝系统发送该交易状态通知
//请务必判断请求时的total_fee、seller_id与通知时获取的total_fee、seller_id为一致的
//调试用,写文本函数记录程序运行情况是否正常
//logResult("这里写入想要调试的代码变量值,或其他运行的结果记录");
}
else
if
(
$_POST
[
'trade_status'
]
==
'TRADE_SUCCESS'
)
{
//判断该笔订单是否在商户网站中已经做过处理
//如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
//如果有做过处理,不执行商户的业务程序
//注意:
//付款完成后,支付宝系统发送该交易状态通知
//请务必判断请求时的total_fee、seller_id与通知时获取的total_fee、seller_id为一致的
...
...
@@ -75,30 +75,30 @@ if($verify_result) {
$link
=
mysql
_connect
(
""
,
""
,
"
"
);
$link
=
mysql
i_connect
(
"mysql"
,
"zhibo"
,
"Rni43v7RpkWUP9FD
"
);
if
(
$link
){
mysql
_select_db
(
"
"
,
$link
);
mysql_query
(
"set names utf8"
);
$result
=
mysql_query
(
"select * from cmf_users_charge where orderno='
$out_trade_no
' and money='
$total_fee
' and status='0' and type='1'"
);
$row
=
mysql_fetch_assoc
(
$result
);
mysql
i_select_db
(
"zhibo
"
,
$link
);
mysql
i
_query
(
"set names utf8"
);
$result
=
mysql
i
_query
(
"select * from cmf_users_charge where orderno='
$out_trade_no
' and money='
$total_fee
' and status='0' and type='1'"
);
$row
=
mysql
i
_fetch_assoc
(
$result
);
$str
=
json_encode
(
$row
);
if
(
$row
){
mysql_query
(
"update cmf_users set coin=coin+
{
$row
[
'coin'
]
}
where id='
$row[touid]
'"
);
mysql_query
(
"update cmf_users_charge set status='1',trade_no='
$trade_no
' where id=
{
$row
[
'id'
]
}
"
);
mysql
i
_query
(
"update cmf_users set coin=coin+
{
$row
[
'coin'
]
}
where id='
$row[touid]
'"
);
mysql
i
_query
(
"update cmf_users_charge set status='1',trade_no='
$trade_no
' where id=
{
$row
[
'id'
]
}
"
);
file_put_contents
(
'./logali.txt'
,
date
(
'y-m-d h:i:s'
)
.
' msg:'
.
"支付成功:
\r\n
"
,
FILE_APPEND
);
}
else
{
file_put_contents
(
'./logali.txt'
,
date
(
'y-m-d h:i:s'
)
.
' msg:'
.
"orderno:"
.
$out_trade_no
.
' 订单信息不存在'
.
"
\r\n
"
,
FILE_APPEND
);
}
}
}
}
echo
"success"
;
//请不要修改或删除
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment