Reputation: 43
My problem is as follows: I have a business paypal account where I have a list of transactions made by my clients (buying products on my webpage). I store their orders info via paypal IPN which only sends me the transaction ID of the order. So I store this transaction ID on my database among other basic data. Now I need 2 things:
I see Paypal API v2 is the recommended as the v1 is gonna be abandoned. I'm using Checkout-PHP-SDK: https://github.com/paypal/Checkout-PHP-SDK
But I'm facing problems only trying to get any transaction data. I read that in order to get the data i cannot use the transaction ID but the order ID instead. But how can use an order ID that I ignore?, because from paypal IPN I only receive transaction ID and that's only what I have. So how can I get the order id from this transaction id?. I know I'm probably confusing terms so sorry in advance.
Upvotes: 0
Views: 2207
Reputation: 30359
When you capture an order, the immediate API response already contains all information about the transaction -- including the transaction ID at purchase_units[0].payments.captures[0].id
. There is no need to use the old IPN service. Your integration should not depend on IPN in any way, that is bad design.
For refunds, use that transaction (capture) id with the v2/payments API
Upvotes: 1