<?php

/**
 * Copyright © Resurs Bank AB. All rights reserved.
 * See LICENSE for license details.
 */

namespace Resursbank\MerchantApi\Hook;

use Resursbank\MerchantApi\Service\Ecom;
use Resursbank\MerchantApi\Service\FakeContainer;
use Resursbank\MerchantApi\Util\Log;
use Throwable;

class ActionDispatcher
{
    public static function exec(): void
    {
        try {
            (new Ecom(FakeContainer::getConfig()))->configure();
        } catch (Throwable $error) {
            // @todo Add a flash message in frontend?
            Log::error(message: $error);
        }
    }
}
