Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the full transaction details in paypal using the payment_id in paypal android sdk

Tags:

android

paypal

I am using the paypal android sdk 2.14.1. When I make the payment by the sdk, then it give the following response,

{
"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 the full transaction details

So please anyone can give the suggestion how to get the transaction details. by payment id.

Note: I am using soap APIs.

like image 346
Aman Gupta - ΔMΔN Avatar asked Jun 22 '16 16:06

Aman Gupta - ΔMΔN


Video Answer


2 Answers

I got the answer,

First of all we have to generate the access-Token by the client_id 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 getting the access-Token I have to make another api call for getting the full transaction details,

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 hitting this I will get the full transaction details.

For know more go to this link.

like image 84
Aman Gupta - ΔMΔN Avatar answered Sep 17 '22 06:09

Aman Gupta - ΔMΔN


Send the payment id to server API as:

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

like image 29
Muhammad Usman Avatar answered Sep 19 '22 06:09

Muhammad Usman