У меня есть серьезная проблема с управлением сеансом в zf2 и PayPal. Как только я попаду на страницу платежа, я потеряю сессию zf2. Как его решить?
$mySession = new Container('mySession'); $mySession->login = "name"; $mySession->droit= "admin";
Благодарю.
Обновление: страница перенаправления:
<?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"); ?>
страница оплаты:
<?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>
в<?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>
в<?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>
решение состоит в том, чтобы использовать модуль, реализованный для zf2, который является speckPaypal, вот то, за которым я следил, чтобы заставить его работать:
http://phpcantho24h.blogspot.com/2014/04/paypal-express-checkout-creating-simple.html
Надеюсь, поможет.