在 infusionsoft 中添加订单项目时出现问题

issue in adding order item in infusionsoft

我正在 infusionsoft api 中添加一个 orderitem api.. 但我遇到语法错误但我无法找出答案。

 require_once($_SERVER['DOCUMENT_ROOT']."/infusionsoftAPI/src/isdk.php");
 $app = new iSDK;

 $_REQUEST['contactId'] = 4;

 if(!empty($_REQUEST['contactId']))
 {
    if ($app->cfgCon("aaaa", 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeee')) {
        echo "Infusionsoft Connection Successfulls";
    } else {
        echo "Infusionsoft Connection Failed";
        exit;
    }
} else {
    echo '<p>No contact id selected.</p>';
    exit();
}
some code
some code
$invoiceId = $app->blankOrder($contactId,"Video Report Subscription - Extra", $oDate,0,0);
$extra_price = $extraemail * $result['price_after_expire'];

$ordresult = $app->addOrderItem($invoiceId, 4, 9, $extra_price, 1, "helloo", "aaaaaa");

我收到这个错误

ERROR: -1 - No method matching arguments: java.lang.String,java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.String, java.lang.String

但是当我写的时候

  $ordresult = $app->addOrderItem($invoiceId, 4, 9, 22.00, 1, "helloo", "aaaaaa");

有效.... 问题是它没有得到 $extra_price 作为参数..

看起来 $extra_price 是一个整数,但 addOrderItem 需要一个浮点数。 尝试:

$ordresult = $app->addOrderItem($invoiceId, 4, 9, floatval($extra_price), 1, "helloo", "aaaaaa");

参考:InvoiceService addOrderItem API