<div xmlns:stripe="http://www.w3.org/1999/xhtml">
  <div class="modal-header">
    <img ng-src="{{logoBlack.custom_asset_file_attributes.attachment_url}}" alt="{{logo.custom_asset_file_attributes.attachment}}" class="modal-logo"/>
    <h1 translate>{{ 'app.shared.stripe.online_payment' }}</h1>
  </div>
  <div class="modal-body">
    <uib-alert ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">{{alert.msg}}</uib-alert>

    <div class="panel panel-default bg-light m-n">
      <form name="stripeForm" stripe:form cart-items="cartItems" on-payment-success="onPaymentSuccess" stripe-key="{{stripeKey}}" class="form-horizontal">
        <div class="panel-body">

          <div class="row">
            <wallet-info current-user="currentUser"
                         cart-items="cartItems"
                         price="price"
                         wallet="wallet"/>
          </div>
          <div id="card-element"></div>
          <div id="card-errors" role="alert"></div>

          <div class="form-group" ng-class="{'has-error': stripeForm.acceptCondition.$dirty && stripeForm.acceptCondition.$invalid}" ng-show="cgv">
            <div class="col-sm-12 text-sm checkbox-group">
              <input type="checkbox" name="acceptCondition" id="acceptCondition" ng-model="acceptCondition" value="true" ng-required="cgv != null"/>
              <label for="acceptCondition">{{ 'app.shared.stripe.i_have_read_and_accept_' | translate }}
                <a href="{{cgv.custom_asset_file_attributes.attachment_url}}" target="_blank" translate>{{ 'app.shared.stripe._the_general_terms_and_conditions' }}</a>
              </label>
            </div>
            <div ng-if="!cgv">
              <input type="hidden" name="acceptCondition" ng-model="acceptCondition" value="true">
            </div>
          </div>
          <div ng-if="schedule">
            <p translate translate-values="{DEADLINES: schedule.items.length}">{{ 'app.shared.stripe.payment_schedule' }}</p>
          </div>

        </div>
        <div class="panel-footer no-padder">
           <button type="submit" class="btn btn-valid btn-info btn-block p-l btn-lg text-u-c r-b text-base" ng-disabled="stripeForm.$invalid || attempting" translate translate-values="{AMOUNT:(amount | currency)}">{{ 'app.shared.stripe.confirm_payment_of_'}}</button>
        </div>
      </form>

    </div>

  </div>

  <div class="modal-footer text-center">
    <i class="fa fa-lock fa-2x m-r-sm pos-rlt" style="top:7px; color:#9edd78;"></i>
    <img src="../../images/powered_by_stripe.png" class="m-r-sm" />
    <img src="../../images/mastercard.png" class="m-r-sm" />
    <img src="../../images/visa.png" class="m-r-sm" />
  </div>


</div>
