From 7c79e4f0a6d911b45c727e1ffaf0c63fbc9abe57 Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Fri, 7 Jun 2024 09:25:13 +0200 Subject: [PATCH 1/3] Update .gitattributes --- .gitattributes | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index d57386a..e2be6c2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,9 +3,7 @@ /.gitattributes export-ignore /.github/ export-ignore /.gitignore export-ignore -/.travis.yml export-ignore /.wp-env.json export-ignore -/Gruntfile.js export-ignore /phpcs.xml.dist export-ignore /phpmd.ruleset.xml export-ignore /phpstan.neon.dist export-ignore From db351c62b95706b71e473bdbca45129ed74e871f Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Fri, 7 Jun 2024 09:25:15 +0200 Subject: [PATCH 2/3] Update .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index efa9b3a..6ee7be9 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ # WordPress content /wp-content/ + +# Packages +/packages/ From 31e388ce1d44883581912587a0e608ecf8001c0d Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Fri, 7 Jun 2024 09:55:16 +0200 Subject: [PATCH 3/3] Make standalone plugin for easier development and testing. --- .wp-env.json | 13 +++++++++---- composer.json | 28 +++++++++++++++++++++++++++- pronamic-pay-event-espresso.php | 33 ++++++++++++++++++++++++++++++--- 3 files changed, 66 insertions(+), 8 deletions(-) diff --git a/.wp-env.json b/.wp-env.json index 12da052..c12687b 100644 --- a/.wp-env.json +++ b/.wp-env.json @@ -1,12 +1,17 @@ { "core": null, "plugins": [ - ".", - "../../../", - "https://github.com/pronamic/eventespresso/releases/download/4.10.38.p/event-espresso-core-reg-4.10.38.p.zip", + "pronamic/wp-env-quick-login", + "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" + "https://downloads.wordpress.org/plugin/one-time-login.zip", + "https://downloads.wordpress.org/plugin/wp-plugin-dependencies.zip", + "https://github.com/pronamic/eventespresso/releases/download/4.10.38.p/event-espresso-core-reg-4.10.38.p.zip" ], + "mappings": { + "wp-content/plugins/pronamic-pay-event-espresso": "." + }, "config": { "PRONAMIC_PAY_DEBUG": true } diff --git a/composer.json b/composer.json index 7633251..816c456 100644 --- a/composer.json +++ b/composer.json @@ -40,17 +40,42 @@ } }, "config": { - "sort-packages": true, "allow-plugins": { "composer/installers": true, "dealerdirect/phpcodesniffer-composer-installer": true, "roots/wordpress-core-installer": true, "automattic/jetpack-autoloader": true, "phpstan/extension-installer": true + }, + "platform": { + "php": "8.1" + }, + "platform-check": false, + "sort-packages": true, + "wp-slug": "pronamic-pay-event-espresso" + }, + "extra": { + "installer-paths": { + "packages/{$vendor}/{$name}": [ + "pronamic/wp-datetime", + "pronamic/wp-gravityforms-nl", + "pronamic/wp-html", + "pronamic/wp-http", + "pronamic/wp-mollie", + "pronamic/wp-money", + "pronamic/wp-number", + "vendor:wp-pay", + "vendor:wp-pay-extensions", + "vendor:wp-pay-gateways", + "woocommerce/action-scheduler" + ] } }, "require": { "php": ">=8.0", + "automattic/jetpack-autoloader": "^3.0", + "composer/installers": "^2.2", + "woocommerce/action-scheduler": "^3.8", "wp-pay/core": "^4.16" }, "require-dev": { @@ -63,6 +88,7 @@ "roots/wordpress": "^6.4", "szepeviktor/phpstan-wordpress": "^1.3", "vimeo/psalm": "^0.3.14", + "wp-pay-gateways/mollie": "^4.11", "wp-phpunit/wp-phpunit": "^6.4", "yoast/phpunit-polyfills": "^2.0" }, diff --git a/pronamic-pay-event-espresso.php b/pronamic-pay-event-espresso.php index 5ccf567..f1ca665 100644 --- a/pronamic-pay-event-espresso.php +++ b/pronamic-pay-event-espresso.php @@ -16,9 +16,6 @@ * * License: GPL-3.0-or-later * - * Requires Plugins: pronamic-ideal - * Depends: wp-pay/core - * * GitHub URI: https://github.com/pronamic/wp-pronamic-pay-event-espresso * * @author Pronamic @@ -27,6 +24,25 @@ * @package Pronamic\WordPress\Pay\Extensions\EventEspresso */ +if ( ! defined( 'ABSPATH' ) ) { + exit; +} + +/** + * Autoload. + */ +require_once __DIR__ . '/vendor/autoload_packages.php'; + +/** + * Bootstrap. + */ +\Pronamic\WordPress\Pay\Plugin::instance( + [ + 'file' => __FILE__, + 'action_scheduler' => __DIR__ . '/packages/woocommerce/action-scheduler/action-scheduler.php', + ] +); + add_filter( 'pronamic_pay_plugin_integrations', function ( $integrations ) { @@ -41,3 +57,14 @@ function ( $integrations ) { return $integrations; } ); + +if ( class_exists( \Pronamic\WordPress\Pay\Gateways\Mollie\Integration::class ) ) { + add_filter( + 'pronamic_pay_gateways', + function ( $gateways ) { + $gateways[] = new \Pronamic\WordPress\Pay\Gateways\Mollie\Integration(); + + return $gateways; + } + ); +}