how to retrive form posts via json
===

Hey all i am trying to figure out how to go about getting my forms values that are sent via ajax json in the php script.

    $.ajax
    ({
        type: "POST",
        url: "http://www.xxx.com/cart/gateway",
        dataType: 'json',
        async: false,
		contentType: "json",
        data: JSON.stringify({ "unique_id": $("#order_unique_id").val(), "name_on_card" : $("#name_on_card").val(), "card_number" : $("#card_number").val(), "expiry_date" : $("#expiry_date").val(), "cvv_code" : $("#cvv_code").val() }),
        success: function (data) {
			if (data && data != null && data["success"] != null && data["orderid"]) {
					processSuccess(data["orderid"]);
				} else if (data && data != null && data["error"] != null) {
					processError(data["error"]);
				} else {
					processError('unknown');
				}
				processing = false; 
        }
    })

Currently it has an error but thats only because its looking for a POST value from a form. Here is that code:

     public function __construct(&$page, $params) {
		$page->cart = new theCart();
		$page->cart->set_form();
		
		switch($action){
			case 'gateway':
				$this->checkoutCart($page);
				break;

     ...}

     function set_form()
	{
    $this->setFormValue('b_email');
    $this->setFormValue('b_first_name');
    $this->setFormValue('b_last_name');
    .....etc etc
	//ADDED 7/25/2012
	$this->setFormValue('name_on_card'); 
	$this->setFormValue('card_number'); 
	$this->setFormValue('expiry_date'); 
	$this->setFormValue('cvv_code'); 
	$this->setFormValue('order_unique_id'); 
    		
	$this->verified = false;
     }

     function setFormValue($name){
       if(isset($_POST[$name])){
         $this->$name = trim($_POST[$name]);
       }
     }

     private function checkoutCart(&$page){
		$page->part->body->content_html = $this->pPay($page, $this->getPay());
	}

     private function getPay(){
		//echo 'getP== ' . json_decode( $_POST[ 'unique_id' ], true );
		echo 'getP== ' . $_POST['unique_id'];

		return array(
			'unique_id' => $_POST['unique_id'],
			'name_on_card' => $_POST['name_on_card'],
			'card_number' => $_POST['card_number'],
			'expiration_date' => $_POST['expiry_date'],
			'cvv_code' => $_POST['cvv_code']
		);
	}

I am not getting any value for **$_POST['unique_id']** above.

How can i correct this from happening?