Problem adding order item to infusionsoft

I add orderitem to the infusionsoft api .. but I get a syntax error, but I can not 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 get this error

ERROR: -1 - No arguments for matching methods: 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 problem is that it does not get $ extra_price as an argument.

+5
source share
1 answer

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

Link: addOrderItem InvoiceService API

+3
source

Source: https://habr.com/ru/post/1214543/


All Articles