SignifydOrderSessionId.php 870 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Signifyd\Model;
  7. use Magento\Framework\DataObject\IdentityGeneratorInterface;
  8. /**
  9. * Encapsulates generation of uuid by quote id.
  10. */
  11. class SignifydOrderSessionId
  12. {
  13. /**
  14. * @var IdentityGeneratorInterface
  15. */
  16. private $identityGenerator;
  17. /**
  18. * @param IdentityGeneratorInterface $identityGenerator
  19. */
  20. public function __construct(
  21. IdentityGeneratorInterface $identityGenerator
  22. ) {
  23. $this->identityGenerator = $identityGenerator;
  24. }
  25. /**
  26. * Returns unique identifier through generation uuid by quote id.
  27. *
  28. * @param int $quoteId
  29. * @return string
  30. */
  31. public function get($quoteId)
  32. {
  33. return $this->identityGenerator->generateIdForData($quoteId);
  34. }
  35. }