通过贝宝将变量发送到返回URL的正确方法 [英] The correct way to get variables sent by PayPal to the return URL

查看:83
本文介绍了通过贝宝将变量发送到返回URL的正确方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在按照此答案 Paypal结帐返回数据中的步骤进行重定向买家会自动返回到这样的退货网址(您可以看到rm选项设置为2)

I'm following the steps from this answer Paypal checkout return data to redirect buyers automatically to the return URL like this (as you can see the rm option is set to 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,但是没有网站付款首选项"选项.

now I'm trying to set Auto Return in paypal account to redirect the buyer automatically to the return URL but there's no "Website Payment Preferences" option.

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

Second question: how to send custom variables and fetch them again using the return url like username, password..... any data entered by the user before paying so I can grab all the data like this

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

因此,如果状态为已完成"并且返回的金额等于表格金额,则可以使用返回的电子邮件,用户名和密码在我的网站上创建付费帐户

so if the status is Completed and the returned amount is equal to the form amount I can use the returned email, username and password to create a paid account on my site

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

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

My idea is to use custom field like this

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

但是我想这里提到的是错误的

but I guess it's wrong as mentioned here amount of non-hosted paypal buy now buttin is not changing

很抱歉,这篇长文章,谢谢.

Sorry for this long post and Thanks in advance.

推荐答案

管理按钮.它是在按钮而非帐户上设置的,也可以在表单中自行设置.

Manage Buttons. It's set on the button, not the account, or you can set it yourself in the form.

这篇关于通过贝宝将变量发送到返回URL的正确方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆