<div>
  <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>{{ '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="payment" class="form-horizontal">
        <div class="panel-body">

          <h3 class="m-t-xs" ng-if="walletAmount" ng-bind-html="'you_have_amount_in_wallet' | translate:{ amount: numberFilter(walletAmount, 2), currency: currencySymbol }"></h3>
          <p ng-if="walletAmount > 0 && amount !== 0" class="text-italic" ng-bind-html="'credit_amount_for_pay_reservation' | translate:{ amount: numberFilter(amount, 2), currency: currencySymbol }"></p>

          <div class="form-group" ng-class="{'has-error': stripeForm.number.$dirty && stripeForm.number.$invalid}">
            <div class="col-sm-12">
              <input autocomplete="off" class="form-control card-number" placeholder="{{ 'enter_your_card_number' | translate }}" type="text" data-stripe="number" name="number" ng-model="cardNumero" required ng-minlength="14" ng-maxlength="16" ng-pattern="/^\d+$/">
            </div>
          </div>

          <div class="form-group">
            <div class="col-sm-4" ng-class="{'has-error': stripeForm.expMonth.$dirty && stripeForm.expMonth.$invalid}">
              <input class="form-control card-expiry-month" placeholder="MM" type="text" data-stripe="exp-month" name="expMonth" ng-model="expMonth" required ng-minlength="1" ng-maxlength="2" ng-pattern="/^\d+$/">
            </div>
            <div class="col-sm-4" ng-class="{'has-error': stripeForm.expYear.$dirty && stripeForm.expYear.$invalid}">
              <input class="form-control card-expiry-year" placeholder="YYYY" type="text" data-stripe="exp-year" name="expYear" ng-model="expYear" required ng-minlength="4" ng-maxlength="4" ng-pattern="/^\d+$/">
            </div>
            <div class="col-sm-4" ng-class="{'has-error': stripeForm.cvc.$dirty && stripeForm.cvc.$invalid}">
              <input autocomplete="off" class="form-control card-cvc" placeholder="CVC" type="text" data-stripe="cvc" name="cvc" ng-model="cvc" required ng-minlength="3" ng-maxlength="4" ng-pattern="/^\d+$/">
            </div>
          </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">{{ 'i_have_read_and_accept_' | translate }} <a href="{{cgv.custom_asset_file_attributes.attachment_url}}" target="_blank" translate>{{ '_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>
        <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)}" translate-interpolation="messageformat">{{ 'confirm_payment_of_html'}}</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>
    <%= image_tag("powered_by_stripe.png", class: 'm-r-sm') %>
    <%= image_tag("mastercard.png", class: 'm-r-sm') %>
    <%= image_tag("visa.png", class: 'm-r-sm') %>
  </div>


</div>
