Skip to content

Commit

Permalink
Merge branch 'ppi-996/fix-disappearing-smart-payment-buttons' into 't…
Browse files Browse the repository at this point in the history
…runk'

PPI-996 - Fix disappearing payment buttons

See merge request shopware/6/services/paypal!831
  • Loading branch information
Bird87ZA committed Sep 27, 2024
2 parents 16bc221 + 3fc9954 commit 9693587
Show file tree
Hide file tree
Showing 215 changed files with 295 additions and 285 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- PPI-957 - Added quick links to the extension context menu and PayPal settings
- PPI-991 - Fixes an issue, where Trustly was erroneously offered
- PPI-995 - Fixes an issue, where the Zettle set up wizard could get stuck
- PPI-996 - Fixes an issue, where PayPal buttons could disappear during checkout with certain themes

# 9.6.0
- PPI-922 - Improved visibility of Apple Pay on browsers and devices that are not supported
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG_de-DE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- PPI-957 - Fügt Schnell-Links zum Kontext-Menü der Erweiterung und der PayPal Einstellungen hinzu
- PPI-991 - Behebt ein Problem, bei dem Trustly fälschlicherweise zur Auswahl stand
- PPI-995 - Behebt ein Problem, bei dem der Zettle-Einrichtungsassistent nicht korrekt beendet werden konnte
- PPI-996 - Behebt ein Problem, bei dem PayPal-Buttons mit bestimmten Themes während des Checkouts verschwinden konnten

# 9.6.0
- PPI-922 - Verbessert die Sichtbarkeit von Apple Pay für nicht unterstützte Browser und Geräte
Expand Down
2 changes: 1 addition & 1 deletion src/Administration/PayPalPaymentMethodController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PayPalPaymentMethodController extends AbstractController
* @internal
*/
public function __construct(
private readonly PaymentMethodUtil $paymentMethodUtil
private readonly PaymentMethodUtil $paymentMethodUtil,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/Card/AbstractCardValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abstract class AbstractCardValidator implements CardValidatorInterface
* @internal
*/
public function __construct(
private readonly SystemConfigService $systemConfigService
private readonly SystemConfigService $systemConfigService,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/Cart/Service/ExcludedProductValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ExcludedProductValidator
*/
public function __construct(
SystemConfigService $systemConfigService,
SalesChannelRepository $productRepository
SalesChannelRepository $productRepository,
) {
$this->systemConfigService = $systemConfigService;
$this->productRepository = $productRepository;
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/Cart/Validation/CartValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct(
SettingsValidationServiceInterface $settingsValidationService,
RequestStack $requestStack,
ExcludedProductValidator $excludedProductValidator,
AvailabilityService $availabilityService
AvailabilityService $availabilityService,
) {
$this->cartPriceService = $cartPriceService;
$this->methodDataRegistry = $methodDataRegistry;
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/CheckoutSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CheckoutSubscriber implements EventSubscriberInterface

public function __construct(
PaymentMethodDataRegistry $methodDataRegistry,
LoggerInterface $logger
LoggerInterface $logger,
) {
$this->methodDataRegistry = $methodDataRegistry;
$this->logger = $logger;
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/Exception/MissingPayloadException.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MissingPayloadException extends ShopwareHttpException
{
public function __construct(
string $orderId,
string $path
string $path,
) {
parent::__construct(
'Missing request payload {{ path }} to order "{{ orderId }}" not found',
Expand Down
4 changes: 2 additions & 2 deletions src/Checkout/ExpressCheckout/ExpressCheckoutSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function __construct(
SystemConfigService $systemConfigService,
PaymentMethodUtil $paymentMethodUtil,
ExcludedProductValidator $excludedProductValidator,
LoggerInterface $logger
LoggerInterface $logger,
) {
$this->expressCheckoutDataService = $service;
$this->settingsValidationService = $settingsValidationService;
Expand Down Expand Up @@ -252,7 +252,7 @@ public function onCheckoutConfirmLoaded(CheckoutConfirmPageLoadedEvent $event):
private function getExpressCheckoutButtonData(
SalesChannelContext $salesChannelContext,
string $eventName,
bool $addProductToCart = false
bool $addProductToCart = false,
): ?ExpressCheckoutButtonData {
if (!$this->checkSettings($salesChannelContext, $eventName)) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(
private readonly ExpressCheckoutDataServiceInterface $expressCheckoutDataService,
private readonly SettingsValidationServiceInterface $settingsValidationService,
private readonly SystemConfigService $systemConfigService,
private readonly PaymentMethodUtil $paymentMethodUtil
private readonly PaymentMethodUtil $paymentMethodUtil,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
private readonly AbstractSalesChannelContextFactory $salesChannelContextFactory,
private readonly OrderResource $orderResource,
private readonly CartService $cartService,
private readonly LoggerInterface $logger
private readonly LoggerInterface $logger,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function __construct(
EntityRepository $customerRepository,
AccountService $accountService,
SystemConfigService $systemConfigService,
LoggerInterface $logger
LoggerInterface $logger,
) {
$this->registerRoute = $registerRoute;
$this->countryRepository = $countryRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ public function __construct(
private readonly PaymentMethodUtil $paymentMethodUtil,
SystemConfigService $systemConfigService,
CredentialsUtilInterface $credentialsUtil,
private readonly CartPriceService $cartPriceService
private readonly CartPriceService $cartPriceService,
) {
parent::__construct($localeCodeProvider, $systemConfigService, $credentialsUtil);
}

public function buildExpressCheckoutButtonData(
SalesChannelContext $salesChannelContext,
bool $addProductToCart = false
bool $addProductToCart = false,
): ?ExpressCheckoutButtonData {
$cart = $this->cartService->getCart($salesChannelContext->getToken(), $salesChannelContext);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ShippingInformationMessageHandler
public function __construct(
private readonly EntityRepository $orderDeliveryRepository,
private readonly OrderResource $orderResource,
private readonly LoggerInterface $logger
private readonly LoggerInterface $logger,
) {
}

Expand Down
6 changes: 3 additions & 3 deletions src/Checkout/Order/Shipping/Service/ShippingService.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct(
EntityRepository $salesChannelRepository,
EntityRepository $orderTransactionRepository,
EntityRepository $shippingMethodRepository,
LoggerInterface $logger
LoggerInterface $logger,
) {
$this->shippingResource = $shippingResource;
$this->salesChannelRepository = $salesChannelRepository;
Expand Down Expand Up @@ -92,7 +92,7 @@ private function addTrackers(
string $transactionId,
string $orderDeliveryId,
string $carrier,
string $salesChannelId
string $salesChannelId,
): void {
if (!$addedTrackingCodes) {
return;
Expand Down Expand Up @@ -121,7 +121,7 @@ private function removeTrackers(
string $transactionId,
string $orderDeliveryId,
string $carrier,
string $salesChannelId
string $salesChannelId,
): void {
if (!$removedTrackingCodes) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/PUI/PUISubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(
SettingsValidationServiceInterface $settingsValidationService,
PUIFraudNetDataService $puiFraudNetDataService,
PUIPaymentInstructionDataService $puiPaymentInstructionDataService,
LoggerInterface $logger
LoggerInterface $logger,
) {
$this->settingsValidationService = $settingsValidationService;
$this->puiFraudNetDataService = $puiFraudNetDataService;
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/PUI/Service/PUICustomerDataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class PUICustomerDataService
*/
public function __construct(
EntityRepository $orderAddressRepository,
EntityRepository $customerRepository
EntityRepository $customerRepository,
) {
$this->orderAddressRepository = $orderAddressRepository;
$this->customerRepository = $customerRepository;
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/PUI/Service/PUIFraudNetDataService.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PUIFraudNetDataService
*/
public function __construct(
PaymentMethodDataRegistry $paymentMethodDataRegistry,
CredentialsUtilInterface $credentialsUtil
CredentialsUtilInterface $credentialsUtil,
) {
$this->paymentMethodDataRegistry = $paymentMethodDataRegistry;
$this->credentialsUtil = $credentialsUtil;
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/PUI/Service/PUIInstructionsFetchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct(
private readonly EntityRepository $orderTransactionRepository,
private readonly OrderResource $orderResource,
private readonly OrderTransactionStateHandler $orderTransactionStateHandler,
private readonly TransactionDataService $transactionDataService
private readonly TransactionDataService $transactionDataService,
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class PUIPaymentInstructionDataService
public function __construct(
PaymentMethodDataRegistry $paymentMethodDataRegistry,
AbstractPUIPaymentInstructionsRoute $puiPaymentInstructionsRoute,
RouterInterface $router
RouterInterface $router,
) {
$this->paymentMethodDataRegistry = $paymentMethodDataRegistry;
$this->puiPaymentInstructionsRoute = $puiPaymentInstructionsRoute;
Expand Down
8 changes: 4 additions & 4 deletions src/Checkout/Payment/Handler/PayPalHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(
private readonly OrderPatchService $orderPatchService,
private readonly TransactionDataService $transactionDataService,
private readonly VaultTokenService $vaultTokenService,
private readonly LoggerInterface $logger
private readonly LoggerInterface $logger,
) {
}

Expand All @@ -52,7 +52,7 @@ public function __construct(
public function handlePayPalOrder(
SyncPaymentTransactionStruct $transaction,
RequestDataBag $requestDataBag,
SalesChannelContext $salesChannelContext
SalesChannelContext $salesChannelContext,
): RedirectResponse {
$this->logger->debug('Started');

Expand Down Expand Up @@ -123,7 +123,7 @@ public function handlePayPalOrder(
public function handlePreparedOrder(
AsyncPaymentTransactionStruct $transaction,
RequestDataBag $dataBag,
SalesChannelContext $salesChannelContext
SalesChannelContext $salesChannelContext,
): RedirectResponse {
$this->logger->debug('Started');
$paypalOrderId = $dataBag->get(AbstractPaymentMethodHandler::PAYPAL_PAYMENT_ORDER_ID_INPUT_NAME);
Expand Down Expand Up @@ -160,7 +160,7 @@ public function handleFinalizeOrder(
string $paypalOrderId,
string $salesChannelId,
SalesChannelContext $context,
string $partnerAttributionId
string $partnerAttributionId,
): void {
$this->logger->debug('Started');

Expand Down
10 changes: 5 additions & 5 deletions src/Checkout/Payment/Handler/PlusPuiHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function __construct(
TransactionPatchBuilder $transactionPatchBuilder,
ShippingAddressPatchBuilder $shippingAddressPatchBuilder,
OrderTransactionStateHandler $orderTransactionStateHandler,
LoggerInterface $logger
LoggerInterface $logger,
) {
$this->paymentResource = $paymentResource;
$this->orderTransactionRepo = $orderTransactionRepo;
Expand All @@ -83,7 +83,7 @@ public function handlePlusPayment(
AsyncPaymentTransactionStruct $transaction,
RequestDataBag $dataBag,
SalesChannelContext $salesChannelContext,
CustomerEntity $customer
CustomerEntity $customer,
): RedirectResponse {
$this->logger->debug('Started');
$paypalPaymentId = $dataBag->get(self::PAYPAL_PAYMENT_ID_INPUT_NAME);
Expand Down Expand Up @@ -117,7 +117,7 @@ public function handleFinalizePayment(
Context $context,
string $paymentId,
string $payerId,
string $partnerAttributionId
string $partnerAttributionId,
): void {
$this->logger->debug('Started');
$transactionId = $transaction->getOrderTransaction()->getId();
Expand Down Expand Up @@ -192,7 +192,7 @@ private function patchPayPalPayment(
array $patches,
string $paypalPaymentId,
string $salesChannelId,
string $orderTransactionId
string $orderTransactionId,
): void {
try {
$this->paymentResource->patch($patches, $paypalPaymentId, $salesChannelId);
Expand All @@ -208,7 +208,7 @@ private function addPayPalTransactionId(
AsyncPaymentTransactionStruct $transaction,
string $paypalPaymentId,
Context $context,
?string $paypalToken = null
?string $paypalToken = null,
): void {
$customFields = [
SwagPayPal::ORDER_TRANSACTION_CUSTOM_FIELDS_PAYPAL_TRANSACTION_ID => $paypalPaymentId,
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/Payment/Method/APMHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct(
SettingsValidationServiceInterface $settingsValidationService,
OrderResource $orderResource,
LoggerInterface $logger,
AbstractAPMOrderBuilder $orderBuilder
AbstractAPMOrderBuilder $orderBuilder,
) {
$this->transactionDataService = $transactionDataService;
$this->orderTransactionStateHandler = $orderTransactionStateHandler;
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/Payment/Method/ApplePayHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function __construct(
LoggerInterface $logger,
OrderResource $orderResource,
VaultTokenService $vaultTokenService,
private readonly CardValidatorInterface $applePayValidator
private readonly CardValidatorInterface $applePayValidator,
) {
parent::__construct($settingsValidationService, $orderTransactionStateHandler, $orderExecuteService, $orderPatchService, $transactionDataService, $logger, $orderResource, $vaultTokenService);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/Payment/Method/GooglePayHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(
LoggerInterface $logger,
OrderResource $orderResource,
VaultTokenService $vaultTokenService,
private readonly CardValidatorInterface $googlePayValidator
private readonly CardValidatorInterface $googlePayValidator,
) {
parent::__construct($settingsValidationService, $orderTransactionStateHandler, $orderExecuteService, $orderPatchService, $transactionDataService, $logger, $orderResource, $vaultTokenService);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Checkout/Payment/Method/PUIHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function __construct(
PUICustomerDataService $puiCustomerDataService,
RequestStack $requestStack,
TranslatorInterface $translator,
LoggerInterface $logger
LoggerInterface $logger,
) {
$this->settingsValidationService = $settingsValidationService;
$this->orderTransactionStateHandler = $orderTransactionStateHandler;
Expand Down
6 changes: 3 additions & 3 deletions src/Checkout/Payment/PayPalPaymentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function __construct(
public function pay(
AsyncPaymentTransactionStruct $transaction,
RequestDataBag $dataBag,
SalesChannelContext $salesChannelContext
SalesChannelContext $salesChannelContext,
): RedirectResponse {
$this->logger->debug('Started');
$transactionId = $transaction->getOrderTransaction()->getId();
Expand Down Expand Up @@ -121,7 +121,7 @@ public function pay(
public function finalize(
AsyncPaymentTransactionStruct $transaction,
Request $request,
SalesChannelContext $salesChannelContext
SalesChannelContext $salesChannelContext,
): void {
$this->logger->debug('Started');

Expand Down Expand Up @@ -235,7 +235,7 @@ private function getPartnerAttributionId(bool $isECS, bool $isSPB, bool $isPlus)

private function transactionAlreadyFinalized(
AsyncPaymentTransactionStruct $transaction,
SalesChannelContext $salesChannelContext
SalesChannelContext $salesChannelContext,
): bool {
$transactionStateMachineStateId = $transaction->getOrderTransaction()->getStateId();
$criteria = new Criteria([$transactionStateMachineStateId]);
Expand Down
4 changes: 2 additions & 2 deletions src/Checkout/Payment/Service/OrderExecuteService.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
OrderResource $orderResource,
OrderTransactionStateHandler $orderTransactionStateHandler,
OrderNumberPatchBuilder $orderNumberPatchBuilder,
LoggerInterface $logger
LoggerInterface $logger,
) {
$this->orderResource = $orderResource;
$this->orderTransactionStateHandler = $orderTransactionStateHandler;
Expand All @@ -55,7 +55,7 @@ public function captureOrAuthorizeOrder(
PayPalOrder $paypalOrder,
string $salesChannelId,
Context $context,
string $partnerAttributionId
string $partnerAttributionId,
): PayPalOrder {
$this->logger->debug('Started');

Expand Down
4 changes: 2 additions & 2 deletions src/Checkout/Payment/Service/OrderPatchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class OrderPatchService
public function __construct(
SystemConfigService $systemConfigService,
PurchaseUnitPatchBuilder $purchaseUnitPatchBuilder,
OrderResource $orderResource
OrderResource $orderResource,
) {
$this->systemConfigService = $systemConfigService;
$this->purchaseUnitPatchBuilder = $purchaseUnitPatchBuilder;
Expand All @@ -47,7 +47,7 @@ public function patchOrder(
OrderTransactionEntity $orderTransaction,
SalesChannelContext $salesChannelContext,
string $paypalOrderId,
string $partnerAttributionId
string $partnerAttributionId,
): void {
$patches = [
$this->purchaseUnitPatchBuilder->createFinalPurchaseUnitPatch(
Expand Down
Loading

0 comments on commit 9693587

Please sign in to comment.