-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Quoc Dat Pham
committed
Aug 30, 2017
1 parent
61653a9
commit 7b5ed77
Showing
4 changed files
with
152 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
lemonway.ocmod/upload/catalog/model/extension/payment/lemonway.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
lemonway.ocmod/upload/catalog/view/theme/default/template/extension/payment/lemonway.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
<div> | ||
<h3 class="lemonway-method-title"> | ||
{{ text_card }} | ||
</h3> | ||
<div> | ||
<form action="{{ link_checkout }}" method="POST"> | ||
{% if lemonway_oneclick_enabled and customerId %} {# Hide One-click form from guest #} | ||
{% if card %} {# User already have a saved card. He can choose to use it or not #} | ||
<div> | ||
<div class="radio"> | ||
<label> | ||
<input type="radio" class="hide_cards" name="lemonway_oneclick" value="use_card" checked /> | ||
{{ text_use_card }} (<em>{{ card['card_num'] }}</em> - <em>{{ card['card_exp'] }}</em>) | ||
</label> | ||
</div> | ||
<div class="radio"> | ||
<label> | ||
<input type="radio" class="show_cards" name="lemonway_oneclick" value="register_card" /> | ||
{{ text_save_new_card }} | ||
</label> | ||
</div> | ||
<div class="radio"> | ||
<label> | ||
<input type="radio" class="show_cards" name="lemonway_oneclick" value="no_use_card" /> | ||
{{ text_not_use_card }} | ||
</label> | ||
</div> | ||
</div> | ||
{% endif %} | ||
{% endif %} | ||
|
||
<!-- Choose a card type --> | ||
<!-- If the user choose to use a saved card, he doesn't need to choose a card type --> | ||
<div id="card_choosing_container" style="{{ (lemonway_oneclick_enabled and customerId and card) ? 'display: none' : '' }}"> | ||
<div class="row"> | ||
<div class="col-md-1 text-center"> | ||
<label> | ||
<img class="img-responsive" alt="CB" src="catalog/view/theme/default/image/lemonway_cb.gif"> | ||
<input type="radio" name="cc_type" value="CB" checked /> | ||
</label> | ||
</div> | ||
<div class="col-md-1 text-center"> | ||
<label> | ||
<img class="img-responsive" alt="Visa" src="catalog/view/theme/default/image/lemonway_visa.gif"> | ||
<input type="radio" name="cc_type" value="VISA" /> | ||
</label> | ||
</div> | ||
<div class="col-md-1 text-center"> | ||
<label> | ||
<img class="img-responsive" alt="MasterCard" src="catalog/view/theme/default/image/lemonway_mastercard.gif"> | ||
<input type="radio" name="cc_type" value="MASTERCARD" /> | ||
</label> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="buttons"> | ||
<div class="pull-right"> | ||
{% if lemonway_oneclick_enabled and customerId %} {# Hide One-click form from guest #} | ||
{% if not card %} {# If no saved card => Ask to save the card #} | ||
<!-- User can choose to save his card --> | ||
<label> | ||
{{ text_save_card }} | ||
<input type="checkbox" name="lemonway_oneclick" value="register_card" /> | ||
</label> | ||
{% endif %} | ||
{% endif %} | ||
<button type="submit" data-toggle="tooltip" class="btn btn-primary" data-loading-text="{{ text_loading }}"> | ||
{{ button_continue }} | ||
</button> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
$(function() | ||
{ | ||
// If using a saved card, hide the card choices | ||
$(".hide_cards").click(function() | ||
{ | ||
$('#card_choosing_container').hide(300); | ||
}); | ||
// If not using a saved card, show the card choices | ||
$(".show_cards").click(function() | ||
{ | ||
$('#card_choosing_container').show(300); | ||
}) | ||
}); | ||
</script> |