简体   繁体   English

使用PayPal IPN验证付款金额(USD +其他),无需运费或税金

[英]Using PayPal IPN to verify payment amounts (USD + others) without shipping or tax

Sorry for the longwinded title, but that pretty much sums up my issue here. 很抱歉这个名称很长,但这几乎总结了我的问题。 I am using PayPal IPN to verify incoming payments against prices in my database. 我正在使用PayPal IPN来验证我的数据库中的价格收入。 I am only selling one item at a time, no cart, and there is no shipping cost. 我一次只卖一件商品,没有购物车,也没有运费。 Tax is only charged if the buyer is from one area. 只有在买方来自某个地区时才会收税。

All prices are stored in my database as XX.XX without any tax. 所有价格都作为XX.XX存储在我的数据库中,不含任何税。 When PayPal sends back data via IPN I thought I could use mc_gross to compare with my database prices but I have found two possible issues: 当PayPal通过IPN发回数据时我以为我可以使用mc_gross来比较我的数据库价格,但我发现了两个可能的问题:

  1. If the buyer pays with non-usd funds, I read that mc_gross will not equal the price I sent to PayPal in the first place and therefore will not matchup with my database, is this true? 如果买方支付非美元资金,我读到mc_gross将不会等于我首先发送给PayPal的价格,因此不会与我的数据库匹配,这是真的吗?

  2. If the buyer is within the taxable area, and tax is added to his total at PayPal.com will this be reflected in mc_gross? 如果买方在应税区域内,并且在PayPal.com上将税额添加到他的总额中,这将反映在mc_gross中吗? I found conflicting info in the PayPal docs and online about whether or not mc_gross includes tax price. 我在PayPal文档和网上发现了有关mc_gross是否包含税价的相互矛盾的信息。

If the buyer pays with non-usd funds, I read that mc_gross will not equal the price I sent to PayPal in the first place and therefore will not matchup with my database, is this true? 如果买方支付非美元资金,我读到mc_gross将不会等于我首先发送给PayPal的价格,因此不会与我的数据库匹配,这是真的吗?

You should be verifying how you are processing the payment in the first place, lock down the fund type or store an item id using the custom variable 您应首先验证您如何处理付款,锁定基金类型或使用custom变量存储商品ID

If the buyer is within the taxable area, and tax is added to his total at PayPal.com will this be reflected in mc_gross? 如果买方在应税区域内,并且在PayPal.com上将税额添加到他的总额中,这将反映在mc_gross中吗? I found conflicting info in the PayPal docs and online about whether or not mc_gross includes tax price. 我在PayPal文档和网上发现了有关mc_gross是否包含税价的相互矛盾的信息。

mc_gross is the total amount paid so yes tax is included, you should be verifying what product was purchased using some sort of id not by the amount paid mc_gross是支付的总金额,因此包含税,您应该使用某种ID来验证购买的产品,而不是支付的金额

If the buyer is within the taxable area, and tax is added to his total at PayPal.com will this be reflected in mc_gross? 如果买方在应税区域内,并且在PayPal.com上将税额添加到他的总额中,这将反映在mc_gross中吗? I found conflicting info in the PayPal docs and online about whether or not mc_gross includes tax price. 我在PayPal文档和网上发现了有关mc_gross是否包含税价的相互矛盾的信息。

As David Nguyen says mc_gross is the total amount paid so yes tax is included. 正如David Nguyen所说,mc_gross是支付的总金额,所以是税收。 but, you must use mc_gross to compare with your database prices to secure the transaction. 但是,您必须使用mc_gross与数据库价格进行比较以确保交易安全

if you like to get the real price without the tax all you have to do is to check if the posted variable "tax" is numeric and if so decrease it from the posted variable "mc_gross". 如果你想在没有税的情况下获得实际价格,你只需检查过帐变量“tax”是否为数字,如果是,则将其从发布变量“mc_gross”中减去。

e.g.
mc_gross = 142.68
tax = 19.68
mc_gross - tax = 123

your database amount need to be 123. If not there is a security error because the user change the price and bypass the system. 您的数据库数量需要为123.如果不存在安全错误,因为用户更改价格并绕过系统。

by the way you must also check the currency, create a post back and more, click here for more details 顺便说一下,你还必须检查货币,创建一个帖子等等, 点击这里了解更多详情

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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