expressCart/views/themes/Material/pay.hbs

66 lines
3.6 KiB
Handlebars

<div class="col xl10 offset-xl1 s12">
<div class="row">
{{#if paymentMessage}}
<p class="text-danger text-center">{{paymentMessage}}</p>
{{/if}}
<div class="col m4">
<div class="card">
<div class="card-content">
<div class="row">
<span class="card-title">{{ @root.__ "Customer details" }}</span>
{{#unless session.customer}}
<p>{{ @root.__ "Existing customer" }}</p>
<div class="input-field col s12">
<input type="email" id="customerLoginEmail" name="loginEmail" minlength="5" placeholder="Email address" required>
</div>
<div class="input-field col s12">
<input type="password" class="form-control" id="customerLoginPassword" name="loginPassword" minlength="5" placeholder="Password" required>
</div>
<div class="input-field col s12 m6">
<a href="/customer/forgotten" class="btn waves-effect waves-light blue darken-3 pull-left">{{ @root.__ "Forgotten" }}</a>
</div>
<div class="input-field col s12 m6">
<button id="customerLogin" class="btn waves-effect waves-light blue darken-3 pull-right" type="submit">Login</button>
</div>
{{/unless}}
{{#if session.customer}}
<div class="col s12">
<button id="customerLogout" class="btn waves-effect waves-light blue darken-3 pull-right">{{ @root.__ "Change customer" }}</button>
</div>
{{/if}}
<form id="shipping-form" class="shipping-form" action="/{{config.paymentGateway}}/checkout_action{{@root.paymentType}}" method="post" role="form" data-toggle="validator" novalidate="false">
{{> themes/Material/shipping-form}}
{{#if session.customer}}
{{#ifCond config.paymentGateway '==' 'paypal'}}
{{> payments/paypal}}
{{/ifCond}}
{{/if}}
{{#unless session.customer}}
<div class="col s12">
<p class="text-muted">{{ @root.__ "Enter a password to create an account for next time" }}</p>
<div class="input-field col s12">
<input type="password" class="form-control customerDetails" id="newCustomerPassword" name="newCustomerPassword" placeholder="Password" required>
</div>
</div>
<div class="col s12">
<a id="createCustomerAccount" class="btn waves-effect waves-light blue darken-3 pull-right">{{ @root.__ "Create account" }}</a>
</div>
{{/unless}}
</form>
{{#if session.customer}}
{{#ifCond config.paymentGateway '==' 'stripe'}}
{{> partials/payments/stripe}}
{{/ifCond}}
{{#ifCond config.paymentGateway '==' 'authorizenet'}}
{{> partials/payments/authorizenet}}
{{/ifCond}}
{{/if}}
</div>
</div>
</div>
</div>
<div id="cart" class="col-md-7 col m7 offset-m1">
{{> themes/Material/cart}}
</div>
</div>
</div>