Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent the shop from breaking #198

Closed
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
12 changes: 10 additions & 2 deletions src/Core/ViewConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use OxidEsales\Eshop\Core\Exception\StandardException;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Theme;
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
use OxidSolutionCatalysts\AmazonPay\Core\Helper\PhpHelper;
use OxidSolutionCatalysts\AmazonPay\Core\Provider\OxidServiceProvider;
use OxidSolutionCatalysts\AmazonPay\Model\User;
Expand Down Expand Up @@ -366,7 +367,14 @@ public function getPayloadSignIn(): string
*/
public function getSignature(string $payload): string
{
$amazonClient = OxidServiceProvider::getAmazonClient();
return $amazonClient->generateButtonSignature($payload);
try {
$amazonClient = OxidServiceProvider::getAmazonClient();
return $amazonClient->generateButtonSignature($payload);
} catch (Exception $exception) {
/** @var Logger $logger */
$logger = ContainerFactory::getInstance()->getContainer()->get(Logger::class);
$logger->log('error', $exception->getMessage(), [$exception]);
return '';
}
}
}
Loading