怎样将订单存入数据库(需要在服务器上测试)
我把我的代码git到远程服务器上后(当然此时config.php里面的配置参数也要相应的进行修改),中间的马赛克位置填你服务器的域名或者公网IP地址:
notify_url.php代码
<?php
require_once 'config.php';
require_once 'pagepay/service/AlipayTradeService.php';
require_once("../include/memcache.php");
$arr=$_POST;
$alipaySevice = new AlipayTradeService($config);
$alipaySevice->writeLog(var_export($_POST,true));
$result = $alipaySevice->check($arr);
/* 实际验证过程建议商户添加以下校验。
1、商户需要验证该通知数据中的out_trade_no是否为商户系统中创建的订单号,
2、判断total_amount是否确实为该订单的实际金额(即商户订单创建时的金额),
3、校验通知中的seller_id(或者seller_email) 是否为out_trade_no这笔单据的对应的操作方(有的时候,一个商户可能有多个seller_id/seller_email)
4、验证app_id是否为该商户本身。
*/
if($result)