<?php
session_start();
include_once '../includes/autoloader.php';
include_once '../includes/function.php';
 $objvalidate = new bank;
 header('Content-Type: application/json');
 if ($_SERVER['REQUEST_METHOD'] === 'POST') {

    $postData = file_get_contents('php://input');
    $data = json_decode($postData, true);
$sender = purify($data["sender"]);
$recipient = purify($data["recipient"]);
$transferAmount = purify($data["transferAmount"]);
$transProDate = purify($data["transProDate"]);
$transferFee = purify($data["transferFee"]);
$percentage = purify($data["percentage"]);
$transfeeStatus = purify($data["transfeeStatus"]);
$maturityDate = purify($data["maturityDate"]);
$maturityDateStatus = purify($data["maturityDateStatus"]);
$Country = purify($data["Country"]);
$message = purify($data["message"]);
$currency = purify($data["currency"]);
$transid = random_alphanumericstrings(20);
$currentUrl = "http://".$_SERVER['HTTP_HOST'];
$encryption = password_hash($currentUrl, PASSWORD_DEFAULT);
if ($sender) {
// $sha = password_hash($password, PASSWORD_DEFAULT);
$objvalidate->setSender($sender);
$objvalidate->setRecipient($recipient);
$objvalidate->setTransferAmount($transferAmount);
$objvalidate->setTransProDate($transProDate);
$objvalidate->setTransferFee($transferFee);
$objvalidate->setPercentage($percentage);
$objvalidate->setTransfeeStatus($transfeeStatus);
$objvalidate->setMaturityDate($maturityDate);
$objvalidate->setMaturityDateStatus($maturityDateStatus);
$objvalidate->setEncryption($encryption);
$objvalidate->setcountry($Country);
$objvalidate->setId($transid);
$objvalidate->setepin($message);
$objvalidate->setpin($currency);
$save = $objvalidate->saveProgress();
if ($save) {
 echo 'true';
 
 
  }
}
}