ManagerInterface.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sales\Model\Order\Payment\Transaction;
  7. use Magento\Sales\Api\Data\OrderPaymentInterface;
  8. use Magento\Sales\Model\Order\Payment\Transaction;
  9. /**
  10. * Manage payment transaction
  11. */
  12. interface ManagerInterface
  13. {
  14. /**
  15. * Lookup an authorization transaction using parent transaction id, if set
  16. *
  17. * @param string $parentTransactionId
  18. * @param int $paymentId
  19. * @param int $orderId
  20. * @return false|Transaction
  21. */
  22. public function getAuthorizationTransaction($parentTransactionId, $paymentId, $orderId);
  23. /**
  24. * Checks if transaction exists by txt id
  25. *
  26. * @param string $transactionId
  27. * @param int $paymentId
  28. * @param int $orderId
  29. * @return bool
  30. */
  31. public function isTransactionExists($transactionId, $paymentId, $orderId);
  32. /**
  33. * Update transaction ids for further processing
  34. * If no transactions were set before invoking, may generate an "offline" transaction id
  35. *
  36. * @param OrderPaymentInterface $payment
  37. * @param string $type
  38. * @param bool|Transaction $transactionBasedOn
  39. * @return string|null
  40. */
  41. public function generateTransactionId(OrderPaymentInterface $payment, $type, $transactionBasedOn = false);
  42. }