我可以将变量发送给Paypal,并在付款完成后将其发回给我吗? [英] Can I send a variable to paypal, and have it post it back to me when payment completes?

查看:59
本文介绍了我可以将变量发送给Paypal,并在付款完成后将其发回给我吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Express Checkout API在付款后将我网站上的用户帐户转换为高级帐户.唯一的问题是,只有在用户单击按钮返回之前,它才将用户发送回站点,并且在发生这种情况时会更新其权限.大约40%的用户似乎没有这样做....因此,他们的帐户在付款后再也不会记入贷方.

Ive been using express checkout API to convert people's accounts on my site to premium accounts after paying. The only problem with it is that it doesn't send the user back to the site until they click the button to return, and it updates their permission when that happens. About 40% of the users don't seem to do that.... so their accounts never get credited after payment.

尽管paypal会在成功付款后立即进行回发,但我从未能够立即使它真正更新用户的帐户,因为我无法使它发送回某种可以识别用户身份的信息.完成付款.只有将您发送回发送回ID的站点(该站点发送事务ID)后,我才能执行此操作.它会搜索它,并在数据库中找到它时授予许可.

Although paypal does an instant post-back upon the successful payment, I was never able to make it actually update the user's account right away, since I cant get it to send back some sort of informational that would identify the user that just completed the payment. I could only do that when you are sent back to the site, which sends the transaction ID, that I logged with a post-back. It searches for it, and grants permission if it was found int he DB.

是否可以将某种变量提交给paypal,然后将其回发给我?类似于& user_id = 123之类的东西,这使得更新用户许可非常容易.

Is there a way to submit some sort of a variable to paypal, that it will then post back to me? Something like &user_id=123, which would make it very handly to update the user's permission.

推荐答案

是的,如果您发送item_number,则 IPN通知将在回发给您时包括在内.当用户开始付款过程时,我会在数据库中记录一个唯一的ID,并在将其发送到PayPal时将其包括在内.当IPN进入时,该唯一ID与数据库中的记录匹配,从而为我提供了我需要的所有信息.

Yes, if you send item_number, the IPN notification will include that when it posts back to you. I record a unique ID in the database when the user starts the payment process, and include that when sending them to PayPal. When the IPN comes in, that unique ID matches up with the record in the database, giving me all the info I need.

修改:发表评论:

我希望上面链接的网站上有一个代码示例,但是基本上我使用的是我张贴到

I expect there's a code example somewhere on the site linked above, but basically in my case I'm using a form that I POST to https://www.paypal.com/cgi-bin/webscr. Within that form are various hidden fields documented in the IPN stuff (cmd for what command to perform, business to specify your business ID, item_name for a nice description in the PayPal UI, item_number for the item number I mentioned above, etc., etc.). When IPN posts back to your IPN address, it includes various fields (such as payment_status — kind of important! &mdash and the item_number you fed in when posting to them).

这篇关于我可以将变量发送给Paypal,并在付款完成后将其发回给我吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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