{#
Copyright (c) 2018 VeriTrans Inc., a Digital Garage company. All rights reserved.
http://www.veritrans.co.jp/
#}
{{ include('VeriTrans4G2/Resource/template/default/js/vt4g_credit_js.twig') }}
{{ include('VeriTrans4G2/Resource/template/default/css/vt4g_css.twig') }}
{% form_theme form 'Form/form_div_layout.twig' %}
<script>
$(function () {
$('.vt4g_payment_credit').appendTo($('.ec-orderPayment').first());
})
</script>
<div class="vt4g_payment_credit">
{# ベリトランス会員ID決済 入力フォーム #}
{% if useAccountPayment and accountCards is not empty %}
<div class="accordion_one">
<div id="vt4g-credit-account" class="ec-rectHeading">
<h2 class="vt4g_toggle_title">
登録済みクレジットカード決済
<div class ="vt4g_toggle_btn">
<span class="plus-dark-icon change-class"></span>
</div>
</h2>
<div class="accordion_inner">
{{ form_widget(accountForm._token) }}
<input type="hidden" name="mode" value="account">
<p class="ec-para-normal">決済に利用するカードを選択してください。</p>
{% if isCardMaxOver %}
<p class="ec-para-normal ec-color-red">登録できるカード情報が上限に達しているため、新しいカード情報でお支払いはできません。</p>
<p class="ec-para-normal ec-color-red">新しいカード情報でお支払いの場合は、マイページから使用しないカード情報を削除してください。</p>
{% endif %}
<p class="ec-color-red ec-para-normal"></p>
<div class="ec-borderedDefs">
<dl>
<dt><label class="ec-label"><p>登録済みの</p>クレジットカード番号</label><span class="ec-required">必須</span></dt>
<dd>
<table class="table table-bordered">
<thead>
<tr class="active">
<th>カード番号</th>
<th>有効期限</th>
</tr>
</thead>
<tbody>
{% for index, card in accountCards %}
<tr>
<td class="ec-blockRadio">
<label>
<input name="card_id" type="radio" value="{{ card.cardId }}" {% if card.isDefault %}checked{% endif %}>
<span>{{ card.cardNumber }}</span>
</label>
<input type = "hidden" name = "registered_mask_card_number" value="{{ card.cardNumber }}">
<input type = "hidden" class = "registered_card_name" value="{{ card.registeredCardName }}">
</td>
<td>{{ card.expire }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<input type = "hidden" id = "account_mask_card_number" name = "account_mask_card_number">
</dd>
</dl>
<dl>
<dt><label class="ec-label">お支払い方法</label><span class="ec-required">必須</span></dt>
<dd>
<div class="ec-select {% if accountForm.payment_type.vars.errors is not empty %}error{% endif %}">
{{ form_widget(accountForm.payment_type) }}
<p class="ec-errorMessage">{{ form_errors(accountForm.payment_type) }}</p>
</div>
</dd>
</dl>
{% if paymentInfo.mpi_flg is defined and paymentInfo.mpi_flg %}
<dl>
<dt><label for="payment_credit_account_card_name" class="ec-label">カード名義人名</label><span class="ec-required">必須</span></dt>
<dd>
<div class="ec-input {% if accountForm.card_name.vars.errors is not empty %}error{% endif %}">
{{ form_widget(accountForm.card_name) }}
<p class="ec-para-normal">(例: TARO YAMADA)</p>
{{ form_errors(accountForm.card_name) }}
</div>
</dd>
</dl>
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
{# 再取引 入力フォーム #}
{% if useReTradePayment and reTradeCards is not empty %}
<div class="accordion_one">
<div id="vt4g-credit-retrade" class="ec-rectHeading">
<h2 class="vt4g_toggle_title">
かんたん決済 (前回ご利用カードでのお支払い)
<div class ="vt4g_toggle_btn">
<span class="plus-dark-icon change-class"></span>
</div>
</h2>
<div class="accordion_inner">
{{ form_widget(oneClickForm._token) }}
<input type="hidden" name="mode" value="retrade">
<p class="ec-para-normal">決済に利用するカードを選択してください。</p>
<p class="ec-color-red ec-para-normal"></p>
<div class="ec-borderedDefs">
<dl>
<dt><label class="ec-label">これまでの<p>クレジットカード番号</p></label><span class="ec-required">必須</span></dt>
<dd>
<table class="table table-bordered">
<thead>
<tr class="active">
<th>カード番号</th>
<th>ご注文日時</th>
</tr>
</thead>
<tbody>
{% for index, card in reTradeCards %}
<tr>
<td class="ec-blockRadio">
<label>
<input name="payment_order_id" type="radio" value="{{ card.paymentOrderId }}" {% if index is same as(0) %}checked{% endif %}>
<span>{{ card.cardNumber }}</span>
</label>
<input type = "hidden" name = "registered_mask_card_number" value="{{ card.cardNumber }}">
<input type = "hidden" class = "registered_card_name" value="{{ card.registeredCardName }}">
</td>
<td>{{ card.orderDate }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<input type = "hidden" id = "retrade_mask_card_number" name = "retrade_mask_card_number">
</dd>
</dl>
<dl>
<dt><label class="ec-label">お支払い方法</label><span class="ec-required">必須</span></dt>
<dd>
<div class="ec-select {% if oneClickForm.payment_type.vars.errors is not empty %}error{% endif %}">
{{ form_widget(oneClickForm.payment_type) }}
<p class="ec-errorMessage">{{ form_errors(oneClickForm.payment_type) }}</p>
</div>
</dd>
</dl>
{% if paymentInfo.mpi_flg is defined and paymentInfo.mpi_flg %}
<dl>
<dt><label for="payment_credit_retrade_card_name" class="ec-label">カード名義人名</label><span class="ec-required">必須</span></dt>
<dd>
<div class="ec-input {% if oneClickForm.card_name.vars.errors is not empty %}error{% endif %}">
{{ form_widget(oneClickForm.card_name) }}
<p class="ec-para-normal">(例: TARO YAMADA)</p>
{{ form_errors(oneClickForm.card_name) }}
</div>
</dd>
</dl>
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
{# クレジットカード情報 入力フォーム #}
{% if not isCardMaxOver %}
<div class="accordion_one">
<div id="vt4g-credit" class="ec-rectHeading">
<input type="hidden" name="token_id" value="">
<input type="hidden" name="token_expire_date" value="">
<input type="hidden" name="mask_card_number" value="">
<input type="hidden" name="subsc_order_flg" value="{{ subscOrderFlg }}">
<h2 class="vt4g_toggle_title">
{{ title }}
<div class ="vt4g_toggle_btn">
<span class="plus-dark-icon change-class"></span>
</div>
</h2>
<div class="accordion_inner">
{{ form_widget(form._token) }}
<input type="hidden" name="mode" value="next">
<p class="ec-color-red ec-para-normal" id="vt4g_form_credit_error"></p>
{% if ('vt4g_plugin.shopping.credit.token.timelimit'|trans) != 'vt4g_plugin.shopping.credit.token.timelimit' %}
<p class="ec-para-normal ec-color-red">{{ 'vt4g_plugin.shopping.credit.token.timelimit'|trans }}</p>
{% endif %}
<div class="ec-borderedDefs">
<dl>
<dt><label for="vt4g_card_no" class="ec-label">クレジットカード番号</label><span class="ec-required">必須</span></dt>
<dd>
<div class="ec-input {% if form.card_no.vars.errors is not empty %}error{% endif %}">
{{ form_widget(form.card_no, {"id": "vt4g_card_no"}) }}
{{ form_errors(form.card_no) }}
</div>
</dd>
</dl>
<dl>
<dt><label for="vt4g_expiry_mon" class="ec-label">カード有効期限</label><span class="ec-required">必須</span></dt>
<dd>
<div class="ec-select {% if form.expiry_month.vars.errors is not empty or form.expiry_year.vars.errors is not empty %}error{% endif %}">
{{ form_widget(form.expiry_month, {"id": "vt4g_expiry_mon"}) }}月 / 20{{ form_widget(form.expiry_year) }}年
{{ form_errors(form.expiry_month) }}
{{ form_errors(form.expiry_year) }}
</div>
</dd>
</dl>
<dl>
<dt><label for="payment_credit_card_name" class="ec-label">カード名義人名</label><span class="ec-required">必須</span></dt>
<dd>
<div class="ec-input {% if form.card_name.vars.errors is not empty %}error{% endif %}">
{{ form_widget(form.card_name) }}
<p class="ec-para-normal">(例: TARO YAMADA)</p>
{{ form_errors(form.card_name) }}
</div>
</dd>
</dl>
{% if paymentInfo.security_flg is defined and paymentInfo.security_flg %}
<dl>
<dt><label for="payment_credit_sec_code" class="ec-label">セキュリティコード</label><span class="ec-required">必須</span></dt>
<dd>
<div class="ec-halfInput {% if form.sec_code.vars.errors is not empty %}error{% endif %}">
{{ form_widget(form.sec_code) }}
<p class="ec-para-normal">(例: 123)</p>
{{ form_errors(form.sec_code) }}
</div>
</dd>
</dl>
{% endif %}
<dl>
<dt><label for="payment_credit_payment_type" class="ec-label">お支払い方法</label><span class="ec-required">必須</span></dt>
<dd>
<div class="ec-select {% if form.payment_type.vars.errors is not empty %}error{% endif %}">
{{ form_widget(form.payment_type) }}
<p class="ec-errorMessage">{{ form_errors(form.payment_type) }}</p>
</div>
</dd>
</dl>
{% if cardRegistFlg %}
<dl>
<dt><label for="payment_credit_cardinfo_regist" class="ec-label">カード情報登録</label><span class="ec-required">必須</span></dt>
<dd>
<div class="ec-radio {% if form.cardinfo_regist.vars.errors is not empty %}error{% endif %}">
{{ form_widget(form.cardinfo_regist) | spaceless }}
{{ form_errors(form.cardinfo_regist) }}
</div>
</dd>
</dl>
{% endif %}
{% if cardRetradeFlg %}
<dl>
<dt>
<label for="payment_credit_cardinfo_retrade" class="ec-label">かんたん決済</label><span class="ec-required">必須</span>
<div>【利用する】を選択いただくと次回購入時にカード情報の入力を省くことができます。</div>
</dt>
<dd>
<div class="ec-radio {% if form.cardinfo_retrade.vars.errors is not empty %}error{% endif %}">
{{ form_widget(form.cardinfo_retrade) | spaceless }}
{{ form_errors(form.cardinfo_retrade) }}
</div>
</dd>
</dl>
{% endif %}
</div>
</div>
</div>
</div>
{% endif %}
</div>