Skip to content

Commit

Permalink
Merge pull request #29 from vanengers/master
Browse files Browse the repository at this point in the history
Third-party module compatibility: Quick checkout fix
  • Loading branch information
RicardoJ committed Dec 1, 2015
2 parents 7b5361c + 56e62e2 commit fdb03df
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
4 changes: 3 additions & 1 deletion catalog/model/payment/mollie/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ public function getMethod ($address, $total)
{
$payment_method = $this->getAPIClient()->methods->get(static::MODULE_NAME);

$amount = round($total, 2);
// Quick checkout provides an array wile the default checkout provides only the total.
$amount = is_array($total) ? $total[0]['value'] : round($total, 2);

$minimum = $payment_method->getMinimumAmount();
$maximum = $payment_method->getMaximumAmount();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,25 @@
<script type="text/javascript">
(function ($)
{

function initiateMollieConfirmClick(confirm_button_exists)
{
if (confirm_button_exists)
{
$("#qc_confirm_order").click(function ()
{
$("#mollie_payment_form").submit();
});
}
else
{
$("#button-confirm").click(function ()
{
$("#mollie_payment_form").submit();
});
}
}

// Run after pageload.
$(function ()
{
Expand All @@ -59,6 +78,8 @@
$("#mollie_payment_form").parent().show();
}

// render after change (for ajax checkouts)
initiateMollieConfirmClick(confirm_button_exists);
return;
}

Expand All @@ -75,6 +96,9 @@
{
$("#mollie_payment_form").submit();
});

// default confirm button render
initiateMollieConfirmClick(confirm_button_exists);
});
}) (window.jQuery || window.$);
</script>
Expand Down

0 comments on commit fdb03df

Please sign in to comment.