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


PHP AlipayNotify::notify_verify方法代码示例

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


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

示例1: dirname

<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
$_input_charset = 'utf-8';
$partner = $INI['alipay']['mid'];
$security_code = $INI['alipay']['sec'];
$sign_type = 'MD5';
$transport = 'http';
$alipay = new AlipayNotify($partner, $security_code, $sign_type, $_input_charset, $transport);
$verify_result = $alipay->notify_verify();
$out_trade_no = $_POST['out_trade_no'];
$trade_no = strval($_POST['trade_no']);
$total_fee = $_POST['total_fee'];
@(list($_, $order_id, $city_id, $_) = explode('-', $out_trade_no, 4));
if (Table::Fetch('pay', $out_trade_no)) {
    die('success');
}
if ($_ == 'charge') {
    if ($verify_result) {
        if ($_POST['trade_status'] == 'TRADE_FINISHED' || $_POST['trade_status'] == 'TRADE_SUCCESS') {
            @(list($_, $user_id, $create_time, $_) = explode('-', $out_trade_no, 4));
            ZFlow::CreateFromCharge($total_fee, $user_id, $create_time, 'alipay', $trade_no);
        }
    }
    die('success');
}
if ($verify_result) {
    //$guarantee = strtoupper($INI['alipay']['guarantee']) == 'Y';
    $guaranteewait = strtoupper($INI['alipay']['guaranteesuccess']) == 'N';
    $guarantee = $guaranteewait && $_POST['trade_status'] == 'WAIT_SELLER_SEND_GOODS';
    if ($_POST['trade_status'] == 'TRADE_FINISHED' || $_POST['trade_status'] == 'TRADE_SUCCESS' || $guarantee) {
开发者ID:BGCX262,项目名称:zuituware-svn-to-git,代码行数:31,代码来源:notify.php

示例2: verifyNotify

 public function verifyNotify()
 {
     $alipayNotify = new AlipayNotify($this->alipay_config);
     return $alipayNotify->notify_verify();
 }
开发者ID:zwq,项目名称:unpei,代码行数:5,代码来源:AlipayProxy.php

示例3: return_code

 /**
  *显示页.
  *
  *@param $code
  */
 public function return_code($code, $is_notify = 0, $equipment_type = "pc")
 {
     Configure::write('debug', 1);
     if ($is_notify == 1) {
         Configure::write('debug', 0);
     }
     $this->pageTitle = '支付完成' . ' - ' . $this->configs['shop_name'];
     $this->ur_heres[] = array('name' => $this->ld['checkout_center'], 'url' => '');
     $price_format = !empty($this->configs['price_format']) ? $this->configs['price_format'] : '¥%s元';
     $payment = $this->Payment->findbycode($code);
     //添加到model中
     if (empty($payment)) {
         $this->redirect('/');
     }
     $payment_config = unserialize($payment['Payment']['config']);
     $alipay_amount = 0;
     $trade_status = 0;
     if ($equipment_type == 'wap' && $code == 'alipay') {
         //手机支付宝支付回调
         $alipay_config = array();
         //合作身份者id,以2088开头的16位纯数字
         $alipay_config['partner'] = isset($payment_config['partner']) ? $payment_config['partner'] : '';
         //收款支付宝账号,一般情况下收款账号就是签约账号
         $alipay_config['seller_id'] = isset($payment_config['partner']) ? $payment_config['partner'] : '';
         //商户的私钥(后缀是.pen)文件相对路径
         $alipay_config['private_key_path'] = ROOT . '/vendors/payments/alipaywap/key/rsa_private_key.pem';
         //支付宝公钥(后缀是.pen)文件相对路径
         $alipay_config['ali_public_key_path'] = ROOT . '/vendors/payments/alipaywap/key/rsa_public_key.pem';
         //签名方式 不需修改
         $alipay_config['sign_type'] = strtoupper('RSA');
         //字符编码格式 目前支持 gbk 或 utf-8
         $alipay_config['input_charset'] = strtolower('utf-8');
         //ca证书路径地址,用于curl中ssl校验
         //请保证cacert.pem文件在当前文件夹目录中
         $alipay_config['cacert'] = ROOT . '/vendors/payments/alipaywap/cacert.pem';
         //访问模式,根据自己的服务器是否支持ssl访问,若支持请选择https;若不支持请选择http
         $alipay_config['transport'] = 'http';
         $alipaySubmit_classfile = ROOT . "/vendors/payments/alipaywap/alipay_notify.class.php";
         include_once $alipaySubmit_classfile;
         $alipayNotify = new AlipayNotify($alipay_config);
         $verify_result = $alipayNotify->verifyReturn();
         $payment_api_log_id_str = isset($_REQUEST['out_trade_no']) ? $_REQUEST['out_trade_no'] : 0;
         $payment_api_log_id_arr = split("_", $payment_api_log_id_str);
         $payment_api_log_id = $payment_api_log_id_arr[0];
         //支付记录Id
         //		$payment_api_log_id=isset($_REQUEST['out_trade_no'])?$_REQUEST['out_trade_no']:0;
         $verify_result = $alipayNotify->verifyReturn();
         $alipay_amount = isset($_REQUEST['total_fee']) ? $_REQUEST['total_fee'] : 0;
         $alipay_trade_status = isset($_REQUEST['trade_status']) ? $_REQUEST['trade_status'] : '';
         $trade_status = 0;
         if ($alipay_trade_status == 'TRADE_FINISHED' || $alipay_trade_status == 'TRADE_SUCCESS') {
             $trade_status = 1;
         }
     } else {
         App::import('Vendor', 'payments/' . $payment['Payment']['code']);
         $response_payment = new $code();
         $response_payment->notify($payment_config);
         $payment_api_log_id = $response_payment->get_track_id();
         if ($code == 'authorizenet_aim' && isset($_SESSION['aim']) && !empty($_SESSION['aim'])) {
             $response_payment = unserialize(base64_decode($_SESSION['aim']));
             unset($_SESSION['aim']);
         }
         $trade_status = $response_payment->get_trade_status();
         if ($is_notify == 1) {
             $verify_result = $alipayNotify->notify_verify();
         } else {
             $verify_result = $response_payment->return_verify();
         }
     }
     $payment_api_log = $this->PaymentApiLog->find('first', array('conditions' => array('PaymentApiLog.id' => $payment_api_log_id)));
     if (empty($payment_api_log) && $is_notify == 0) {
         $this->flash('支付失败', '/pages/home', 60);
     } else {
         if (empty($payment_api_log) && $is_notify == 1) {
             echo "fail";
             die;
         }
     }
     if ($payment_api_log['PaymentApiLog']['type'] == '2') {
         //充值支付
         $back_url = '/users/deposit';
     } else {
         $amount_result = false;
         if (isset($response_payment)) {
             $amount_result = $response_payment->check_amount($payment_api_log['PaymentApiLog']['amount']);
         } else {
             if (isset($alipay_amount)) {
                 $amount_result = floatval($alipay_amount) == floatval($payment_api_log['PaymentApiLog']['amount']) ? true : false;
             }
         }
         //订单支付
         if (constant('Product') == 'AllInOne') {
             $this->loadModel('Order');
             $this->loadModel('OrderProduct');
             $this->loadModel('OrderAction');
//.........这里部分代码省略.........
开发者ID:hobbysh,项目名称:seevia-opensource,代码行数:101,代码来源:responds_controller.php

示例4: verifyNotify

 public function verifyNotify()
 {
     $notify = new AlipayNotify($this->partner, $this->key, $this->sign_type, $this->_input_charset, $this->transport);
     return $notify->notify_verify();
 }
开发者ID:bfyang5130,项目名称:zzl,代码行数:5,代码来源:AlipayProxy.php


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