StaticAdditionalInformationProvider.php 867 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\InstantPurchase\PaymentMethodIntegration;
  7. use Magento\Vault\Api\Data\PaymentTokenInterface;
  8. /**
  9. * Payment additional information provider that returns predefined value.
  10. *
  11. * @api
  12. * @since 100.2.0
  13. */
  14. class StaticAdditionalInformationProvider implements PaymentAdditionalInformationProviderInterface
  15. {
  16. /**
  17. * @var array
  18. */
  19. private $value;
  20. /**
  21. * StaticAdditionalInformationProvider constructor.
  22. * @param array $value
  23. */
  24. public function __construct(array $value = [])
  25. {
  26. $this->value = $value;
  27. }
  28. /**
  29. * @inheritdoc
  30. * @since 100.2.0
  31. */
  32. public function getAdditionalInformation(PaymentTokenInterface $paymentToken): array
  33. {
  34. return $this->value;
  35. }
  36. }