PayPal Unique Transaction ID


#1

I’m using Ionic’s Native PayPal plugin, and I can’t figure out how to get the Unique Transaction ID. In PayPal Merchant account this looks like this:

Mobile Express Checkout Payment Received (Unique Transaction ID #2DQ323412348184972P)


#2

Looking at the docs you only get an object with some data after a payment was executed, right? I would assume that you can use one of the values in there (id probably) to talk to other APIs to get more information about the payment.


#3

Yes, this is the response I get, and I have an ID there, but not sure how to use it from here onwards…

{"client":{"environment":"sandbox","product_name":"PayPal iOS SDK","paypal_sdk_version":"2.17.0","platform":"iOS"},"response_type":"payment","response":{"id":"PAY-55S22348738162090FERTF3GI","state":"approved","create_time":"2017-06-07T20:10:12Z","intent":"sale"}}


#4

5 minute research:

https://ionicframework.com/docs/native/paypal/
uses
https://github.com/paypal/PayPal-Cordova-Plugin
uses
https://github.com/paypal/PayPal-iOS-SDK

There
https://github.com/paypal/PayPal-iOS-SDK#single-payment
says

  1. Accept a Single Payment and receive back a proof of payment.
  2. On your server, Verify the Payment, Capture the Payment, or Process the Order (PayPal Developer site) using PayPal’s API.

where “Verify the Payment” e.g. links to
https://developer.paypal.com/webapps/developer/docs/integration/mobile/verify-mobile-payment/
where there is a link to
https://developer.paypal.com/docs/api/payments/#payment_get
which seems to use this “PAY-…” thingie to get more data on the payment.


#5

Thanks, yes, this is it! The only downside is that it need to be implemented on the backend.

Thanks a lot!!!