Beispiel #1
0
 public function verifyReturn()
 {
     $alipayNotify = new AlipayNotify($this->alipay_config);
     return $alipayNotify->return_verify();
 }
Beispiel #2
0
<?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';
/* very import, this value is add by my phpframewrok */
unset($_GET['param']);
/* end */
$alipay = new AlipayNotify($partner, $security_code, $sign_type, $_input_charset, $transport);
$verify_result = $alipay->return_verify();
$out_trade_no = $_GET['out_trade_no'];
//获取订单号
$total_fee = $_GET['total_fee'];
//获取总价格
@(list($_, $order_id, $city_id, $_) = explode('-', $out_trade_no, 4));
if ($verify_result) {
    if ($_GET['trade_status'] == 'TRADE_FINISHED' || $_GET['trade_status'] == 'TRADE_SUCCESS') {
        $order = Table::Fetch('order', $order_id);
        if ($order['state'] == 'unpay') {
            //1
            $table = new Table('order');
            $table->SetPk('id', $order_id);
            $table->pay_id = $out_trade_no;
            $table->money = $total_fee;
            $table->state = 'pay';
            $flag = $table->update(array('state', 'pay_id', 'total_fee'));
            if ($flag) {
                $table = new Table('pay');
Beispiel #3
0
 public function verifyReturn()
 {
     $notify = new AlipayNotify($this->partner, $this->key, $this->sign_type, $this->_input_charset, $this->transport);
     return $notify->return_verify();
 }