Skip to content

Commit

Permalink
Merge branch 'release/3.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
remcotolsma committed Aug 5, 2021
2 parents d6cd255 + 8d1392b commit 6113584
Show file tree
Hide file tree
Showing 11 changed files with 336 additions and 253 deletions.
35 changes: 23 additions & 12 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run

coverage:
tests:
override:
- command: ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
coverage:
file: build/logs/clover.xml
format: clover

environment:
php: 7.3.0
variables:
WP_TESTS_DB_NAME: 'wp_phpunit_tests'
WP_TESTS_DB_USER: 'root'
WP_TESTS_DB_PASS: ''
WP_TESTS_DB_HOST: 'localhost'
project_setup:
before:
- mysql -e "CREATE DATABASE wp_phpunit_tests"
WP_TESTS_DB_HOST: '127.0.0.1'

services:
mysql: 5.7

dependencies:
override:
- composer install --ignore-platform-reqs --no-interaction
nodes:
coverage:
tests:
override:
- command: ./vendor/bin/phpunit
coverage:
file: build/logs/clover.xml
format: clover

project_setup:
before:
- mysql -e "CREATE DATABASE wp_phpunit_tests"

filter:
excluded_paths:
Expand Down
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
## [Unreleased][unreleased]
-

## [3.0.0] - 2021-08-05
- Updated to `pronamic/wp-pay-core` version `3.0.0`.
- Updated to `pronamic/wp-money` version `2.0.0`.
- Changed `TaxedMoney` to `Money`, no tax info.
- Switched to `pronamic/wp-coding-standards`.
- Ignore unsupported recurring-only payment methods in payment method select field.

## [2.2.1] - 2021-01-21
- Fixed using undefined variable.
- Removed debug code.
Expand Down Expand Up @@ -59,7 +66,8 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
## 1.0.0 - 2015-11-05
- First release.

[unreleased]: https://github.com/wp-pay-extensions/formidable-forms/compare/2.2.1...HEAD
[unreleased]: https://github.com/wp-pay-extensions/formidable-forms/compare/3.0.0...HEAD
[3.0.0]: https://github.com/wp-pay-extensions/formidable-forms/compare/2.2.1...3.0.0
[2.2.1]: https://github.com/wp-pay-extensions/formidable-forms/compare/2.2.0...2.2.1
[2.2.0]: https://github.com/wp-pay-extensions/formidable-forms/compare/2.1.4...2.2.0
[2.1.4]: https://github.com/wp-pay-extensions/formidable-forms/compare/2.1.3...2.1.4
Expand Down
14 changes: 5 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,21 @@
},
"require": {
"php": ">=5.6.20",
"wp-pay/core": "^2.6"
"wp-pay/core": "^3.0"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.4",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
"php-coveralls/php-coveralls": "^2.4",
"phpcompatibility/php-compatibility": "^9.1",
"phpcompatibility/phpcompatibility-wp": "^2.0",
"phpmd/phpmd": "^2.7",
"phpunit/phpunit": "^5.7 || ^6.0",
"roots/wordpress": "^5.6",
"squizlabs/php_codesniffer": "^3.4",
"wp-coding-standards/wpcs": "^2.3",
"wp-phpunit/wp-phpunit": "^5.6"
"pronamic/wp-coding-standards": "^1.0",
"roots/wordpress": "^5.8",
"wp-phpunit/wp-phpunit": "^5.8"
},
"scripts": {
"coveralls": "vendor/bin/php-coveralls -v",
"phpcbf": "vendor/bin/phpcbf",
"phpcs": "vendor/bin/phpcs -s -v",
"phpcs": "XDEBUG_MODE=off vendor/bin/phpcs -s -v",
"phplint": "find src tests -name '*.php' | xargs -n 1 -P 4 php -l",
"phpmd": "vendor/bin/phpmd src,tests text phpmd.ruleset.xml --suffixes php",
"phpstan": "vendor/bin/phpstan analyse",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "formidable-forms",
"version": "2.2.1",
"version": "3.0.0",
"description": "Formidable Forms driver for the WordPress payment processing library.",
"repository": {
"type": "git",
Expand Down
20 changes: 2 additions & 18 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
<?xml version="1.0"?>

<ruleset name="WordPress Pay Formidable Forms rules">
<config name="minimum_supported_wp_version" value="4.7" />

<config name="testVersion" value="5.6-" />

<file>.</file>

<arg name="colors"/>
<arg name="extensions" value="php" />
<arg value="sp" />

<exclude-pattern>node_modules/*</exclude-pattern>
<exclude-pattern>tests/bootstrap.php</exclude-pattern>
<exclude-pattern>tests/wp-config.php</exclude-pattern>
<exclude-pattern>vendor/*</exclude-pattern>
<exclude-pattern>wordpress/*</exclude-pattern>
<exclude-pattern type="relative">^wp-content/*</exclude-pattern>

<rule ref="PHPCompatibilityWP" />

<rule ref="WordPress">
<rule ref="PronamicWP">
<exclude name="Generic.CodeAnalysis.UselessOverridingMethod.Found" />
<exclude name="Generic.Files.LowercasedFilename.NotFound" />

<exclude name="Squiz.Commenting" />

<exclude name="WordPress.Files.FileName.InvalidClassFileName" />
<exclude name="WordPress.Files.FileName.NotHyphenatedLowercase" />
<exclude name="WordPressVIPMinimum.Functions.RestrictedFunctions.url_to_postid_url_to_postid" />
</rule>
</ruleset>
4 changes: 0 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
</whitelist>
</filter>

<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
</logging>

<php>
<env name="WP_PHPUNIT__TESTS_CONFIG" value="tests/wp-config.php"/>
</php>
Expand Down
5 changes: 3 additions & 2 deletions src/Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use FrmRegAppController;
use FrmRegNotification;
use Pronamic\WordPress\Money\Currency;
use Pronamic\WordPress\Money\TaxedMoney;
use Pronamic\WordPress\Money\Money;
use Pronamic\WordPress\Pay\AbstractPluginIntegration;
use Pronamic\WordPress\Pay\Core\PaymentMethods;
use Pronamic\WordPress\Pay\Payments\PaymentStatus;
Expand Down Expand Up @@ -384,6 +384,7 @@ public function redirect_for_payment( $entry_id, $form_id ) {
/* translators: %s: payment data title */
__( 'Payment for %s', 'pronamic_ideal' ),
\sprintf(
/* translators: %s: Formidable Forms entry ID */
__( 'Formidable entry %s', 'pronamic_ideal' ),
$entry_id
)
Expand All @@ -393,7 +394,7 @@ public function redirect_for_payment( $entry_id, $form_id ) {
$currency = Currency::get_instance( FormidableFormsHelper::get_currency_from_settings() );

// Amount.
$payment->set_total_amount( new TaxedMoney( FormidableFormsHelper::get_amount_from_field( $this->action, $entry ), $currency ) );
$payment->set_total_amount( new Money( FormidableFormsHelper::get_amount_from_field( $this->action, $entry ), $currency ) );

// Method.
$payment->method = FormidableFormsHelper::get_payment_method_from_action_entry( $this->action, $entry );
Expand Down
6 changes: 6 additions & 0 deletions src/PaymentMethodSelectFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use FrmFieldFactory;
use FrmFieldSelect;
use FrmFieldsHelper;
use Pronamic\WordPress\Pay\Core\PaymentMethods;
use Pronamic\WordPress\Pay\Plugin;

/**
Expand Down Expand Up @@ -397,6 +398,11 @@ public function get_payment_methods() {
$value = sprintf( 'pronamic_pay_%s', $payment_method );
}

// Ignore unsupported recurring-only payment methods.
if ( \in_array( $payment_method, array_keys( PaymentMethods::get_direct_debit_methods() ), true ) ) {
continue;
}

$payment_methods[] = array(
'label' => $name,
'value' => $value,
Expand Down
64 changes: 34 additions & 30 deletions vendor-bin/phpstan/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6113584

Please sign in to comment.