<?php
namespace TbiBank\FusionPay\Model;

/**
 * Class ProgrammaticOrderContext
 *
 * Per-request flag marking that the current order is being created programmatically
 * (e.g. via the Gateway API), so payment method visibility rules can be bypassed.
 * Replaces the deprecated Magento\Framework\Registry for this single purpose.
 */
class ProgrammaticOrderContext
{
    /**
     * @var bool
     */
    private $active = false;

    /**
     * Mark the current request as a programmatic order.
     */
    public function activate(): void
    {
        $this->active = true;
    }

    /**
     * Whether the current request is a programmatic order.
     *
     * @return bool
     */
    public function isActive(): bool
    {
        return $this->active;
    }
}
