为 PayPal 立即购买按钮提供特殊 ID?
我有一项服务,从付费的地方开始。我想给 PayPal 付款一个特殊的 ID。该 ID 将通过 IPN 传递,我可以读取它,这样我就可以使用该特殊 ID 修改我的 mysql 数据库。如果这一切都有意义...
我基本上想升级他们的帐户,而不必执行一些复杂的过程,我已经尝试过向用户发送交易 ID,他们必须转到一个特殊的 URL 来更改他们的帐户帐户信息。
明白我的意思吗?我该怎么做呢?
谢谢, 库尔顿
I have a service I am starting where it's paid. I want to give a PayPal payment a special id. The ID would be passed through IPN and I could read it so I can modify my mysql database with that special ID. If that all makes sense...
I am basically want to upgrade their account without having to do some complicated process which I have already tried where it would send the user the transaction ID and they would have to go to a special URL to change their account information.
See what I mean? How would I go about doing this?
Thanks,
Coulton
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在我意识到你只能发送预定义的贝宝变量而不能自己创建之前,我对此进行了多年的研究。
这些都列在这里
https://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/howto_checkout -outside
您可以用于自定义变量的一个称为“自定义”
您还需要确保使用此按钮
您还需要打开并设置一个 URL PayPal 上的即时付款通知
他们将其称为侦听器,但它实际上只是将付款数据发送到 PayPal 页面。
请注意,这不是按钮首选项中设置的付款完成后返回客户的 URL。
检索 PHP 中的自定义变量,
完整说明请参见此处
http://www.brianmoreau.com/articles/paypal_buy_now_button_sending_custom_variables.php
希望这可以帮助您我在这上面花了很多时间。
此方法还允许您获取买家详细信息,例如电子邮件和地址以及交易参考。
要查看付款后 paypal 发送的完整数据,请点击历史记录、IPN 历史记录
I played around with this for ages before I have realized that you can only send the pre defined paypal variables and not make your own up.
These are listed here
https://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/howto_checkout-outside
One you can use for a custom variable is called 'custom'
You also need to ensure you use this button
You also need to turn on and set a URL for the Instant Payment Notification on PayPal
They call this as a listener but it really just sends the payment data to the paypal page.
Note this is not the URL the customer is returned to after payment completion as set in button preferences.
Retrieve the custom variable in PHP thus
Full instructions here
http://www.brianmoreau.com/articles/paypal_buy_now_button_sending_custom_variables.php
Hope this saves you the many hours I spent on it.
This method also allows you to obtain the buyer details such as email and address and the transaction reference.
To view the full data paypal sends after payment by clicking on history, IPN history
如果其他人对如何执行此操作有疑问,我已经找到了解决方法。创建按钮时,请包含以下内容:
这样您就可以通过 get 将付款人传递给 IPN。只需使用
$_GET['user_id']
即可获取数据(在我的例子中是 user_id)。您可以传递任何您想要的变量!If anyone else has a question on how to do it, I've found a way to fix it. When making your button, include this:
So you can pass who has made the payment to the IPN via get. Simply use
$_GET['user_id']
to get the data (in my case a user_id). You can pass any variables you wish!