Mollie Payments for WooCommerce - Version 5.1.8

Version Description

  • 24-05-2019 =

  • Fix - Re-add "orderlines_process_items_afterprocessing_item" hook

  • Fix - Fix issue where renewal order status was not respecting settings

  • Fix - Fix PHP Notice: Undefined property: Mollie_WC_Payment_Payment::$id, closes #289

  • Fix - Switch version check from woocommerce_db_version to woocommerce_version as the latter is re-added to database a lot faster when it's missing then the former. Might solve issues where Mollie plugin is disabled when WooCommerce updates.

Download this release

Release Info

Developer davdebcom
Plugin Icon wp plugin Mollie Payments for WooCommerce
Version 5.1.8
Comparing to
See all releases

Code changes from version 5.1.7 to 5.1.8

includes/mollie/wc/gateway/abstract.php CHANGED
@@ -507,8 +507,10 @@ abstract class Mollie_WC_Gateway_Abstract extends WC_Payment_Gateway
507
 
508
  if ( $product == false ) {
509
  $mollie_payment_type = 'payment';
 
510
  break;
511
  }
 
512
  }
513
  }
514
 
507
 
508
  if ( $product == false ) {
509
  $mollie_payment_type = 'payment';
510
+ do_action( Mollie_WC_Plugin::PLUGIN_ID . '_orderlines_process_items_after_processing_item', $cart_item );
511
  break;
512
  }
513
+ do_action( Mollie_WC_Plugin::PLUGIN_ID . '_orderlines_process_items_after_processing_item', $cart_item );
514
  }
515
  }
516
 
includes/mollie/wc/gateway/abstractseparecurring.php CHANGED
@@ -57,7 +57,7 @@ abstract class Mollie_WC_Gateway_AbstractSepaRecurring extends Mollie_WC_Gateway
57
  $this->updateOrderStatus(
58
  $renewal_order,
59
  $initial_order_status,
60
- sprintf( __( "Awaiting payment confirmation. For %s days", 'mollie-payments-for-woocommerce' ) . "\n",
61
  self::WAITING_CONFIRMATION_PERIOD_DAYS )
62
  );
63
 
@@ -73,6 +73,14 @@ abstract class Mollie_WC_Gateway_AbstractSepaRecurring extends Mollie_WC_Gateway
73
  $this->addPendingPaymentOrder($renewal_order);
74
  }
75
 
 
 
 
 
 
 
 
 
76
  /**
77
  * @param $renewal_order
78
  */
57
  $this->updateOrderStatus(
58
  $renewal_order,
59
  $initial_order_status,
60
+ sprintf( __( "Awaiting payment confirmation.", 'mollie-payments-for-woocommerce' ) . "\n",
61
  self::WAITING_CONFIRMATION_PERIOD_DAYS )
62
  );
63
 
73
  $this->addPendingPaymentOrder($renewal_order);
74
  }
75
 
76
+ /**
77
+ * @return bool
78
+ */
79
+ protected function paymentConfirmationAfterCoupleOfDays ()
80
+ {
81
+ return true;
82
+ }
83
+
84
  /**
85
  * @param $renewal_order
86
  */
includes/mollie/wc/payment/payment.php CHANGED
@@ -285,6 +285,9 @@ class Mollie_WC_Payment_Payment extends Mollie_WC_Payment_Object {
285
  // Add messages to log
286
  Mollie_WC_Plugin::debug( __METHOD__ . ' called for payment ' . $order_id );
287
 
 
 
 
288
  $this->unsetActiveMolliePayment( $order_id, $payment->id );
289
  $this->setCancelledMolliePaymentId( $order_id, $payment->id );
290
 
@@ -303,13 +306,11 @@ class Mollie_WC_Payment_Payment extends Mollie_WC_Payment_Object {
303
  $new_order_status = apply_filters( Mollie_WC_Plugin::PLUGIN_ID . '_order_status_cancelled', $new_order_status );
304
 
305
  // Overwrite gateway-wide
306
- $new_order_status = apply_filters( Mollie_WC_Plugin::PLUGIN_ID . '_order_status_cancelled_' . $this->id, $new_order_status );
307
 
308
  // Update order status, but only if there is no payment started by another gateway
309
  if ( ! $this->isOrderPaymentStartedByOtherGateway( $order ) ) {
310
 
311
- $gateway = Mollie_WC_Plugin::getDataHelper()->getWcPaymentGatewayByOrder( $order );
312
-
313
  if ( $gateway || ( $gateway instanceof Mollie_WC_Gateway_Abstract ) ) {
314
  $gateway->updateOrderStatus( $order, $new_order_status );
315
  }
@@ -318,7 +319,7 @@ class Mollie_WC_Payment_Payment extends Mollie_WC_Payment_Object {
318
  $order_payment_method_title = get_post_meta( $order_id, '_payment_method_title', $single = true );
319
 
320
  // Add message to log
321
- Mollie_WC_Plugin::debug( $this->id . ': Order ' . $order->get_id() . ' webhook called, but payment also started via ' . $order_payment_method_title . ', so order status not updated.', true );
322
 
323
  // Add order note
324
  $order->add_order_note( sprintf(
@@ -368,6 +369,9 @@ class Mollie_WC_Payment_Payment extends Mollie_WC_Payment_Object {
368
  // Add messages to log
369
  Mollie_WC_Plugin::debug( __METHOD__ . ' called for order ' . $order_id );
370
 
 
 
 
371
  // New order status
372
  $new_order_status = Mollie_WC_Gateway_Abstract::STATUS_FAILED;
373
 
@@ -375,10 +379,7 @@ class Mollie_WC_Payment_Payment extends Mollie_WC_Payment_Object {
375
  $new_order_status = apply_filters( Mollie_WC_Plugin::PLUGIN_ID . '_order_status_failed', $new_order_status );
376
 
377
  // Overwrite gateway-wide
378
- $new_order_status = apply_filters( Mollie_WC_Plugin::PLUGIN_ID . '_order_status_failed_' . $this->id, $new_order_status );
379
-
380
- $gateway = Mollie_WC_Plugin::getDataHelper()->getWcPaymentGatewayByOrder( $order );
381
-
382
 
383
  // If WooCommerce Subscriptions is installed, process this failure as a subscription, otherwise as a regular order
384
  // Update order status for order with failed payment, don't restore stock
@@ -444,6 +445,9 @@ class Mollie_WC_Payment_Payment extends Mollie_WC_Payment_Object {
444
  // Add messages to log
445
  Mollie_WC_Plugin::debug( __METHOD__ . ' called for order ' . $order_id );
446
 
 
 
 
447
  // Check that this payment is the most recent, based on Mollie Payment ID from post meta, do not cancel the order if it isn't
448
  if ( $mollie_payment_id != $payment->id ) {
449
  Mollie_WC_Plugin::debug( __METHOD__ . ' called for order ' . $order_id . ' and payment ' . $payment->id . ', not processed because of a newer pending payment ' . $mollie_payment_id );
@@ -466,13 +470,11 @@ class Mollie_WC_Payment_Payment extends Mollie_WC_Payment_Object {
466
  $new_order_status = apply_filters( Mollie_WC_Plugin::PLUGIN_ID . '_order_status_expired', $new_order_status );
467
 
468
  // Overwrite gateway-wide
469
- $new_order_status = apply_filters( Mollie_WC_Plugin::PLUGIN_ID . '_order_status_expired_' . $this->id, $new_order_status );
470
 
471
  // Update order status, but only if there is no payment started by another gateway
472
  if ( ! $this->isOrderPaymentStartedByOtherGateway( $order ) ) {
473
 
474
- $gateway = Mollie_WC_Plugin::getDataHelper()->getWcPaymentGatewayByOrder( $order );
475
-
476
  if ( $gateway || ( $gateway instanceof Mollie_WC_Gateway_Abstract ) ) {
477
  $gateway->updateOrderStatus( $order, $new_order_status );
478
  }
@@ -481,7 +483,7 @@ class Mollie_WC_Payment_Payment extends Mollie_WC_Payment_Object {
481
  $order_payment_method_title = get_post_meta( $order_id, '_payment_method_title', $single = true );
482
 
483
  // Add message to log
484
- Mollie_WC_Plugin::debug( $this->id . ': Order ' . $order->get_id() . ' webhook called, but payment also started via ' . $order_payment_method_title . ', so order status not updated.', true );
485
 
486
  // Add order note
487
  $order->add_order_note( sprintf(
285
  // Add messages to log
286
  Mollie_WC_Plugin::debug( __METHOD__ . ' called for payment ' . $order_id );
287
 
288
+ // Get current gateway
289
+ $gateway = Mollie_WC_Plugin::getDataHelper()->getWcPaymentGatewayByOrder( $order );
290
+
291
  $this->unsetActiveMolliePayment( $order_id, $payment->id );
292
  $this->setCancelledMolliePaymentId( $order_id, $payment->id );
293
 
306
  $new_order_status = apply_filters( Mollie_WC_Plugin::PLUGIN_ID . '_order_status_cancelled', $new_order_status );
307
 
308
  // Overwrite gateway-wide
309
+ $new_order_status = apply_filters( Mollie_WC_Plugin::PLUGIN_ID . '_order_status_cancelled_' . $gateway->id, $new_order_status );
310
 
311
  // Update order status, but only if there is no payment started by another gateway
312
  if ( ! $this->isOrderPaymentStartedByOtherGateway( $order ) ) {
313
 
 
 
314
  if ( $gateway || ( $gateway instanceof Mollie_WC_Gateway_Abstract ) ) {
315
  $gateway->updateOrderStatus( $order, $new_order_status );
316
  }
319
  $order_payment_method_title = get_post_meta( $order_id, '_payment_method_title', $single = true );
320
 
321
  // Add message to log
322
+ Mollie_WC_Plugin::debug( $gateway->id . ': Order ' . $order->get_id() . ' webhook called, but payment also started via ' . $order_payment_method_title . ', so order status not updated.', true );
323
 
324
  // Add order note
325
  $order->add_order_note( sprintf(
369
  // Add messages to log
370
  Mollie_WC_Plugin::debug( __METHOD__ . ' called for order ' . $order_id );
371
 
372
+ // Get current gateway
373
+ $gateway = Mollie_WC_Plugin::getDataHelper()->getWcPaymentGatewayByOrder( $order );
374
+
375
  // New order status
376
  $new_order_status = Mollie_WC_Gateway_Abstract::STATUS_FAILED;
377
 
379
  $new_order_status = apply_filters( Mollie_WC_Plugin::PLUGIN_ID . '_order_status_failed', $new_order_status );
380
 
381
  // Overwrite gateway-wide
382
+ $new_order_status = apply_filters( Mollie_WC_Plugin::PLUGIN_ID . '_order_status_failed_' . $gateway->id, $new_order_status );
 
 
 
383
 
384
  // If WooCommerce Subscriptions is installed, process this failure as a subscription, otherwise as a regular order
385
  // Update order status for order with failed payment, don't restore stock
445
  // Add messages to log
446
  Mollie_WC_Plugin::debug( __METHOD__ . ' called for order ' . $order_id );
447
 
448
+ // Get current gateway
449
+ $gateway = Mollie_WC_Plugin::getDataHelper()->getWcPaymentGatewayByOrder( $order );
450
+
451
  // Check that this payment is the most recent, based on Mollie Payment ID from post meta, do not cancel the order if it isn't
452
  if ( $mollie_payment_id != $payment->id ) {
453
  Mollie_WC_Plugin::debug( __METHOD__ . ' called for order ' . $order_id . ' and payment ' . $payment->id . ', not processed because of a newer pending payment ' . $mollie_payment_id );
470
  $new_order_status = apply_filters( Mollie_WC_Plugin::PLUGIN_ID . '_order_status_expired', $new_order_status );
471
 
472
  // Overwrite gateway-wide
473
+ $new_order_status = apply_filters( Mollie_WC_Plugin::PLUGIN_ID . '_order_status_expired_' . $gateway->id, $new_order_status );
474
 
475
  // Update order status, but only if there is no payment started by another gateway
476
  if ( ! $this->isOrderPaymentStartedByOtherGateway( $order ) ) {
477
 
 
 
478
  if ( $gateway || ( $gateway instanceof Mollie_WC_Gateway_Abstract ) ) {
479
  $gateway->updateOrderStatus( $order, $new_order_status );
480
  }
483
  $order_payment_method_title = get_post_meta( $order_id, '_payment_method_title', $single = true );
484
 
485
  // Add message to log
486
+ Mollie_WC_Plugin::debug( $gateway->id . ': Order ' . $order->get_id() . ' webhook called, but payment also started via ' . $order_payment_method_title . ', so order status not updated.', true );
487
 
488
  // Add order note
489
  $order->add_order_note( sprintf(
includes/mollie/wc/plugin.php CHANGED
@@ -7,7 +7,7 @@ class Mollie_WC_Plugin
7
  {
8
  const PLUGIN_ID = 'mollie-payments-for-woocommerce';
9
  const PLUGIN_TITLE = 'Mollie Payments for WooCommerce';
10
- const PLUGIN_VERSION = '5.1.7';
11
 
12
  const DB_VERSION = '1.0';
13
  const DB_VERSION_PARAM_NAME = 'mollie-db-version';
7
  {
8
  const PLUGIN_ID = 'mollie-payments-for-woocommerce';
9
  const PLUGIN_TITLE = 'Mollie Payments for WooCommerce';
10
+ const PLUGIN_VERSION = '5.1.8';
11
 
12
  const DB_VERSION = '1.0';
13
  const DB_VERSION_PARAM_NAME = 'mollie-db-version';
mollie-payments-for-woocommerce.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Mollie Payments for WooCommerce
4
  * Plugin URI: https://www.mollie.com
5
  * Description: Accept payments in WooCommerce with the official Mollie plugin
6
- * Version: 5.1.7
7
  * Author: Mollie
8
  * Author URI: https://www.mollie.com
9
  * Requires at least: 3.8
@@ -62,7 +62,7 @@ add_action( 'plugins_loaded', 'mollie_wc_check_php_version' );
62
  * Check if WooCommerce is active and of a supported version
63
  */
64
  function mollie_wc_check_woocommerce_status() {
65
- if ( ! class_exists( 'WooCommerce' ) || version_compare( get_option( 'woocommerce_db_version' ), '2.2', '<' ) ) {
66
  remove_action('init', 'mollie_wc_plugin_init');
67
  add_action( 'admin_notices', 'mollie_wc_plugin_inactive' );
68
  return;
@@ -88,7 +88,7 @@ function mollie_wc_plugin_init() {
88
  function mollie_wc_plugin_activation_hook ()
89
  {
90
 
91
- if ( ! class_exists( 'WooCommerce' ) || version_compare( get_option( 'woocommerce_db_version' ), '2.2', '<' ) ) {
92
  remove_action('init', 'mollie_wc_plugin_init');
93
  add_action( 'admin_notices', 'mollie_wc_plugin_inactive' );
94
  return;
@@ -169,7 +169,7 @@ function mollie_wc_plugin_inactive() {
169
  return false;
170
  }
171
 
172
- if ( version_compare( get_option( 'woocommerce_db_version' ), '2.2', '<' ) ) {
173
 
174
  echo '<div class="error"><p>';
175
  echo sprintf( esc_html__( '%1$sMollie Payments for WooCommerce is inactive.%2$s This version requires WooCommerce 2.2 or newer. Please %3$supdate WooCommerce to version 2.2 or newer &raquo;%4$s', 'mollie-payments-for-woocommerce' ), '<strong>', '</strong>', '<a href="' . esc_url( admin_url( 'plugins.php' ) ) . '">', '</a>' );
3
  * Plugin Name: Mollie Payments for WooCommerce
4
  * Plugin URI: https://www.mollie.com
5
  * Description: Accept payments in WooCommerce with the official Mollie plugin
6
+ * Version: 5.1.8
7
  * Author: Mollie
8
  * Author URI: https://www.mollie.com
9
  * Requires at least: 3.8
62
  * Check if WooCommerce is active and of a supported version
63
  */
64
  function mollie_wc_check_woocommerce_status() {
65
+ if ( ! class_exists( 'WooCommerce' ) || version_compare( get_option( 'woocommerce_version' ), '2.2', '<' ) ) {
66
  remove_action('init', 'mollie_wc_plugin_init');
67
  add_action( 'admin_notices', 'mollie_wc_plugin_inactive' );
68
  return;
88
  function mollie_wc_plugin_activation_hook ()
89
  {
90
 
91
+ if ( ! class_exists( 'WooCommerce' ) || version_compare( get_option( 'woocommerce_version' ), '2.2', '<' ) ) {
92
  remove_action('init', 'mollie_wc_plugin_init');
93
  add_action( 'admin_notices', 'mollie_wc_plugin_inactive' );
94
  return;
169
  return false;
170
  }
171
 
172
+ if ( version_compare( get_option( 'woocommerce_version' ), '2.2', '<' ) ) {
173
 
174
  echo '<div class="error"><p>';
175
  echo sprintf( esc_html__( '%1$sMollie Payments for WooCommerce is inactive.%2$s This version requires WooCommerce 2.2 or newer. Please %3$supdate WooCommerce to version 2.2 or newer &raquo;%4$s', 'mollie-payments-for-woocommerce' ), '<strong>', '</strong>', '<a href="' . esc_url( admin_url( 'plugins.php' ) ) . '">', '</a>' );
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Mollie Payments for WooCommerce ===
2
- Contributors: daanvm, davdebcom, l.vangunst, ndijkstra, robin-mollie
3
- Tags: mollie, payments, payment gateway, woocommerce, credit card
4
  Requires at least: 3.8
5
  Tested up to: 5.2
6
- Stable tag: 5.1.7
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -40,7 +40,8 @@ European and local payment methods:
40
  * ING Home'Pay (Belgium)
41
  * Giropay (Germany)
42
  * EPS (Austria)
43
- * SOFORTbanking (EU)
 
44
  * Belfius (Belgium)
45
  * KBC/CBC payment button (Belgium)
46
  * SEPA - Credit Transfer (EU)
@@ -180,6 +181,13 @@ Automatic updates should work like a charm; as always though, ensure you backup
180
 
181
  == Changelog ==
182
 
 
 
 
 
 
 
 
183
  = 5.1.7 - 28-04-2019 =
184
 
185
  * Fix - Remove Bitcoin as payment gateway, no longer supported by Mollie, contact info@mollie.com for details
1
  === Mollie Payments for WooCommerce ===
2
+ Contributors: daanvm, danielhuesken, davdebcom, dinamiko, inpsyde, l.vangunst, ndijkstra, robin-mollie, wido
3
+ Tags: mollie, payments, payment gateway, woocommerce, credit card, ideal, bancontact, klarna, sofort, giropay, woocommerce subscriptions
4
  Requires at least: 3.8
5
  Tested up to: 5.2
6
+ Stable tag: 5.1.8
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
40
  * ING Home'Pay (Belgium)
41
  * Giropay (Germany)
42
  * EPS (Austria)
43
+ * Przelewy24 (Poland)
44
+ * SOFORT banking (EU)
45
  * Belfius (Belgium)
46
  * KBC/CBC payment button (Belgium)
47
  * SEPA - Credit Transfer (EU)
181
 
182
  == Changelog ==
183
 
184
+ = 5.1.8 - 24-05-2019 =
185
+
186
+ * Fix - Re-add "_orderlines_process_items_after_processing_item" hook
187
+ * Fix - Fix issue where renewal order status was not respecting settings
188
+ * Fix - Fix PHP Notice: Undefined property: Mollie_WC_Payment_Payment::$id, closes #289
189
+ * Fix - Switch version check from woocommerce_db_version to woocommerce_version as the latter is re-added to database a lot faster when it's missing then the former. Might solve issues where Mollie plugin is disabled when WooCommerce updates.
190
+
191
  = 5.1.7 - 28-04-2019 =
192
 
193
  * Fix - Remove Bitcoin as payment gateway, no longer supported by Mollie, contact info@mollie.com for details