{% extends 'TopxiaAdminBundle::layout.html.twig' %}

{% set script_controller = 'system/payment' %}

{% set menu = 'admin_payment' %}

{% block main %}

{{ web_macro.flash_messages() }}

<form class="form-horizontal" method="post" id="payment-form" novalidate >
  
  <div class="form-group">
    <div class="col-md-3 control-label">
      <label >支付功能</label>
    </div>
    <div class="controls col-md-8 radios">
      {{ radios('enabled', {1:'开启', 0:'关闭'}, payment.enabled) }}
    </div>
  </div>

    <div class="form-group">
      <div class="col-md-3 control-label">
        <label for="disabled_message">支付关闭时的提示信息</label>
      </div>
      <div class="controls col-md-8">
        <textarea id="disabled_message" name="disabled_message" class="form-control">{{payment.disabled_message}}</textarea>
        <div class="help-block">提示信息支持HTML标签。</div>
      </div>
    </div>


  <fieldset>
    <legend>支付宝</legend>
    <div class="form-group">
      <div class="col-md-3 control-label">
        <label>接口状态</label>
      </div>
      <div class="controls col-md-8 radios">
        {{ radios('alipay_enabled', {1:'开启', 0:'关闭'}, payment.alipay_enabled) }}
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-3 control-label">
        <label for="alipay_key">接口类型</label>
      </div>
      <div class="controls col-md-8 radios">
        {{ radios('alipay_type', {'direct':'立即到账接口', 'escow': '担保交易接口', 'dualfun':'标准双接口' }, payment.alipay_type)}}
        <div class="help-block">
          支付宝规定，“立即到账接口”只能以企业名义申请，个人用户只能申请“担保交易接口”。
          <a href="http://www.edusoho.com/intro/96#payment" target="_blank">如何申请？</a>
          <br>
          "立即到账接口"如需在移动客户端使用，还需开通<a href="https://b.alipay.com/order/productDetail.htm?productId=2013080604609688" target="blank">手机网站支付</a>
          <br>
          “标准双接口”在2014-12-29日已被支付宝下线，此时间前申请成功的用户还可以在签约期内使用，建议签约担保交易以免过期后影响正常支付。
        </div>
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-3 control-label">
        <label for="alipay_key">PID</label>
      </div>
      <div class="controls col-md-8">
        <input type="text" id="alipay_key" name="alipay_key" class="form-control" value="{{payment.alipay_key}}">
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-3 control-label">
        <label for="alipay_key">Key</label>
      </div>
      <div class="controls col-md-8">
        <input type="text" id="alipay_secret" name="alipay_secret" class="form-control" value="{{payment.alipay_secret}}">
      </div>
    </div>

    <div class="form-group">
      <div class="col-md-3 control-label">
        <label for="alipay_key">支付宝账户</label>
      </div>
      <div class="controls col-md-8">
        <input type="text" id="alipay_account" name="alipay_account" class="form-control" value="{{payment.alipay_account}}">
        <div class="help-block">如需开启移动客户端支付，需填写支付宝账户。</div>
      </div>
    </div>

  </fieldset>

  <div class="form-group">
    <div class="col-md-3 control-label"></div>
    <div class="controls col-md-8">
      <button type="submit" class="btn btn-primary">提交</button>
    </div>
  </div>


  <input type="hidden" name="_csrf_token" value="{{ csrf_token('site') }}">
</form>

{% endblock %}