<%@ page extends="oneit.servlets.jsp.JSPInclude" %>
<%@ include file="/inc/stdimports50.jsp" %><%-- This is in cougar --%>
<%@ include file="/inc/stdcms.jsp" %><%-- This is in cougar --%>
<%@ include file="/extensions/performa/inc/stdimports.jsp" %>

<oneit:dynIncluded>
<%
    String  nextPage    =   WebUtils.getSamePageInRenderMode(request, "CardPayment");
%>

    
    
    <oneit:form name="editJob"  method="post"   enctype="multipart/form-data">

        <div class="container-fluid">
            
            <oneit:dynInclude   page="/extensions/applicantportal/inc/multifieldtext.jsp"   data="<%= CollectionUtils.EMPTY_MAP%>"/>
            
            <h1 class="page-title">Enter Payment Details</h1>
            
                <div class="row">
                    <div class="col-lg-4 col-md-4 col-sm-6">
                        <div class="form-group hide">
                            <input type="hidden" name="stripe-token-id" />
                        </div>
                    </div>
                </div>
            <oneit:button   value="Pay" name="savePayment" cssClass="btn btn-primary btn-lg"  id="payNow" 
                                                            requestAttribs='<%= CollectionUtils.mapEntry("nextPage", nextPage)
                                                                                            .toMap() %>'/>
        </div>
    </oneit:form>
     
     
    
    <form action="/charge" method="post" id="payment-form">
        <div class="form-row">
            <label for="card-element">
                Credit or debit card
            </label>
            <div id="card-element">
                 a Stripe Element will be inserted here. 
            </div>
            <div id="card-number">
                 a Stripe Element will be inserted here. 
            </div>
            <div id="card-expiry">
                 a Stripe Element will be inserted here. 
            </div>
            <div id="card-cvc">
                 a Stripe Element will be inserted here. 
            </div>

             Used to display Element errors 
            <div id="card-errors" role="alert"></div>
        </div>

        <button>Submit Payment</button>
    </form>
    <script src="https://js.stripe.com/v3/"></script>
    <script>
        var stripePubKey = '<%= MakePaymentFP.STRIPE_PUB_KEY %>';
    </script>
    <oneit:script>
        <!-- MUST be included after initializing stripePubKey -->
        <oneit:script src="/scripts/performaStripe.js"/>
    </oneit:script>
</oneit:dynIncluded>