Skip to content

Commit

Permalink
Merge branch 'release/4.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
rvdsteege committed Sep 26, 2022
2 parents 1d56474 + 6ec9e22 commit 76d436e
Show file tree
Hide file tree
Showing 22 changed files with 521 additions and 441 deletions.
15 changes: 15 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"core": null,
"plugins": [
".",
"../../../",
"https://github.com/pronamic/gravityforms/releases/download/2.6.6/gravityforms-2.6.6.zip",
"pronamic/wp-pronamic-pay-test-helper",
"https://downloads.wordpress.org/plugin/pronamic-client.zip",
"https://downloads.wordpress.org/plugin/query-monitor.zip",
"https://downloads.wordpress.org/plugin/one-time-login.zip"
],
"config": {
"PRONAMIC_PAY_DEBUG": true
}
}
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
## [Unreleased][unreleased]
-

## [4.2.0] - 2022-09-26
- Fixed conditional logic object without any logic.
- Updated for new payment methods and fields registration.

## [4.1.1] - 2022-08-15
- Fixed compatibility issue with plugins producing output in `gform_admin_pre_render` filter.
- Fixed duplicate configurations in payment gateway configuration field setting ([pronamic/wp-pronamic-pay-gravityforms#8](https://github.com/pronamic/wp-pronamic-pay-gravityforms/issues/8)).
Expand Down Expand Up @@ -345,7 +349,8 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C
## 1.0.0 - 2015-01-01
- First release.

[unreleased]: https://github.com/pronamic/wp-pronamic-pay-gravityforms/compare/4.1.1...HEAD
[unreleased]: https://github.com/pronamic/wp-pronamic-pay-gravityforms/compare/4.2.0...HEAD
[4.2.0]: https://github.com/pronamic/wp-pronamic-pay-gravityforms/compare/4.1.1...4.2.0
[4.1.1]: https://github.com/pronamic/wp-pronamic-pay-gravityforms/compare/4.1.0...4.1.1
[4.1.0]: https://github.com/pronamic/wp-pronamic-pay-gravityforms/compare/4.0.1...4.1.0
[4.0.1]: https://github.com/pronamic/wp-pronamic-pay-gravityforms/compare/4.0.0...4.0.1
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
"scripts": {
"coveralls": "vendor/bin/php-coveralls -v",
"phpcbf": "vendor/bin/phpcbf",
"phpcbf": "XDEBUG_MODE=off vendor/bin/phpcbf",
"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",
Expand Down
13 changes: 11 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gravityforms",
"version": "4.1.1",
"version": "4.2.0",
"description": "Gravity Forms driver for the WordPress payment processing library.",
"repository": {
"type": "git",
Expand Down Expand Up @@ -35,6 +35,7 @@
"last 2 versions"
],
"devDependencies": {
"@wordpress/env": "^5.2.0",
"autoprefixer": "^10.2.5",
"eslint": "^8.0",
"eslint-plugin-json": "^3.1",
Expand All @@ -46,13 +47,21 @@
"grunt-postcss": "^0.9.0",
"grunt-sass-lint": "^0.2.4",
"load-grunt-tasks": "^5.1.0",
"npm-run-all": "^4.1.5",
"sass-lint": "^1.13.1"
},
"scripts": {
"build-image": "npm-run-all build-image-*",
"build-image-svg-default": "svgo images/src/wp-pay.svg -o images/dist/wp-pay.svgo-min.svg",
"eslint": "eslint . --ext .json --ext .js",
"lint": "npm-run-all --parallel eslint sass-lint",
"sass-lint": "sass-lint --verbose"
"sass-lint": "sass-lint --verbose",
"start": "wp-env start && npm run setup && npm run login",
"setup": "npm-run-all setup-*",
"setup-gravityforms": "wp-env run cli wp config set GF_LICENSE_KEY $GRAVITYFORMS_LICENSE_KEY",
"setup-mollie": "wp-env run cli wp config set MOLLIE_API_KEY $MOLLIE_API_KEY",
"setup-buckaroo-website-key": "wp-env run cli wp config set BUCKAROO_WEBSITE_KEY $BUCKAROO_WEBSITE_KEY",
"setup-buckaroo-secret-key": "wp-env run cli wp config set BUCKAROO_SECRET_KEY $BUCKAROO_SECRET_KEY",
"login": "wp-env run cli wp user one-time-login admin"
}
}
41 changes: 41 additions & 0 deletions pronamic-pay-gravityforms.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php
/**
* Plugin Name: Pronamic Pay Gravity Forms Add-On
* Plugin URI: https://www.pronamic.eu/plugins/pronamic-pay-gravityforms/
* Description: Extend the Pronamic Pay plugin with Gravity Forms support to receive payments through a variety of payment providers.
*
* Version: 4.1.0
* Requires at least: 4.7
*
* Author: Pronamic
* Author URI: https://www.pronamic.eu/
*
* Text Domain: pronamic-pay-gravityforms
* Domain Path: /languages/
*
* License: GPL-3.0-or-later
*
* Depends: wp-pay/core
*
* GitHub URI: https://github.com/pronamic/wp-pronamic-pay-gravityforms
*
* @author Pronamic <[email protected]>
* @copyright 2005-2022 Pronamic
* @license GPL-3.0-or-later
* @package Pronamic\WordPress\Pay\Extensions\GravityForms
*/

add_filter(
'pronamic_pay_plugin_integrations',
function ( $integrations ) {
foreach ( $integrations as $integration ) {
if ( $integration instanceof \Pronamic\WordPress\Pay\Extensions\GravityForms\Extension ) {
return $integrations;
}
}

$integrations[] = new \Pronamic\WordPress\Pay\Extensions\GravityForms\Extension();

return $integrations;
}
);
100 changes: 50 additions & 50 deletions src/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ class Admin {
*/
public static function bootstrap() {
// Actions.
add_action( 'admin_init', array( __CLASS__, 'admin_init' ) );
add_action( 'admin_init', array( __CLASS__, 'maybe_redirect_to_entry' ) );
add_action( 'admin_init', [ __CLASS__, 'admin_init' ] );
add_action( 'admin_init', [ __CLASS__, 'maybe_redirect_to_entry' ] );

add_action( 'gform_entry_info', array( __CLASS__, 'entry_info' ), 10, 2 );
add_action( 'gform_entry_info', [ __CLASS__, 'entry_info' ], 10, 2 );

// Filters.
add_filter( 'gform_custom_merge_tags', array( __CLASS__, 'custom_merge_tags' ), 10 );
add_filter( 'gform_custom_merge_tags', [ __CLASS__, 'custom_merge_tags' ], 10 );

// Actions - AJAX.
add_action( 'wp_ajax_gf_get_form_data', array( __CLASS__, 'ajax_get_form_data' ) );
add_action( 'wp_ajax_gf_get_form_data', [ __CLASS__, 'ajax_get_form_data' ] );
}

/**
Expand All @@ -56,11 +56,11 @@ public static function admin_init() {
* @return array
*/
public static function form_settings_menu_item( $menu_items ) {
$menu_items[] = array(
$menu_items[] = [
'name' => 'pronamic_pay',
'label' => __( 'Pay', 'pronamic_ideal' ),
'query' => array( 'fid' => null ),
);
'query' => [ 'fid' => null ],
];

return $menu_items;
}
Expand Down Expand Up @@ -93,102 +93,102 @@ public static function entry_info( $form_id, $lead ) {
*/
public static function custom_merge_tags( $merge_tags ) {
// Payment.
$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Payment Status', 'pronamic_ideal' ),
'tag' => '{payment_status}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Payment Date', 'pronamic_ideal' ),
'tag' => '{payment_date}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Transaction Id', 'pronamic_ideal' ),
'tag' => '{transaction_id}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Payment Amount', 'pronamic_ideal' ),
'tag' => '{payment_amount}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic Payment ID', 'pronamic_ideal' ),
'tag' => '{pronamic_payment_id}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic Pay Again URL', 'pronamic_ideal' ),
'tag' => '{pronamic_pay_again_url}',
);
];

// Bank transfer.
$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic bank transfer recipient reference', 'pronamic_ideal' ),
'tag' => '{pronamic_payment_bank_transfer_recipient_reference}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic bank transfer recipient bank name', 'pronamic_ideal' ),
'tag' => '{pronamic_payment_bank_transfer_recipient_bank_name}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic bank transfer recipient name', 'pronamic_ideal' ),
'tag' => '{pronamic_payment_bank_transfer_recipient_name}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic bank transfer recipient IBAN', 'pronamic_ideal' ),
'tag' => '{pronamic_payment_bank_transfer_recipient_iban}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic bank transfer recipient BIC', 'pronamic_ideal' ),
'tag' => '{pronamic_payment_bank_transfer_recipient_bic}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic bank transfer recipient city', 'pronamic_ideal' ),
'tag' => '{pronamic_payment_bank_transfer_recipient_city}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic bank transfer recipient country', 'pronamic_ideal' ),
'tag' => '{pronamic_payment_bank_transfer_recipient_country}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic bank transfer recipient account number', 'pronamic_ideal' ),
'tag' => '{pronamic_payment_bank_transfer_recipient_account_number}',
);
];

// Subscription.
$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic Subscription Payment ID', 'pronamic_ideal' ),
'tag' => '{pronamic_subscription_payment_id}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic Subscription Amount', 'pronamic_ideal' ),
'tag' => '{pronamic_subscription_amount}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic Subscription Cancel URL', 'pronamic_ideal' ),
'tag' => '{pronamic_subscription_cancel_url}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic Subscription Renew URL', 'pronamic_ideal' ),
'tag' => '{pronamic_subscription_renew_url}',
);
];

$merge_tags[] = array(
$merge_tags[] = [
'label' => __( 'Pronamic Subscription Renewal Date', 'pronamic_ideal' ),
'tag' => '{pronamic_subscription_renewal_date}',
);
];

return $merge_tags;
}
Expand All @@ -207,12 +207,12 @@ public static function maybe_redirect_to_entry() {

if ( ! empty( $lead ) ) {
$url = add_query_arg(
array(
[
'page' => 'gf_entries',
'view' => 'entry',
'id' => $lead['form_id'],
'lid' => $lead_id,
),
],
admin_url( 'admin.php' )
);

Expand Down Expand Up @@ -243,13 +243,13 @@ public static function ajax_get_form_data() {
*/
public static function get_new_feed_url( $form_id ) {
return add_query_arg(
array(
[
'page' => 'gf_edit_forms',
'view' => 'settings',
'subview' => 'pronamic_pay',
'id' => $form_id,
'fid' => 0,
),
],
admin_url( 'admin.php' )
);
}
Expand Down
Loading

0 comments on commit 76d436e

Please sign in to comment.