reference; if ($transaction['completed'] == '1') { $status = false; } if ($payment->grossAmount == 0.0) $status = false; // Wrong ammount of money $item = $payment->items->item[0]; if ($item->amount != ($pagseguro['price'] / 100)) $status = false; if ($status) { // transaction log mysql_update('UPDATE `znote_pagseguro` SET `completed` = 1 WHERE `transaction` = \'' . $paymentCode . '\''); // Process payment $data = mysql_select_single("SELECT `points` AS `old_points` FROM `znote_accounts` WHERE `account_id`='$custom';"); // Give points to user $new_points = $data['old_points'] + $item->quantity; mysql_update("UPDATE `znote_accounts` SET `points`='$new_points' WHERE `account_id`='$custom'"); } } else if ($paymentStatus == 7) { mysql_update('UPDATE `znote_pagseguro` SET `completed` = 1 WHERE `transaction` = \'' . $paymentCode . '\' '); } ?>