【问题标题】:square connect v2 api does not charge centssquare connect v2 api 不收费
【发布时间】:2017-05-31 06:08:12
【问题描述】:

square connect api 不收费。例如,如果客户以 17.25 美元的价格在线购买,我的计费软件显示已支付 17.25 美元,但当我收到我的方形报告时,它只收取或收取 17.00 美元。所以我做空了 0.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 美元。

任何帮助都会很棒。

谢谢你

【问题讨论】:

    标签: square-connect


    【解决方案1】:

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

    尝试删除(int)

    【讨论】:

    • 太棒了!它现在工作正常。它现在报告美分。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多