setProcessUrl example

$salesChannelContext = static::createMock(SalesChannelContext::class);
        $salesChannelContext
            ->method('getTotalRounding')
            ->willReturn(new CashRoundingConfig(2, 0.01, true));

        $taxProvider = new TaxProviderEntity();
        $taxProvider->setId(Uuid::randomHex());
        $taxProvider->setActive(true);
        $taxProvider->setPriority(1);
        $taxProvider->setIdentifier(TestConstantTaxRateProvider::class);
        $taxProvider->setApp(new AppEntity());
        $taxProvider->setProcessUrl('https://example.com');

        $collection = new TaxProviderCollection([$taxProvider]);

        $result = new EntitySearchResult(
            TaxProviderDefinition::ENTITY_NAME,
            1,
            $collection,
            null,
            new Criteria(),
            Context::createDefaultContext()
        );

        
$taxProvider->setName($provider->getName());
            $taxProvider->setIdentifier(
                \sprintf('app\\%s_%s', $appName ?? self::META_APP_NAME, $provider->getIdentifier()),
            );

            $result->add($taxProvider);

            if (!$appId || !$appName) {
                continue;
            }

            $taxProvider->setProcessUrl($provider->getProcessUrl());
            $taxProvider->setAppId($appId);
        }

        return new EntitySearchResult(
            TaxProviderDefinition::ENTITY_NAME,
            $result->count(),
            $result,
            null,
            new Criteria(),
            Context::createDefaultContext()
        );
    }
Home | Imprint | This part of the site doesn't use cookies.