<?php
/*
	$xml ="<mapi><mapiversion>1.0</mapiversion><md5content>2e9c07f8a05b07c14bbefc80c9fdb73c</md5content><result><operation>authorization</operation><status>ok</status><date>2010-07-22</date><time>08:50:53 UTC+0000</time><transid>4C48066CDFCE5</transid><origAmount>1.00</origAmount><origCurrency>USD</origCurrency><idForMerchant></idForMerchant><emailClient>maohangjun@gmail.com</emailClient><merchantDatas><credits1>aValueOne</credits1><_aKey_keyTwo>aValueTwo</_aKey_keyTwo></merchantDatas><refProduct0></refProduct0></result></mapi>";
*/	
	$xml = $_POST['xml'];
	
	$obj = new SimpleXMLElement(trim($xml));
	
	$operation 		= $obj->result[0]->operation;
	$status 		= $obj->result[0]->status;
	$date 			= $obj->result[0]->date;
	$time 			= $obj->result[0]->time;
	$transid 		= $obj->result[0]->transid;
	$origAmount 	= $obj->result[0]->origAmount;
	$origCurrency 	= $obj->result[0]->origCurrency;
	$idForMerchant 	= $obj->result[0]->idForMerchant;
	$emailClient 	= $obj->result[0]->emailClient;
	$merchantDatas 	= $obj->result[0]->merchantDatas;
	$refProduct0 	= $obj->result[0]->refProduct0;
	$freedata1		= $obj->result[0]->merchantDatas->_aKey_freedata1;

echo($freedata1);

//var_dump($_POST);

//var_dump($obj);
?>