I am facing issue in calling place order method for pushing new order to infusion soft from PHP
Good morning @jitendra_mishra ,
We are always happy to provide what assistance we can, but would need to see the error as well as the source code that was generating it to answer your question.
Thanks!
Below are my function in which I am passing $order as array but placeOrder methode is undifind error getting
function insertOrderInfusionsoft($order = NULL) {
//echo 'aaaaaaaaaaaaaaaa<pre>'; print_r($order); die;
$infusionsoft = new \Infusionsoft\Infusionsoft(array(
'clientId' => '',
'clientSecret' => '',
'redirectUri' => '',
));
$token_file = __DIR__ . '/token.txt';
if (!file_exists($token_file)) {
errorLog("-No token file");
exit();
}
if (empty($order)) {
errorLog("-No data found");
exit();
}
$token = unserialize(file_get_contents($token_file));
$infusionsoft->setToken($token);
if ($infusionsoft->getToken()) {
try {
$contact = unserialize($order);
$duplicateCheck = 0;
$dupCheckFound = '';
$orderplace = $infusionsoft->orders->placeOrder();
echo '<pre>';
print_r($orderplace);
die;
$order = $infusionsoft->orders->OrderService->placeOrder();
$infusionsoft->Orders->placeOrder('2', '3', '4', array('Email'), array('Phone1'), 1, array('Email'), '6', '7');
if ($cid) {
echo '<br>' . 'Order Imported successfully: ' . $order;
}
} catch (\Infusionsoft\TokenExpiredException $e) {
errorLog("-Token Expired");
} catch (Exception $e) {
errorLog($e->getMessage());
}
} else {
errorLog("-No token");
}
}
The first thing that looks out of place is that, according to the PHP-SDK source, you have parameter mismatches on the placeOrder call:
public function placeOrder($contactId, $creditCardId, $payPlanId, $productIds, $subscriptionPlanIds, $processSpecials, $promoCodes, $leadAffiliateId, $affiliateId)
Additionally, I would verify that all parameters values for ids exist in the subject app before calling this method.