【问题标题】:how to add freindly URL for a page with 2 parameters in PrestaShop?如何在 PrestaShop 中为具有 2 个参数的页面添加友好的 URL?
【发布时间】:2023-03-18 13:47:01
【问题描述】:

我正在 PrestaShop 1.6 中实施东部银行支付网关。我已经配置了成功支付和取消支付的回调 URL。 我的付款控制器如下:

class EblpaymentPaymentModuleFrontController extends ModuleFrontController
{
    public $ssl = true;

    /**
     * @see FrontController::initContent()
     */
    public function initContent()
    {
        parent::initContent();
    }
    $this->setTemplate('ebl_payment.tpl');
}

ebl_payment.tpl 如下:

<script src= "https:easterbank-test-server/checkout.js"
data-complete="http://localhost/modules/eblpayment/eblcallback"
data-cancel="http://localhost/modules/eblpayment/eblcallback"
>
<input type="button" name="paymentSubmit" onclick="Checkout.showPaymentPage();" value="Submit Order" class="exclusive_large"/>

当我点击 ebl_payment.tpl 中的按钮时,我被重定向到付款页面。

付款成功后,我被重定向到以下网址:

http://localhost/modules/eblpayment/eblcallback?resultIndicator=3496c5ca27314c6f&sessionVersion=35ae276406

对于这个 URL,我得到 404 页面。

我可以在 SEO 和 URLS 部分下为后台的前端控制器页面添加一个友好的 URL。

现在我想用两个尾参数“resultIndicator”和“sessionVersion”为上述 URL 添加友好 URL,以便我可以重定向到 ebl_payment.tpl 页面中作为数据完整值给出的“eblcallback”前端控制器 URL .

提前致谢

【问题讨论】:

    标签: php prestashop


    【解决方案1】:

    我已经找到了问题的解决方案。 只需更改回调 URL

    http://localhost/modules/eblpayment/eblcallback

    http://localhost/index.php?fc=module&module=eblpayment&controller=eblcallback'

    解决了这个问题。

    我被重定向到“eblcallback”前端控制器。 在这里我可以通过 Tools::getValue('resultIndicator') 获取 URL 参数,然后检查想要的结果“支付成功”或“支付失败”等。

    无需添加友好网址。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-08-20
      • 2022-06-13
      • 1970-01-01
      • 1970-01-01
      • 2016-02-03
      • 2012-12-29
      • 2016-09-27
      相关资源
      最近更新 更多