Losing ZF2 Session after Paypal redirection

左心房为你撑大大i 提交于 2019-12-04 05:56:46

问题


I have a serious problem with managing session in zf2 and PayPal payment. Once I get in the page of the payment, I lose the zf2 session. How to solve it?

$mySession = new Container('mySession');
$mySession->login = "name";
$mySession->droit=  "admin";

Thanks.

Update : the redirect page :

<?php
  session_start();
 extract($_GET);
if($action == "paypal")
  header("Location: ./paymentgetway.php?action=$action&invoiceId=$invoiceId&L_NAME0=$L_NAME0&L_AMT0=$L_AMT0&L_DESC0=$L_DESC0&L_QTY0=$L_QTY0");
?>

the payment page :

<?php
    session_start();
    require_once ("payment/paypal/paypalfunctions.php");
    extract($_GET);
    extract($_SESSION);
    switch ($action) {
        case "paypal":
            if (isset($L_NAME0) && isset($L_AMT0) && isset($L_DESC0) && isset($L_QTY0)) {
                include("payment/paypal/expresscheckout.php");
            } else {
                header("Location:index.php");
            }
            break;
        case "paymentcanceled":
            $file = "payment/paypal/paymentcanceled.php";
            break;
        case "paymentcompleted":
            if ($paymentapi == "paypal") {
                include("payment/saveTransactionDetails.php");
            }
            $file = "payment/paypal/paymentcompleted.php";
            break;
        case "paymentpending":
            $file = "payment/paypal/paymentpending.php";
            break;
        case "apierror":
            $file = "payment/paypal/apierror.php";
            break;
        default:
            header("Location: index.php");
    }
    ?>

    <!DOCTYPE html>
    <html lang="fr">      
        <body>  
            <div class="corps">
                <?php include($file); ?>   
            </div>
        </body>
    </html>

回答1:


the solution is to use the modul realised for zf2 which is speckPaypal , here is the tuto i followed to make it work :

http://phpcantho24h.blogspot.com/2014/04/paypal-express-checkout-creating-simple.html

Hope it helps.



来源:https://stackoverflow.com/questions/30599270/losing-zf2-session-after-paypal-redirection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!