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/Domain/Resource/Protocol/TransactionStatus/Collection.php b/app/code/community/Payone/Core/Model/Domain/Resource/Protocol/TransactionStatus/Collection.php
index ef8ecad3..5d793659 100644
--- a/app/code/community/Payone/Core/Model/Domain/Resource/Protocol/TransactionStatus/Collection.php
+++ b/app/code/community/Payone/Core/Model/Domain/Resource/Protocol/TransactionStatus/Collection.php
@@ -49,6 +49,9 @@ public function _construct()
public function getByOrder(Mage_Sales_Model_Order $order)
{
$this->addFieldToFilter('order_id', $order->getId());
+ if ($order->getData('increment_id') != 0) {
+ $this->addFilter('reference', $order->getData('increment_id'), 'or');
+ }
}
/**
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/app/code/community/Payone/Core/controllers/TransactionStatusController.php b/app/code/community/Payone/Core/controllers/TransactionStatusController.php
index 9474592a..01b7d070 100644
--- a/app/code/community/Payone/Core/controllers/TransactionStatusController.php
+++ b/app/code/community/Payone/Core/controllers/TransactionStatusController.php
@@ -79,6 +79,27 @@ public function indexAction()
// Handle Request:
$response = $service->handleByPost();
+ /**
+ * MAGE-536 : Fix missing OrderId and StoreId in TxStatus when reference exists
+ */
+ if ($response->getStatus() == 'TSOK') {
+ /** @var $transactionStatusCollection Payone_Core_Model_Domain_Resource_Protocol_TransactionStatus_Collection */
+ $transactionStatusCollection = Mage::getModel('payone_core/domain_protocol_transactionStatus')
+ ->getCollection();
+ $transactionStatusCollection->getItemsByColumnValue('reference', $reference);
+
+ /** @var Payone_Core_Model_Domain_Protocol_TransactionStatus $transactionStatus */
+ foreach ($transactionStatusCollection as $transactionStatus) {
+ if (empty($transactionStatus->getOrderId())) {
+ $transactionStatus->setOrderId($order->getId());
+ }
+ if (empty($transactionStatus->getStoreId())) {
+ $transactionStatus->setStoreId($order->getStoreId());
+ }
+ $transactionStatus->save();
+ }
+ }
+
// NEW forwarding handling
$this->_forwardStatus($order);
diff --git a/app/design/frontend/base/default/template/payone/core/payment/method/form/onlinebanktransfer.phtml b/app/design/frontend/base/default/template/payone/core/payment/method/form/onlinebanktransfer.phtml
index 91a557dd..a9705004 100644
--- a/app/design/frontend/base/default/template/payone/core/payment/method/form/onlinebanktransfer.phtml
+++ b/app/design/frontend/base/default/template/payone/core/payment/method/form/onlinebanktransfer.phtml
@@ -52,8 +52,8 @@ $getOnlineBankTransferType = $this->onlineBankTransferTypeMapping();
-
+
diff --git a/app/design/frontend/base/default/template/payone/core/payment/method/form/onlinebanktransfertrustly.phtml b/app/design/frontend/base/default/template/payone/core/payment/method/form/onlinebanktransfertrustly.phtml
index cf82f963..1c98876c 100644
--- a/app/design/frontend/base/default/template/payone/core/payment/method/form/onlinebanktransfertrustly.phtml
+++ b/app/design/frontend/base/default/template/payone/core/payment/method/form/onlinebanktransfertrustly.phtml
@@ -124,10 +124,16 @@ if ($paymentConfigId == 0) {
-
+
+
diff --git a/js/payone/core/amazonpay.js b/js/payone/core/amazonpay.js
index f1d2497c..ebdfdf5d 100644
--- a/js/payone/core/amazonpay.js
+++ b/js/payone/core/amazonpay.js
@@ -199,7 +199,11 @@ window.onDocumentReady = function () {
$('confirmSelection').onclick = function (event) {
event.preventDefault();
- window.onCheckoutProgress(event.currentTarget);
+ if (event.currentTarget != null) {
+ window.onCheckoutProgress(event.currentTarget);
+ } else {
+ window.onCheckoutProgress(event.target);
+ }
};
$('placeOrder').onclick = function (event) {
event.preventDefault();
@@ -207,7 +211,12 @@ window.onDocumentReady = function () {
PayoneCheckout.amazonSellerId,
PayoneCheckout.amazonOrderReferenceId,
function(confirmationFlow) {
- placeOrder(event.currentTarget, confirmationFlow);
+ if (event.currentTarget != null) {
+ placeOrder(event.currentTarget, confirmationFlow);
+ } else {
+ placeOrder(event.target, confirmationFlow);
+ }
+
}
);
};
diff --git a/js/payone/core/onlinebanktransfer.js b/js/payone/core/onlinebanktransfer.js
index 886f345b..770f453e 100644
--- a/js/payone/core/onlinebanktransfer.js
+++ b/js/payone/core/onlinebanktransfer.js
@@ -49,7 +49,9 @@ function payoneSwitchOnlineBankTransfer(typeCode, methodCode, element, country,
var giropayPaymentMethodContainer = $("dt_method_payone_online_bank_transfer_giropay") || $('p_method_payone_online_bank_transfer_giropay');
var pffPaymentMethodContainer = $("dt_method_payone_online_bank_transfer_pff") || $('p_method_payone_online_bank_transfer_pff');
var sofortPaymentMethodContainer = $("dt_method_payone_online_bank_transfer_sofortueberweisung") || $('p_method_payone_online_bank_transfer_sofortueberweisung');
-
+ var p24PaymentMethodContainer = $("dt_method_payone_online_bank_transfer_p24") || $('p_method_payone_online_bank_transfer_p24');
+ var pfcPaymentMethodContainer = $("dt_method_payone_online_bank_transfer_pfc") || $('p_method_payone_online_bank_transfer_pfc');
+ var bctPaymentMethodContainer = $("dt_method_payone_online_bank_transfer_bct") || $('p_method_payone_online_bank_transfer_bct');
function enableBankGroupNl() {
@@ -100,6 +102,7 @@ function payoneSwitchOnlineBankTransfer(typeCode, methodCode, element, country,
if(epsPaymentMethodContainer) {
epsPaymentMethodContainer.on("click", function (event) {
disableAll();
+ onlineBankTransferTypeSwitch(methodCode);
enableBankGroupAt();
});
}
@@ -108,6 +111,7 @@ function payoneSwitchOnlineBankTransfer(typeCode, methodCode, element, country,
if (idlPaymentMethodContainer) {
idlPaymentMethodContainer.on("click", function (event) {
disableAll();
+ onlineBankTransferTypeSwitch(methodCode);
enableBankGroupNl();
});
}
@@ -116,6 +120,7 @@ function payoneSwitchOnlineBankTransfer(typeCode, methodCode, element, country,
if (giropayPaymentMethodContainer) {
giropayPaymentMethodContainer.on("click", function (event) {
disableAll();
+ onlineBankTransferTypeSwitch(methodCode);
enableSepaIban();
enableSepaBic();
});
@@ -127,6 +132,7 @@ function payoneSwitchOnlineBankTransfer(typeCode, methodCode, element, country,
if(pffPaymentMethodContainer){
pffPaymentMethodContainer.on("click", function (event) {
disableAll();
+ onlineBankTransferTypeSwitch(methodCode);
});
}
}
@@ -135,6 +141,7 @@ function payoneSwitchOnlineBankTransfer(typeCode, methodCode, element, country,
if(sofortPaymentMethodContainer){
sofortPaymentMethodContainer.on("click", function (event) {
disableAll();
+ onlineBankTransferTypeSwitch(methodCode);
if (sofortueberweisungShowIban.value == 1) {
enableSepaIban();
enableSepaBic();
@@ -148,8 +155,31 @@ function payoneSwitchOnlineBankTransfer(typeCode, methodCode, element, country,
}
}
- if (typeCode === 'PFC' || typeCode === 'P24' || typeCode === 'BCT') {
+ if (typeCode == 'P24') {
+ disableAll();
+ if(p24PaymentMethodContainer) {
+ p24PaymentMethodContainer.on("click", function (event) {
+ onlineBankTransferTypeSwitch(methodCode);
+ });
+ }
+ }
+
+ if (typeCode == 'PFC') {
disableAll();
+ if(pfcPaymentMethodContainer) {
+ pfcPaymentMethodContainer.on("click", function (event) {
+ onlineBankTransferTypeSwitch(methodCode);
+ });
+ }
+ }
+
+ if (typeCode == 'BCT') {
+ disableAll();
+ if(bctPaymentMethodContainer) {
+ bctPaymentMethodContainer.on("click", function (event) {
+ onlineBankTransferTypeSwitch(methodCode);
+ });
+ }
}
function disableAll() {
@@ -181,6 +211,27 @@ function payoneSwitchOnlineBankTransfer(typeCode, methodCode, element, country,
}
+function onlineBankTransferTypeSwitch(methodCode) {
+ let btTypeInputs = document.getElementsByName('payment[payone_onlinebanktransfer_type]');
+ let btMethodInputs = document.getElementsByName('payment[payone_config_payment_method_id]');
+
+ btTypeInputs.forEach(function (element) {
+ if (element.id === methodCode + '_obt_type') {
+ element.removeAttribute("disabled");
+ } else {
+ element.setAttribute("disabled", "disabled");
+ }
+ });
+
+ btMethodInputs.forEach(function (element) {
+ if (element.id === methodCode + '_config_id') {
+ element.removeAttribute("disabled");
+ } else {
+ element.setAttribute("disabled", "disabled");
+ }
+ });
+}
+
function copyOnlineBankTransferSepaIban(code) {
var input_sepa_iban_xxx_el = $(code + '_sepa_iban_xxx');
var input_sepa_iban_el = $(code + '_sepa_iban');
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