Subversion Repositories SmartDukaan

Rev

Rev 21163 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21163 Rev 23010
Line 332... Line 332...
332
			break;
332
			break;
333
		}
333
		}
334
		return $response;	
334
		return $response;	
335
	}
335
	}
336
	
336
	
-
 
337
	function post_json($url, $json_body) {
-
 
338
		$ch = curl_init($url);
-
 
339
		curl_setopt_array($ch, array(
-
 
340
		    CURLOPT_POST => TRUE,
-
 
341
		    CURLOPT_RETURNTRANSFER => TRUE,
-
 
342
		    CURLOPT_HTTPHEADER => array(
-
 
343
		        'Content-Type: application/json'
-
 
344
		    ),
-
 
345
		    CURLOPT_POSTFIELDS => json_encode($json_body)
-
 
346
		));
-
 
347
		
-
 
348
		// Send the request
-
 
349
		$response = curl_exec($ch);
-
 
350
		
-
 
351
		// Check for errors
-
 
352
		if($response === FALSE){
-
 
353
		    die(curl_error($ch));
-
 
354
		}
-
 
355
		// Decode the response
-
 
356
		$responseData = json_decode($response, TRUE);
-
 
357
	}
-
 
358
	
337
	function post_cartinfo_request($url,$fields,$format='json'){
359
	function post_cartinfo_request($url,$fields,$format='json'){
338
		$this->log("[url] $url",'api');
360
		$this->log("[url] $url",'api');
339
		//$this->log("[fields] ".print_r($fields,1),'api');
361
		//$this->log("[fields] ".print_r($fields,1),'api');
340
		$fields_string = '';
362
		$fields_string = '';
341
		//open connection
363
		//open connection