Skip to content

Commit

Permalink
MAGE-536: Fix AmzPay Checkout, Paypal Checkout, config export, and on…
Browse files Browse the repository at this point in the history
…epage checkout template behaviour
  • Loading branch information
Vincent Boulanger committed Apr 26, 2024
1 parent a814a3a commit 437f671
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
12 changes: 12 additions & 0 deletions js/payone/core/opcheckoutmod.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});
});
}
12 changes: 12 additions & 0 deletions js/payone/core/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

0 comments on commit 437f671

Please sign in to comment.