website_payment_configuration.php 1.1 KB

12345678910111213141516171819202122232425262728293031
  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\Encryption\EncryptorInterface;
  9. use Magento\Store\Model\ScopeInterface;
  10. use Magento\TestFramework\Helper\Bootstrap;
  11. // save payment website config data
  12. require __DIR__ . '/../../Store/_files/second_website_with_two_stores.php';
  13. require __DIR__ . '/process_config_data.php';
  14. $objectManager = Bootstrap::getObjectManager();
  15. /** @var EncryptorInterface $encryptor */
  16. $encryptor = $objectManager->get(EncryptorInterface::class);
  17. $websiteConfigData = [
  18. 'payment/payflowpro/partner' => 'website_partner',
  19. 'payment/payflowpro/vendor' => 'website_vendor',
  20. 'payment/payflowpro/user' => $encryptor->encrypt('website_user'),
  21. 'payment/payflowpro/pwd' => $encryptor->encrypt('website_pwd'),
  22. ];
  23. /** @var Config $websiteConfig */
  24. $websiteConfig = $objectManager->create(Config::class);
  25. $websiteConfig->setScope(ScopeInterface::SCOPE_WEBSITES);
  26. $websiteConfig->setWebsite($websiteId);
  27. $processConfigData($websiteConfig, $websiteConfigData);