i am adding an orderitem in infusionsoft api.. but i am getting syntax error but i m not able to find out.
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");
i am getting this error
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
But when i write
$ordresult = $app->addOrderItem($invoiceId, 4, 9, 22.00, 1, "helloo", "aaaaaa");
it works.... the issue is that it is not getting $extra_price as its argument..
Looks like $extra_price
is an integer, but addOrderItem
expects a float.
Try:
$ordresult = $app->addOrderItem($invoiceId, 4, 9, floatval($extra_price), 1, "helloo", "aaaaaa");
Reference: InvoiceService addOrderItem API