diff --git a/app/code/community/Payone/Core/Model/Config/Protect/Creditrating.php b/app/code/community/Payone/Core/Model/Config/Protect/Creditrating.php index e05fceb4..e6ac6625 100644 --- a/app/code/community/Payone/Core/Model/Config/Protect/Creditrating.php +++ b/app/code/community/Payone/Core/Model/Config/Protect/Creditrating.php @@ -257,7 +257,7 @@ public function getResultLifetime() */ public function getResultLifetimeInSeconds() { - return $this->result_lifetime * 24 * 3600; + return (is_int($this->result_lifetime) ? $this->result_lifetime : 0) * 24 * 3600; } /** diff --git a/app/code/community/Payone/Core/Model/Service/Amazon/Pay/Checkout.php b/app/code/community/Payone/Core/Model/Service/Amazon/Pay/Checkout.php index a11a019f..d796319f 100644 --- a/app/code/community/Payone/Core/Model/Service/Amazon/Pay/Checkout.php +++ b/app/code/community/Payone/Core/Model/Service/Amazon/Pay/Checkout.php @@ -136,7 +136,7 @@ public function confirmSelection($params) $this->quote->getPayment()->importData([ 'method' => $paymentMethodCode, 'payone_config_payment_method_id' => $this->config->getId(), - 'checks' => [], + 'checks' => 0, ]); $this->quote->setTotalsCollectedFlag(false); diff --git a/app/code/community/Payone/Core/Model/Service/Paypal/Express/Checkout.php b/app/code/community/Payone/Core/Model/Service/Paypal/Express/Checkout.php index f0c36c2e..695a8062 100644 --- a/app/code/community/Payone/Core/Model/Service/Paypal/Express/Checkout.php +++ b/app/code/community/Payone/Core/Model/Service/Paypal/Express/Checkout.php @@ -160,7 +160,7 @@ public function savePayment($data) // | Mage_Payment_Model_Method_Abstract::CHECK_ORDER_TOTAL_MIN_MAX // | Mage_Payment_Model_Method_Abstract::CHECK_ZERO_TOTAL; - $data['checks'] = array(); + $data['checks'] = 0; $payment = $this->_quote->getPayment(); diff --git a/js/payone/core/opcheckoutmod.js b/js/payone/core/opcheckoutmod.js index 3e54d203..6481be02 100644 --- a/js/payone/core/opcheckoutmod.js +++ b/js/payone/core/opcheckoutmod.js @@ -12,3 +12,15 @@ if (Review) { return superMethod(transport); }); } + +if (Payment) { + Payment.prototype.addAfterInitFunction('fcpoVisibleSelectedMethod', function() { + let methodsSelectors = document.getElementsByName('payment[method]'); + + methodsSelectors.forEach(function(input){ + if (input.checked) { + input.click(); + } + }); + }); +} diff --git a/js/payone/core/shared.js b/js/payone/core/shared.js index 1b43ed39..6eabf117 100644 --- a/js/payone/core/shared.js +++ b/js/payone/core/shared.js @@ -130,4 +130,16 @@ function changeSubmitButtonStatus(checkboxEl) $$('.btn-checkout')[0].setAttribute("disabled", "disabled"); $$('.btn-checkout')[0].hide(); } +} + +/** + * @param elem + */ +function enableElement(elem) { + if (elem == undefined) { + return; + } + + elem.disabled = false; + elem.removeClassName('disabled'); } \ No newline at end of file