diff --git a/.github/workflows/e2e-test.yml b/.github/workflows/e2e-test.yml index 5f57e95e..60201f9f 100644 --- a/.github/workflows/e2e-test.yml +++ b/.github/workflows/e2e-test.yml @@ -15,7 +15,7 @@ jobs: timeout-minutes: 20 strategy: fail-fast: false - if: ${{ github.actor != 'renovate[bot]' || github.actor != 'lgtm-com[bot]' }} + if: ${{ github.actor != 'renovate[bot]' && github.actor != 'lgtm-com[bot]' }} # Prevent bots from initiating E2E pipeline steps: - name: Clone Code @@ -66,3 +66,25 @@ jobs: with: name: html-report path: test-report + + - name: Copy Adyen api logs from container if available + if: always() + run: | + # Create a local directory for logs + mkdir -p logs + + # Check if the log file exists in the container + if docker exec shopware6 test -f /var/www/html/var/log/adyen/api.log; then + echo "Log file exists. Copying..." + docker cp shopware6:/var/www/html/var/log/adyen/api.log logs + else + echo "Log file does not exist. Skipping copy." + fi + shell: bash + + - name: Upload Adyen api Logs + if: always() + uses: actions/upload-artifact@v3 + with: + name: adyen-api-logs + path: logs/* \ No newline at end of file diff --git a/.github/workflows/e2e/adyen-integration-tools-tests/projects/common/redirect/KlarnaPaymentPage.js b/.github/workflows/e2e/adyen-integration-tools-tests/projects/common/redirect/KlarnaPaymentPage.js index f47b1ba8..da5cd6e6 100644 --- a/.github/workflows/e2e/adyen-integration-tools-tests/projects/common/redirect/KlarnaPaymentPage.js +++ b/.github/workflows/e2e/adyen-integration-tools-tests/projects/common/redirect/KlarnaPaymentPage.js @@ -30,7 +30,6 @@ export default class KlarnaPaymentPage { if (await this.paymentTypeSelectButton.isVisible()) { await this.paymentTypeSelectButton.click(); - await this.paymentTypeSelectButton.click(); } } diff --git a/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/pageObjects/plugin/ShippingDetails.page.js b/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/pageObjects/plugin/ShippingDetails.page.js index 24813ad8..5b587c1c 100644 --- a/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/pageObjects/plugin/ShippingDetails.page.js +++ b/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/pageObjects/plugin/ShippingDetails.page.js @@ -19,11 +19,11 @@ export class ShippingDetailsPage extends SPRBasePage { this.editSalutationDropDown = this.editAddressEditorWrapper.locator("#billing-addresspersonalSalutation"); this.editFirstNameField = this.editAddressEditorWrapper.locator("#billing-addresspersonalFirstName"); this.editLastNameField = this.editAddressEditorWrapper.locator("#billing-addresspersonalLastName"); - this.editAddressField = this.editAddressEditorWrapper.locator("#billing-addressAddressStreet"); - this.editPostCodeField = this.editAddressEditorWrapper.locator("#billing-addressAddressZipcode"); - this.editCityField = this.editAddressEditorWrapper.locator("#billing-addressAddressCity"); - this.editCountrySelectDropdown = this.editAddressEditorWrapper.locator("#billing-addressAddressCountry"); - this.editStateSelectDropDown = this.editAddressEditorWrapper.locator("#billing-addressAddressCountryState"); + this.editAddressField = this.editAddressEditorWrapper.locator("#billing-edit-addressAddressStreet"); + this.editPostCodeField = this.editAddressEditorWrapper.locator("#billing-edit-addressAddressZipcode"); + this.editCityField = this.editAddressEditorWrapper.locator("#billing-edit-addressAddressCity"); + this.editCountrySelectDropdown = this.editAddressEditorWrapper.locator("#billing-edit-addressAddressCountry"); + this.editStateSelectDropDown = this.editAddressEditorWrapper.locator("#billing-edit-addressAddressCountryState"); this.editSaveAddressButton = this.editAddressEditorWrapper.locator("button[type='submit']"); diff --git a/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/tests/ClearPayPayment.spec.js b/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/tests/ClearPayPayment.spec.js index ed629d51..235fa2ac 100644 --- a/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/tests/ClearPayPayment.spec.js +++ b/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/tests/ClearPayPayment.spec.js @@ -18,6 +18,7 @@ test.describe.parallel("Payment via ClearPay", () => { await doPrePaymentChecks(page); }); + // Requires specific locations (VPN) test.skip("should succeed", async ({ page }) => { await payViaClearPay(page); diff --git a/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/tests/PayPalPayment.spec.js b/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/tests/PayPalPayment.spec.js index 339af266..d9efd7d7 100644 --- a/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/tests/PayPalPayment.spec.js +++ b/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/tests/PayPalPayment.spec.js @@ -12,7 +12,7 @@ import { PayPalPaymentPage } from "../../common/redirect/PayPalPaymentPage.js"; const paymentResources = new PaymentResources(); const users = paymentResources.guestUser; -test.describe.skip("Payment via PayPal", () => { +test.describe("Payment via PayPal", () => { test.beforeEach(async ({ page }) => { await goToShippingWithFullCart(page); await proceedToPaymentAs(page, users.regular); diff --git a/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/tests/SepaDirectDebitPayment.spec.js b/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/tests/SepaDirectDebitPayment.spec.js index 8108adb5..aa40a981 100644 --- a/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/tests/SepaDirectDebitPayment.spec.js +++ b/.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/tests/SepaDirectDebitPayment.spec.js @@ -20,7 +20,7 @@ test.describe("Payment via SEPA Direct debit", () => { }); // Depends on ECP-8525 - test.fixme("should succeed", async ({ page }) => { + test("should succeed", async ({ page }) => { const paymentDetailPage = new PaymentDetailsPage(page); const sepaPaymentSection = await paymentDetailPage.selectSepaDirectDebit(); diff --git a/.github/workflows/templates/docker-compose.playwright.yml b/.github/workflows/templates/docker-compose.playwright.yml index fdbcf10b..017672fa 100644 --- a/.github/workflows/templates/docker-compose.playwright.yml +++ b/.github/workflows/templates/docker-compose.playwright.yml @@ -16,7 +16,7 @@ services: volumes: - ../scripts/e2e.sh:/e2e.sh - ../e2e/adyen-integration-tools-tests/:/tmp/adyen-integration-tools-tests/ - - ../../../test-report:/tmp/test-report + - ../../test-report:/tmp/test-report networks: localnetwork: diff --git a/.gitignore b/.gitignore index 058cce53..207d333b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,8 @@ .DS_Store #composer -vendor/ \ No newline at end of file +vendor/ + +#github actions +.github/test-report +.github/workflows/e2e/adyen-integration-tools-tests/projects/shopware/test-results \ No newline at end of file diff --git a/src/Handlers/AbstractPaymentMethodHandler.php b/src/Handlers/AbstractPaymentMethodHandler.php index 363aa71f..45b6b971 100644 --- a/src/Handlers/AbstractPaymentMethodHandler.php +++ b/src/Handlers/AbstractPaymentMethodHandler.php @@ -292,13 +292,16 @@ public function pay( */ $stateData = $requestStateData ?? $storedStateData ?? []; + $billieData = []; $companyName = $dataBag->get('companyName'); $registrationNumber = $dataBag->get('registrationNumber'); - $billieData = [ - 'companyName' => $companyName, - 'registrationNumber' => $registrationNumber, - ]; + if ($companyName && $registrationNumber) { + $billieData = [ + 'companyName' => $companyName, + 'registrationNumber' => $registrationNumber, + ]; + } /* * If there are more than one stateData and /payments calls have been completed, @@ -773,7 +776,10 @@ private function getPaymentRequest( $billieData = [] ) { $transactionId = $transaction->getOrderTransaction()->getId(); - $stateData['billieData'] = $billieData; + if ($billieData !== []) { + $stateData['billieData'] = $billieData; + } + try { $request = $this->preparePaymentsRequest( $salesChannelContext,