Paypal中的IPN与PDT [英] IPN vs PDT in Paypal

查看:454
本文介绍了Paypal中的IPN与PDT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在选择贝宝的即时付款通知(IPN)和付款数据传输(PDT)之间遇到麻烦.

I'm having some trouble choosing between PayPal's Instant Payment Notification (IPN) and Payment Data Transfer (PDT).

基本上,用户在我的网站上购买一次性产品,在PayPal上付款,然后返回我的网站.我了解IPN的工作原理,但现在看到的是,我可以通过PDT更轻松地触发一次成功购买后触发的各种操作,因为数据将返回到那里,然后返回(而不是需要单独的侦听器)

Basically, users buy a one-off product on my site, pay on PayPal, and return to my site. I understand how IPN works but I'm now seeing that I might be able to trigger the various actions that take place after a successful purchase more easily with PDT, as the data gets returned there and then (as opposed to needing a separate listener).

但是,贝宝(PayPal)的PDT文档包含以下神秘之处:"PDT不能用于信用卡或Express Checkout交易. ...但是我找不到关于该主题的任何内容.

However, PayPal's PDT documentation contains this cryptic line: "PDT is not meant to be used with credit card or Express Checkout transactions." ... but I can't find anything further whatsoever on the topic.

  1. 信用卡真的不打算与PDT一起使用吗?我不只是一句话.

  1. Are credit cards REALLY not meant to be used with PDT? I would like more than a sentence.

这是否意味着用户必须拥有/创建PayPal帐户才能付款?

Does that mean that a user must have/create a PayPal account to pay?

这是否意味着如果我要允许用户直接使用其PayPal帐户和/或信用卡付款,我必须实施IPN?

Does it mean that if I want to allow users to pay with their PayPal accounts AND/OR with credit cards directly, I must implement IPN?

经历过这个的人能给我一些启示吗?

Could anyone who's gone through this kindly shed some light?

推荐答案

PDT和IPN的API相似.主要区别在于您收到通知的时间.因此,我建议同时实施.

The APIs for PDT and IPN are similar. The main difference is when you receive the notification. For that reason I would recommend implementing both.

  • 使用PDT,您可以立即收到通知,并且可以执行所需的任何其他处理,并向用户显示确认页面.
  • 使用IPN,即使用户的计算机爆炸后,也可以确保您收到付款通知,然后才能将PDT发送给您.

同时实现这两个方面,并同时获得两个方面的最佳效果.但是,如果仅执行一项操作,则IPN是可靠的一项.

Implement both and get the best of both worlds. But if you're only doing one, IPN is the reliable one.

一个陷阱:如果您同时实施这两种方法,那么您的付款就有可能被处理两次.注意确保不会发生这种情况.我编写的应用程序几乎以相同的方式处理PDT和IPN(后端部分相同),并且该代码在数据库中获取了每个Web用户的锁定,因此,如果同一用户尝试多次提交完全相同的付款,只能处理一次.处理后,该过程的结果将重新用于以后的处理尝试.

One catch: if you implement both then there's a chance your payments could be processed twice. Take care to ensure that doesn't happen. The application I wrote handles the PDT and IPN almost identically (the backend part is the same) and that code acquires a per-web-user lock in the database, so that if the same user tries to submit the exact same payment multiple times it can only be processed once. Once processed the result of that process is re-used for any subsequent attempts to process it.

修改 还有一件事:IPN比PDT承载更多的信息.您可以从IPN收到很多不同的消息,例如拒付通知等,因此您确实应该实现它.

Edit One more thing: IPN carries more information than PDT. There are lots of different messages that you can receive from IPN, such as chargeback notification, etc, and thus you really should implement it.

PayPal的PDT系统将订单确认发送到使用PayPal Payments Standard的商户站点,并允许他们对该信息进行身份验证.然后,这些站点可以在订单确认"页面中本地显示此数据.

PayPal's PDT system sends order confirmations to merchant sites that use PayPal Payments Standard and lets them authenticate this information. Such sites can then display this data locally in an "order confirmation" page.

IPN提供与上述相同的功能.那么,什么时候应该选择PDT而不是IPN?

IPN provides the same capabilities described above. So, when should you choose PDT instead of IPN?

使用PDT,客户完成付款后会立即通知您的网站.但是,使用IPN,从客户完成付款到您的站点收到有关此事件的通知的时间之间存在实质性的滞后.

With PDT, your site is notified immediately when a customer completes payment. With IPN, however, there is a material lag between the time a customer completes payment and the time your site receives notification of this event.

因此,如果您的站点包含需要立即付款通知的功能,请使用PDT.

So, use PDT if your site includes a feature that requires immediate payment notification.

例如,考虑一个数字音乐商店.有了PDT,这家商店可以让客户立即下载购买的商品,因为PDT会立即发送订单确认.使用IPN,不可能立即执行订单.

For example, consider a digital music store. With PDT, this store can let customers download their purchases right away since PDT sends order confirmations immediately. With IPN, such immediate order fulfillment is not possible.

PDT的一个主要弱点是:它一次只能发送一次订单确认.结果,PDT发送确认信息时,您的站点必须正在运行;否则,它将永远不会收到该消息.

PDT has a a major weakness: it sends order confirmations once and only once. As a result, when PDT sends a confirmation, your site must be running; otherwise, it will never receive the message.

相比之下,使用IPN,实际上可以保证订单确认的交付,因为IPN会重新发送确认,直到您的站点确认收货为止.因此,贝宝(PayPal)建议您实施IPN而不是PDT.

With IPN, in contrast, delivery of order confirmations is virtually guaranteed since IPN resends a confirmation until your site acknowledges receipt. For this reason, PayPal recommends that you implement IPN rather than PDT.

IPN的另一个优点是它可以发送许多类型的通知,而PDT仅发送订单确认.因此,使用IPN,您的站点可以接收例如退款通知以及订单确认. 注意:如果必须立即通知您的网站付款,则可以实施IPN和PDT.但是,如果您这样做,您的站点将为每次销售收到两个订单确认.因此,您必须小心,仅对给定确认消息的一个副本采取措施(例如,运送产品).

Another advantage of IPN is that it sends many types of notifications, while PDT sends just order confirmations. So, using IPN, your site can receive, for example, chargeback notifications as well as order confirmations. Note: If your site must be notified of payments immediately, you can implement both IPN and PDT. However, if you do, your site will receive two order confirmations for each sale. As a result, you must be careful to take action (say, ship a product) on just one copy of a given confirmation message.

此处的文档

这篇关于Paypal中的IPN与PDT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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