Paypal 错误:商品金额格式不正确

发布于 2024-11-28 00:37:47 字数 1257 浏览 1 评论 0原文

我在贝宝上遇到了一个奇怪的问题。当我的购物车传递带小数位的值(如 1.15)时,它不起作用并显示错误:您用于输入 PayPal 系统的链接包含格式不正确的商品金额。

这是有效的无小数数量的输出:

paypal_class->dump_fields() Output:

Field Name     Value
amount_1       70.00 
business       xxxxxxxxxxxxxxxx
cancel_return  xxxxxxxxxxxxxxxxxx
cmd            _cart 
currency_code  HUF 
invoice        171SPLINTERCELLCONVICTIONxxxxxxxxxxxxxxxxxxx
item_name_1    Apple 
item_number_1  211 
notify_url     xxxxxxxxxxxxxxxxxxxxxxxx
on0_1          Option 
os0_1          Default 
quantity_1     1 
return         xxxxxxxxxxxxxxxxxxxxxxxxx
rm             2 
shipping_1     5 
tax_cart       0.00 
upload         1 

这是无效的带小数位数的输出(出于安全原因我删除了一些变量)。

paypal_class->dump_fields() Output:

Field Name     Value
amount_1       70.15 
business       xxxxxxxxxxxxxxxxxx
cancel_return  xxxxxxxxxxxxxxxxxxx
cmd            _cart 
currency_code  HUF 
invoice        172SPLINTERCELLCONVICTIONxxxxxxx
item_name_1    Apple 
item_number_1  211 
notify_url     xxxxxxxxxxx 
on0_1          Option 
os0_1          Default 
quantity_1     1 
return         xxxxxxxxxxx 
rm             2 
shipping_1     5 
tax_cart       0.00 
upload         1 

它不仅仅适用于三种货币: 匈牙利福林, 日圆, 新台币。

有什么帮助吗?将不胜感激。

I am encountering a weird problem from paypal. When My shopping cart pass value with decimal places(like 1.15) it does not work and shows me the error:The link you have used to enter the PayPal system contains an incorrectly formatted item amount.

This is the output of without decimal numbers in amount which works:

paypal_class->dump_fields() Output:

Field Name     Value
amount_1       70.00 
business       xxxxxxxxxxxxxxxx
cancel_return  xxxxxxxxxxxxxxxxxx
cmd            _cart 
currency_code  HUF 
invoice        171SPLINTERCELLCONVICTIONxxxxxxxxxxxxxxxxxxx
item_name_1    Apple 
item_number_1  211 
notify_url     xxxxxxxxxxxxxxxxxxxxxxxx
on0_1          Option 
os0_1          Default 
quantity_1     1 
return         xxxxxxxxxxxxxxxxxxxxxxxxx
rm             2 
shipping_1     5 
tax_cart       0.00 
upload         1 

This is the output of with decimal places which does not work(I deleted some of the variables for security reasons).

paypal_class->dump_fields() Output:

Field Name     Value
amount_1       70.15 
business       xxxxxxxxxxxxxxxxxx
cancel_return  xxxxxxxxxxxxxxxxxxx
cmd            _cart 
currency_code  HUF 
invoice        172SPLINTERCELLCONVICTIONxxxxxxx
item_name_1    Apple 
item_number_1  211 
notify_url     xxxxxxxxxxx 
on0_1          Option 
os0_1          Default 
quantity_1     1 
return         xxxxxxxxxxx 
rm             2 
shipping_1     5 
tax_cart       0.00 
upload         1 

and it does not work for only the three currencies:
Hungarian Forint,
Japanese Yen,
Taiwan New Dollars.

Is there any help? Will be grateful.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心房敞 2024-12-05 00:37:47

您的应用程序应通过您正在使用的类将正确的货币格式传递给 PayPal。

因此,如果您在数据库中将价格存储为十进制数字(例如美元),但访问者将其区域设置/查看首选项设置为日元,则您的应用程序应相应地转换价格(在本例中为不带小数的整数) places),然后应该将其传递给您的 PayPal 类。

Your application should pass the correct currency format to PayPal via the class you're using.

So if you're storing prices as decimal numbers in your database (as US dollars for example) but a visitor sets their locale/viewing preference to Yen, then your application should convert prices accordingly (and in this case to an integer with no decimal places), which should then be passed to your PayPal class.

静谧 2024-12-05 00:37:47

这三种货币没有小数。每当您输入小数值时,贝宝都会显示错误。因此,请尝试将值四舍五入(10.25 至 10 或 11)。

These three currencies does not have decimal value. Whenever you put decimal values paypal will show errors. So try to round the values( 10.25 to 10 or 11).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文