Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top