https://github.com/itk-dev/os2forms_payment
https://github.com/itk-dev/os2forms_payment
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/itk-dev/os2forms_payment
- Owner: itk-dev
- License: mit
- Created: 2023-09-08T11:13:22.000Z (over 2 years ago)
- Default Branch: develop
- Last Pushed: 2023-10-13T06:57:40.000Z (over 2 years ago)
- Last Synced: 2024-09-02T06:48:26.107Z (over 1 year ago)
- Language: PHP
- Size: 57.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# OS2Forms payment
## Installation
```sh
composer require os2forms/payment
drush pm:enable os2forms_payment
```
Define settings in `settings.local.php`:
```sh
// 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'] = '';
// Page containing terms and conditions URL, including protocol.
$settings['os2forms_payment']['terms_url'] = '';
// Page containing merchant terms URL, including protocol.
$settings['os2forms_payment']['merchant_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
```sh
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: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.3-fpm:latest composer install
docker run --rm --interactive --tty --volume ${PWD}:/app itkdev/php8.3-fpm:latest composer code-analysis
```