成功支付宝付款后无法重定向商家网站

Posted

技术标签:

【中文标题】成功支付宝付款后无法重定向商家网站【英文标题】: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页面......如果交易成功我必须更新数据库中的金额否则失败金额应该在数据库中更新......谁能帮帮我。

【问题讨论】:

【参考方案1】:

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

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

【讨论】:

以上是关于成功支付宝付款后无法重定向商家网站的主要内容,如果未能解决你的问题,请参考以下文章

支付宝支付接口开发的回调地址怎么写

使用信用卡页面减少贝宝支付上的字段

Magento:支付完成后,paypal 标准支付未重定向到 Magento 成功页面

我有自己的购物车时支付宝付款

执行贝宝付款后如何重定向?

自动重定向说明