Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

issue in adding order item in infusionsoft

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..

like image 646
user Avatar asked Oct 19 '22 16:10

user


1 Answers

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

like image 143
Sachin Joseph Avatar answered Oct 27 '22 18:10

Sachin Joseph