【问题标题】:Identity Token is NOT required for PayPal's Payment Data Transfer (PDT)?PayPal 的支付数据传输 (PDT) 不需要身份令牌?
【发布时间】:2011-07-01 07:32:37
【问题描述】:

我设置了一个使用 IPN 的 PayPal 站点,但我无法让 PayPal 将 GET 变量发送到我指定的返回 URL。它正在将用户的浏览器发送到返回 URL,但没有通过 GET 或 POST 传递任何内容。

我将 PayPal 企业帐户中的一项设置:“付款数据传输(可选)”更改为在 PayPal 网站上生成“身份令牌”的设置。

我还收到一封来自 PayPal 的自动电子邮件:

---------- Forwarded message ----------
From: service@paypal.com <service@paypal.com>
Subject: Payment Data Transfer (PDT) Has Been Enabled

This email is to inform you that you have successfully enabled Payment Data Transfer.

PDT's primary function is to display payment transaction details to buyers when they are redirected back to your site upon payment completion. However, there are cases, such as with pending transactions, where you won't receive notification of all transactions. For this reason, PayPal strongly recommends that you also enable Instant Payment Notification (IPN).

To learn more about enabling and setting up IPN:
https://www.paypal.com/us/cgi-bin/?cmd=p/xcl/rec/ipn-intro-outside

To learn more about Payment Data Transfer, including setup instructions and a complete list of variables:
https://www.paypal.com/us/cgi-bin/?cmd=p/xcl/rec/pdt-intro-outside

Sincerely,
PayPal

点击第二个链接并点击“技术概述”(https://www.paypal.com/us/cgi-bin/webscr?cmd=p/xcl/rec/pdt-techview-outside)显示:

您的 POST 应发送至 https://www.paypal.com/cgi-bin/webscr。 您必须发布交易令牌 使用变量“tx”和值 之前的交易代币 收到(例如 “tx=transaction_token”),以及 使用特殊身份令牌 变量 at 和 PDT 的值 身份令牌(例如 “at=identity_token”)。你也会 需要附加一个名为“cmd”的变量 值为“_notify-synch”,对于 例如“cmd=_notify-synch”,到 POST 字符串。

但是,我根本没有传递身份令牌,但一切正常!

(a) Is this a problem?
(b) Why is it working if the documentation implies that it shouldn't?
(c) Is this a consequence of specifying an outdated API version (58.0)? What is the value I should be using?

【问题讨论】:

    标签: paypal paypal-ipn


    【解决方案1】:

    在我看来,身份令牌应该是必需的参数,因为这是 Paypal 可以验证您发出的请求是否有效的唯一方法。否则,其他人可以简单地猜测交易 ID(即使它不是针对他们的帐户)并从 Paypal 获取该交易的详细信息。

    我猜这是您遇到的错误。您是在 Paypal 沙盒中还是在实时环境中进行测试?

    【讨论】:

      【解决方案2】:

      意识到 OP 可能在 9 年后不再需要答案,但其他人仍然可能:

      交易 ID 和身份令牌的 POST 纯粹是为了验证原始交易通知(通过 GET 方法中继到商家的返回 URL)是否确实来自 PayPal。

      就好像在对 PayPal 说:“我的网站刚刚收到客户付款的假设确认信息。这里又是交易 ID 和我的卖家 ID。这是否合法匹配?”

      事实上,在https://developer.paypal.com/docs/api-basics/notifications/payment-data-transfer/,当谈到设置测试时,它只谈到让你的脚本准备好接收、解析和显示 GET 数据。它没有提到 POSTing back to PayPal(尽管在其他地方提到过)。所以,是的,PDT 功能应该可以工作,而无需事后将 POST 返回到 PayPal 并等待 SUCCESS 或 FAIL 的响应,但是......

      任何知道自己在做什么的人都可以转到卖家的 URL 并附加一个带有正确变量组合的查询字符串,以伪造 PayPal PDT 系统最初发送的相同类型的 GET 请求,无论交易 ID 是否是真的。

      【讨论】:

        猜你喜欢
        • 2014-01-13
        • 2013-07-04
        • 2013-10-03
        • 2019-11-29
        • 1970-01-01
        • 1970-01-01
        • 2016-04-17
        • 2015-04-16
        • 2013-12-24
        相关资源
        最近更新 更多