Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions Gateway/Config/ConfigProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class ConfigProvider

public const VAULT_CODE = 'subscribe_pro_vault';

public const ADMIN_ORDER_AMOUNT_URL = '/admin/subscribepro/order/amount/';
public const ADMIN_ORDER_AMOUNT_URL = 'subscribepro/order/amount';

/**
* @var \Swarming\SubscribePro\Model\Config\General
Expand Down Expand Up @@ -48,6 +48,11 @@ class ConfigProvider
*/
protected $oauth;

/**
* @var \Magento\Framework\UrlInterface
*/
protected $urlBuilder;

/**
* @param \Swarming\SubscribePro\Model\Config\General $generalConfig
* @param Config $gatewayConfig
Expand All @@ -64,7 +69,8 @@ public function __construct(
\Magento\Payment\Model\CcConfigProvider $ccConfigProvider,
\Swarming\SubscribePro\Platform\Tool\Config $platformConfigTool,
\Swarming\SubscribePro\Platform\Tool\Oauth $oauth,
\Magento\Store\Model\StoreManagerInterface $storeManager
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\UrlInterface $urlBuilder
) {
$this->generalConfig = $generalConfig;
$this->gatewayConfig = $gatewayConfig;
Expand All @@ -73,6 +79,7 @@ public function __construct(
$this->platformConfigTool = $platformConfigTool;
$this->storeManager = $storeManager;
$this->oauth = $oauth;
$this->urlBuilder = $urlBuilder;
}

/**
Expand All @@ -98,7 +105,7 @@ public function getConfig($storeId = null)
'isActive' => $this->gatewayConfig->isActive($storeId),
'isThreeDSActive' => $this->gatewayConfig->isThreeDSActive($storeId),
'isWalletAuthorizationActive' => $this->gatewayConfig->isWalletAuthorizationActive($storeId),
'adminOrderAmountUrl' => self::ADMIN_ORDER_AMOUNT_URL,
'adminOrderAmountUrl' => $this->urlBuilder->getUrl(self::ADMIN_ORDER_AMOUNT_URL),
'sessionAccessToken' => $this->oauth->getSessionAccessToken($storeId),
'browserSize' => $this->gatewayConfig->getBrowserSize($storeId),
'acceptHeader' => $this->gatewayConfig->getAcceptHeader($storeId),
Expand Down