square connect v2 api不收取美分

时间:2017-05-30 21:37:10

标签: square-connect

方形连接api不收费美分。例如,如果客户以17.25美元的价格在线购物,我的计费软件显示为17.25美元,但是当我收到我的方形报告时,它只收取或收取17.00美元。所以我短了.25美分。

我的process-card.php文件有这个;

# Monetary amounts are specified in the smallest unit of the applicable currency.
# This amount is in cents. It's also hard-coded for $1.00, which isn't very useful.
    "amount_money" => array (
    "amount" => (int)$_POST['amount'] *100,
    "currency" => "CAD"

然后出于测试目的,我将* 100更改为* 111,确定它会收取美分,但这次不是从发票中收取17.25美元,方形报告显示,收到18.87美元。

任何帮助都会很棒。

感谢您

1 个答案:

答案 0 :(得分:0)

您将$_POST['amount']类型转换为整数,这将删除小数点后的任何内容。

尝试删除(int)