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

查看:102
本文介绍了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调用(文档).此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天全站免登陆