src/Neuron/GameServer/Credits.php
public function handleUseRequest ($data, $transactionId, $transactionKey)
	{
		if (!$this->objCredits) {
			return null;
		}

		if (isset ($_POST['transaction_id']) && isset ($_POST['transaction_secret']))
		{
			$valid = $this->objCredits->isRequestValid ($_POST['transaction_id'], $_POST['transaction_secret']);

			if ($valid)
			{
				$amount = $_POST['transaction_amount'];
				$this->objUser->useCredit ($amount, $data);

				return true;
			}
			else
			{
				$this->error = 'This request was not valid or already executed. Ignore.';
			}
		}
		else
		{
			$this->error = 'No post data received.';
		}

		return false;
	}
public function handleUseRequest ($data, $transactionId, $transactionKey)
	{
		if (!$this->objCredits) {
			return null;
		}

		if (isset ($_POST['transaction_id']) && isset ($_POST['transaction_secret']))
		{
			$valid = $this->objCredits->isRequestValid ($_POST['transaction_id'], $_POST['transaction_secret']);

			if ($valid)
			{
				$amount = $_POST['transaction_amount'];
				$this->objUser->useCredit ($amount, $data);

				return true;
			}
			else
			{
				$this->error = 'This request was not valid or already executed. Ignore.';
			}
		}
		else
		{
			$this->error = 'No post data received.';
		}

		return false;
	}
This function connects to the credit gateway
and checks if a certain transaction exists.

If the transaction exists, it handles it
and returns TRUE.

@param $data
@param $transactionId
@param $transactionKey
@return bool|null