Make sure the user needs to select store.

This commit is contained in:
ndeet 2023-06-22 11:24:21 +02:00
parent 2356aa3750
commit 4c340ee466
2 changed files with 6 additions and 3 deletions

View File

@ -291,8 +291,11 @@ class Data
$applicationIdentifier = 'magento2';
$baseUrl = $this->btcPayService->getBtcPayServerBaseUrl();
$authorizeUrl = null;
$authorizeUrl = \BTCPayServer\Client\ApiKey::getAuthorizeUrl($baseUrl, \Storefront\BTCPay\Helper\Data::REQUIRED_API_PERMISSIONS, 'Magento 2 @ ' . $magentoRootDomain, true, false, $redirectToUrlAfterCreation, $applicationIdentifier);
if ($baseUrl) {
$authorizeUrl = \BTCPayServer\Client\ApiKey::getAuthorizeUrl($baseUrl, \Storefront\BTCPay\Helper\Data::REQUIRED_API_PERMISSIONS, 'Magento 2 @ ' . $magentoRootDomain, true, true, $redirectToUrlAfterCreation, $applicationIdentifier);
}
return $authorizeUrl;
}

View File

@ -68,10 +68,10 @@ class ApiKeyComment implements CommentInterface
$baseUrl = $this->btcPayService->getBtcPayServerBaseUrl();
if ($baseUrl) {
$authorizeUrl = \BTCPayServer\Client\ApiKey::getAuthorizeUrl($baseUrl, \Storefront\BTCPay\Helper\Data::REQUIRED_API_PERMISSIONS, 'Magento 2 @ ' . $magentoRootDomain, true, false, $redirectToUrlAfterCreation, $applicationIdentifier);
$authorizeUrl = \BTCPayServer\Client\ApiKey::getAuthorizeUrl($baseUrl, \Storefront\BTCPay\Helper\Data::REQUIRED_API_PERMISSIONS, 'Magento 2 @ ' . $magentoRootDomain, true, true, $redirectToUrlAfterCreation, $applicationIdentifier);
$r = '<a target="_blank" href="' . $authorizeUrl . '">Generate API key</a>, but be sure to save any changes first.';
} else {
$r = 'Make sure you configure the <strong>VTCPay Base Url</strong> above';
$r = 'Make sure you configure the <strong>BTCPay Base Url</strong> above';
}
}
return $r;