Dear Experts
I need to do a small automation for one my client. He does online business, as soon as he invoiced a customer, he should communicate this invoice to the courier company. The courier company has send us the following php based api could anyone help me to convert this into foxpro based one.
<?php
// pickup_request function
function pickup_request($api_key,$client_id,$recipient_name,$recipient_contact_no,$recipient_address,$recipient_city,$parcel_type,$cod_amount,$parcel_description,$order_id){
// curl post
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL," curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"client_id=$client_id&api_key=$api_key&recipient_name=$recipient_name&recipient_contact_no=$recipient_contact_no&recipient_address=$recipient_address&parcel_type=$parcel_type&recipient_city=$recipient_city&parcel_description=$parcel_description&cod_amount=$cod_amount&order_id=$order_id");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo $server_output = curl_exec($ch);
curl_close ($ch);
}
//call set parcel variables
$api_key = "apiNNNN0000000bxx";
$client_id = "CLI123";
$recipient_name = "MR ABC";
$recipient_contact_no = "0755555555";
$recipient_address = "No Street, XYZ Region";
$recipient_city = "City";
$parcel_type = "2";
$cod_amount = "10.00";
$parcel_description = "book";
$order_id = "1234";
//call pickup_request function
pickup_request($api_key,$client_id,$recipient_name,$recipient_contact_no,$recipient_address,$recipient_city,$parcel_type,$cod_amount,$parcel_description,$order_id);
}
?>
I need to do a small automation for one my client. He does online business, as soon as he invoiced a customer, he should communicate this invoice to the courier company. The courier company has send us the following php based api could anyone help me to convert this into foxpro based one.
<?php
// pickup_request function
function pickup_request($api_key,$client_id,$recipient_name,$recipient_contact_no,$recipient_address,$recipient_city,$parcel_type,$cod_amount,$parcel_description,$order_id){
// curl post
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL," curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,
"client_id=$client_id&api_key=$api_key&recipient_name=$recipient_name&recipient_contact_no=$recipient_contact_no&recipient_address=$recipient_address&parcel_type=$parcel_type&recipient_city=$recipient_city&parcel_description=$parcel_description&cod_amount=$cod_amount&order_id=$order_id");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo $server_output = curl_exec($ch);
curl_close ($ch);
}
//call set parcel variables
$api_key = "apiNNNN0000000bxx";
$client_id = "CLI123";
$recipient_name = "MR ABC";
$recipient_contact_no = "0755555555";
$recipient_address = "No Street, XYZ Region";
$recipient_city = "City";
$parcel_type = "2";
$cod_amount = "10.00";
$parcel_description = "book";
$order_id = "1234";
//call pickup_request function
pickup_request($api_key,$client_id,$recipient_name,$recipient_contact_no,$recipient_address,$recipient_city,$parcel_type,$cod_amount,$parcel_description,$order_id);
}
?>