payment_id can be fake in REST API /v1/payments/payment/{payment_id}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use PayPal-Java-SDK to call REST API /v1/payments/payment/{payment_id} to get payment details. The code is:
Payment payment = Payment.get(apiContext, paymentId);
I used valid paymentId: PAY-6J516405S23367429LP6IYLQ and it was working as expected. I got the details about PAY-6J516405S23367429LP6IYLQ payment.
I changed the last sign in paymentId from Q to R to see how an error looks like when invalid paymentId is used. But I didn't get the error. The returned JSON was mostly the same like for PAY-6J516405S23367429LP6IYLQ. The only one difference was paymentId in lines:
"id": "PAY-6J516405S23367429LP6IYLR",
"parent_payment": "PAY-6J516405S23367429LP6IYLR",
"href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-6J516405S23367429LP6IYLR",
The data were the same including transaction id:
transactions[0].related_resources[0].sale.id
I retested but this time for PAY-6J516405S23367429LP6IYLS and PAY-6J516405S23367429LP6IYLT and nothing changed. Still I got JSON data for PAY-6J516405S23367429LP6IYLQ.
Only when I changed paymentId to PAY-6J516405S23367429LP6IYLP I got the following error:
It happened in sandbox.
Could you explain me why is that?
Thank you in advance for help.
- Labels:
-
Payments REST APIs
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Getting errors when integrating standard checkout with my web site. Probably a beginner problem. in SDKs
- Receiving a PAYMENT.SALE.COMPLETED webhook notification - how can I trace the parent Subscription in REST APIs
- Recurring payment with credit card in REST APIs
- User is asked for shipping address when creating a credit card order in REST APIs
- Usa in REST APIs