I am not all that familiar with paypal's transactions/processing. I do know that they offer an API for accessing transaction information and processing. I suggest that you thoroughly go thru their documentation.
If I remember right the API uses Oauth. I would not suggest using Oauth unless you can find a very good script to run Oauth from and/or have a very firm understanding of how Oauth works.
NOTE: SHA-160 has been available in PHP since 4.3.0 (via sha1()). and for what ever reason you need it in versions before that you can use
<?php
if(!function_exists('rotl'))
{
function shr($x, $n)
{
return (0x80000000 & $x) ? (($x >> 1) & ~0x80000000 | 0x40000000) >> $n-1 : $x >> $n;
}
function rotl($x, $n)
{
return ($x << $n) | shr($x, 32-$n);
}
}
function sha160($str, $raw_output = false)
{
$h0 = 0x67452301;
$h1 = 0xefcdaB89;
$h2 = 0x98badcfe;
$h3 = 0x10325476;
$h4 = 0xc3d2e1f0;
$m = "$str\x80". str_repeat("\x0", (64 - (($l = strlen($str)) + 8 + 1) % 64) + 4). pack('N', $l << 3);
while($t = substr($m, 0, 64))
{
$a = $h0;
$b = $h1;
$c = $h2;
$d = $h3;
$e = $h4;
$w = array_values(unpack('N16', $t));
for($j = 0; $j <= 79; ++$j)
{
if(16 <= $j)
{
$w[] = rotl($w[$j-3] ^ $w[$j-8] ^ $w[$j-14] ^ $w[$j-16], 1);
}
if($j <= 19)
{
$k = 0x5a827999;
$f = ($b & $c) ^ (~$b & $d);
}
else if($j <= 39)
{
$k = 0x6ed9eba1;
$f = $b ^ $c ^ $d;
}
else if($j <= 59)
{
$k = 0x8f1bbcdc;
$f = ($b & $c) ^ ($b & $d) ^ ($c & $d);
}
else if($j <= 79)
{
$k = 0xca62c1d6;
$f = $b ^ $c ^ $d;
}
$t = rotl($a, 5) + $f + $e + $k + $w[$j];
$e = $d;
$d = $c;
$c = rotl($b, 30);
$b = $a;
$a = (int) $t;
}
$h0 = $a + $h0;
$h1 = $b + $h1;
$h2 = $c + $h2;
$h3 = $d + $h3;
$h4 = $e + $h4;
$m = substr($m, 64);
}
$hash = pack('N*', $h0, $h1, $h2, $h3, $h4);
return ($raw_output) ? $hash : bin2hex($hash);
}
function sha160_file($filename, $raw_output = false)
{
if(file_exists($filename) && is_file($filename) && is_readable($filename))
{
return sha160(file_get_contents($filename), $raw_output);
}
return false;
}
?>