<?php
    if (is_file(realpath('system/stripe-php/init.php'))) {
      require_once(realpath('system/stripe-php/init.php'));
    }


    // Set your secret key. Remember to switch to your live secret key in production.
    // See your keys here: https://dashboard.stripe.com/apikeys
    \Stripe\Stripe::setApiKey('sk_live_wz1r8mYdFPWPPAMLDrFMrj4P');  //   sk_live_wz1r8mYdFPWPPAMLDrFMrj4P


    
    $setup_intent = \Stripe\SetupIntent::create([
        'payment_method_types' => ['au_becs_debit'],
    ]);
    $client_secret = $setup_intent->client_secret;
 
  




  
  
  

   


    
?>

<div class="modal fade" tabindex="-1" role="dialog" id="modalIsDeviceInstalled">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">ACTIVATION</h4>
      </div>
      <div class="modal-body">
        <p>Has the device been installed and the asset currently has power ?</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-dark changeIsInstalled" data-is-installed="no" data-dismiss="modal">No</button>
        <button type="button" class="btn form_submit changeIsInstalled" data-is-installed="yes" data-dismiss="modal">Yes</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<div class="modal fade" tabindex="-1" role="dialog" id="modalDeviceInstalledWarning">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">Warning</h4>
      </div>
      <div class="modal-body">
        <p>The systems requires a series of commands to configure the unit and your account, please ensure the system is installed and has power within 3 days of activation.</p>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn form_submit" data-dismiss="modal">OK</button>
      </div>
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<div class="modal fade" tabindex="-1" role="dialog" id="modalStripePayment">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">Enter Payment Details</h4>
      </div>
      <div class="modal-body strip-payment-wrapper">
        <form id="payment-form">
          <div id="card-element"><!--Stripe.js injects the Card Element--></div>
          <button id="submit">
            <div class="spinner hidden" id="spinner"></div>
            <span id="button-text">Pay</span>
          </button>
          <p id="card-error" role="alert"></p>
          <p class="result-message hidden">
            Payment succeeded, see the result in your
            <a href="" target="_blank">Stripe dashboard.</a> Refresh the page to pay again.
          </p>
        </form>
      </div>
      <!-- <div class="modal-footer">
         <button type="button" class="btn form_submit" data-dismiss="modal">OK</button>
       </div>-->
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->


<div class="modal fade" tabindex="-1" role="dialog" id="modalStripePaymentBSB">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">Enter Payment Details</h4>
      </div>
      <div class="modal-body strip-payment-wrapper">
        <form id="payment-form-becs">
            <div class="sr-combo-inputs-row">
              <label for="au-bank-account-element" style="margin-bottom: 20px;">
                Bank Account
              </label>
              <div id="au-bank-account-element">
              </div>
            </div>
            <div id="bank-name"></div>
           <button id="submit-button-becs" data-secret="<?php echo($client_secret) ?>" style="margin-top: 10px;">
            <div class="spinner hidden" id="spinner"></div>
            <span id="button-text" >Pay</span>
          </button>
          <p id="card-error" role="alert"></p>
    
        </form>
      </div>
      <!-- <div class="modal-footer">
         <button type="button" class="btn form_submit" data-dismiss="modal">OK</button>
       </div>-->
    </div><!-- /.modal-content -->
  </div><!-- /.modal-dialog -->
</div><!-- /.modal -->


