【问题标题】:Unable to redirect merchant site after successful paypal payment成功支付宝付款后无法重定向商家网站
【发布时间】:2013-10-16 18:30:21
【问题描述】:

我正在使用贝宝沙盒测试买家和卖家账户。使用这些卖家账户来集成贝宝支付网关。 付款成功后,它应该会自动重定向到成功页面。 这是我使用的代码

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<form name='_xclick' target='_parent' action='https://www.sandbox.paypal.com/webscr' method='post'>


        <input type="hidden" name="cmd" value="_xclick">
        <input type="hidden" name="business" value="xxxxxxxxxxxxx-faxxxx@gmail.com">
        <input type="hidden" name="currency_code" value="USD">
        <input type="hidden" name="item_name" value="Invoice payment">
        <input type="hidden" name="return" value="http://www.mysite.com/success.php/">


                   <input type="hidden" name="amount" value="12">

   <input type='subimit' name='submit' value='pay by paypal'>
    </form>  

我还在贝宝卖家设置中打开了网站付款的自动退货功能。如何将事务 id 传递给 success.php。什么代码应该写在success.php页面......如果交易成功我必须更新数据库中的金额否则失败金额应该在数据库中更新......谁能帮帮我。

【问题讨论】:

    标签: php paypal payment-gateway paypal-sandbox paypal-ipn


    【解决方案1】:

    在成功页面上,您只需获取数据

    $item_transaction = $_GET['tx']; // Paypal transaction ID
    $item_price = $_GET['amt']; // Paypal received amount
    $item_currency = $_GET['cc']; // Paypal received currency type
    

    【讨论】:

      猜你喜欢
      • 2012-11-19
      • 2019-05-30
      • 2016-10-12
      • 1970-01-01
      • 2015-10-14
      • 2016-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多