PayPal PaymentDetails getReceiverList() 为空。为什么?
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以防万一有人遇到这个问题,我发现 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.