Here is a sample code for Express Checkout, change the credentials and work on it. Here, you can pass necessary parameter with the values and you can call up which method you need on "&method" parameter.
<?php
$url = "https://api-3t.paypal.com/nvp";
//$url = "https://api-3t.sandbox.paypal.com/nvp";
$nvps =
"&USER=XXXXXXXx"
."&PWD=XXXXXXXX"
."&SIGNATURE=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
if(!isset($token)) {
$nvpset= $nvps
."&returnurl=http://localhost/training/ec_return.php"
."&cancelurl=http://localhost/training/ec_call.php"
."&localecode=US"
."&SOLUTIONTYPE=Sole"
."&method=SetExpressCheckout"
."&version=204.0"
."&paymentrequest_0_currencycode=USD"
."&addroverride=1"
."&noshipping=2"
."&PAYMENTREQUEST_0_SHIPTONAME= James Costerton"
."&PAYMENTREQUEST_0_SHIPTOSTREET=3929 Coburn Hollow Road"
."&PAYMENTREQUEST_0_SHIPTOCITY=London"
."&PAYMENTREQUEST_0_SHIPTOSTATE="
."&PAYMENTREQUEST_0_SHIPTOZIP=SE23 1NX"
."&PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=GB"
."&PAYMENTREQUEST_n_SHIPTOPHONENUM=309-374-5347"
."&paymentrequest_0_amt=1.00";
$response = RunAPICall($nvpset);
echo '<pre>';
print_r($response);
}
function RunAPICall($nvps){
global $url;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_SSLVERSION,6);
curl_setopt($ch, CURLOPT_TIMEOUT, 45);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$nvps);
$result = curl_exec($ch);
$httpResponseAr = explode("&", strtoupper($result));
$httpParsedResponseAr = array();
foreach ($httpResponseAr as $value) {
$tmpAr = explode("=", $value);
if(sizeof($tmpAr) > 1) {
$httpParsedResponseAr[$tmpAr[0]] = urldecode($tmpAr[1]);
}
}
curl_close ($ch);
return $httpParsedResponseAr;
}?>