diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..2405b8fb2 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,14 @@ + + +| Questions | Answers +|-----------------| ------------------------------------------------------- +| Branch? | Master/Release +| Description? | Please be specific when describing the PR.
Every detail helps: versions, browser/server configuration, specific module/theme, etc. Feel free to add more information below this table. +| Type? | bug fix / improvement / new feature / refactoring +| How to test? | Indicate how to verify that this change works as expected. +| Fixed issue ? | If none leave blank diff --git a/.github/workflows/E2E_On_PR.yml b/.github/workflows/E2E_On_PR.yml index 119cf4207..ed658e494 100755 --- a/.github/workflows/E2E_On_PR.yml +++ b/.github/workflows/E2E_On_PR.yml @@ -1,7 +1,6 @@ name: Cypress E2E Automation [develop branch] on: pull_request: - types: [opened, reopened] branches: [develop, develop**, develop-**] concurrency: @@ -59,7 +58,7 @@ jobs: run: | ${{ matrix.make }} - - name: Waiting for Ngrok tunnel + - name: Waiting for Ngrok run: | URL="${{ matrix.url }}" TIMEOUT=120 @@ -102,7 +101,7 @@ jobs: - name: Archive videos and screenshots if: ${{ always() }} - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Cypress_Mollie_videos_screenshots_${{ matrix.prestashop }} retention-days: 2 diff --git a/.github/workflows/create_zip.yml b/.github/workflows/create_zip.yml new file mode 100644 index 000000000..b83d575bd --- /dev/null +++ b/.github/workflows/create_zip.yml @@ -0,0 +1,40 @@ +name: Create module ZIP + +on: + workflow_dispatch: + +jobs: + prepare-zip: + name: Prepare module ZIP artifact + runs-on: ubuntu-latest + env: + MODULE_NAME: mollie + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.12.0 + with: + access_token: ${{ github.token }} + + - name: checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Build module ZIP + run: | + composer install --no-dev --optimize-autoloader --classmap-authoritative + composer dump-autoload --no-dev --optimize --classmap-authoritative + cp .github/.htaccess vendor/.htaccess + rm -rf .git .docker .editorconfig .github tests .php-cs-fixer.php Makefile cypress .docker cypress.config.js cypress.env.json docker-compose*.yml .gitignore bin codeception.yml package-lock.json package.json .php_cs.dist .php-cs-fixer.dist .php-cs-fixer.dist.php + mv .env.dist .env + mkdir ${{ env.MODULE_NAME }} + rsync -Rr ./ ./${{ env.MODULE_NAME }} + shopt -s extglob + rm -r !(${{ env.MODULE_NAME }}) + find . -maxdepth 1 -type f -exec rm "{}" \; + cd ${{ env.MODULE_NAME }} && rm -rf ${{ env.MODULE_NAME }} + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ env.MODULE_NAME }} + path: ./ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1d84d2267..32f780890 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,12 @@ name: Tests -on: [ pull_request ] +on: + pull_request: + branches: + - '**' + push: + branches: + - 'master' jobs: php-cs-fixer: @@ -62,3 +68,33 @@ jobs: - name: Run PHPStan run: docker run --rm --volumes-from temp-ps -v $PWD:/web/module -e _PS_ROOT_DIR_=/var/www/html --workdir=/web/module phpstan/phpstan:0.12 analyse --configuration=/web/module/tests/phpstan/phpstan_base.neon --debug --error-format github + + prepare-zip: + name: Prepare module ZIP artifact + runs-on: ubuntu-latest + needs: [ test ] + env: + MODULE_NAME: mollie + steps: + # todo ask for permissions to add cancel previous workflow action + - name: checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Build module ZIP + run: | + composer install --no-dev --optimize-autoloader --classmap-authoritative + composer dump-autoload --no-dev --optimize --classmap-authoritative + rm -rf .git .github tests .php-cs-fixer.php Makefile cypress* docker-compose*.yml package.json package-lock.json .docker + mkdir ${{ env.MODULE_NAME }} + rsync -Rr ./ ./${{ env.MODULE_NAME }} + shopt -s extglob + rm -r !(${{ env.MODULE_NAME }}) + find . -maxdepth 1 -type f -exec rm "{}" \; + cd ${{ env.MODULE_NAME }} && rm -rf ${{ env.MODULE_NAME }} + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ env.MODULE_NAME }} + path: ./ \ No newline at end of file diff --git a/Makefile b/Makefile index de3a68b13..e675d76ee 100755 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ module = mollie # target: fix-lint - Launch php cs fixer fix-lint: - docker-compose run --rm php sh -c "vendor/bin/php-cs-fixer fix --using-cache=no" + docker compose run --rm php sh -c "vendor/bin/php-cs-fixer fix --using-cache=no" # Launch the PS build and E2E Cypress app automatically. Eexample: make VERSION=1785 e2eh1785_local, make VERSION=8 e2eh8_local etc. # Warning: .env with secrets must be imported if you wanna test locally! This checks the .env existence, ignoring if there is no such on your machine. @@ -17,9 +17,9 @@ endif e2eh$(VERSION)_local: composer install # detaching containers - docker-compose -f docker-compose.$(VERSION).yml up -d --force-recreate + docker compose -f docker-compose.$(VERSION).yml up -d --force-recreate # sees what containers are running - docker-compose -f docker-compose.$(VERSION).yml ps + docker compose -f docker-compose.$(VERSION).yml ps make waiting-for-containers-local make seeding-customized-sql make installing-uninstalling-enabling-module @@ -29,9 +29,9 @@ e2eh$(VERSION)_local: # For CI build with PS autoinstall e2eh$(VERSION): # detaching containers - docker-compose -f docker-compose.$(VERSION).yml up -d --force-recreate + docker compose -f docker-compose.$(VERSION).yml up -d --force-recreate # sees what containers are running - docker-compose -f docker-compose.$(VERSION).yml ps + docker compose -f docker-compose.$(VERSION).yml ps make waiting-for-containers-CI make seeding-customized-sql make installing-uninstalling-enabling-module diff --git a/changelog.md b/changelog.md index eb2c90030..bf7f3bf8f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,12 @@ ![Mollie](https://www.mollie.nl/files/Mollie-Logo-Style-Small.png) # Changelog # + +## Changes in release 6.2.4 ## ++ Workflow improvements ++ Satispay payment method added ++ Pay by Bank payment method added + ## Changes in release 6.2.3 ## + Multi shop improvements with order states + Logging improvements diff --git a/composer.json b/composer.json index 4127a996b..9e6cbf27d 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,6 @@ "invertus/knapsack": "^10.0" }, "require-dev": { - "roave/security-advisories": "dev-latest", "invertus/prestashop-models": "^1.0", "prestashop/php-dev-tools": "*", "phpunit/phpunit": "~5.7", diff --git a/controllers/front/return.php b/controllers/front/return.php index d5c664310..18783dc22 100644 --- a/controllers/front/return.php +++ b/controllers/front/return.php @@ -107,7 +107,13 @@ public function initContent() } if (false === $data['mollie_info']) { $data['mollie_info'] = []; - $data['msg_details'] = $this->module->l('There is no order with this ID.', self::FILE_NAME); + //NOTE: information instead of error as this might occur due to cancellation of the payment + $logger->info(sprintf('There is no order with this order number - %s', (string) $orderNumber)); + + $data['msg_details'] = $this->module->l('Your payment was not successful. Try again.', self::FILE_NAME); + $this->setWarning($data['msg_details']); + + Tools::redirect(Context::getContext()->link->getPageLink('cart', true)); } elseif (PaymentMethod::BANKTRANSFER === $data['mollie_info']['method'] && PaymentStatus::STATUS_OPEN === $data['mollie_info']['bank_status'] ) { diff --git a/cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js b/cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js index 8b0657a29..2aa23bbc0 100755 --- a/cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js +++ b/cypress/e2e/ps8/05_mollie.ps8.PaymentTestsPaymentsAPI.js @@ -161,8 +161,6 @@ it('C339391: 56 Przelewy24 Checkouting [Payments API]', () => { cy.contains('Przelewy24').click({force:true}) cy.get('.condition-label > .js-terms').click({force:true}) cy.contains('Place order').click() - cy.get('.input-float > input').type('testing@testing.com') - cy.get('[class="button form__button"]').click() cy.get('[value="paid"]').click() cy.get('[class="button form__button"]').click() cy.get('#content-hook_order_confirmation > .card-block').should('be.visible') diff --git a/mollie.php b/mollie.php index 57969e2a2..4e7c91505 100755 --- a/mollie.php +++ b/mollie.php @@ -89,7 +89,7 @@ public function __construct() { $this->name = 'mollie'; $this->tab = 'payments_gateways'; - $this->version = '6.2.3'; + $this->version = '6.2.4'; $this->author = 'Mollie B.V.'; $this->need_instance = 1; $this->bootstrap = true; diff --git a/src/Config/Config.php b/src/Config/Config.php index 7bb76294f..27abc82aa 100644 --- a/src/Config/Config.php +++ b/src/Config/Config.php @@ -59,13 +59,19 @@ class Config 'cartesbancaires' => ['fr'], 'directdebit' => [ 'fi', 'at', 'pt', 'be', 'bg', 'es', 'hr', 'cy', 'cz', 'dk', 'ee', 'fr', 'gf', 'de', 'gi', 'gr', 'gp', 'gg', 'hu', - 'is', 'ie', 'im', 'it', 'je', 'lv', 'li', 'lt', 'lu', 'pt', 'mt', 'mq', 'yt', 'mc', 'nl', 'no', 'pl', 'pt', 're', - 'ro', 'bl', 'mf', 'pm', 'sm', 'sk', 'sl', 'es', 'se', 'ch', 'gb', 'uk', + 'is', 'ie', 'im', 'it', 'je', 'lv', 'li', 'lt', 'lu', 'mt', 'mq', 'yt', 'mc', 'nl', 'no', 'pl', 're', + 'ro', 'bl', 'mf', 'pm', 'sm', 'sk', 'sl', 'se', 'ch', 'gb', 'uk', ], 'mybank' => [], 'trustly' => ['at', 'de', 'ee', 'es', 'fi', 'lt', 'lv', 'nl'], + 'satispay' => [ + 'at', 'be', 'bg', 'hr', 'cy', 'cz', 'dk', 'ee', 'fi', 'fr', 'de', 'gr', 'hu', 'is', 'ie', + 'it', 'lv', 'lt', 'lu', 'mt', 'nl', 'no', 'pl', 'pt', 'ro', 'sk', 'si', 'es', 'se', 'ch', + 'li', 'gb', 'tr', + ], 'riverty' => ['nl', 'be', 'de', 'at'], 'payconiq' => [], + 'paybybank' => ['at', 'be', 'cy', 'ee', 'fi', 'fr', 'de', 'gr', 'ie', 'it', 'lv', 'lt', 'lu', 'mt', 'nl', 'pt', 'sk', 'si', 'es', 'uk'], ]; const SUPPORTED_PHP_VERSION = '5.6'; @@ -327,6 +333,8 @@ class Config 'riverty' => 'Riverty', 'payconiq' => 'Payconiq', 'trustly' => 'Trustly', + 'satispay' => 'Satispay', + 'paybybank' => 'Pay by Bank', ]; public const LOG_SEVERITY_LEVEL_INFORMATIVE = 1;