-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
account-paymentmethods.tpl
125 lines (117 loc) · 6.02 KB
/
account-paymentmethods.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{if $createSuccess}
{include file="$template/includes/alert.tpl" type="success" msg="<i class='fas fa-check fa-fw'></i> {lang key='paymentMethods.addedSuccess'}"}
{elseif $createFailed}
{include file="$template/includes/alert.tpl" type="warning" msg="<i class='fas fa-times fa-fw'></i> {lang key='paymentMethods.addFailed'}"}
{elseif $saveSuccess}
{include file="$template/includes/alert.tpl" type="success" msg="<i class='fas fa-check fa-fw'></i> {lang key='paymentMethods.updateSuccess'}"}
{elseif $saveFailed}
{include file="$template/includes/alert.tpl" type="warning" msg="<i class='fas fa-check fa-fw'></i> {lang key='paymentMethods.saveFailed'}"}
{elseif $setDefaultResult === true}
{include file="$template/includes/alert.tpl" type="success" msg="<i class='fas fa-check fa-fw'></i> {lang key='paymentMethods.defaultUpdateSuccess'}"}
{elseif $setDefaultResult === false}
{include file="$template/includes/alert.tpl" type="warning" msg="<i class='fas fa-times fa-fw'></i> {lang key='paymentMethods.defaultUpdateFailed'}"}
{elseif $deleteResult === true}
{include file="$template/includes/alert.tpl" type="success" msg="<i class='fas fa-check fa-fw'></i> {lang key='paymentMethods.deleteSuccess'}"}
{elseif $deleteResult === false}
{include file="$template/includes/alert.tpl" type="warning" msg="<i class='fas fa-times fa-fw'></i> {lang key='paymentMethods.deleteFailed'}"}
{/if}
<div class="card">
<div class="card-body">
<h3 class="card-title">{lang key='paymentMethods.title'}</h3>
<p>{lang key='paymentMethods.intro'}</p>
<p>
{if $allowCreditCard}
<a href="{routePath('account-paymentmethods-add')}" class="btn btn-primary" data-role="add-new-credit-card">
{lang key='paymentMethods.addNewCC'}
</a>
{/if}
{if $allowBankDetails}
<a href="{routePathWithQuery('account-paymentmethods-add', null, 'type=bankacct')}" class="btn btn-default">
{lang key='paymentMethods.addNewBank'}
</a>
{/if}
</p>
<table class="table table-striped" id="payMethodList">
<tr>
<th></th>
<th>{lang key='paymentMethods.name'}</th>
<th>{lang key='paymentMethods.description'}</th>
<th>{lang key='paymentMethods.status'}</th>
<th colspan="2">{lang key='paymentMethods.actions'}</th>
</tr>
{foreach $client->payMethods->validateGateways() as $payMethod}
<tr>
<td>
<i class="{$payMethod->getFontAwesomeIcon()}"></i>
</td>
<td>{$payMethod->payment->getDisplayName()}</td>
<td>
{if $payMethod->description}
{$payMethod->description}
{else}
-
{/if}
</td>
<td>{$payMethod->getStatus()}{if $payMethod->isDefaultPayMethod()} - {lang key='paymentMethods.default'}{/if}</td>
<td>
<a href="{routePath('account-paymentmethods-setdefault', $payMethod->id)}" class="btn btn-sm btn-default btn-set-default{if $payMethod->isDefaultPayMethod() || $payMethod->isExpired()} disabled{/if}">
{lang key='paymentMethods.setAsDefault'}
</a>
<a href="{routePath('account-paymentmethods-view', $payMethod->id)}" class="btn btn-sm btn-default{if $payMethod->getType() == 'RemoteBankAccount'} disabled{/if}" data-role="edit-payment-method">
<i class="fas fa-pencil"></i>
{lang key='paymentMethods.edit'}
</a>
{if $allowDelete}
<a href="{routePath('account-paymentmethods-delete', $payMethod->id)}" class="btn btn-sm btn-default btn-delete">
<i class="fas fa-trash"></i>
{lang key='paymentMethods.delete'}
</a>
{/if}
</td>
</tr>
{foreachelse}
<tr>
<td colspan="6" align="center">
{lang key='paymentMethods.noPaymentMethodsCreated'}
</td>
</tr>
{/foreach}
</table>
</div>
</div>
<form method="post" action="" id="frmDeletePaymentMethod">
<div class="modal fade" id="modalPaymentMethodDeleteConfirmation" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title" id="myModalLabel">{lang key='paymentMethods.areYouSure'}</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<p>{lang key='paymentMethods.deletePaymentMethodConfirm'}</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{lang key='no'}</button>
<button type="submit" class="btn btn-primary">{lang key='yes'}</button>
</div>
</div>
</div>
</div>
</form>
<form method="post" action="" id="frmSetDefaultPaymentMethod"></form>
<script>
jQuery(document).ready(function() {
jQuery('.btn-set-default').click(function(e) {
e.preventDefault();
jQuery('#frmSetDefaultPaymentMethod')
.attr('action', jQuery(this).attr('href'))
.submit();
});
jQuery('.btn-delete').click(function(e) {
e.preventDefault();
jQuery('#frmDeletePaymentMethod')
.attr('action', jQuery(this).attr('href'));
jQuery('#modalPaymentMethodDeleteConfirmation').modal('show');
});
});
</script>