default_payment_configuration.php 1009 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. use Magento\Config\Model\Config;
  8. use Magento\Framework\App\Config\ScopeConfigInterface;
  9. use Magento\Framework\Encryption\EncryptorInterface;
  10. use Magento\TestFramework\Helper\Bootstrap;
  11. require __DIR__ . '/process_config_data.php';
  12. $objectManager = Bootstrap::getObjectManager();
  13. /** @var EncryptorInterface $encryptor */
  14. $encryptor = $objectManager->get(EncryptorInterface::class);
  15. // save payment configuration for the default scope
  16. $configData = [
  17. 'payment/payflowpro/partner' => 'def_partner',
  18. 'payment/payflowpro/vendor' => 'def_vendor',
  19. 'payment/payflowpro/user' => $encryptor->encrypt('def_user'),
  20. 'payment/payflowpro/pwd' => $encryptor->encrypt('def_pwd'),
  21. ];
  22. /** @var Config $defConfig */
  23. $defConfig = $objectManager->create(Config::class);
  24. $defConfig->setScope(ScopeConfigInterface::SCOPE_TYPE_DEFAULT);
  25. $processConfigData($defConfig, $configData);