Login   Register  
PHP Classes
elePHPant
Icontem

File: virtual_paypal.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Herve FOUCHER  >  paypal_ipn  >  virtual_paypal.php  >  Download  
File: virtual_paypal.php
Role: Unit test script
Content type: text/plain
Description: A fake and random (either INVALID or VERIFIED) Paypal server response
Class: paypal_ipn
Paypal payment notification processing
Author: By
Last change:
Date: 12 years ago
Size: 400 bytes
 

Contents

Class file image Download
<?php

$f 
fopen("what_server_receives.txt""a");

while( list(
$key$val) = each ($_POST))
{
    
fwrite ($f"$key = $val\n");
}
fwrite ($fstr_repeat("-"80)."\n");

fclose($f);

// if the POST doesn't contain cmd variable, return INVALID
if($_POST["cmd"]!="_notify-validate")
{
    print 
"INVALID";
}

// otherwise, return random answer
print rand(0,1)?"VERIFIED":"INVALID";

?>