<?php
   /**
    * form
    *
    * @package Wojo Framework
    * @author wojoscripts.com
    * @copyright 2023
    * @version 5.50: form.tpl.php, v1.00 7/18/2023 8:10 AM Gewa Exp $
    *
    */
   if (!defined('_WOJO')) {
      die('Direct access to this location is not allowed.');
   }
?>
<form action="https://www.skrill.com/app/payment.pl" method="post" id="mb_form" name="mb_form" class="margin-top center-align">
   <a id="gSubmit" class="wojo white shadow icon button">
      <img class="wojo medium image" src="<?php echo SITEURL . '/gateways/skrill/skrill_logo.svg'; ?>" alt="<?php echo $this->gateway->displayname; ?>">
   </a>
   <input type="hidden" name="pay_to_email" value="<?php echo $this->gateway->extra; ?>">
   <input type="hidden" name="return_url" value="<?php echo Url::url('/dashboard'); ?>">
   <input type="hidden" name="cancel_url" value="<?php echo Url::url('/dashboard'); ?>">
   <input type="hidden" name="status_url" value="<?php echo SITEURL . '/gateways/' . $this->gateway->dir; ?>/shop/ipn.php"/>
   <input type="hidden" name="merchant_fields" value="session_id, item, custom"/>
   <input type="hidden" name="item" value="<?php echo time(); ?>"/>
   <input type="hidden" name="session_id" value="<?php echo md5(time()) ?>"/>
   <input type="hidden" name="custom" value="<?php echo Utility::encode(App::Auth()->uid . '_' . App::Auth()->sesid); ?>"/>
   <input type="hidden" name="amount" value="<?php echo Utility::numberParse($this->cart->grand); ?>"/>
   <input type="hidden" name="currency" value="<?php echo ($this->gateway->extra2)? : App::Core()->currency; ?>"/>
   <input type="hidden" name="detail1_description" value="<?php echo $this->core->company . ' - ' . Language::$word->CHECKOUT; ?>"/>
</form>
<script>
   $('#gSubmit').on('click', function () {
      $('#mb_form').submit();
   });
</script>