• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP AlipayNotify类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: alipay_notify_app

 /**
  * App支付Notify
  */
 function alipay_notify_app()
 {
     $alipay_config_app = $this->config->item('alipay_config_app');
     $alipayNotify = new AlipayNotify($alipay_config_app);
     $verify_result = $alipayNotify->verifyNotify();
     if ($verify_result) {
         //验证成功
         $out_trade_no = $_POST['out_trade_no'];
         //支付宝交易号
         $trade_no = $_POST['trade_no'];
         //交易状态
         $trade_status = $_POST['trade_status'];
         $this->log_result('alipay_notify', "【支付宝回调App】:\n" . json_encode($_POST) . "\n");
         if ($trade_status == 'TRADE_FINISHED' || $trade_status == 'TRADE_SUCCESS') {
             //判断该笔订单是否在商户网站中已经做过处理
             //如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
             //如果有做过处理,不执行商户的业务程序
             $order = $this->order_model->get_order_info($out_trade_no);
             if ($order['TradeStatus'] != 'TRADE_FINISHED' && $order['TradeStatus'] != 'TRADE_SUCCESS') {
                 $data = array('TradeStatus' => $trade_status, 'TradeNo' => $trade_no, 'PayTime' => time(), 'PayType' => 'alipay');
                 $this->order_model->update_order_info($out_trade_no, $data);
             }
         }
         //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——
         echo "success";
         //请不要修改或删除
         /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     } else {
         //验证失败
         echo "fail";
         //调试用,写文本函数记录程序运行情况是否正常
         //logResult("这里写入想要调试的代码变量值,或其他运行的结果记录");
     }
 }
开发者ID:iyakexi,项目名称:app-pay-server-demo,代码行数:37,代码来源:order.php


示例2: respond

    function respond() {
        
        ini_set("display_errors","On");
        $where = array('ologin_code'=>front::$get['ologin_code']);
        $ologins = ologin::getInstance()->getrows($where);
        $ologin = unserialize_config($ologins[0]['ologin_config']);

        //var_dump($ologin);
        
        $aliapy_config['partner'] = $ologin['alipaylogin_id'];
        $aliapy_config['key'] = $ologin['alipaylogin_key'];
        $aliapy_config['return_url'] = ologin::url(basename(__FILE__,'.php'));
        $aliapy_config['sign_type']    = 'MD5';
        $aliapy_config['input_charset']= 'utf-8';
        $aliapy_config['transport']    = 'http';
        $aliapy_config['cacert']    = getcwd().'/lib/plugins/alipayauth/cacert.pem';
        //var_dump($aliapy_config);
        unset($_GET['case']);unset($_GET['act']);unset($_GET['ologin_code']);unset($_GET['site']);
        require_once("alipayauth/alipay_notify.class.php");
        $alipayNotify = new AlipayNotify($aliapy_config);
        //var_dump($alipayNotify);
        $verify_result = $alipayNotify->verifyReturn();
        //var_dump($verify_result);
        if($verify_result) {//验证成功
            $user_id = front::$get['user_id'];
            $token = front::$get['token'];
            session::set('access_token',$token);
            session::set("openid",$user_id);
            return array('nickname'=>  front::get('real_name'));
        }
        else {
            echo "验证失败";exit;
        }
    }
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:34,代码来源:alipaylogin.php


示例3: verifyReturn

 public function verifyReturn()
 {
     require_once "alipay.config.php";
     require_once "lib/alipay_notify.class.php";
     $alipayNotify = new \AlipayNotify($alipay_config);
     return $alipayNotify->verifyReturn();
 }
开发者ID:torry999,项目名称:lingshi,代码行数:7,代码来源:Alipay.class.php


示例4: ValidateNotification

 public function ValidateNotification($txn_id = null)
 {
     parent::ValidateNotification($txn_id);
     $alipay_config = $this->_getConfig();
     $alipayNotify = new AlipayNotify($alipay_config);
     return $alipayNotify->getResponse($txn_id);
 }
开发者ID:openbizx,项目名称:openbizx-cubix,代码行数:7,代码来源:Alipay.php


示例5: actionAlipayOrderReturn

 public function actionAlipayOrderReturn()
 {
     require_once Yii::getAlias('@vendor') . "/payment/alipay/alipay.config.php";
     require_once Yii::getAlias('@vendor') . "/payment/alipay/lib/alipay_notify.class.php";
     $alipayNotify = new \AlipayNotify($alipay_config);
     $verify_result = $alipayNotify->verifyReturn();
     if ($verify_result) {
         $out_trade_no = $_GET['out_trade_no'];
         $trade_no = $_GET['trade_no'];
         $trade_status = $_GET['trade_status'];
         $model = Order::findOne(['order_sn' => $out_trade_no]);
         if ($model) {
             if ($trade_status === 'TRADE_SUCCESS' || $trade_status === 'TRADE_FINISHED') {
                 if ($model->pay()) {
                     $this->_sendMsg($model);
                     Yii::info("订单支付成功!订单号:{$out_trade_no}");
                 } else {
                     Yii::error("订单支付失败!订单号:{$out_trade_no}");
                     Yii::$app->session->setFlash('danger', '订单支付失败!');
                 }
             } elseif ($trade_status === 'TRADE_CLOSED') {
                 Yii::$app->session->setFlash('warning', '订单未支付!');
             }
         }
     } else {
         throw new ForbiddenHttpException('参数非法。');
     }
     return $this->redirect(['/order/detail', 'order' => $model->order_sn]);
 }
开发者ID:daixianceng,项目名称:xiaoego.com,代码行数:29,代码来源:PaymentController.php


示例6: notify

 public function notify($req)
 {
     require_once __DIR__ . '/mobiAlipay/lib/alipay_notify.class.php';
     //计算得出通知验证结果
     $alipayNotify = new AlipayNotify($this->mobiAlipayConfig);
     $verifyResult = $alipayNotify->verifyNotify();
     if ($verifyResult) {
         //商户订单号
         $out_trade_no = $req['out_trade_no'];
         //支付宝交易号
         $trade_no = $req['trade_no'];
         //交易状态
         $trade_status = $req['trade_status'];
         if ($req['trade_status'] == 'TRADE_FINISHED' || $req['trade_status'] == 'TRADE_SUCCESS') {
             //处理订单状态
             $uid = (new \Mall\Mdu\OrderModule())->setOrderStatus($out_trade_no, $_SERVER['REQUEST_TIME']);
             if ($uid != 0) {
                 (new \Mall\Mdu\OrderLogsModule())->addOrderLogBySn($out_trade_no, $this->di['sysconfig']['orderActType']['successPayment'], $uid, '用户', '支付成功');
                 echo 'success';
             } else {
                 echo 'fail';
             }
         }
     } else {
         echo "fail";
     }
 }
开发者ID:nicklos17,项目名称:littlemall,代码行数:27,代码来源:MobiAlipayClass.php


示例7: notify

 function notify()
 {
     //计算得出通知验证结果
     $alipayNotify = new AlipayNotify($this->alipay_config);
     $verify_result = $alipayNotify->verifyNotify();
     $this->log('deposit/notify ' . 'verify:' . ($verify_result ? 'true' : 'false') . ' ' . json_encode($_POST, JSON_UNESCAPED_UNICODE));
     if ($verify_result) {
         //验证成功
         //商户订单号
         $out_trade_no = $_POST['out_trade_no'];
         //支付宝交易号
         $trade_no = $_POST['trade_no'];
         //交易状态
         $trade_status = $_POST['trade_status'];
         $deposit_id = intval($out_trade_no);
         if (!$deposit_id) {
             echo "fail";
             return FALSE;
         }
         $record = DB::fetch_first('SELECT * FROM ' . DB::table('user_deposit') . ' WHERE ' . DB::implode(array('id' => $deposit_id)));
         if (!$record) {
             echo "fail";
             return FALSE;
         }
         if ($record['status'] == TRADE_FINISHED) {
             echo "success";
             return TRUE;
         }
         switch ($trade_status) {
             case 'WAIT_BUYER_PAY':
                 DB::update('user_deposit', array('trade_no' => $trade_no, 'status' => WAIT_BUYER_PAY, 'updatetime' => TIMESTAMP), array('id' => $deposit_id));
                 break;
             case 'TRADE_CLOSED':
                 DB::update('user_deposit', array('status' => TRADE_CLOSED, 'updatetime' => TIMESTAMP), array('id' => $deposit_id));
                 break;
             case 'WAIT_SELLER_SEND_GOODS':
                 $this->send_goods($record, $trade_no);
                 DB::update('user_deposit', array('status' => WAIT_BUYER_CONFIRM, 'updatetime' => TIMESTAMP), array('id' => $deposit_id));
                 break;
             case 'WAIT_BUYER_CONFIRM_GOODS':
                 DB::update('user_deposit', array('status' => WAIT_BUYER_CONFIRM, 'updatetime' => TIMESTAMP), array('id' => $deposit_id));
                 break;
             case 'TRADE_SUCCESS':
                 DB::update('user_deposit', array('status' => TRADE_UNSUPPORTED, 'updatetime' => TIMESTAMP), array('id' => $deposit_id));
                 break;
             case 'TRADE_FINISHED':
                 DB::update('user_deposit', array('status' => TRADE_FINISHED, 'updatetime' => TIMESTAMP), array('id' => $deposit_id));
                 if ($record && $record['uid']) {
                     DB::query('UPDATE ' . DB::table('user_status') . ' SET ' . DB::quote_field('balance') . ' = ' . DB::quote_field('balance') . ' + ' . $record['price'] . ' WHERE ' . DB::implode(array('uid' => $record['uid'])));
                 }
                 break;
         }
         $this->log('deposit/notify id:' . $deposit_id . ' ' . $trade_status);
         echo "success";
         return TRUE;
     } else {
         echo "fail";
         return FALSE;
     }
 }
开发者ID:huiwei19,项目名称:oursustc-php,代码行数:60,代码来源:alipay.php


示例8: actionNotifyUrl

 public function actionNotifyUrl()
 {
     //计算得出通知验证结果
     $alipayNotify = new \AlipayNotify($this->alipayConfig());
     $verify_result = $alipayNotify->verifyNotify();
     if ($verify_result) {
         //验证成功
         if ($_REQUEST['trade_status'] == 'TRADE_FINISHED') {
             //退款日期超过可退款期限后(如三个月可退款),支付宝系统发送该交易状态通知
             echo '退款';
         } else {
             if ($_REQUEST['trade_status'] == 'TRADE_SUCCESS') {
                 //付款完成后,支付宝系统发送该交易状态通知
                 if (ChargeOrder::getInstance()->setOrderStatus($_REQUEST['out_trade_no'])) {
                     // 设置订单状态
                     return $this->redirect('http://wechat.baihey.com/wap/site/main#/charge_order?orderId=' . $_REQUEST['out_trade_no'] . '&payType=4');
                 } else {
                     // 设置订单状态失败
                     return $this->redirect('http://wechat.baihey.com/wap/site/main#/charge_order?orderId=' . $_REQUEST['out_trade_no'] . '&payType=4');
                 }
             } else {
                 // 未付款
                 return $this->redirect('http://wechat.baihey.com/wap/site/main#/charge_order?orderId=' . $_REQUEST['out_trade_no'] . '&payType=4');
             }
         }
         echo "success";
         //请不要修改或删除
     } else {
         //验证失败
         echo "fail";
         return $this->redirect('http://wechat.baihey.com/wap/site/main#/charge_order?orderId=' . $_REQUEST['out_trade_no'] . '&payType=4');
     }
 }
开发者ID:xswolf,项目名称:baihey,代码行数:33,代码来源:ChargeController.php


示例9: return_url

 public function return_url()
 {
     import("@.ORG.Alipay.AlipayNotify");
     $alipayNotify = new AlipayNotify($this->setconfig());
     $verify_result = $alipayNotify->verifyReturn();
     if ($verify_result) {
         //商户订单号
         $out_trade_no = $_GET['out_trade_no'];
         //支付宝交易号
         $trade_no = $_GET['trade_no'];
         //交易状态
         $trade_status = $_GET['trade_status'];
         if ($_GET['trade_status'] == 'WAIT_SELLER_SEND_GOODS') {
             $indent = M('Indent')->field('id,price')->where(array('index_id' => $out_trade_no))->find();
             if ($indent !== false) {
                 //$back=M('Users')->where(array('id'=>$indent['uid']))->setInc('money',$indent['price']);
                 $back = M('Indent')->where(array('id' => $indent['id']))->setField('status', 1);
                 if ($back != false) {
                     $this->success('充值成功', U('Home/Index/index'));
                 } else {
                     $this->error('充值失败,请在线客服,为您处理', U('Home/Index/index'));
                 }
             } else {
                 $this->error('订单不存在', U('Home/Index/index'));
             }
         } else {
             $this->error('请勿重复操作', U('Home/Index/index'));
         }
     } else {
         $this->error('充值失败 ,请在线客服,为您处理', U('Home/Index/index'));
     }
 }
开发者ID:dlpc,项目名称:wxshoppingmall,代码行数:32,代码来源:AlipayAction.class.php


示例10: alipayNotify

 /**
  * 支付宝回调
  */
 public static function alipayNotify()
 {
     vendor('Alipay.Notify', COMMON_PATH . 'Vendor');
     $alipay_config = C('ALIPAY');
     $AlipayNotify = new \AlipayNotify($alipay_config);
     return $AlipayNotify->verifyNotify();
 }
开发者ID:Orchild,项目名称:mt,代码行数:10,代码来源:Payment.class.php


示例11: return_url

 public function return_url()
 {
     import("@.ORG.Alipay.AlipayNotify");
     $alipayNotify = new AlipayNotify($this->setconfig());
     $verify_result = $alipayNotify->verifyReturn();
     if ($verify_result) {
         $out_trade_no = $this->_get('out_trade_no');
         $trade_no = $this->_get('trade_no');
         $trade_status = $this->_get('trade_status');
         if ($this->_get('trade_status') == 'TRADE_FINISHED' || $this->_get('trade_status') == 'TRADE_SUCCESS') {
             $product_cart_model = M('product_cart');
             $order = $product_cart_model->where(array('orderid' => $out_trade_no))->find();
             if (!$this->wecha_id) {
                 $this->wecha_id = $order['wecha_id'];
             }
             $sepOrder = 0;
             if (!$order) {
                 $order = $product_cart_model->where(array('id' => $out_trade_no))->find();
                 $sepOrder = 1;
             }
             if ($order) {
                 if ($order['paid'] == 1) {
                     exit('该订单已经支付,请勿重复操作');
                 }
                 if (!$sepOrder) {
                     $product_cart_model->where(array('orderid' => $out_trade_no))->setField('paid', 1);
                 } else {
                     $product_cart_model->where(array('id' => $out_trade_no))->setField('paid', 1);
                 }
                 $member_card_create_db = M('Member_card_create');
                 $userCard = $member_card_create_db->where(array('token' => $this->token, 'wecha_id' => $this->wecha_id))->find();
                 $member_card_set_db = M('Member_card_set');
                 $thisCard = $member_card_set_db->where(array('id' => intval($userCard['cardid'])))->find();
                 $set_exchange = M('Member_card_exchange')->where(array('cardid' => intval($thisCard['id'])))->find();
                 $arr['token'] = $this->token;
                 $arr['wecha_id'] = $this->wecha_id;
                 $arr['expense'] = $order['price'];
                 $arr['time'] = time();
                 $arr['cat'] = 99;
                 $arr['staffid'] = 0;
                 $arr['score'] = intval($set_exchange['reward']) * $order['price'];
                 M('Member_card_use_record')->add($arr);
                 $userinfo_db = M('Userinfo');
                 $thisUser = $userinfo_db->where(array('token' => $thisCard['token'], 'wecha_id' => $arr['wecha_id']))->find();
                 $userArr = array();
                 $userArr['total_score'] = $thisUser['total_score'] + $arr['score'];
                 $userArr['expensetotal'] = $thisUser['expensetotal'] + $arr['expense'];
                 $userinfo_db->where(array('token' => $thisCard['token'], 'wecha_id' => $arr['wecha_id']))->save($userArr);
                 $this->redirect(U('Product/my', array('token' => $order['token'], 'wecha_id' => $order['wecha_id'], 'success' => 1)));
             } else {
                 exit('订单不存在:' . $out_trade_no);
             }
         } else {
             exit('付款失败');
         }
     } else {
         exit('不存在的订单');
     }
 }
开发者ID:yakrsa,项目名称:football,代码行数:59,代码来源:AlipaytypeAction.class.php


示例12: verifyAlipayNotify

function verifyAlipayNotify(array $alipayConfig)
{
    $alipayConfig = getAlipayConfig($alipayConfig);
    $alipayNotify = new AlipayNotify($alipayConfig);
    $verifyResult = (bool) $alipayNotify->verifyNotify();
    echo $verifyResult ? 'success' : 'fail';
    return $verifyResult;
}
开发者ID:omusico,项目名称:ThinkSNS-4,代码行数:8,代码来源:alipay.php


示例13: check

 function check($result)
 {
     require_once "alipay/config.php";
     require_once "alipay/lib/alipay_notify.class.php";
     $alipayNotify = new \AlipayNotify($alipay_config);
     $verify_result = $alipayNotify->verifyReturn($result);
     return $verify_result;
 }
开发者ID:xingluxin,项目名称:jianshen,代码行数:8,代码来源:AliPay.class.php


示例14: callback

 /**
  * 支付宝回调
  * @param unknown $aParams
  * @return Ambigous <验证结果, boolean>
  */
 public static function callback($aParams)
 {
     require_once LIB_PATH . '/Payment/Alipay/alipay_service.class.php';
     require_once LIB_PATH . '/Payment/Alipay/alipay_notify.class.php';
     $alipay_config = Yaf_G::getConf('aliapy_config', null, 'alipay');
     $alipayNotify = new AlipayNotify($alipay_config);
     return $alipayNotify->verifyNotify($aParams);
 }
开发者ID:pancke,项目名称:yyaf,代码行数:13,代码来源:Alipay.php


示例15: endPay

 function endPay($PassageInfo, $OrderInfo)
 {
     /* 商户号 */
     $partner = $PassageInfo['StagePartnerId'];
     /* 密钥 */
     $key = $PassageInfo['StageSecureCode'];
     require "AliPayClass/notify_url.php";
     //计算得出通知验证结果
     $alipayNotify = new AlipayNotify($aliapy_config);
     $verify_result = $alipayNotify->verifyNotify();
     if ($verify_result) {
         //验证成功
         /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
         //请在这里加上商户的业务逻辑程序代
         //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
         //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表
         $out_trade_no = $_REQUEST['out_trade_no'];
         //获取订单号
         $trade_no = $_REQUEST['trade_no'];
         //获取支付宝交易号
         $total_fee = $_REQUEST['total_fee'];
         //获取总价格
         if ($OrderInfo['OrderId'] == $out_trade_no && $total_fee == $OrderInfo['Coin']) {
             $Pay['OrderId'] = $OrderInfo['OrderId'];
             $Pay['PayUserId'] = $OrderInfo['PayUserId'];
             $Pay['AcceptUserId'] = $OrderInfo['AcceptUserId'];
             $Pay['PassageId'] = $OrderInfo['PassageId'];
             $Pay['AppId'] = $OrderInfo['AppId'];
             $Pay['PartnerId'] = $OrderInfo['PartnerId'];
             $Pay['SubPassageId'] = $OrderInfo['SubPassageId'];
             $Pay['Amount'] = $OrderInfo['Amount'];
             $Pay['Coin'] = $OrderInfo['Coin'];
             $Pay['Credit'] = $OrderInfo['Credit'];
             $Pay['PayIP'] = $OrderInfo['PayIP'];
             $Pay['PayTime'] = $OrderInfo['PayTime'];
             $Pay['UserSourceId'] = $OrderInfo['UserSourceId'];
             $Pay['UserSourceDetail'] = $OrderInfo['UserSourceDetail'];
             $Pay['UserSourceProjectId'] = $OrderInfo['UserSourceProjectId'];
             $Pay['UserSourceActionId'] = $OrderInfo['UserSourceActionId'];
             $Pay['UserRegTime'] = $OrderInfo['UserRegTime'];
             $Pay['PayedTime'] = strtotime($_REQUEST['notify_time']);
             $Pay['StageOrder'] = $trade_no;
             $Pay['comment'] = json_encode(array('buyer_email' => $_REQUEST['buyer_email'], 'buyer_id' => $_REQUEST['buyer_id']));
             return $Pay;
         } else {
             return false;
         }
         //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——
         echo "success";
         //请不要修改或删除
         /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     } else {
         //验证失败
         echo "fail";
         //调试用,写文本函数记录程序运行情况是否正常
         //logResult("这里写入想要调试的代码变量值,或其他运行的结果记录");
     }
 }
开发者ID:eappl,项目名称:prototype,代码行数:58,代码来源:AliTel.php


示例16: verifyReturn

 /**
  * 验证支付宝的服务器返回
  *
  * @return boolen 返回验证状态, true代表合法请求,fasle代表无效返回
  */
 public function verifyReturn()
 {
     $notify = new \AlipayNotify($this->_config);
     if ($notify->verifyNotify()) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:VanJames,项目名称:Dskies2,代码行数:14,代码来源:Payment.php


示例17: alipay_notify

 public function alipay_notify($post)
 {
     require_once "lib/alipay_notify.class.php";
     $this->alipay_config['cacert'] = $this->cacert;
     $alipayNotify = new AlipayNotify($this->alipay_config);
     $verify_result = $alipayNotify->verifyNotify();
     if ($verify_result) {
         return $post['trade_status'];
     } else {
         return "error";
     }
 }
开发者ID:crab890715,项目名称:GoOut-Panel,代码行数:12,代码来源:guarantee.php


示例18: notifyVerify

 public function notifyVerify()
 {
     require_once "alipay/alipay_notify.class.php";
     $alipayNotify = new AlipayNotify($this->_config);
     $verify_result = $alipayNotify->verifyNotify();
     //验证
     if ($verify_result) {
         return $_POST;
     } else {
         return false;
     }
 }
开发者ID:onlineshine,项目名称:myzf,代码行数:12,代码来源:alipay.php


示例19: callback

 public function callback()
 {
     es_session::start();
     $aliapy_config['partner'] = $this->api['config']['app_key'];
     $aliapy_config['key'] = $this->api['config']['app_secret'];
     $aliapy_config['return_url'] = SITE_DOMAIN . APP_ROOT . "/api_callback.php?c=Taobao";
     $aliapy_config['sign_type'] = 'MD5';
     $aliapy_config['input_charset'] = 'utf-8';
     $aliapy_config['transport'] = 'http';
     require_once APP_ROOT_PATH . "system/api_login/taobao/alipay_notify.class.php";
     unset($_GET['c']);
     $alipayNotify = new AlipayNotify($aliapy_config);
     $verify_result = $alipayNotify->verifyReturn();
     if ($verify_result) {
         //验证成功
         /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
         //请在这里加上商户的业务逻辑程序代码
         //——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
         //获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表
         $user_id = $_GET['user_id'];
         //支付宝用户id
         $token = $_GET['token'];
         //授权令牌
         $real_name = $_GET['real_name'];
         //执行商户的业务程序
         $msg['id'] = $user_id;
         $msg['name'] = $real_name;
         $msg['field'] = 'taobao_id';
         es_session::set("api_user_info", $msg);
         $user_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where taobao_id = '" . $msg['id'] . "' and taobao_id <> ''");
         if ($user_data) {
             $user_current_group = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_group where id = " . intval($user_data['group_id']));
             $user_group = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_group where score <=" . intval($user_data['score']) . " order by score desc");
             if ($user_current_group['score'] < $user_group['score']) {
                 $user_data['group_id'] = intval($user_group['id']);
             }
             es_session::set("user_info", $user_data);
             $GLOBALS['db']->query("update " . DB_PREFIX . "user set login_ip = '" . CLIENT_IP . "',login_time= " . TIME_UTC . ",group_id=" . intval($user_data['group_id']) . " where id =" . $user_data['id']);
             //$GLOBALS['db']->query("update ".DB_PREFIX."deal_cart set user_id = ".intval($user_data['id'])." where session_id = '".es_session::id()."'");
             es_session::delete("api_user_info");
             app_recirect_preview();
         } else {
             app_redirect(url("shop", "user#api_login"));
         }
         //——请根据您的业务逻辑来编写程序(以上代码仅作参考)——
         /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     } else {
         //验证失败
         //如要调试,请看alipay_notify.php页面的return_verify函数,比对sign和mysign的值是否相等,或者检查$veryfy_result有没有返回true
         echo "验证失败";
     }
 }
开发者ID:eliu03,项目名称:fanweP2P,代码行数:52,代码来源:Taobao_api.php


示例20: verifyNotify

 public function verifyNotify()
 {
     $basePath = base_path();
     require_once $basePath . "/vendor/alipay/alipay.config.php";
     require_once $basePath . "/vendor/alipay/lib/alipay_notify.class.php";
     $alipayNotify = new AlipayNotify($alipay_config);
     $verify_result = $alipayNotify->verifyNotify();
     if (!$verify_result) {
         throw new Exception("支付宝验证失败", 9001);
     } else {
         return true;
     }
 }
开发者ID:qnck,项目名称:qingnianchuangke,代码行数:13,代码来源:Alipay.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP AlipaySubmit类代码示例发布时间:2022-05-23
下一篇:
PHP Alias类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap