Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drupal 10 readiness #4

Merged
merged 6 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -158,4 +158,4 @@ jobs:
node-version: '16'
- run: yarn install
- name: coding-standards-check
run: yarn coding-standards-check
run: yarn coding-standards-check
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,15 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Updated

- Made OS2Forms payment module Drupal 10 compatible

### Added

- Added OS2Forms payment module
- Added further payment validation via NETS API

### Fixed

- Corrected format of payment metods
- Corrected format of payment methods
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion os2forms_payment.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/Element/NetsEasyPaymentElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 3 additions & 3 deletions src/Helper/PaymentHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -12,6 +11,7 @@
use Drupal\webform\WebformSubmissionInterface;
use GuzzleHttp\ClientInterface;
use Psr\Http\Message\ResponseInterface;
use Symfony\Component\HttpFoundation\RequestStack;

/**
* Payment helper class.
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down
Loading