在我的Magento我有2个商店,我想在我的Magento中集成示例支付网关。在magento中,如果Transaction Status为Success,则会有一个像这样的逻辑去重定向Success Page else重定向到Failure Page。
但是从PG方面来看,他们没有这种逻辑,他们只想要一个URL,当来自我的网站的任何请求他们只需要重定向到那个URL时,所以最后我决定这样。
根据PG的反应,我在redirect.php中写了一些代码,请找到下面的代码。
<?php
header("Pragma: no-cache");
header("Cache-Control: no-cache");
header("Expires: 0");
$mageFilename = '../app/Mage.php';
require_once $mageFilename;
Mage::app();
if (empty($_REQUEST['ORDERID'])) {
$_order_orig = Mage::getModel('sales/order')->loadByIncrementId($_REQUEST['ORDERID']);
$store_id = $_order_orig->getStoreId();
if ($_REQUEST['STATUS'] == 'TXN_SUCCESS' && $_REQUEST['RESPCODE'] == 01) {
if($store_id == 2)
$newurl = 'https://example.com/secondstore/index.php/checkout/onepage/success?status=TRANSACTION SUCESSFUL';
else
$newurl = 'https://example.com/index.php/checkout/onepage/success?status=TRANSACTION SUCESSFUL';
header('Location: '.$newurl);
die();
} else {
if($store_id == 2)
$newurl = 'https://example.com/secondstore/index.php/checkout/onepage/failure/?status=TRANSACTION FAILURE';
else
$newurl = 'https://example.com/index.php/checkout/onepage/failure/?status=TRANSACTION FAILURE';
header('Location: '.$newurl);
die();
}
} else {
$newurl = 'https://example.com/index.php/checkout/onepage/failure/?status=TRANSACTION FAILURE';
header('Location: '.$newurl);
die();
}
?>
每件事情都运转正常,但它会重定向到我的主页。
但是同样的代码在我的暂存网站中运行良好。
乳清它正在发生?
有什么想法吗?