Skip to content

Pass value from checkout to some backend method (Magento 2.4)

Every time I get from external service different number value.

I just pass this value by AJAX to Controller:

return storage.post(
    'somemodule/controller',
    someNumber,
    false
).done(function (response) {
    console.log(response);
}).fail(function (response) {
        loader.stopLoader();
});

Then recalculate summary section.

I just want to pass someNumber to MagentoQuoteModelQuoteAddressTotalGrand:collect()
method.

How I can do it? Or maybe somehow save someNumber to localStorage and then pass it to backend?