$transID = time();
    $startingDate = $_POST['start'];
    $endingDate = $_POST['end'];
    $amount = $_POST['amount'];
    // Unneeded
    $maxNumberOfPayments = null;
    $paymentPeriod = null;
    $dateOfMonth = null;
    $dayOfWeek = null;
    $maxAmountPerPayment = null;
    $maxNumberOfPaymentsPerPeriod = null;
    $pinType = null;
    $returnUrl = '';
    $cancelUrl = 'http://www.google.com';
    $client = new SoapClient($devel_WSDL);
    $response = $client->preauthPaypal($brandID, $transID, $startingDate, $endingDate, $amount, $maxNumberOfPayments, $paymentPeriod, $dateOfMonth, $dayOfWeek, $maxAmountPerPayment, $maxNumberOfPaymentsPerPeriod, $pinType, $returnUrl, $cancelUrl);
    if ($response->platformResponse) {
        $presp = explode("|", $response->platformResponse);
        //        foreach ($presp as $k => $v){
        //            echo $k . " - " . $v . "<br/>";
        //        }
    }
    $key = explode("=", $presp[3]);
    echo "<br/><a href=\"https://www.sandbox.paypal.com/webscr?cmd=_ap-preapproval&preapprovalkey=" . $key[1] . "\">Preauth</a><br/>";
} else {
    if ($_POST['pay'] && $_POST['amount'] && $_POST['key']) {
        $brandID = 0;
        $transID = time();
        $amount = $_POST['amount'];
        $returnUrl = 'http://www.google.com';
        $cancelUrl = 'http://www.google.com';