1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 如何检测支付宝接口中notify_url.php有没有返回 支付宝中的手机网站支付接口 php版

如何检测支付宝接口中notify_url.php有没有返回 支付宝中的手机网站支付接口 php版

时间:2021-03-11 23:11:38

相关推荐

如何检测支付宝接口中notify_url.php有没有返回 支付宝中的手机网站支付接口 php版

require_once("alipay.config.php");

require_once("lib/alipay_notify.class.php");

$alipayNotify = new AlipayNotify($alipay_config);

$verify_result = $alipayNotify->verifyNotify();

if($verify_result) {//验证成功

$notify_data = $alipayNotify->decrypt($_POST[‘notify_data‘]);

$doc = new DOMDocument();

$doc->loadXML($notify_data);

if( ! empty($doc->getElementsByTagName( "notify" )->item(0)->nodeValue) ) {

$out_trade_no = $doc->getElementsByTagName( "out_trade_no" )->item(0)->nodeValue;

$trade_no = $doc->getElementsByTagName( "trade_no" )->item(0)->nodeValue;

$trade_status = $doc->getElementsByTagName( "trade_status" )->item(0)->nodeValue;

if($_POST[‘trade_status‘] == ‘TRADE_FINISHED‘ || $_POST[‘trade_status‘] == ‘TRADE_SUCCESS‘) {

//以下是数据库操作代码

require_once(‘../Connections/coon.php‘);

mysql_select_db($database_coon, $coon);

mysql_query("UPDATE shop_orders SET ZT=‘payed‘ WHERE DDH=‘$out_trade_no‘");

mysql_close($coon);

//数据库操作结束

echo "success";

}

}

}

else {

echo "fail";

}

?>

操作数据库的代码没有执行,查过支付宝可以正常访问这个页面。问题出现在解密或者解析XML上,请问高手们这个哪里有问题?我是采用RSA加密方式。

你这是官方文档应用的 这个文档是有错误的!!低级错误!!!$_POST[‘trade_status‘]改成$trade_status写日志调试!!!

追问:

非常感谢您!改了之后就成功了!感谢无私的奉献!

追答:

官方给的实例问题!!!不客气!!

原文:/phpxuetang/p/4857154.html

如何检测支付宝接口中notify_url.php有没有返回 支付宝中的手机网站支付接口 php版 notify_url.php 异步通知页面未成功执行...

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。