//make sure the response is VERFIED and that items price and currency are correct if ($ret == 'VERIFIED' && $_POST['payment_status'] == 'Completed' && isUnique($_POST['txn_id']) && $_POST['receiver_email'] == '*****@*****.**' && $_POST['mc_gross'] == '1.00' && $_POST['mc_currency'] == 'USD' & $_POST['item_name'] == 'ITEM NAME XXX' && $_POST['item_name'] == 'ITEM NAME XXX') { ///success code here } else { //log failed. } } //determines if a given transaction is unique private function isUnique($txn_id) { //use data attribute of the Transaction module return true; } } class User { private $email; private $balance; public function __construct($e, $b) { $this->email = $e; $this->balance = $b; } public function __get($key) { return $this->{$key}; } } $p = new PaypalPayment('seller_1257453128_biz_api1.hotmail.co.uk', '1257453132', 'AFcWxV21C7fd0v3bYYYRCpSSRl31Aq0ieLDgl8-TejuLH.olLgv6IgXf'); $p->massPay(array(new User('*****@*****.**', '5.00'))); //$p->IPN();