<?php

require __DIR__ . '/../../../../../app/bootstrap.php';

use Magento\Framework\App\Area;
use Magento\Framework\App\Bootstrap;
use Magento\Framework\App\State;
use Magento\Rma\Model\ItemFactory;
use Magento\Store\Model\App\Emulation;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Sales\Model\OrderFactory;
use Magento\Rma\Model\RmaFactory;
use FiloBlu\Rma\Plugin\Model\RmaModelRmaProcessor;
use const Filoblu\Storelocator\Model\Rma\ItemFactory;


$bootstrap = Bootstrap::create(BP, $_SERVER);

$objectManager = $bootstrap->getObjectManager();

/** @var State $state */
$state = $objectManager->get(State::class);
$state->setAreaCode(\Magento\Framework\App\Area::AREA_FRONTEND);


$payload = array (
    'city' => 'SANTA MARIA DI SALA',
    'region_id' => 616,
    'postcode' => '30036',
    'country_id' => 'IT',
    'items' =>
        array (
            0 =>
                array (
                    'order_item_id' => 577,
                    'qty_requested' => 1,
                ),
        ),
);

/** @var \FiloBlu\Rma\Model\EasyReturn $easyReturn */
$easyReturn = $objectManager->get(\FiloBlu\Rma\Model\EasyReturn::class);

$easyReturn->estimateReturnShippingCost($payload);
