Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions src/Checkout/ExpressCheckout/ExpressCheckoutSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
use Swag\PayPal\Setting\Exception\PayPalSettingsInvalidException;
use Swag\PayPal\Setting\Service\SettingsValidationServiceInterface;
use Swag\PayPal\Setting\Settings;
use Swag\PayPal\Storefront\Data\Struct\AbstractScriptData;
use Swag\PayPal\Util\PaymentMethodUtil;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\ControllerEvent;
Expand Down Expand Up @@ -320,8 +319,6 @@ private function getExpressCheckoutButtonData(
$event
);

$data?->setPageType($this->getPageType($event));

return $data;
}

Expand Down Expand Up @@ -367,22 +364,4 @@ private function expressOptionForEventEnabled(string $salesChannelId, string $ev
return false;
}
}

private function getPageType(ShopwareSalesChannelEvent $event): ?string
{
return match (true) {
$event instanceof ProductPageLoadedEvent,
$event instanceof QuickviewPageletLoadedEvent => AbstractScriptData::PAGE_TYPE_PRODUCT_DETAILS,
$event instanceof OffcanvasCartPageLoadedEvent => AbstractScriptData::PAGE_TYPE_MINI_CART,
$event instanceof CheckoutRegisterPageLoadedEvent => AbstractScriptData::PAGE_TYPE_CHECKOUT,
$event instanceof CheckoutCartPageLoadedEvent => AbstractScriptData::PAGE_TYPE_CART,
$event instanceof NavigationPageLoadedEvent,
$event instanceof CmsPageLoadedEvent,
$event instanceof SearchPageLoadedEvent,
$event instanceof GuestWishlistPageletLoadedEvent,
$event instanceof SwitchBuyBoxVariantEvent,
$event instanceof SalesChannelEntitySearchResultLoadedEvent => AbstractScriptData::PAGE_TYPE_PRODUCT_LISTING,
default => null,
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,50 @@
namespace Swag\PayPal\Checkout\ExpressCheckout\Service;

use Shopware\Core\Checkout\Cart\SalesChannel\CartService;
use Shopware\Core\Checkout\Customer\CustomerEntity;
use Shopware\Core\Content\Cms\Events\CmsPageLoadedEvent;
use Shopware\Core\Framework\Event\ShopwareSalesChannelEvent;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\System\SalesChannel\Entity\SalesChannelEntitySearchResultLoadedEvent;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
use Shopware\Core\System\SystemConfig\SystemConfigService;
use Shopware\Storefront\Event\SwitchBuyBoxVariantEvent;
use Shopware\Storefront\Page\Checkout\Cart\CheckoutCartPageLoadedEvent;
use Shopware\Storefront\Page\Checkout\Offcanvas\OffcanvasCartPageLoadedEvent;
use Shopware\Storefront\Page\Checkout\Register\CheckoutRegisterPageLoadedEvent;
use Shopware\Storefront\Page\Navigation\NavigationPageLoadedEvent;
use Shopware\Storefront\Page\Product\ProductPageLoadedEvent;
use Shopware\Storefront\Page\Search\SearchPageLoadedEvent;
use Shopware\Storefront\Pagelet\PageletLoadedEvent;
use Shopware\Storefront\Pagelet\Wishlist\GuestWishlistPageletLoadedEvent;
use Swag\CmsExtensions\Storefront\Pagelet\Quickview\QuickviewPageletLoadedEvent;
use Swag\PayPal\Checkout\Cart\Service\CartPriceService;
use Swag\PayPal\Checkout\ExpressCheckout\ExpressCheckoutButtonData;
use Swag\PayPal\Checkout\Payment\PayPalPaymentHandler;
use Swag\PayPal\RestApi\V1\Resource\TokenResource;
use Swag\PayPal\Setting\Service\CredentialsUtilInterface;
use Swag\PayPal\Setting\Settings;
use Swag\PayPal\Storefront\Data\Service\AbstractScriptDataService;
use Swag\PayPal\Storefront\Data\Struct\AbstractScriptData;
use Swag\PayPal\Util\Availability\AvailabilityContext;
use Swag\PayPal\Util\Availability\AvailabilityContextBuilder;
use Swag\PayPal\Util\Lifecycle\Method\PayLaterMethodData;
use Swag\PayPal\Util\Lifecycle\Method\PaymentMethodDataRegistry;
use Swag\PayPal\Util\Lifecycle\Method\PayPalMethodData;
use Swag\PayPal\Util\Lifecycle\Method\VenmoMethodData;
use Swag\PayPal\Util\LocaleCodeProvider;
use Swag\PayPal\Util\PaymentMethodUtil;
use Symfony\Component\Routing\RouterInterface;

#[Package('checkout')]
class PayPalExpressCheckoutDataService extends AbstractScriptDataService
{
private const ADD_TO_CART_EVENTS = [
PageletLoadedEvent::class,
ProductPageLoadedEvent::class,
NavigationPageLoadedEvent::class,
SearchPageLoadedEvent::class,
];

/**
* @internal
*/
Expand All @@ -43,48 +64,30 @@
CredentialsUtilInterface $credentialsUtil,
TokenResource $tokenResource,
private readonly CartPriceService $cartPriceService,
private readonly PayLaterMethodData $payLaterMethodData,
private readonly PaymentMethodDataRegistry $paymentMethodDataRegistry,
private readonly AvailabilityContextBuilder $availabilityContextBuilder,
) {
parent::__construct($localeCodeProvider, $systemConfigService, $credentialsUtil, $tokenResource);
}

/**
* @deprecated tag:v11.0.0 - Parameter $addProductToCart will be removed, use $event parameter instead
*/
public function buildExpressCheckoutButtonData(
SalesChannelContext $salesChannelContext,
bool $addProductToCart = false,
?ShopwareSalesChannelEvent $event = null
): ?ExpressCheckoutButtonData {
$cart = $this->cartService->getCart($salesChannelContext->getToken(), $salesChannelContext);

if (!$addProductToCart && $cart->getLineItems()->count() === 0) {
return null;
}

if (!$addProductToCart && $this->cartPriceService->isZeroValueCart($cart)) {
return null;
}

$customer = $salesChannelContext->getCustomer();
if ($customer instanceof CustomerEntity && $customer->getActive()) {
if (!$this->isAvailable($event, $salesChannelContext)) {

Check failure on line 81 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.4, trunk)

Parameter #1 $event of method Swag\PayPal\Checkout\ExpressCheckout\Service\PayPalExpressCheckoutDataService::isAvailable() expects Shopware\Core\Framework\Event\ShopwareSalesChannelEvent, Shopware\Core\Framework\Event\ShopwareSalesChannelEvent|null given.

Check failure on line 81 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.2, trunk)

Parameter #1 $event of method Swag\PayPal\Checkout\ExpressCheckout\Service\PayPalExpressCheckoutDataService::isAvailable() expects Shopware\Core\Framework\Event\ShopwareSalesChannelEvent, Shopware\Core\Framework\Event\ShopwareSalesChannelEvent|null given.

Check failure on line 81 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.4, v6.7.0.0)

Parameter #1 $event of method Swag\PayPal\Checkout\ExpressCheckout\Service\PayPalExpressCheckoutDataService::isAvailable() expects Shopware\Core\Framework\Event\ShopwareSalesChannelEvent, Shopware\Core\Framework\Event\ShopwareSalesChannelEvent|null given.

Check failure on line 81 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.2, v6.7.0.0)

Parameter #1 $event of method Swag\PayPal\Checkout\ExpressCheckout\Service\PayPalExpressCheckoutDataService::isAvailable() expects Shopware\Core\Framework\Event\ShopwareSalesChannelEvent, Shopware\Core\Framework\Event\ShopwareSalesChannelEvent|null given.
return null;
}

$context = $salesChannelContext->getContext();
$salesChannelId = $salesChannelContext->getSalesChannelId();
$availabilityContext = $this->getAvailabilityContext($event, $salesChannelContext);

Check failure on line 86 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.4, trunk)

Parameter #1 $event of method Swag\PayPal\Checkout\ExpressCheckout\Service\PayPalExpressCheckoutDataService::getAvailabilityContext() expects Shopware\Core\Framework\Event\ShopwareSalesChannelEvent, Shopware\Core\Framework\Event\ShopwareSalesChannelEvent|null given.

Check failure on line 86 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.2, trunk)

Parameter #1 $event of method Swag\PayPal\Checkout\ExpressCheckout\Service\PayPalExpressCheckoutDataService::getAvailabilityContext() expects Shopware\Core\Framework\Event\ShopwareSalesChannelEvent, Shopware\Core\Framework\Event\ShopwareSalesChannelEvent|null given.

Check failure on line 86 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.4, v6.7.0.0)

Parameter #1 $event of method Swag\PayPal\Checkout\ExpressCheckout\Service\PayPalExpressCheckoutDataService::getAvailabilityContext() expects Shopware\Core\Framework\Event\ShopwareSalesChannelEvent, Shopware\Core\Framework\Event\ShopwareSalesChannelEvent|null given.

Check failure on line 86 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.2, v6.7.0.0)

Parameter #1 $event of method Swag\PayPal\Checkout\ExpressCheckout\Service\PayPalExpressCheckoutDataService::getAvailabilityContext() expects Shopware\Core\Framework\Event\ShopwareSalesChannelEvent, Shopware\Core\Framework\Event\ShopwareSalesChannelEvent|null given.
$fundingSources = $this->getFundingSources($availabilityContext);

$fundingSources = ['paypal', 'venmo'];

$availabilityContext = null;
if ($addProductToCart && $event instanceof ProductPageLoadedEvent) {
$availabilityContext = AvailabilityContextBuilder::buildFromProduct(
$event->getPage()->getProduct(),
$salesChannelContext
);
} elseif (!$addProductToCart) {
$availabilityContext = AvailabilityContextBuilder::buildFromCart($cart, $salesChannelContext);
}

if ($this->showPayLater($salesChannelId, $availabilityContext)) {
array_splice($fundingSources, 1, 0, ['paylater']);
if (!$fundingSources) {
return null;
}

return (new ExpressCheckoutButtonData())->assign([
Expand All @@ -98,7 +101,7 @@
'buttonShape' => $this->systemConfigService->getString(Settings::ECS_BUTTON_SHAPE, $salesChannelId),
'addProductToCart' => $addProductToCart,
'contextSwitchUrl' => $this->router->generate('frontend.paypal.express.prepare_cart'),
'payPalPaymentMethodId' => $this->paymentMethodUtil->getPayPalPaymentMethodId($context),
'payPalPaymentMethodId' => $this->paymentMethodUtil->getPayPalPaymentMethodId($salesChannelContext->getContext()),
'createOrderUrl' => $this->router->generate('frontend.paypal.express.create_order'),
'prepareCheckoutUrl' => $this->router->generate('frontend.paypal.express.prepare_checkout'),
'checkoutConfirmUrl' => $this->router->generate(
Expand All @@ -108,8 +111,9 @@
),
'handleErrorUrl' => $this->router->generate('frontend.paypal.handle-error'),
'cancelRedirectUrl' => $this->router->generate($addProductToCart ? 'frontend.checkout.cart.page' : 'frontend.checkout.register.page'),
'showPayLater' => $this->showPayLater($salesChannelId, $availabilityContext),
'showPayLater' => \in_array('paylater', $fundingSources, true),
'fundingSources' => $fundingSources,
'pageType' => $this->getPageType($event),

Check failure on line 116 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.4, trunk)

Parameter #1 $event of method Swag\PayPal\Checkout\ExpressCheckout\Service\PayPalExpressCheckoutDataService::getPageType() expects Shopware\Core\Framework\Event\ShopwareSalesChannelEvent, Shopware\Core\Framework\Event\ShopwareSalesChannelEvent|null given.

Check failure on line 116 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.2, trunk)

Parameter #1 $event of method Swag\PayPal\Checkout\ExpressCheckout\Service\PayPalExpressCheckoutDataService::getPageType() expects Shopware\Core\Framework\Event\ShopwareSalesChannelEvent, Shopware\Core\Framework\Event\ShopwareSalesChannelEvent|null given.

Check failure on line 116 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.4, v6.7.0.0)

Parameter #1 $event of method Swag\PayPal\Checkout\ExpressCheckout\Service\PayPalExpressCheckoutDataService::getPageType() expects Shopware\Core\Framework\Event\ShopwareSalesChannelEvent, Shopware\Core\Framework\Event\ShopwareSalesChannelEvent|null given.

Check failure on line 116 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.2, v6.7.0.0)

Parameter #1 $event of method Swag\PayPal\Checkout\ExpressCheckout\Service\PayPalExpressCheckoutDataService::getPageType() expects Shopware\Core\Framework\Event\ShopwareSalesChannelEvent, Shopware\Core\Framework\Event\ShopwareSalesChannelEvent|null given.
]);
}

Expand All @@ -118,10 +122,90 @@
return Settings::ECS_BUTTON_LANGUAGE_ISO;
}

private function showPayLater(string $salesChannelId, ?AvailabilityContext $availabilityContext): bool
protected function isAvailable(ShopwareSalesChannelEvent $event, SalesChannelContext $salesChannelContext): bool
{
if (!$this->isAddToCartEvent($event)) {
$cart = $this->cartService->getCart($salesChannelContext->getToken(), $salesChannelContext);

if ($cart->getLineItems()->count() === 0) {
return false;
}

if ($this->cartPriceService->isZeroValueCart($cart)) {
return false;
}
}

if ($salesChannelContext->getCustomer()?->getActive()) {
return false;
}

return true;
}

protected function getAvailabilityContext(ShopwareSalesChannelEvent $event, SalesChannelContext $salesChannelContext): AvailabilityContext
{
return $availabilityContext !== null
&& $this->systemConfigService->getBool(Settings::ECS_SHOW_PAY_LATER, $salesChannelId)
&& $this->payLaterMethodData->isAvailable($availabilityContext);
if ($event instanceof ProductPageLoadedEvent) {
return $this->availabilityContextBuilder->buildFromProduct(
$event->getPage()->getProduct(),
$salesChannelContext
);
}

if ($this->isAddToCartEvent($event)) {
return $this->availabilityContextBuilder->buildFromSalesChannelContext($salesChannelContext);

Check failure on line 156 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.4, trunk)

Call to an undefined method Swag\PayPal\Util\Availability\AvailabilityContextBuilder::buildFromSalesChannelContext().

Check failure on line 156 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.2, trunk)

Call to an undefined method Swag\PayPal\Util\Availability\AvailabilityContextBuilder::buildFromSalesChannelContext().

Check failure on line 156 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.4, v6.7.0.0)

Call to an undefined method Swag\PayPal\Util\Availability\AvailabilityContextBuilder::buildFromSalesChannelContext().

Check failure on line 156 in src/Checkout/ExpressCheckout/Service/PayPalExpressCheckoutDataService.php

View workflow job for this annotation

GitHub Actions / phpstan (8.2, v6.7.0.0)

Call to an undefined method Swag\PayPal\Util\Availability\AvailabilityContextBuilder::buildFromSalesChannelContext().
}

$cart = $this->cartService->getCart($salesChannelContext->getToken(), $salesChannelContext);

return $this->availabilityContextBuilder->buildFromCart($cart, $salesChannelContext);
}

protected function isAddToCartEvent(ShopwareSalesChannelEvent $event): bool
{
foreach (self::ADD_TO_CART_EVENTS as $addToCartEvent) {
if ($event instanceof $addToCartEvent) {
return true;
}
}

return false;
}

private function getPageType(ShopwareSalesChannelEvent $event): ?string
{
return match (true) {
$event instanceof ProductPageLoadedEvent,
$event instanceof QuickviewPageletLoadedEvent => AbstractScriptData::PAGE_TYPE_PRODUCT_DETAILS,
$event instanceof OffcanvasCartPageLoadedEvent => AbstractScriptData::PAGE_TYPE_MINI_CART,
$event instanceof CheckoutRegisterPageLoadedEvent => AbstractScriptData::PAGE_TYPE_CHECKOUT,
$event instanceof CheckoutCartPageLoadedEvent => AbstractScriptData::PAGE_TYPE_CART,
$event instanceof NavigationPageLoadedEvent,
$event instanceof CmsPageLoadedEvent,
$event instanceof SearchPageLoadedEvent,
$event instanceof GuestWishlistPageletLoadedEvent,
$event instanceof SwitchBuyBoxVariantEvent,
$event instanceof SalesChannelEntitySearchResultLoadedEvent => AbstractScriptData::PAGE_TYPE_PRODUCT_LISTING,
default => null,
};
}

private function getFundingSources(AvailabilityContext $context): array
{
$fundingSources = [];

if ($this->paymentMethodDataRegistry->getPaymentMethod(PayPalMethodData::class)->isAvailable($context)) {
$fundingSources[] = 'paypal';
}

if ($this->systemConfigService->getBool(Settings::ECS_SHOW_PAY_LATER, $context->getSalesChannelId()) && $this->paymentMethodDataRegistry->getPaymentMethod(PayLaterMethodData::class)->isAvailable($context)) {
$fundingSources[] = 'paylater';
}

if ($this->paymentMethodDataRegistry->getPaymentMethod(VenmoMethodData::class)->isAvailable($context)) {
$fundingSources[] = 'venmo';
}

return $fundingSources;
}
}
35 changes: 11 additions & 24 deletions src/Installment/Banner/InstallmentBannerSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Shopware\Storefront\Page\Checkout\Offcanvas\OffcanvasCartPageLoadedEvent;
use Shopware\Storefront\Page\Checkout\Register\CheckoutRegisterPage;
use Shopware\Storefront\Page\Checkout\Register\CheckoutRegisterPageLoadedEvent;
use Shopware\Storefront\Page\Page;
use Shopware\Storefront\Page\PageLoadedEvent;
use Shopware\Storefront\Page\Product\ProductPage;
use Shopware\Storefront\Page\Product\ProductPageLoadedEvent;
Expand All @@ -30,9 +29,9 @@
use Swag\PayPal\Installment\Banner\Service\BannerDataServiceInterface;
use Swag\PayPal\Setting\Exception\PayPalSettingsInvalidException;
use Swag\PayPal\Setting\Service\SettingsValidationServiceInterface;
use Swag\PayPal\Util\Availability\AvailabilityContext;
use Swag\PayPal\Util\Availability\AvailabilityContextBuilder;
use Swag\PayPal\Util\Lifecycle\Method\PayLaterMethodData;
use Swag\PayPal\Util\Lifecycle\Method\PaymentMethodDataRegistry;
use Swag\PayPal\Util\PaymentMethodUtil;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

Expand All @@ -43,6 +42,9 @@
class InstallmentBannerSubscriber implements EventSubscriberInterface
{
public const PAYPAL_INSTALLMENT_BANNER_DATA_EXTENSION_ID = 'payPalInstallmentBannerData';
/**
* @deprecated tag:v11.0.0 - Will be removed without replacement
*/
public const PAYPAL_INSTALLMENT_BANNER_DATA_CART_PAGE_EXTENSION_ID = 'payPalInstallmentBannerDataCheckoutCart';

public function __construct(
Expand All @@ -51,7 +53,8 @@ public function __construct(
private readonly BannerDataServiceInterface $bannerDataService,
private readonly ExcludedProductValidator $excludedProductValidator,
private readonly LoggerInterface $logger,
private readonly PayLaterMethodData $payLaterMethodData,
private readonly PaymentMethodDataRegistry $paymentMethodDataRegistry,
private readonly AvailabilityContextBuilder $availabilityContextBuilder,
) {
}

Expand Down Expand Up @@ -90,26 +93,24 @@ public function addInstallmentBanner(PageLoadedEvent $pageLoadedEvent): void
return;
}

$availabilityContext = AvailabilityContextBuilder::buildFromProduct($page->getProduct(), $salesChannelContext);
}

if (!$page instanceof ProductPage) {
$availabilityContext = $this->availabilityContextBuilder->buildFromProduct($page->getProduct(), $salesChannelContext);
} else {
if ($this->excludedProductValidator->cartContainsExcludedProduct($page->getCart(), $pageLoadedEvent->getSalesChannelContext())) {
return;
}

$availabilityContext = AvailabilityContextBuilder::buildFromCart($page->getCart(), $salesChannelContext);
$availabilityContext = $this->availabilityContextBuilder->buildFromCart($page->getCart(), $salesChannelContext);
}

if (!$this->shouldDisplayPayLaterBanner($page, $availabilityContext)) {
if (!$this->paymentMethodDataRegistry->getPaymentMethod(PayLaterMethodData::class)->isAvailable($availabilityContext)) {
return;
}

$bannerData = $this->bannerDataService->getInstallmentBannerData($page, $salesChannelContext);

/** @deprecated tag:v11.0.0 - Will be removed */
if ($page instanceof CheckoutCartPage) {
$productTableBannerData = clone $bannerData;
/** @deprecated tag:v11.0.0 - All setters will be removed */
$productTableBannerData->setLayout('flex');
$productTableBannerData->setColor('grey');
$productTableBannerData->setRatio('20x1');
Expand Down Expand Up @@ -153,18 +154,4 @@ public function addInstallmentBannerPagelet(PageletLoadedEvent $pageletLoadedEve
$bannerData
);
}

private function shouldDisplayPayLaterBanner(Page $page, AvailabilityContext $availabilityContext): bool
{
return $this->pageOfCorrectType($page)
? $this->payLaterMethodData->isAvailable($availabilityContext)
: true;
}

private function pageOfCorrectType(Page $page): bool
{
return $page instanceof CheckoutRegisterPage
|| $page instanceof OffcanvasCartPage
|| $page instanceof CheckoutConfirmPage;
}
}
3 changes: 2 additions & 1 deletion src/Resources/config/services/express_checkout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
<argument type="service" id="Swag\PayPal\Setting\Service\CredentialsUtil"/>
<argument type="service" id="Swag\PayPal\RestApi\V1\Resource\TokenResource" />
<argument type="service" id="Swag\PayPal\Checkout\Cart\Service\CartPriceService"/>
<argument type="service" id="Swag\PayPal\Util\Lifecycle\Method\PayLaterMethodData"/>
<argument type="service" id="Swag\PayPal\Util\Lifecycle\Method\PaymentMethodDataRegistry"/>
<argument type="service" id="Swag\PayPal\Util\Availability\AvailabilityContextBuilder"/>
</service>

<service id="Swag\PayPal\Checkout\ExpressCheckout\SalesChannel\ExpressPrepareCheckoutRoute" public="true">
Expand Down
3 changes: 2 additions & 1 deletion src/Resources/config/services/installment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<argument type="service" id="Swag\PayPal\Installment\Banner\Service\BannerDataService"/>
<argument type="service" id="Swag\PayPal\Checkout\Cart\Service\ExcludedProductValidator"/>
<argument type="service" id="monolog.logger.paypal"/>
<argument type="service" id="Swag\PayPal\Util\Lifecycle\Method\PayLaterMethodData"/>
<argument type="service" id="Swag\PayPal\Util\Lifecycle\Method\PaymentMethodDataRegistry"/>
<argument type="service" id="Swag\PayPal\Util\Availability\AvailabilityContextBuilder"/>
<tag name="kernel.event_subscriber"/>
</service>

Expand Down
3 changes: 3 additions & 0 deletions src/Resources/config/services/util.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,8 @@
<service id="Swag\PayPal\Util\Availability\AvailabilityService">
<argument type="service" id="Swag\PayPal\Util\Lifecycle\Method\PaymentMethodDataRegistry"/>
</service>

<service id="Swag\PayPal\Util\Availability\AvailabilityContextBuilder">
</service>
</services>
</container>
Loading
Loading