How to get full transaction information in PayPal using pay_id in paypal android sdk

I am using paypal android sdk 2.14.1 . When I make a payment using sdk, it gives the following answer:

{ "response": { "state": "approved", "id": "PAY-9A140896UE325390DK5VK4KI", "create_time": "2016-06-22T15:26:40Z", "intent": "sale" }, "client": { "platform": "Android", "paypal_sdk_version": "2.14.1", "product_name": "PayPal-Android-SDK", "environment": "sandbox" }, "response_type": "payment" 

}

But I want complete transaction information

Therefore, please, anyone can give a suggestion on how to get transaction information . by payment identifier.

Note. I use soapy APIs.

+5
source share
3 answers

I got an answer,

First of all, we need to generate the client_id access token and secret ,

 curl -v https://api.sandbox.paypal.com/v1/oauth2/token \ -H "Accept: application/json" \ -H "Accept-Language: en_US" \ -u "client_id:secret" \ -d "grant_type=client_credentials" 

After receiving the access token, I need to make another api call to get complete information about the transaction,

 curl -v -X GET https://api.sandbox.paypal.com/v1/payments/payment/Payment-Id \ -H "Content-Type:application/json" \ -H "Authorization: Bearer Access-Token" 

After that I will receive complete transaction information .

To learn more, follow this link.

+2
source

Send payment id to server API:

 url -v -X GET https://api.sandbox.paypal.com/v1/payments/payment/Payment-Id \ -H "Content-Type:application/json" \ -H "Authorization: Bearer Access-Token" 

for more details check here

+1
source

Get the "id": "PAY-9A140896UE325390DK5VK4KI" restored in the mSDK response, and then find the payment resource using the REST API on the server. This is also the recommended implementation of a mobile fraud check payment checker.

Check here the procedure Check mobile payment

0
source

All Articles