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


Unable to redirect merchant site after successful paypal payment

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

<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>  

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

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

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