PaymentInformationManagementInterface.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Checkout\Api;
  7. /**
  8. * Interface for managing quote payment information
  9. * @api
  10. * @since 100.0.2
  11. */
  12. interface PaymentInformationManagementInterface
  13. {
  14. /**
  15. * Set payment information and place order for a specified cart.
  16. *
  17. * @param int $cartId
  18. * @param \Magento\Quote\Api\Data\PaymentInterface $paymentMethod
  19. * @param \Magento\Quote\Api\Data\AddressInterface|null $billingAddress
  20. * @throws \Magento\Framework\Exception\CouldNotSaveException
  21. * @return int Order ID.
  22. */
  23. public function savePaymentInformationAndPlaceOrder(
  24. $cartId,
  25. \Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
  26. \Magento\Quote\Api\Data\AddressInterface $billingAddress = null
  27. );
  28. /**
  29. * Set payment information for a specified cart.
  30. *
  31. * @param int $cartId
  32. * @param \Magento\Quote\Api\Data\PaymentInterface $paymentMethod
  33. * @param \Magento\Quote\Api\Data\AddressInterface|null $billingAddress
  34. * @throws \Magento\Framework\Exception\CouldNotSaveException
  35. * @return int Order ID.
  36. */
  37. public function savePaymentInformation(
  38. $cartId,
  39. \Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
  40. \Magento\Quote\Api\Data\AddressInterface $billingAddress = null
  41. );
  42. /**
  43. * Get payment information
  44. *
  45. * @param int $cartId
  46. * @return \Magento\Checkout\Api\Data\PaymentDetailsInterface
  47. */
  48. public function getPaymentInformation($cartId);
  49. }