PaymentAdapter.php 851 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Sales\Model\Order;
  7. use Magento\Sales\Api\Data\InvoiceInterface;
  8. use Magento\Sales\Api\Data\OrderInterface;
  9. use Magento\Sales\Model\Order\Invoice\PayOperation;
  10. /**
  11. * @inheritdoc
  12. */
  13. class PaymentAdapter implements PaymentAdapterInterface
  14. {
  15. /**
  16. * @var PayOperation
  17. */
  18. private $payOperation;
  19. /**
  20. * @param PayOperation $payOperation
  21. */
  22. public function __construct(
  23. PayOperation $payOperation
  24. ) {
  25. $this->payOperation = $payOperation;
  26. }
  27. /**
  28. * @inheritdoc
  29. */
  30. public function pay(
  31. OrderInterface $order,
  32. InvoiceInterface $invoice,
  33. $capture
  34. ) {
  35. return $this->payOperation->execute($order, $invoice, $capture);
  36. }
  37. }