简体   繁体   中英

Retrieving Paypal transaction fee

Is there any way to retrieve the transaction fee charged by Paypal using the REST API?

I've got a mobile application that makes a charge using the Paypal SDK, and then posts the transaction ID to the server. I'm trying to use this to get the transaction fee from Paypal.

Looking at the documentation , it looks like the fee should be returned as part of the details object, though it's not clear how to get this from the payment.

For example, if I get the payment using the following endpoint: /v1/payments/payment/PAY-XXXXXXX

The response returns information about the transaction, including the amount and currency, but nothing about the Paypal fee.

在此处输入图片说明

I've also tried looking up the sale ( /v1/payments/sale/XXXXXXX ) but that doesn't return anything about the Paypal fees either.

在此处输入图片说明

Interestingly enough, I don't seem to be able to view this information either from the transactions grid in the web interface, but I'm sure this information was definitely available in the old version of the web interface (before the redesign).

Not sure if I'm missing something obvious here.

Unfortunately, despite being documented, it seems this hasn't been implemented. According to PayPal Merchant Technical Support, on 02/16/2015:

"Kindly take note that transaction fees will not be returned in REST APIs response and I am not being able to ensure whether this will be implemented in future."

I learned that fee tracking was a requirement for my company's PayPal implementation, and I ended up switching to SDKs as a result.

The details object of the amount object has a fee field, which when you look up the sale using the URL you mentioned above should be in each transaction in the transactions array.

This should return the value you are looking for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM