Beispiel #1
0
						// Check if the user is sending money to own account
						if ($iban == AccountUtils::getEmailFromIBAN ($emailId)) {
							echo "You can't tranfer money to your own account";
							return;
						}

						// Insert the data in the TRANSACTION TABLE
						$db->insert($data, "TRANSACTIONS");

						$updatedBalanceAfterDeduction = bcsub ($balance, $amount, FLOAT_PRECISION);

						//Email id of target user
						$emailTargetUser = AccountUtils::getEmailFromIBAN($iban);

						$data = array(
									"senderIban" => AccountUtils::getIBANFromEmail($emailId),
									"receiverIban" => $iban,
									"bic" => $bic,
									"amount" => $amount,
									"description" => "'$description'",
									"userId" => "'$emailTargetUser'",
									"date" => "'".date('Y-m-d H:i:s')."'",
									"closingBalance" => $balanceOfTheTargetUser,
									"isActive" => $isActive,
									"type" => "'CREDIT'"
								);

						// Insert the credit data in the TRANSACTION TABLE
						$db->insert($data, "TRANSACTIONS");
						
						$updatedBalanceAfterAddition = bcadd($balanceOfTheTargetUser, $amount, FLOAT_PRECISION);
Beispiel #2
0
<?php

require_once("../../classes/PluploadHandler.php");
require_once '../../includes/global.inc.php';
require_once '../../utils/Account.util.php';
require_once '../../utils/Generators.util.php';

$emailToUpdate = "*****@*****.**";

$tanNos = Generators::generateTANs ($emailToUpdate, 10);

  $tanEmailMessage = "";

  for ($i=0; $i < count($tanNos); $i++) { 
    $tanEmailMessage .= $i . ": " . $tanNos[$i] . "<br/>";
    $tanEmailMessage .= "<br/><hr>";
  }

echo $tanEmailMessage;

$tanToDecrypt = "dHDhS024hPzH/T8GxZiWFZoVDNVVJWCj/nfi7rBeNxBKQf904WD5zSEV4KppYKCzpC4mldvM9THJB2gwlw==";

echo "====>".AccountUtils::checkTANValidity($emailToUpdate, $tanToDecrypt);