【问题标题】:Authorize.net request amount rounding off 3 decimal points to 2Authorize.net 请求金额小数点后 3 位四舍五入为 2
【发布时间】:2016-06-24 21:44:03
【问题描述】:

我正在研究 authorize.net php API,我发现那里有问题。我发送 45.347 美元作为金额值,但它四舍五入到小数点后 2 位(45.35 美元)。有什么办法可以显示小数点后3?

【问题讨论】:

  • 否,因为货币值精确到两位数。在将值发送到 Authnet 之前,您需要自己向上或向下舍入。
  • 根据他们的文档,我也这么认为。他们说金额限制为 2 个十进制数字

标签: api authorize.net


【解决方案1】:

根据第 22 页上的 documentation for the advanced integration method (AIM) 部分,x_amount 字段仅支持两位小数。

您必须在提交交易前对您的金额进行四舍五入。

x_amount Value: Amount of the transaction.
Format: 15 digit-maximum, with a decimal point (no dollar symbol). For
example, 8.95.
Notes: This is the total amount and must include tax, shipping, and any
other charges.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-03
    • 1970-01-01
    • 1970-01-01
    • 2019-03-15
    • 2015-11-24
    相关资源
    最近更新 更多