Skip to content

Commit 09fe8fb

Browse files
committed
feature: add reload on modal close and implement payment availability check in Mrcash
1 parent a0352d7 commit 09fe8fb

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Model/Method/Mrcash.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,19 @@ public function getPaymentMethodName($payment)
181181
{
182182
return 'bancontactmrcash';
183183
}
184+
185+
public function isAvailable(\Magento\Quote\Api\Data\CartInterface $quote = null)
186+
{
187+
$orderId = $quote ? $quote->getReservedOrderId() : null;
188+
189+
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
190+
191+
$paymentGroupTransaction = $objectManager->get(\Buckaroo\Magento2\Helper\PaymentGroupTransaction::class);
192+
193+
if ($paymentGroupTransaction->getAlreadyPaid($orderId) > 0) {
194+
return false;
195+
}
196+
197+
return true;
198+
}
184199
}

view/frontend/web/js/view/payment/method-renderer/giftcards.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ define(
291291
class: 'action primary accept',
292292
click: function () {
293293
this.closeModal(true);
294+
window.location.reload();
294295
}
295296
}]
296297
});

0 commit comments

Comments
 (0)