Hi guys been trying to get WooCommerce to send customer details via API to PromoSoftware
add_action('woocommerce_thankyou', 'send_order_to_ext');
function wdm_send_order_to_ext( ){
$api = new RestClient(array(
'base_url' => "http://api.promosoftware.co.uk/v2/t/t",
'format' => "php",
));
$addArray=array(
$addArray['ContactFirstName'] = 'Dave',
$addArray['ContactLastName']='Davison',
$addArray['ContactEmail']='dave@dave.com',
$addArray['ContactSalutation']='Davo',
$addArray['CompanyId']=12,//INT
$result=$api->post('contact',$addArray),
json_decode($result->response),//returnsstdClassobject
json_decode($result->response,true),//returnsassocarray
);
var_dump($result);
}
Im using php-restclient from github…
totally lost here.. just need to be guided in the right direction.