【问题标题】:Unable to redirect on custom success page after payment in worldpay在 worldpay 中付款后无法在自定义成功页面上重定向
【发布时间】:2018-12-16 17:29:30
【问题描述】:

我已经按照以下所有步骤在 worldpay 面板中设置了响应重定向的所有配置,但它仍然没有在我的自定义成功页面上重定向。

我按照以下步骤设置 worldpay:

  1. 登录 Worldpay,打开所需的安装进行编辑

  2. 勾选“启用支付响应?”

  3. 向将接收/处理来自 worldpay 的 POST 数据的页面提供“付款响应 URL”。
  4. 在“购物者重定向网址”中输入相同的网址
  5. 勾选“启用购物者重定向按钮”

  6. 勾选“启用购物者响应”

我已将支付响应 URL 设置为:https://my_domain.com/worldpay-response.php 并在我的根服务器路径上创建 worldpay-response.php 文件。

但我仍然无法在 worldpay-response.php 上获取 $_POST 数据。

worldpay 支付回复文档:click here

【问题讨论】:

    标签: php payment-gateway worldpay


    【解决方案1】:

    通过搜索响应花了 2 天后,我找到了解决方案。

    请按以下步骤操作:

    1. 登录worldpay
    2. 点击左侧的“设置”菜单。
    3. 单击“(Select Junior)”安装的设置图标以设置响应 URL。如需更多帮助,请参阅下面的屏幕截图

    设置付款响应网址购物者重定向网址

    <wpdisplay item="MC_callback"> 
    
    1. 点击“编辑支付页面”按钮。如需更多帮助,请参阅下面的屏幕截图。

    1. 选择您当前的安装 ID,然后点击编辑付款页面。

    1. 点击文件管理左侧菜单并上传文件resultC.html和resultY.html。请参阅下面的屏幕截图。

    文件内容resultC.html

    <html>
          <head>
            <title>Thank you for your payment</title>
          </head>
          <WPDISPLAY ITEM="MC_cancelurl" DEFAULT="" PRE="<meta http-equiv='refresh' 
          content='0;url=" POST="' />">
          <b style="text-align:center;">Please wait while you are being redirected.</b>
      </html>
    

    文件内容resultY.html

    <html>
        <head>
            <title>Thank you for your payment</title>
        </head>
        <WPDISPLAY ITEM="MC_returnurl" DEFAULT="" PRE="<meta http-equiv='refresh' content='0;url=" POST="' />">
        <b style="text-align:center;">Please wait while you are being redirected.</b>
    </html>
    
    1. 在您的服务器上为付款创建表单字段,任何用户都可以在 wordlpay 上付款。
        <!-- For live payments url should be https://secure.worldpay.com/wcc/purchase -->
    
        <form action="https://secure-test.worldpay.com/wcc/purchase" method="POST">
    
            <!-- This next line contains the testMode parameter - it specifies that the submission is a test submission -->
    
            <input type="hidden" name="testMode" value="100" > <!-- testmode value sholud be 100 , for live mode 0  -->
    
            <!-- This next line contains a mandatory parameter. Put your Installation ID inside the quotes after value= -->
    
            <!-- You will need to get the installation ID from your Worldpay account. Login to your account, click setting and under installations
            you should have an option called select junior and a number, put the number between “” e.g. “123456”-->
    
            <input type="hidden" name="instId" value="YOUR_INSTALLATION_ID">
    
            <!-- Another mandatory parameter. Put your own reference identifier for the item purchased inside the quotes after value= -->
    
            <input type="hidden" name="cartId" value="CART_NAME">
    
            <!-- Another mandatory parameter. Put the total cost of the item inside the quotes -->
    
            <!-- Another mandatory parameter. Put the code for the purchase currency inside the quotes after value= like GBP,INR-->
    
            <input type="hidden" name="currency" value="CURRENCY_CODE">
    
            <!-- This creates the button. When it is selected in the browser, the form submits the purchase details to us. -->
    
            <input type="hidden" name="MC_callback" value="YOUR_RESPONSE_URL">
    
            <input type="hidden" name="MC_returnurl" value="YOUR_RETURN_URL">
    
            <input type="hidden" name="MC_cancelurl" value="YOUR_CANCEL_URL">
    
            <input type="text" name="MC_username" value=""  placeholder="Name">
    
            <input type="text" name="tel" value=""  placeholder="Contact Number">
    
            <input type="email" name="email" value=""  placeholder="Email Address">
    
            <input type="text" name="address1" value="" placeholder="House Name/Number">
    
            <input type="text" name="address2" value=""  placeholder="Street Name">
    
            <input type="text" name="postcode" value=""  placeholder="Postcode">
    
            <input type="text" name="amount" value="" required placeholder="amount (&pound;)" id="amount-cs">
    
            <input type="submit" name="make_wordpay_payment" id="make_wordpay_payment" value="Pay Now">
    
        </form>
    

    希望对您有所帮助,如需更多帮助,请点击以下链接。 http://support.worldpay.com/support/kb/bg/customisingadvanced/custa6012.html

    谢谢

    【讨论】:

    • 尝试了同样的方法。但是卡在感谢页面。没有被重定向到我的网站。我们是否需要在 resultC 或 resultY 中提供任何重定向代码。
    • 在购物者重定向网址中添加静态网址。有时完整的 url 像example.com/redirecturl.php
    • 是否可以在 worldpay html 表单中提供返回 url
    • 不,您需要在 worldpay 仪表板中的标题下在购物者重定向 url 中添加静态 url。
    猜你喜欢
    • 2014-07-15
    • 2014-11-07
    • 2013-10-16
    • 2013-07-31
    • 2021-04-26
    • 2018-06-08
    • 2021-01-13
    • 2012-06-26
    • 2014-12-28
    相关资源
    最近更新 更多