我在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>
答案 0 :(得分:0)
解决方案是使用为zf2实现的模块,这是speckPaypal,这是我遵循的tuto使其工作:
http://phpcantho24h.blogspot.com/2014/04/paypal-express-checkout-creating-simple.html
希望它有所帮助。