os2forms/os2forms_payment

OS2Forms payment

Installs: 60

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 3

Forks: 0

Open Issues: 0

Type:drupal-module

dev-develop 2023-10-13 06:57 UTC

This package is not auto-updated.

Last update: 2024-04-24 13:21:03 UTC


README

Installation

composer require os2forms/payment
drush pm:enable os2forms_payment

Define settings in settings.local.php:

// CHECKOUT_KEY, both test and production, can be retrieved from Nets admin panel
$settings['os2forms_payment']['checkout_key'] = '';

// SECRET_KEY, both test and production, can be retrieved from Nets admin panel
$settings['os2forms_payment']['secret_key'] = '';

// Static page containing terms and conditions, e.g. /node/87
$settings['os2forms_payment']['terms_url'] = '';

// Boolean describing whether the module is operated in test mode
$settings['os2forms_payment']['test_mode'] = TRUE;

Setup

Make sure that the setting values described above are set.

  1. Create a new webform
  2. Goto Indstillinger -> Formular -> Form preview settings -> Enable preview page (Obligatorisk)
  3. Add a payent element on the form
  4. Go to the payment element settings and select the element containing the amount to pay (field types: Skjult, Vælg).
  5. Test the form. The Nets gateway should appear on the Review page.

Coding standards

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 node:18 yarn --cwd /app install
docker run --rm --interactive --tty --volume ${PWD}:/app node:18 yarn --cwd /app coding-standards-check

Code analysis

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