I am using PayPal iOS sdk to accept payment from user in my iOS app. I am using sandbox for testing. The payment is working fine, I am getting successful payment response along with Payment_ID. I am passing that Payment_ID to my server and from there using REST API (Show payment details), I am trying to retrieve all the information related to that payment but it is not consistent response.
Sometimes I am getting transaction_fee while sometimes it does not return in API response.
I see there is another NVP/SOAP method to get details but that requires transaction_id while i am only having Payment_ID.
does anyone have solution on how to get transaction fee from paypal?
I got the solution now!
I was receiving Payment_ID in response from from Paypal iOS SDk after payment successfully done. I am passing that to my server and the server is calling Show payment details REST API to get all payment details
In above API response for some cases when transaction state is completed, paypal does not returning transaction_fee_amount. but it returns sale-->id (transactionId).
Using Paypal PHP Library, I used that transactionId and made NVP call for below API, https://developer.paypal.com/docs/classic/api/merchant/GetTransactionDetails_API_Operation_NVP/
Voila!! In successfull response of that I am getting all the details for that transaction.