From 0c3c8fb89b66a50861b4ae9e6f75b09b366d2aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=C3=BCel=20van=20der=20Steege?= Date: Fri, 21 Oct 2022 13:48:16 +0200 Subject: [PATCH 1/6] Add MobilePay payment method (pronamic/wp-pronamic-pay-adyen#16). --- src/Core/PaymentMethods.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Core/PaymentMethods.php b/src/Core/PaymentMethods.php index 731ca0f5..268003cf 100644 --- a/src/Core/PaymentMethods.php +++ b/src/Core/PaymentMethods.php @@ -306,6 +306,14 @@ class PaymentMethods { */ const MISTER_CASH = 'mister_cash'; + /** + * MobilePay + * + * @link https://www.mobilepay.dk/ + * @var string + */ + const MOBILEPAY = 'mobilepay'; + /** * Constant for the Payconiq method. * @@ -448,6 +456,7 @@ public static function get_payment_methods() { self::MAESTRO => __( 'Maestro', 'pronamic_ideal' ), self::MASTERCARD => __( 'Mastercard', 'pronamic_ideal' ), self::MB_WAY => __( 'MB WAY', 'pronamic_ideal' ), + self::MOBILEPAY => __( 'MobilePay', 'pronamic_ideal' ), self::PAYCONIQ => __( 'Payconiq', 'pronamic_ideal' ), self::PAYPAL => __( 'PayPal', 'pronamic_ideal' ), self::PRZELEWY24 => __( 'Przelewy24', 'pronamic_ideal' ), From bfe565db981e1f00333d61414e83c1807379e807 Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Mon, 24 Oct 2022 09:21:01 +0200 Subject: [PATCH 2/6] Allow subscription payments at gateways that don't have support for recurring payments. Related issue: https://github.com/pronamic/wp-pronamic-pay-woocommerce/issues/15. --- src/Plugin.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Plugin.php b/src/Plugin.php index bccb9242..d849f2f8 100644 --- a/src/Plugin.php +++ b/src/Plugin.php @@ -1192,10 +1192,6 @@ public static function start_payment( Payment $payment ) { // Start payment at the gateway. try { - if ( \count( $subscriptions ) > 0 && ! $gateway->supports( 'recurring' ) ) { - throw new \Exception( 'Gateway does not support recurring payments.' ); - } - self::pronamic_service( $payment ); $gateway->start( $payment ); From 989a7b805ff484602c3d99aa42d6d16c21ac5190 Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Mon, 24 Oct 2022 09:47:35 +0200 Subject: [PATCH 3/6] Remove payment method specific support values. --- src/Core/Gateway.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Core/Gateway.php b/src/Core/Gateway.php index ffd0fd53..61ed399a 100644 --- a/src/Core/Gateway.php +++ b/src/Core/Gateway.php @@ -71,9 +71,6 @@ abstract class Gateway { * * Possible values: * - payment_status_request Gateway can request current payment status. - * - recurring_apple_pay Recurring payments through Apple Pay. - * - recurring_credit_card Recurring payments through credit card. - * - recurring_direct_debit Recurring payments through direct debit. */ use SupportsTrait; From 80b7ce6a1c65898f6812247f39908c8fdd5f131a Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Mon, 24 Oct 2022 10:42:50 +0200 Subject: [PATCH 4/6] Catch exceptions while retrieving options. --- src/Fields/SelectField.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Fields/SelectField.php b/src/Fields/SelectField.php index 58614302..1dda5dac 100644 --- a/src/Fields/SelectField.php +++ b/src/Fields/SelectField.php @@ -106,7 +106,13 @@ public function jsonSerialize() { $data = parent::jsonSerialize(); $data['type'] = 'select'; - $data['options'] = $this->get_flat_options(); + $data['options'] = []; + + try { + $data['options'] = $this->get_flat_options(); + } catch ( \Exception $e ) { + $data['error'] = $e->getMessage(); + } return $data; } From 326b02d06ea955b9bafbfb09655eb5488929b7af Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Thu, 3 Nov 2022 15:35:26 +0100 Subject: [PATCH 5/6] 4.5.0 --- CHANGELOG.md | 9 ++++++++- package.json | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a337348..c639e130 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a CHANGELOG](http://keepachangelog.com/). ## [Unreleased][unreleased] + +## [4.5.0] - 2022-11-03 +- Catch exceptions while retrieving options from for example iDEAL issuer select fields. ([#78](https://github.com/pronamic/wp-pay-core/issues/78)) +- Allow subscription payments at gateways that don't have support for recurring payments. ([pronamic/wp-pronamic-pay-woocommerce#15](https://github.com/pronamic/wp-pronamic-pay-woocommerce/issues/15)) +- Added MobilePay payment method. ([pronamic/wp-pronamic-pay-adyen#16](https://github.com/pronamic/wp-pronamic-pay-adyen/issues/16)) +- Remove payment method specific support values `recurring_apple_pay`, `recurring_credit_card` and `recurring_direct_debit`. - Removed `Gateway->update_subscription( Payment $payment )` method, no longer used. ([pronamic/wp-pay-core#41](https://github.com/pronamic/wp-pay-core/issues/41)) - Removed `Gateway->cancel_subscription( Subscription $subscription )` method, no longer used. ([pronamic/wp-pay-core#41](https://github.com/pronamic/wp-pay-core/issues/41)). - Added support for multi-dimensional array in `Util::html_hidden_fields( $data )` method. ([pronamic/wp-pay-core#73](https://github.com/pronamic/wp-pay-core/issues/73)) @@ -531,7 +537,8 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C ## 1.0.0 - First release. -[unreleased]: https://github.com/pronamic/wp-pay-core/compare/4.4.1...HEAD +[unreleased]: https://github.com/pronamic/wp-pay-core/compare/4.5.0...HEAD +[4.5.0]: https://github.com/pronamic/wp-pay-core/compare/4.4.1...4.5.0 [4.4.1]: https://github.com/pronamic/wp-pay-core/compare/4.4.0...4.4.1 [4.4.0]: https://github.com/pronamic/wp-pay-core/compare/4.3.1...4.4.0 [4.3.1]: https://github.com/pronamic/wp-pay-core/compare/4.3.0...4.3.1 diff --git a/package.json b/package.json index 279cbbfc..ae81f5fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@wp-pay/core", - "version": "4.4.1", + "version": "4.5.0", "description": "Core components for the WordPress payment processing library.", "repository": { "type": "git", From ca4461a5b53ce5018b3c00791841f8d4c96e9831 Mon Sep 17 00:00:00 2001 From: Remco Tolsma <869674+remcotolsma@users.noreply.github.com> Date: Thu, 3 Nov 2022 15:36:32 +0100 Subject: [PATCH 6/6] Update CHANGELOG.md --- CHANGELOG.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c639e130..218b3aaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,15 +10,13 @@ This projects adheres to [Semantic Versioning](http://semver.org/) and [Keep a C - Catch exceptions while retrieving options from for example iDEAL issuer select fields. ([#78](https://github.com/pronamic/wp-pay-core/issues/78)) - Allow subscription payments at gateways that don't have support for recurring payments. ([pronamic/wp-pronamic-pay-woocommerce#15](https://github.com/pronamic/wp-pronamic-pay-woocommerce/issues/15)) - Added MobilePay payment method. ([pronamic/wp-pronamic-pay-adyen#16](https://github.com/pronamic/wp-pronamic-pay-adyen/issues/16)) -- Remove payment method specific support values `recurring_apple_pay`, `recurring_credit_card` and `recurring_direct_debit`. -- Removed `Gateway->update_subscription( Payment $payment )` method, no longer used. ([pronamic/wp-pay-core#41](https://github.com/pronamic/wp-pay-core/issues/41)) -- Removed `Gateway->cancel_subscription( Subscription $subscription )` method, no longer used. ([pronamic/wp-pay-core#41](https://github.com/pronamic/wp-pay-core/issues/41)). -- Added support for multi-dimensional array in `Util::html_hidden_fields( $data )` method. ([pronamic/wp-pay-core#73](https://github.com/pronamic/wp-pay-core/issues/73)) ## [4.4.1] - 2022-10-11 - Added support for multi-dimensional array in `Util::html_hidden_fields()` method (pronamic/wp-pay-core#73). - Fixed setting empty consumer bank details object (pronamic/wp-pronamic-pay-mollie#11). -- Removed unused gateway subscription methods. +- Removed payment method specific support values `recurring_apple_pay`, `recurring_credit_card` and `recurring_direct_debit`. +- Removed `Gateway->update_subscription( Payment $payment )` method, no longer used. ([pronamic/wp-pay-core#41](https://github.com/pronamic/wp-pay-core/issues/41)) +- Removed `Gateway->cancel_subscription( Subscription $subscription )` method, no longer used. ([pronamic/wp-pay-core#41](https://github.com/pronamic/wp-pay-core/issues/41)). ## [4.4.0] - 2022-09-26 - Fixed list table styling on mobile (pronamic/wp-pay-core#72).