diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 89dea3f..f959b3e 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -23,7 +23,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [ '8.1' ] + php-versions: [ '8.3' ] dependency-version: [ prefer-lowest, prefer-stable ] steps: - uses: actions/checkout@master @@ -55,7 +55,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [ '8.1' ] + php-versions: [ '8.3' ] dependency-version: [ prefer-lowest, prefer-stable ] steps: - uses: actions/checkout@master @@ -88,7 +88,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-versions: [ '8.1' ] + php-versions: [ '8.3' ] dependency-version: [ prefer-lowest, prefer-stable ] steps: - uses: actions/checkout@master @@ -113,7 +113,7 @@ jobs: run: | # We need a Drupal project to run drupal-check (cf. https://github.com/mglaman/drupal-check#usage) # Install Drupal - composer --no-interaction create-project drupal/recommended-project:^9 --stability=dev drupal + composer --no-interaction create-project drupal/recommended-project:^10 --stability=dev drupal # Copy our module source code into the Drupal module folder. mkdir -p drupal/web/modules/contrib/os2forms_payment cp -r os2forms_payment.* composer.json src drupal/web/modules/contrib/os2forms_payment @@ -158,4 +158,4 @@ jobs: node-version: '16' - run: yarn install - name: coding-standards-check - run: yarn coding-standards-check \ No newline at end of file + run: yarn coding-standards-check diff --git a/CHANGELOG.md b/CHANGELOG.md index 885e99f..acc2f24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased +### Updated + +- Made OS2Forms payment module Drupal 10 compatible + ### Added - Added OS2Forms payment module @@ -16,4 +20,4 @@ Versioning](https://semver.org/spec/v2.0.0.html). ### Fixed -- Corrected format of payment metods +- Corrected format of payment methods diff --git a/README.md b/README.md index 3beb409..e3962b7 100644 --- a/README.md +++ b/README.md @@ -38,16 +38,16 @@ amount to pay (field types: Skjult, Vælg). ## Coding standards ```sh -docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer install -docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer coding-standards-check +docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer install +docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer coding-standards-check -docker run --rm --interactive --tty --volume ${PWD}:/app node:18 yarn --cwd /app install -docker run --rm --interactive --tty --volume ${PWD}:/app node:18 yarn --cwd /app coding-standards-check +docker run --rm --interactive --tty --volume ${PWD}:/app node:20 yarn --cwd /app install +docker run --rm --interactive --tty --volume ${PWD}:/app node:20 yarn --cwd /app coding-standards-check ``` ## Code analysis ```sh -docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer install -docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.1-fpm:latest composer code-analysis +docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer install +docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer code-analysis ``` diff --git a/composer.json b/composer.json index e07b9b8..26c442a 100644 --- a/composer.json +++ b/composer.json @@ -21,13 +21,13 @@ "php": "^8.1", "drupal/webform": "^6.1", "drush/drush": "^11 || ^12", - "symfony/options-resolver": "^5.4 || ^6.0", - "itk-dev/serviceplatformen": "^1.4" + "symfony/options-resolver": "^5.4 || ^6.0" }, "require-dev": { "drupal/coder": "^8.3", "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", "mglaman/drupal-check": "^1.4", + "mglaman/phpstan-drupal": "~1.2.0", "phpunit/phpunit": "^9.5" }, "scripts": { diff --git a/os2forms_payment.info.yml b/os2forms_payment.info.yml index 421d9c7..d043ceb 100644 --- a/os2forms_payment.info.yml +++ b/os2forms_payment.info.yml @@ -2,7 +2,7 @@ name: OS2forms payment type: module description: Accept payments through OS2forms via Nets EasyPay package: OS2Forms -core_version_requirement: ^9 +core_version_requirement: ^9 || ^10 dependencies: - webform:webform diff --git a/src/Element/NetsEasyPaymentElement.php b/src/Element/NetsEasyPaymentElement.php index 036d7bc..4b411e9 100644 --- a/src/Element/NetsEasyPaymentElement.php +++ b/src/Element/NetsEasyPaymentElement.php @@ -2,14 +2,14 @@ namespace Drupal\os2forms_payment\Element; -use Drupal\Core\Render\Element\FormElement; +use Drupal\Core\Render\Element\FormElementBase; /** * Provides an OS2forms payment element'. * * @FormElement("os2forms_payment_nets_easy_payment") */ -class NetsEasyPaymentElement extends FormElement { +class NetsEasyPaymentElement extends FormElementBase { /** * {@inheritdoc} diff --git a/src/Helper/PaymentHelper.php b/src/Helper/PaymentHelper.php index e1d67a3..dab5c62 100644 --- a/src/Helper/PaymentHelper.php +++ b/src/Helper/PaymentHelper.php @@ -3,7 +3,6 @@ namespace Drupal\os2forms_payment\Helper; use Drupal\Core\Form\FormStateInterface; -use Drupal\Core\Http\RequestStack; use Drupal\Core\Site\Settings; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\TempStore\PrivateTempStore; @@ -12,6 +11,7 @@ use Drupal\webform\WebformSubmissionInterface; use GuzzleHttp\ClientInterface; use Psr\Http\Message\ResponseInterface; +use Symfony\Component\HttpFoundation\RequestStack; /** * Payment helper class. @@ -328,7 +328,7 @@ public function responseToObject(ResponseInterface $response): object { } /** - * Sets the amount to pay in private tempoary storage. + * Sets the amount to pay in private temporary storage. * * @param float $amountToPay * The amount to pay. @@ -341,7 +341,7 @@ public function setAmountToPayTemp(float $amountToPay): void { } /** - * Gets the amount to pay in private tempoary storage. + * Gets the amount to pay from private temporary storage. * * @return float * The amount to pay.