VoidHandler.php 1009 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 VoidHandler extends TransactionIdHandler
  9. {
  10. /**
  11. * @param Payment $orderPayment
  12. * @param \Braintree\Transaction $transaction
  13. * @return void
  14. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  15. */
  16. protected function setTransactionId(Payment $orderPayment, \Braintree\Transaction $transaction)
  17. {
  18. return;
  19. }
  20. /**
  21. * Whether transaction should be closed
  22. *
  23. * @return bool
  24. */
  25. protected function shouldCloseTransaction()
  26. {
  27. return true;
  28. }
  29. /**
  30. * Whether parent transaction should be closed
  31. *
  32. * @param Payment $orderPayment
  33. * @return bool
  34. * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  35. */
  36. protected function shouldCloseParentTransaction(Payment $orderPayment)
  37. {
  38. return true;
  39. }
  40. }