Factory.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\Authorizenet\Model\Response;
  8. /**
  9. * Factory class for @see \Magento\Authorizenet\Model\Response
  10. * @deprecated 100.3.1 Authorize.net is removing all support for this payment method
  11. */
  12. class Factory
  13. {
  14. /**
  15. * Object Manager instance
  16. *
  17. * @var \Magento\Framework\ObjectManagerInterface
  18. */
  19. protected $objectManager;
  20. /**
  21. * Instance name to create
  22. *
  23. * @var string
  24. */
  25. protected $instanceName;
  26. /**
  27. * Factory constructor
  28. *
  29. * @param \Magento\Framework\ObjectManagerInterface $objectManager
  30. * @param string $instanceName
  31. */
  32. public function __construct(
  33. \Magento\Framework\ObjectManagerInterface $objectManager,
  34. $instanceName = \Magento\Authorizenet\Model\Response::class
  35. ) {
  36. $this->objectManager = $objectManager;
  37. $this->instanceName = $instanceName;
  38. }
  39. /**
  40. * Create class instance with specified parameters
  41. *
  42. * @param array $data
  43. * @return \Magento\Authorizenet\Model\Response
  44. */
  45. public function create(array $data = [])
  46. {
  47. return $this->objectManager->create($this->instanceName, $data);
  48. }
  49. }