为 PayPal 立即购买按钮提供特殊 ID?

发布于 2024-11-19 16:19:58 字数 231 浏览 1 评论 0原文

我有一项服务,从付费的地方开始。我想给 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

漫漫岁月 2024-11-26 16:19:59

在我意识到你只能发送预定义的贝宝变量而不能自己创建之前,我对此进行了多年的研究。

这些都列在这里
https://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/howto_checkout -outside

您可以用于自定义变量的一个称为“自定义”

<input type="hidden" name="custom" value="<?=$twitId;?>">

您还需要确保使用此按钮

<input type="hidden" name="cmd" value="_s-xclick">

您还需要打开并设置一个 URL PayPal 上的即时付款通知

他们将其称为侦听器,但它实际上只是将付款数据发送到 PayPal 页面。
请注意,这不是按钮首选项中设置的付款完成后返回客户的 URL。

检索 PHP 中的自定义变量,

$userID = $_POST[custom];

完整说明请参见此处
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'

<input type="hidden" name="custom" value="<?=$twitId;?>">

You also need to ensure you use this button

<input type="hidden" name="cmd" value="_s-xclick">

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

$userID = $_POST[custom];

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

も星光 2024-11-26 16:19:58

如果其他人对如何执行此操作有疑问,我已经找到了解决方法。创建按钮时,请包含以下内容:

<input type='hidden' name='notify_url' value='http://yourdomain.com/paypal/ipn.php?user_id=$user_id'>

这样您就可以通过 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:

<input type='hidden' name='notify_url' value='http://yourdomain.com/paypal/ipn.php?user_id=$user_id'>

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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文