PayPal PaymentDetails getReceiverList() is null. Why?
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?
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.
精彩评论