Skip to content

[Shop] Enable credit card payment #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions assets/shop/js/mollie/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ document.addEventListener('DOMContentLoaded', function () {
if (!checkbox) {
return null;
}
let parentElement = checkbox.parentNode;

return parentElement.classList.contains('checked') ? 1 : 0;
return checkbox.checked ? 1 : 0;
}

function createMolliePayment(url, paymentMethod, issuer = null) {
Expand Down Expand Up @@ -311,9 +309,8 @@ document.addEventListener('DOMContentLoaded', function () {
if (!checkbox) {
return null;
}
let parentElement = checkbox.parentNode;

return parentElement.classList.contains('checked') ? 1 : 0;
return checkbox.checked ? 1 : 0;
}

function toggleMollieComponents() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% if (true == hookable_metadata.context.gateway_config.config['single_click_enabled'] | default(false)) and getCustomerFromContext() %}
<div class="ui toggle checkbox checked">
<input type="checkbox" id="mollie-sylius-save-credit-card" name="mollie-sylius-save-credit-card"
value="1" tabindex="0" class="hidden" checked>
<label for="mollie-sylius-save-credit-card">{{ 'sylius_mollie.ui.save_card'|trans }}</label>
<div>
<label class="form-check">
<input type="checkbox" id="mollie-sylius-save-credit-card" checked>
<span>{{ 'sylius_mollie.ui.save_card'|trans }}</span>
</label>
</div>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
{% if single_click_enabled and getCustomerFromContext() %}
{% if (isCardSaved(hookable_metadata.context.order.customer.email)) %}
<div class="mollie-components-use-saved-card">
<div class="ui toggle checkbox checked">
<input type="checkbox" id="mollie-sylius-use-saved-credit-card"
name="mollie-sylius-use-saved-credit-card" value="1" tabindex="0" class="hidden" checked>
<label
for="mollie-sylius-use-saved-credit-card">{{ 'sylius_mollie.ui.use_saved_card'|trans }}</label>
<div>
<label class="form-check">
<input type="checkbox" id="mollie-sylius-use-saved-credit-card" checked>
<span>{{ 'sylius_mollie.ui.use_saved_card'|trans }}</span>
</label>
</div>
</div>
{% endif %}
Expand Down