The `StorageExtension` instance is shared across all Gateway instances, leading to unreliable behavior with multiple gateways due to internal action stack level tracking. The request is to make it safe for use with multiple gateways.
There is only one `StorageExtension` instance per Model which is used in all Gateway instances. The `StorageExtension` keeps the Action Stack Level internally but this only works reliable when used with only one Gateway Instance. This leads to very unexpected behaviour. Example ``` php <?php //example.php require __DIR__ . '/vendor/autoload.php'; use Payum\Core\PayumBuilder; use Payum\Core\Payum; use Payum\Core\Model\Payment; $paymentClass = Payment::class; /** @var Payum $payum */ $payum = (new PayumBuilder()) ->addDefaultStorages() ->addGateway('aGateway', [ 'factory' => 'offline', ]) ->addGateway('bGateway', [ 'factory' => 'offline', ]) ->getPayum() ; header('Content-Type: text/plain'); function getStorageExtension($gateway) { $r = new ReflectionObject($gateway); $p = $r->getProperty('extensions'); $p->setAccessible(true); foreach ($p->getValue($gateway) as $extension) { if ($extension instanceof \Payum\Core\Ext