PayPal PaymentDetails getReceiverList() 为空。为什么?

发布于 2024-10-28 08:55:00 字数 826 浏览 1 评论 0原文

我正在使用 PayPal Adaptive Payments 的 IPN。我能够使 IPN 正常工作,但是当我决定从 PayPal 获取已完成交易的付款详细信息时,PaymentDetails 类的 getReceiverList 方法返回 null。

PaymentDetailsRequest paymentDetailsRequest = new PaymentDetailsRequest("en_US", ServiceEnvironment.SANDBOX);
paymentDetailsRequest.setPayKey(payKey);
PaymentDetailsResponse paymentDetailsResponse = paymentDetailsRequest.execute(credentialObj);

PaymentDetails paymentDetails = paymentDetailsResponse.getPaymentDetails();
List<Receiver> receiverList = paymentDetails.getReceiverList();
// receiverList returns null

这种情况不应该发生,因为交易已经完成并且显然有一个接收者。

如果我从同一 paymentDetails 对象中提取其他数据(例如付款状态),我会得到正确的结果。

String paymentStatus = paymentDetails.getStatus();
// paymentStatus returns COMPLETED

有没有人遇到过这种情况并可以告诉我为什么会发生这种情况?

I'm working with PayPal Adaptive Payments' IPN. I was able to get the IPN to work, but when I decided to get payment details of a COMPLETED transaction back from PayPal, the PaymentDetails class' getReceiverList method returned null.

PaymentDetailsRequest paymentDetailsRequest = new PaymentDetailsRequest("en_US", ServiceEnvironment.SANDBOX);
paymentDetailsRequest.setPayKey(payKey);
PaymentDetailsResponse paymentDetailsResponse = paymentDetailsRequest.execute(credentialObj);

PaymentDetails paymentDetails = paymentDetailsResponse.getPaymentDetails();
List<Receiver> receiverList = paymentDetails.getReceiverList();
// receiverList returns null

That shouldn't be happening because the transaction has completed and there obviously is a receiver.

If I pull other data from the same paymentDetails object such as the payment status, i get the proper result.

String paymentStatus = paymentDetails.getStatus();
// paymentStatus returns COMPLETED

Has anyone come across this and could tell me why this is happening?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

对你再特殊 2024-11-04 08:55:00

以防万一有人遇到这个问题,我发现 PayPal 自适应支付的 IPN 仍然存在许多故障,这就是其中之一。基本上方法 getReceiverList() 没有得到任何东西。对于每个应该返回某些内容但返回 null 的方法来说都是这种情况。

Just in case someone comes across this problem, I have found out that the PayPal Adaptive Payments' IPN still has many glitches, this being one of them. Basically the method getReceiverList() does not get anything. This will be the case for every method that returns null when it should be returning something.

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