bnns
bnns

Reputation: 301

PayPal REST API Show Payment Details V1 Upgrade to V2?

I'm upgrading my company's project and trying to upgrade from the deprecated v1 PayPal SDK to v2, everything worked out alright, until trying to migrate some old functionality to support viewing a previous payment.

The original REST Api was Show Payment Details where you would provide the payment_id defined as The ID of the payment for which to show details.

Most of the documentation indicates that the migration moves from Payments V1 to Orders V2 so I looked at the Get request which was defined as The ID of the order for which to show details. not quite the same so unsurprisingly it didn't work, what seemed more likely was the Payment V2 but they only had references to capture_id for the Show captured payment details and authorization_id for Show details for authorized payment (which I tried in any event to no avail).

Unfortunately PayPal's documentation is quite sparse and I haven't been able to find a proper Migration Guide for Old functionality to new Functionality, breaking changes or handling the equivalent.

I am hoping against all odds that someone has a recommendation where I can retrieve older payments information and maybe upgrade them somehow? (I'm currently considering recreating support for the deprecated API but it seems silly.)

Upvotes: 0

Views: 868

Answers (1)

Preston PHX
Preston PHX

Reputation: 30457

Your question isn't clear on what you're trying to accomplish and with what value, but when you capture a v2/order there are two IDs.

The ID of the order -- which was only relevant during the approval/capture process and no longer useful once complete -- and the ID of the capture which is in the response at purchase_units[0].payments.captures[0].id.

This latter ID is the PayPal transaction ID, and the one you should persist in your database for accounting purposes; it corresponds to all the information and reports in the receiving www.paypal.com account. The v2/payments 'show captured payment details' operates with this ID and will return its status.


For transactions created with a previous API, use that API.

Upvotes: 1

Related Questions