예제 #1
0
파일: pay_respond.php 프로젝트: dlpc/ecshop
        $smarty->assign('payArr', $payArr);
        assign_template();
        $_SESSION['pay_sn'] = $order['order_sn'];
        unset($_SESSION['message']);
        unset($_SESSION['message_sn']);
        $smarty->display('pay_respond.dwt');
    } else {
        header('location:flow.php?step=done');
    }
} else {
    include_once ROOT_PATH . 'includes/lib_transaction.php';
    include_once 'includes/modules/payment/payment.php';
    require ROOT_PATH . 'includes/lib_payment.php';
    require ROOT_PATH . 'includes/lib_order.php';
    $pay_obj = new payment();
    $payArr = $pay_obj->respond();
    if ($payArr != false && $payArr['status'] == 1) {
        $message = '支付成功';
        //$order_id = $db->getRow('select order_id from '.$ecs->table('order_info').' where order_sn='.$payArr['orderid'].'');
        $order_id = $db->getRow("select user_id, email, order_id from " . $ecs->table('order_info') . " where order_sn='" . $payArr['orderid'] . "'");
        $payArr['order_id'] = $order_id['order_id'];
        $payArr['user_id'] = $order_id['user_id'];
        $payArr['email'] = $order_id['email'];
        //$url = '&message='.$message.'&order_id='.$payArr['order_id'].'&status='.$payArr['status'].'&money='.$payArr['payprice'];
        $url = '&message=' . $message . '&order_id=' . $payArr['order_id'] . '&status=' . $payArr['status'] . '&money=' . $payArr['payprice'] . '&email=' . $payArr['email'] . '&user_id=' . $payArr['user_id'];
    } else {
        $message = "支付失败";
        $url = '&message=' . $message;
    }
    $_SESSION['message_sn'] = $payArr['orderid'] ? $payArr['orderid'] : 0;
    $_SESSION['message'] = $order_id['order_id'] ? $order_id['order_id'] : 0;