付款后Paypal IPN处理
我有 IPN 控制器,它正在验证 IPN,然后根据 那篇文章
用户在 paypal 网站上单击“付款”后,ipn 发送到我的 ipn 控制器
,同时用户被重定向回我的网站(在 paypal 控制器之后
)来自贝宝网站。
但问题是,我的 IPN 控制器
没有足够的时间来完成所有逻辑,并且用户在 IPN 处理完成之前在 paypal 控制器之后
登陆我的网站。所以我不能告诉用户是否有任何错误或者是否成功。
有人可以分享他们的经验吗?我能做什么? 只有在 ipn 处理完成后,我才会将用户从 paypal 重定向回我的网站,这样我就可以告诉用户是否成功,等等。
在我的 after paypal 控制器
上,我想检查如果 iPN 处理成功并显示相关消息。
有什么想法吗?
I have IPN controller which is validating IPN and then validating some fields according with that article
After user clicking pay on paypal website the ipn sending to my ipn controller
and at the same time user getting redirected back to my web site(after paypal controller
) from paypal web site.
But the problem is, there is not enough time for my IPN controller
to finish all the logic and user landed to my website on after paypal controller
before IPN processing finished. So i cant say to user is there was any error or is it was successful.
My be some one may share their experience with that? What I can do?
I would redirect user from paypal back to my website only after ipn processing finished, so i could be able to say to user is it was successful or not, etc.
On my after paypal controller
i want to check if the ipn processing was successful and than display related message.
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IPN 与最终用户体验是分开的。
您需要 3 个页面/操作:
一个是如果 paypal 说“付款已确认”
另一个如果贝宝说“付款失败”
- 这两个页面没有任何意义,用户可以破解网站来查看这些页面,它们只是让用户知道发生了什么。
第三个页面/操作是针对 IPN 的,它只是一个等待 paypal 响应的监听器。收到回复后,您将进行检查以确保一切正常:
然后,您可以有一个简单的绑定(“付费!”),当用户“回发”时更新,或者您可以让 ajax 异步执行。
-- 最后一点,我真的想在这里找出如何处理/测试 IPN,而你显然未经研究的问题浪费了我的时间。做一些研究吧伙计。
IPN is separate from the end users experience.
You need 3 pages/actions:
one for if paypal said "payment confirmed"
another for if paypal said "payment failed"
- these 2 pages mean nothing, the user could hack the site to see these pages, they are just there to let the user know what's going on.
Third page/action is for IPN, it's just a listener that waits for paypal's response. Once you get the response then you check against it to make sure everything is ok:
You could then have a simple binding to ("Paid!") that updates when the user 'postsback' or you could have ajax do it async.
-- As a final point, I'm genuinely trying to find out here how to process/test the IPN and your obviously unresearched question has wasted my time. Do some research man.