在infusionsoft中添加订单商品的问题

时间:2015-03-03 09:15:13

标签: php infusionsoft

我在infusionsoft api中添加了一个orderitem ..但我收到了语法错误,但我无法找到答案。

 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");

我收到此错误

  

错误:-1 - 没有匹配参数的方法:   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作为其参数。

1 个答案:

答案 0 :(得分:3)

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

  

$ ordresult = $ app-&gt; addOrderItem($ invoiceId,4,9,floatval($ extra_price),1,“helloo”,“aaaaaa”);

参考:InvoiceService addOrderItem API