mardi 3 février 2015

Help to Integrate WooCommerce to PromoSoftware Rest API


Hi guys been trying to get WooCommerce to send customer details via API to PromoSoftware


Promosoftware api info



add_action('woocommerce_thankyou', 'send_order_to_ext');
function wdm_send_order_to_ext( ){
$api = new RestClient(array(
'base_url' => "http://ift.tt/1K8olJY",
'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.


Thanks





Aucun commentaire:

Enregistrer un commentaire