当前位置: 首页>>代码示例>>PHP>>正文


PHP AlipayNotify::verify方法代码示例

本文整理汇总了PHP中AlipayNotify::verify方法的典型用法代码示例。如果您正苦于以下问题:PHP AlipayNotify::verify方法的具体用法?PHP AlipayNotify::verify怎么用?PHP AlipayNotify::verify使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AlipayNotify的用法示例。


在下文中一共展示了AlipayNotify::verify方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: submit

 public function submit()
 {
     unset($_GET[$GLOBALS['app']->config['ctrl_id']], $_GET[$GLOBALS['app']->config['func_id']]);
     if ($_SESSION['user_id']) {
         unset($_GET['id']);
     } else {
         unset($_GET['sn'], $_GET['passwd']);
     }
     //合作身份者id,以2088开头的16位纯数字
     $alipay_config = array('partner' => $this->param['param']['pid'], 'key' => $this->param['param']['key']);
     $alipay_config['sign_type'] = 'MD5';
     $alipay_config['input_charset'] = 'utf-8';
     $alipay_config['cacert'] = $this->paydir . 'cacert.pem';
     $alipay_config['transport'] = 'http';
     $alipayNotify = new AlipayNotify($alipay_config);
     $verify_result = $alipayNotify->verify($_GET);
     if (!$verify_result) {
         error(P_Lang('订单验证不通过,请联系管理员确认'), $GLOBALS['app']->url, 'error');
     }
     //附款日期
     $pay_date = $GLOBALS['app']->get('notify_time');
     if ($pay_date) {
         $pay_date = strtotime($pay_date);
     }
     //附款金额,支付宝接口仅支持人民币
     $price = $GLOBALS['app']->get('total_fee', 'float');
     //更新订单信息
     $array = array('pay_status' => "付款完成", 'pay_date' => $pay_date, 'pay_price' => $price, 'pay_end' => 1);
     $array['status'] = '付款完成';
     //更新扩展数据
     $alipay = array();
     $alipay['buyer_email'] = $GLOBALS['app']->get('buyer_email');
     $alipay['buyer_id'] = $GLOBALS['app']->get('buyer_id');
     $alipay['time'] = $GLOBALS['app']->get('notify_time');
     $alipay['seller_email'] = $GLOBALS['app']->get('seller_email');
     $alipay['seller_id'] = $GLOBALS['app']->get('seller_id');
     $alipay['total_fee'] = $GLOBALS['app']->get('total_fee');
     $alipay['trade_no'] = $GLOBALS['app']->get('trade_no');
     $alipay['trade_status'] = $GLOBALS['app']->get('trade_status');
     $array['ext'] = serialize($alipay);
     $GLOBALS['app']->model('order')->save($array, $this->order['id']);
     return true;
 }
开发者ID:renlong567,项目名称:43168,代码行数:43,代码来源:notice.php

示例2: submit

 public function submit()
 {
     unset($_GET[$GLOBALS['app']->config['ctrl_id']], $_GET[$GLOBALS['app']->config['func_id']], $_GET['sn']);
     $alipay_config = array('partner' => $this->param['param']['pid'], 'key' => $this->param['param']['key']);
     $alipay_config['sign_type'] = 'MD5';
     $alipay_config['input_charset'] = 'utf-8';
     $alipay_config['cacert'] = $this->paydir . 'cacert.pem';
     $alipay_config['transport'] = 'http';
     $alipayNotify = new AlipayNotify($alipay_config);
     $verify_result = $alipayNotify->verify($_GET);
     if (!$verify_result) {
         phpok_log(P_Lang('异步通知:支付宝验证不通过'));
         exit('fail');
     }
     //附款日期
     $pay_date = $GLOBALS['app']->get('notify_time');
     if ($pay_date) {
         $pay_date = strtotime($pay_date);
     }
     //附款金额,支付宝接口仅支持人民币
     $price = $GLOBALS['app']->get('total_fee', 'float');
     $trade_status = $GLOBALS['app']->get('trade_status');
     $tmp = array('WAIT_SELLER_SEND_GOODS', 'WAIT_BUYER_CONFIRM_GOODS', 'TRADE_FINISHED', 'TRADE_SUCCESS');
     if (in_array($trade_status, $tmp)) {
         $array = array('pay_status' => "付款完成", 'pay_date' => $pay_date, 'pay_price' => $price, 'pay_end' => 1);
         $array['status'] = '付款完成';
         //更新扩展数据
         $alipay = array();
         $alipay['buyer_email'] = $GLOBALS['app']->get('buyer_email');
         $alipay['buyer_id'] = $GLOBALS['app']->get('buyer_id');
         $alipay['time'] = $GLOBALS['app']->get('notify_time');
         $alipay['seller_email'] = $GLOBALS['app']->get('seller_email');
         $alipay['seller_id'] = $GLOBALS['app']->get('seller_id');
         $alipay['total_fee'] = $GLOBALS['app']->get('total_fee');
         $alipay['trade_no'] = $GLOBALS['app']->get('trade_no');
         $alipay['trade_status'] = $GLOBALS['app']->get('trade_status');
         $array['ext'] = serialize($alipay);
         $GLOBALS['app']->model('order')->save($array, $rs['id']);
     }
     exit('success');
 }
开发者ID:renlong567,项目名称:43168,代码行数:41,代码来源:notify.php


注:本文中的AlipayNotify::verify方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。