<!doctype html> 
<html> 
<?php require_once('partials/header.html'); ?>
<body> 
<?php require_once('partials/banner.html'); ?>
 
<div class="container"> 
    <div class="row"> 
        <?php require_once('partials/navigation.html'); ?>
        <div class="col-9"> 
            <div class="row"> 
                <form action="/receipt" class="col-12 form-horizontal" method="post">  <h3>Update Authorization</h3> 
                    <div class="alert alert-warning" role="alert">
                        A valid order ID from an existing authorization is required to update an authorization.
                        <br/><br/>
                        To create an order ID:
                        <ul>
                            <li>run the Authorize process first</li>
                            <li>then enter the order ID from the response below.</li>
                        </ul>
                    </div>
                    <fieldset> 
                        <input type="hidden" readonly="readonly" name="apiOperation" value="UPDATE_AUTHORIZATION" size="20" maxlength="80"/>
                        <input type="hidden" readonly="readonly" name="method" value="PUT" size="20" maxlength="80"/>
                        <div class="form-group">  <label class="col-md-7 control-label" for="orderId">Order ID</label> 
                            <div class="col-md-7"> 
                                <input id= "orderId" required="" class="form-control input-md"  type="text" name="orderId" value="" size="8" maxlength="13" placeholder="[ORDER ID FROM EXISTING TRANSACTION]"/>
                            </div>
                        </div>
                        <div class="form-group">  <label class="col-md-7 control-label" for="transactionId">Transaction ID (Auto generated unique Transaction ID)</label> 
                            <div class="col-md-7"> 
                                <input id="transactionId" class="form-control input-md" type="text" size="19" maxlength="80"  name="transactionId" value="<?php echo 'trans-' . bin2hex(openssl_random_pseudo_bytes(8)) ?>"/> 
                            </div>
                        </div>
                        <div class="form-group">  <label class="col-md-7 control-label" for="transaction[amount]">Amount</label> 
                            <div class="col-md-7"> 
                                <input id= "transaction[amount]" required="" class="form-control input-md"  type="text" name="transaction[amount]" value="" size="8" maxlength="13"/>
                            </div>
                        </div>
                        <div class="form-group">  <label class="col-md-7 control-label" for="transaction[currency]">Currency</label> 
                            <div class="col-md-7">
                                <input class="form-control input-md" id="transaction[currency]"  type="text" name="transaction[currency]" value="<?= $currency ?>"  size="8" maxlength="3" />
                            </div> 
                        </div> 
                        <div class="form-group">  <label class="col-md-7 control-label" for="process"></label> 
                            <div class="col-md-7"> 
                                <button id="process" name="process" class="btn btn-primary">Update Authorization</button> 
                            </div>
                        </div>
                    </fieldset>
                </form>
            </div>
        </div>
    </div>
</div>
 <?php require_once('partials/spinner.html'); ?>

</body>
</html> 
