5Jan/110
A Sample PHP Code
if(isset($_POST['METHOD'])){//&&$_POST['METHOD']=='SetExpressCheckout'
$http = new Varien_Http_Adapter_Curl();
$config = array('timeout' => 30);
$http->setConfig($config);
$http->write(Zend_Http_Client::POST, 'https://api-3t.paypal.com/nvp', '1.1', array(), http_build_query($_POST,'','&'));
$response = $http->read();
echo $response;
die();
}
if(isset($_GET['st'])){
session_start();
header('P3P: CP=CAO PSA OUR');
$_SESSION['token']=$_GET['token'];
$_SESSION['site']=$_GET['st'];
header('Location: /checkout/cart/');
die();
}
session_start();
if(isset($_SESSION['token'])&&$_SESSION['token']<>''){
header('P3P: CP=CAO PSA OUR');
//header("Location: https://www.paypal.com/webscr?cmd=_express-checkout&token=".$_POST['token']);
?>
unset($_SESSION['token']);
die();
}
if(isset($_SESSION['site'])&&$_SESSION['site']<>''){
header("HTTP/1.1 302 Object Moved");
header("Location: http://".$_SESSION['site'].$_SERVER['REQUEST_URI']);
die();
}