RefundHandler.php 588 B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Braintree\Gateway\Response;
  7. use Magento\Sales\Model\Order\Payment;
  8. class RefundHandler extends VoidHandler
  9. {
  10. /**
  11. * Whether parent transaction should be closed
  12. *
  13. * @param Payment $orderPayment
  14. * @return bool
  15. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  16. */
  17. protected function shouldCloseParentTransaction(Payment $orderPayment)
  18. {
  19. return !(bool)$orderPayment->getCreditmemo()->getInvoice()->canRefund();
  20. }
  21. }