Web API 中的当前 PayPal 费用? [英] Current PayPal Fees in web API?

查看:21
本文介绍了Web API 中的当前 PayPal 费用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道是否有公开可用的 PayPal 资源可以让我在我的 Magento 代码中计算交易费用?

例如,如果有人以 1.00 美元的价格购买某物,我想知道其中的 0.15 美元是否是 PayPal 费用.

如果有一个资源,比如 paypal.com/currentfees.xml 或者我可以在我的 PHP 代码中读出的东西,我可以.它存在吗?我知道不同的付款方式(例如 AMEX)有不同的费用,并且费用可能随时变化 -> 因此最好有一种动态的方法来计算 Magento 的订单总额中有多少是真正的 PayPal 费用.

澄清一下,我对向客户收取更多费用不感兴趣,只是想知道我的价格中有多少会用于收费.用于簿记.

谢谢!

解决方案

PayPal 的费用在不同账户甚至交易中都不相同;跨境交易、PayPal Here 交易、大商户折扣等有不同的费用.
看看 https://www.paypal.com/webapps/mpp/paypal-fees 了解更多详情.
所以不,不幸的是,您无法提取资源来查找当前费用.

但是,PayPal确实会在 API 响应中返回为每笔交易支付的费用.
例如,如果您与 PayPal Express Checkout 集成,DoExpressCheckoutPayment API (doc) 用于完成交易.此 API 调用返回一个PAYMENTINFO_0_FEEAMT"参数,其中包含为交易支付的总费用金额.

您是否希望在交易完成后检索此信息;PayPal 还提供 GetTransactionDetails API 调用(doc).此 API 调用还会返回FEEAMT"作为参数.
只需提交 TRANSACTIONID 并读出 FEEAMT.

注意:费用仅根据已完成的交易计算.对于任何订单或授权 ID(例如,以 O-xxxxxxxx 开头的订单),您将不会获得 FEEAMT.

Does anyone know if there is a publicly available PayPal resource that would allow me to calculate transaction fees in my Magento code?

For example, if someone buys something for $1.00, I'd like to know if $0.15 of that is a PayPal fee.

If there were a resource, like paypal.com/currentfees.xml or something that I could readout in my PHP code, I could that. Does it exist? I know there are different fees for different payment methods (e.g., AMEX) and fees could change at any time -> So it'd be good to have a dynamic way to calculate how much of Magento's order totals are really PayPal fees.

EDIT: To clarify, I'm not interested in charging customers more, just in knowing how much of my price is going to fees. For bookkeeping.

Thanks!

解决方案

PayPal fees are not the same across accounts or even by transaction; there are different fees for cross-border transactions, PayPal Here transactions, large-merchant discounts, et cetera.
Have a look at
https://www.paypal.com/webapps/mpp/paypal-fees for more detail.
So no, unfortunately you can't pull a resource to find the current fee.

However, PayPal does return the fees paid for each transaction in the API response.
For example, if you're integrated with PayPal Express Checkout, the DoExpressCheckoutPayment API (doc) is used to finalize a transaction. This API call returns a 'PAYMENTINFO_0_FEEAMT' parameter which contains the total fee amount paid for the transaction.

Should you wish to retrieve this information after the transaction has been completed; PayPal also offers the GetTransactionDetails API call (doc). This API call also returns 'FEEAMT' as a parameter.
Simply submit the TRANSACTIONID and read out the FEEAMT.

Note: Fees are only calculated on completed transactions. You won't get a FEEAMT back for any order or authorization-ID's (e.g. those starting with O-xxxxxxxx).

这篇关于Web API 中的当前 PayPal 费用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆