【问题标题】:The correct way to get variables sent by PayPal to the return URL获取 PayPal 发送到返回 URL 的变量的正确方法
【发布时间】:2015-03-01 17:26:29
【问题描述】:

我正在按照这个答案Paypal checkout return data 中的步骤自动将买家重定向到这样的返回 URL(您可以看到 rm 选项设置为 2)

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="U74VBC2YUQS7E">
<input type="hidden" name="item_name" value="subscribe">
<input type="hidden" name="amount" value="100.00">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="return" value="RETURN URL FOR CONFIRMED PAYMENTS">
 <input type="hidden" name="currency_code" value="USD">
 <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">

现在我正在尝试在 paypal 帐户中设置自动退货,以将买家自动重定向到退货 URL,但没有“网站付款首选项”选项。

第二个问题:如何发送自定义变量并使用返回网址(如用户名、密码)再次获取它们.....用户在付款前输入的任何数据,这样我就可以像这样获取所有数据

$payer_email = $_POST['payer_email'];
$amount = $_POST['mc_gross'];
$payment_status= $_POST['payment_status'];

所以如果状态为 Completed 并且返回的金额等于表单金额,我可以使用返回的电子邮件、用户名和密码在我的网站上创建一个付费帐户

$username = $_POST['username'];
$password = $_POST['password'];

我的想法是使用这样的自定义字段

<input type="hidden" name="custom" value="user=username&password=encrypted-user-pass-with-sha1">

但我想这里提到的amount of non-hosted paypal buy now buttin is not changing是错误的

抱歉这篇长篇文章,提前致谢。

【问题讨论】:

    标签: paypal return-value


    【解决方案1】:

    管理按钮。是在按钮上设置的,不是在账号上设置的,也可以在表单中自己设置。

    【讨论】:

      猜你喜欢
      • 2018-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-31
      • 2015-06-21
      • 2021-05-20
      • 2011-07-21
      相关资源
      最近更新 更多