付款后Paypal IPN处理

发布于 2024-12-06 21:43:26 字数 562 浏览 0 评论 0原文

我有 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 技术交流群。

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

发布评论

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

评论(1

沉睡月亮 2024-12-13 21:43:26

IPN 与最终用户体验是分开的。

您需要 3 个页面/操作:
一个是如果 paypal 说“付款已确认”
另一个如果贝宝说“付款失败”
- 这两个页面没有任何意义,用户可以破解网站来查看这些页面,它们只是让用户知道发生了什么。

第三个页面/操作是针对 IPN 的,它只是一个等待 paypal 响应的监听器。收到回复后,您将进行检查以确保一切正常:

  • 确保您的电子邮件已付款
  • 确保价格正确
  • 用“已付款!”更新您的数据库标记,yada yada

然后,您可以有一个简单的绑定(“付费!”),当用户“回发”时更新,或者您可以让 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:

  • Make sure your email was paid
  • Make sure the price is right
  • Updates your db with "Paid!" marker, yada yada

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.

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