diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 4d4d1c6d..a1e22345 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @Adyen/plugin-developers +* @brankologeecom @MarijaIv @tamaralogeecom @AleksandarBoljanovic @goran-stamenkovski-logeecom @teodoratimoti @DamjanLogeecom diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 51c3097d..0da3f673 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -52,7 +52,7 @@ jobs: docker exec shopware6 bash -c 'php bin/console adyen:fetch-logos' - name: Run E2E Tests - run: docker-compose -f .github/workflows/templates/docker-compose.playwright.yml run --rm playwright /e2e.sh + run: docker compose -f .github/workflows/templates/docker-compose.playwright.yml run --rm playwright /e2e.sh env: INTEGRATION_TESTS_BRANCH: develop SHOPWARE_BASE_URL: ${{secrets.SHOPWARE_BASE_URL}} diff --git a/.github/workflows/templates/docker-compose.playwright.yml b/.github/workflows/templates/docker-compose.playwright.yml index d8386007..6f9c36be 100644 --- a/.github/workflows/templates/docker-compose.playwright.yml +++ b/.github/workflows/templates/docker-compose.playwright.yml @@ -2,7 +2,7 @@ version: '3' services: playwright: - image: mcr.microsoft.com/playwright:focal + image: mcr.microsoft.com/playwright:v1.47.0-focal networks: - localnetwork shm_size: 1gb diff --git a/composer.json b/composer.json index be33e546..88ab69c2 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ } ], "description": "Official Shopware 6 Plugin to connect to Payment Service Provider Adyen", - "version": "3.16.1", + "version": "3.16.2", "type": "shopware-platform-plugin", "license": "MIT", "require": { diff --git a/src/AdyenPaymentShopware6.php b/src/AdyenPaymentShopware6.php index ad47fd45..d2393037 100644 --- a/src/AdyenPaymentShopware6.php +++ b/src/AdyenPaymentShopware6.php @@ -53,7 +53,7 @@ public function installJsAssets($shopwareVersion) $adminAssetPath = __DIR__ . '/Resources/public/administration/js/adyen-payment-shopware6.js'; if (\version_compare($shopwareVersion, '6.5.0.0', '<')) { $resultStorefront = $this->safeCopyAsset( - __DIR__ . '/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware64.js.dist', + __DIR__ . '/Resources/app/storefront/build/storefront/js/adyen-payment-shopware64.js.dist', $storefrontAssetPath ); $resultAdmin = $this->safeCopyAsset( @@ -62,11 +62,11 @@ public function installJsAssets($shopwareVersion) ); } else { $resultStorefront = $this->safeCopyAsset( - __DIR__ . '/Resources/app/storefront/dist/storefront/js/adyen-payment-shopware65.js.dist', + __DIR__ . '/Resources/app/storefront/build/storefront/js/adyen-payment-shopware65.js.dist', $storefrontAssetPath ); $resultAdmin = $this->safeCopyAsset( - __DIR__ . '/Resources/public/administration/js/adyen-payment-shopware64.js.dist', + __DIR__ . '/Resources/public/administration/js/adyen-payment-shopware65.js.dist', $adminAssetPath ); } diff --git a/src/Handlers/AbstractPaymentMethodHandler.php b/src/Handlers/AbstractPaymentMethodHandler.php index 56389ac4..bcfa06fa 100644 --- a/src/Handlers/AbstractPaymentMethodHandler.php +++ b/src/Handlers/AbstractPaymentMethodHandler.php @@ -610,11 +610,17 @@ protected function preparePaymentsRequest( $this->getProduct($orderLine->getProductId(), $salesChannelContext->getContext()) : null; + $domainUrl= null; + $domains = $salesChannelContext->getSalesChannel()->getDomains(); + if ($domains && $domains->first()) { + $domainUrl = $domains->first()->getUrl(); + } + // Add url for only real product and not for the custom cart items. - if (!is_null($product->getId())) { + if (!is_null($product->getId()) && !is_null($domainUrl)) { $productUrl = sprintf( "%s/detail/%s", - $salesChannelContext->getSalesChannel()->getDomains()->first()->getUrl(), + $domainUrl, $product->getId() ); } else { diff --git a/src/Migration/Migration1626331358AdyenRefund.php b/src/Migration/Migration1626331358AdyenRefund.php index df7337bc..211a6954 100644 --- a/src/Migration/Migration1626331358AdyenRefund.php +++ b/src/Migration/Migration1626331358AdyenRefund.php @@ -24,9 +24,7 @@ public function update(Connection $connection): void `created_at` DATETIME(3) NOT NULL, `updated_at` DATETIME(3) NULL, `amount` INT(11) NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk.adyen_refund.order_transaction_id` - FOREIGN KEY (order_transaction_id) references `order_transaction` (id) + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; SQL ); diff --git a/src/Migration/Migration1646742586AdyenPaymentCapture.php b/src/Migration/Migration1646742586AdyenPaymentCapture.php index 89a1cf0a..4e90bf0a 100644 --- a/src/Migration/Migration1646742586AdyenPaymentCapture.php +++ b/src/Migration/Migration1646742586AdyenPaymentCapture.php @@ -24,9 +24,7 @@ public function update(Connection $connection): void `created_at` DATETIME(3) NOT NULL, `updated_at` DATETIME(3) NULL, `amount` INT(11) NOT NULL, - PRIMARY KEY (`id`), - CONSTRAINT `fk.adyen_payment_capture.order_transaction_id` - FOREIGN KEY (order_transaction_id) references `order_transaction` (id) + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; SQL ); diff --git a/src/Migration/Migration1669129247AdyenPayment.php b/src/Migration/Migration1669129247AdyenPayment.php index 785d48f3..0bf026d5 100644 --- a/src/Migration/Migration1669129247AdyenPayment.php +++ b/src/Migration/Migration1669129247AdyenPayment.php @@ -31,9 +31,7 @@ public function update(Connection $connection): void `updated_at` DATETIME(3) DEFAULT NULL COMMENT 'Updated at', PRIMARY KEY (`id`), KEY `ADYEN_PAYMENT_MERCHANT_REFERENCE` (`merchant_reference`), - KEY `ADYEN_PAYMENT_MERCHANT_ORDER_REFERENCE` (`merchant_order_reference`), - CONSTRAINT `fk.adyen_payment.order_transaction_id` - FOREIGN KEY (order_transaction_id) references `order_transaction` (id) + KEY `ADYEN_PAYMENT_MERCHANT_ORDER_REFERENCE` (`merchant_order_reference`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; SQL; diff --git a/src/Migration/Migration1727273181AlterAdyenRefund.php b/src/Migration/Migration1727273181AlterAdyenRefund.php new file mode 100755 index 00000000..7287504a --- /dev/null +++ b/src/Migration/Migration1727273181AlterAdyenRefund.php @@ -0,0 +1,32 @@ +executeStatement(<<executeStatement(<<executeStatement(<<get()); } - $responseData = []; + $responseData = new PaymentMethodsResponse(); try { $paymentsApiService = new PaymentsApi( $this->clientService->getClient($context->getSalesChannelId()) diff --git a/src/Storefront/Controller/FrontendProxyController.php b/src/Storefront/Controller/FrontendProxyController.php index 0677d0e5..e50f34b0 100644 --- a/src/Storefront/Controller/FrontendProxyController.php +++ b/src/Storefront/Controller/FrontendProxyController.php @@ -30,15 +30,12 @@ use Adyen\Shopware\Controller\StoreApi\Payment\PaymentController; use Adyen\Shopware\Exception\ValidationException; use Shopware\Core\Checkout\Cart\SalesChannel\AbstractCartOrderRoute; -use Shopware\Core\Checkout\Cart\SalesChannel\CartOrderRoute; use Shopware\Core\Checkout\Cart\SalesChannel\CartService; use Shopware\Core\Checkout\Order\SalesChannel\SetPaymentOrderRouteResponse; use Shopware\Core\Checkout\Payment\SalesChannel\AbstractHandlePaymentMethodRoute; -use Shopware\Core\Checkout\Payment\SalesChannel\HandlePaymentMethodRoute; use Shopware\Core\Framework\Validation\DataBag\RequestDataBag; use Shopware\Core\System\SalesChannel\ContextTokenResponse; use Shopware\Core\System\SalesChannel\SalesChannel\AbstractContextSwitchRoute; -use Shopware\Core\System\SalesChannel\SalesChannel\ContextSwitchRoute; use Shopware\Core\System\SalesChannel\SalesChannelContext; use Shopware\Storefront\Controller\StorefrontController; use Symfony\Component\HttpFoundation\Request; @@ -50,15 +47,51 @@ */ class FrontendProxyController extends StorefrontController { + /** + * @var AbstractCartOrderRoute + */ + private AbstractCartOrderRoute $cartOrderRoute; - private CartOrderRoute $cartOrderRoute; + /** + * @var CartService + */ private CartService $cartService; - private ContextSwitchRoute $contextSwitchRoute; - private HandlePaymentMethodRoute $handlePaymentMethodRoute; + + /** + * @var AbstractContextSwitchRoute + */ + private AbstractContextSwitchRoute $contextSwitchRoute; + + /** + * @var AbstractHandlePaymentMethodRoute + */ + private AbstractHandlePaymentMethodRoute $handlePaymentMethodRoute; + + /** + * @var PaymentController + */ private PaymentController $paymentController; + + /** + * @var OrderApiController + */ private OrderApiController $orderApiController; + + /** + * @var DonateController + */ private DonateController $donateController; + + /** + * @param AbstractCartOrderRoute $cartOrderRoute + * @param AbstractHandlePaymentMethodRoute $handlePaymentMethodRoute + * @param AbstractContextSwitchRoute $contextSwitchRoute + * @param CartService $cartService + * @param PaymentController $paymentController + * @param OrderApiController $orderApiController + * @param DonateController $donateController + */ public function __construct( AbstractCartOrderRoute $cartOrderRoute, AbstractHandlePaymentMethodRoute $handlePaymentMethodRoute, diff --git a/src/Subscriber/PaymentSubscriber.php b/src/Subscriber/PaymentSubscriber.php index c1c98e2d..db021ebb 100644 --- a/src/Subscriber/PaymentSubscriber.php +++ b/src/Subscriber/PaymentSubscriber.php @@ -238,7 +238,7 @@ public function onShoppingCartLoaded(PageLoadedEvent $event) $giftcards = []; if ($paymentMethod && $paymentMethod->getActive()) { $giftcards = $this->paymentMethodsFilterService->filterAdyenPaymentMethodsByType( - $paymentMethods->getPaymentMethods(), + $paymentMethods->getPaymentMethods() ?? [], 'giftcard' ); }