os2forms / os2forms_payment
OS2Forms支付
dev-develop
2023-10-13 06:57 UTC
Requires
- php: ^8.1
- drupal/webform: ^6.1
- drush/drush: ^11 || ^12
- itk-dev/serviceplatformen: ^1.4
- symfony/options-resolver: ^5.4 || ^6.0
Requires (Dev)
- dealerdirect/phpcodesniffer-composer-installer: ^0.7.1
- drupal/coder: ^8.3
- mglaman/drupal-check: ^1.4
- phpunit/phpunit: ^9.5
This package is not auto-updated.
Last update: 2024-09-11 15:08:52 UTC
README
安装
composer require os2forms/payment drush pm:enable os2forms_payment
在 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;
设置
确保设置值如上所述已设置。
- 创建一个新的表单
- 转到设置 -> 表单 -> 表单预览设置 -> 启用预览页面(必填)
- 在表单中添加支付元素
- 转到支付元素设置并选择包含应付金额的元素(字段类型:隐藏,选择)。
- 测试表单。Nets网关应在审查页面上出现。
编码规范
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
代码分析
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