WooCommerce Germanized - Version 1.9.9

Version Description

  • Improvement: Adjusted payment gateway fee settings to only apply for COD for legal purposes
  • Improvement: Added Woo Paypal Plus checkout price manipulation compatibility
  • Fix: Stock update using wc_maybe_reduce_stock_levels
  • Fix: Added strtoupper to IBAN and BIC for direct debit
Download this release

Release Info

Developer vendidero
Plugin Icon 128x128 WooCommerce Germanized
Version 1.9.9
Comparing to
See all releases

Code changes from version 1.9.8 to 1.9.9

i18n/languages/woocommerce-germanized-de_DE.mo CHANGED
Binary file
i18n/languages/woocommerce-germanized-de_DE.po CHANGED
@@ -3,7 +3,7 @@ msgstr ""
3
  "Project-Id-Version: WooCommerce Germanized v1.5.1\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2018-02-08 13:00+0100\n"
6
- "PO-Revision-Date: 2018-02-08 13:01+0100\n"
7
  "Last-Translator: holzhannes <holzhannes@posteo.de>\n"
8
  "Language-Team: \n"
9
  "Language: de_DE\n"
@@ -731,12 +731,6 @@ msgstr ""
731
 
732
  # @ woocommerce-germanized
733
  #: includes/admin/settings/class-wc-gzd-settings-germanized.php:295
734
- #, fuzzy
735
- #| msgid ""
736
- #| "The european commission provides a platform for online dispute resolution "
737
- #| "(OS) which is accessible at http://ec.europa.eu/consumers/odr/. We are "
738
- #| "not obliged nor willing to participate in dispute settlement proceedings "
739
- #| "before a consumer arbitration board."
740
  msgid ""
741
  "The european commission provides a platform for online dispute resolution "
742
  "(OS) which is accessible at https://ec.europa.eu/consumers/odr. We are not "
3
  "Project-Id-Version: WooCommerce Germanized v1.5.1\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2018-02-08 13:00+0100\n"
6
+ "PO-Revision-Date: 2018-02-08 13:03+0100\n"
7
  "Last-Translator: holzhannes <holzhannes@posteo.de>\n"
8
  "Language-Team: \n"
9
  "Language: de_DE\n"
731
 
732
  # @ woocommerce-germanized
733
  #: includes/admin/settings/class-wc-gzd-settings-germanized.php:295
 
 
 
 
 
 
734
  msgid ""
735
  "The european commission provides a platform for online dispute resolution "
736
  "(OS) which is accessible at https://ec.europa.eu/consumers/odr. We are not "
i18n/languages/woocommerce-germanized-de_DE_formal.mo CHANGED
Binary file
i18n/languages/woocommerce-germanized-de_DE_formal.po CHANGED
@@ -3,7 +3,7 @@ msgstr ""
3
  "Project-Id-Version: WooCommerce Germanized v1.5.1\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2018-02-08 13:01+0100\n"
6
- "PO-Revision-Date: 2018-02-08 13:01+0100\n"
7
  "Last-Translator: holzhannes <holzhannes@posteo.de>\n"
8
  "Language-Team: \n"
9
  "Language: de_DE\n"
3
  "Project-Id-Version: WooCommerce Germanized v1.5.1\n"
4
  "Report-Msgid-Bugs-To: \n"
5
  "POT-Creation-Date: 2018-02-08 13:01+0100\n"
6
+ "PO-Revision-Date: 2018-02-08 13:03+0100\n"
7
  "Last-Translator: holzhannes <holzhannes@posteo.de>\n"
8
  "Language-Team: \n"
9
  "Language: de_DE\n"
includes/class-wc-gzd-checkout.php CHANGED
@@ -74,6 +74,8 @@ class WC_GZD_Checkout {
74
  add_filter( 'woocommerce_get_cancel_order_url', array( $this, 'cancel_order_url' ), PHP_INT_MAX, 1 );
75
  add_filter( 'woocommerce_get_cancel_order_url_raw', array( $this, 'cancel_order_url' ), PHP_INT_MAX, 1 );
76
  add_filter( 'user_has_cap', array( $this, 'disallow_user_order_cancellation' ), 15, 3 );
 
 
77
  add_action( 'woocommerce_germanized_order_confirmation_sent', array( $this, 'maybe_reduce_order_stock' ), 5, 1 );
78
  add_filter( 'woocommerce_my_account_my_orders_actions', array( $this, 'remove_cancel_button' ), 10, 2 );
79
 
@@ -233,8 +235,8 @@ class WC_GZD_Checkout {
233
  }
234
 
235
  public function maybe_reduce_order_stock( $order_id ) {
236
- if ( wc_gzd_get_dependencies()->woocommerce_version_supports_crud() ) {
237
- wc_reduce_stock_levels( $order_id );
238
  } else {
239
  $order = wc_get_order( $order_id );
240
 
@@ -249,7 +251,7 @@ class WC_GZD_Checkout {
249
 
250
  public function set_order_stock_reduced_meta( $order ) {
251
  if ( wc_gzd_get_dependencies()->woocommerce_version_supports_crud() ) {
252
- $order = wc_gzd_set_crud_meta_data( $order, '_order_stock_reduced', '1' );
253
  $order->save();
254
  }
255
  }
74
  add_filter( 'woocommerce_get_cancel_order_url', array( $this, 'cancel_order_url' ), PHP_INT_MAX, 1 );
75
  add_filter( 'woocommerce_get_cancel_order_url_raw', array( $this, 'cancel_order_url' ), PHP_INT_MAX, 1 );
76
  add_filter( 'user_has_cap', array( $this, 'disallow_user_order_cancellation' ), 15, 3 );
77
+
78
+ // Remove order stock right after confirmation is sent
79
  add_action( 'woocommerce_germanized_order_confirmation_sent', array( $this, 'maybe_reduce_order_stock' ), 5, 1 );
80
  add_filter( 'woocommerce_my_account_my_orders_actions', array( $this, 'remove_cancel_button' ), 10, 2 );
81
 
235
  }
236
 
237
  public function maybe_reduce_order_stock( $order_id ) {
238
+ if ( function_exists( 'wc_maybe_reduce_stock_levels' ) ) {
239
+ wc_maybe_reduce_stock_levels( $order_id );
240
  } else {
241
  $order = wc_get_order( $order_id );
242
 
251
 
252
  public function set_order_stock_reduced_meta( $order ) {
253
  if ( wc_gzd_get_dependencies()->woocommerce_version_supports_crud() ) {
254
+ $order = wc_gzd_set_crud_meta_data( $order, '_order_stock_reduced', 'yes' );
255
  $order->save();
256
  }
257
  }
includes/class-wc-gzd-payment-gateways.php CHANGED
@@ -68,6 +68,10 @@ class WC_GZD_Payment_Gateways {
68
  $this->manipulate_gateways();
69
  }
70
 
 
 
 
 
71
  public function manipulate_gateways() {
72
 
73
  $gateways = WC()->payment_gateways->get_available_payment_gateways();
@@ -79,7 +83,7 @@ class WC_GZD_Payment_Gateways {
79
  if ( ! isset( $gateway->force_order_button_text ) || $gateway->force_order_button_text )
80
  $gateway->order_button_text = apply_filters( 'woocommerce_gzd_order_button_payment_gateway_text', __( get_option( 'woocommerce_gzd_order_submit_btn_text' ), 'woocommerce-germanized' ), $gateway->id );
81
 
82
- if ( $gateway->get_option( 'fee' ) ) {
83
 
84
  $gateway_description = $this->gateway_data[ $gateway->id ][ 'description' ];
85
 
@@ -112,11 +116,16 @@ class WC_GZD_Payment_Gateways {
112
  */
113
  public function set_title( $title, $id ) {
114
  $gateways = WC()->payment_gateways->get_available_payment_gateways();
 
115
  foreach ( $gateways as $gateway ) {
116
 
117
  if ( $gateway->id != $id )
118
  continue;
119
 
 
 
 
 
120
  $this->maybe_set_gateway_data( $gateway );
121
 
122
  $title = $this->gateway_data[ $gateway->id ][ 'title' ];
@@ -133,9 +142,15 @@ class WC_GZD_Payment_Gateways {
133
  */
134
  public function init_fields() {
135
  $gateways = WC()->payment_gateways->payment_gateways;
 
136
  if ( ! empty( $gateways ) ) {
137
- foreach ( $gateways as $key => $gateway ) {
138
- add_filter( 'woocommerce_settings_api_form_fields_' . $gateway->id, array( $this, "set_fields" ) );
 
 
 
 
 
139
  }
140
  }
141
  }
@@ -163,7 +178,7 @@ class WC_GZD_Payment_Gateways {
163
  'default' => 'no',
164
  );
165
 
166
- if ( 'wc_gateway_cod' === $gateway ) {
167
 
168
  $fields[ 'forwarding_fee' ] = array(
169
  'title' => __( 'Forwarding Fee', 'woocommerce-germanized' ),
@@ -189,6 +204,10 @@ class WC_GZD_Payment_Gateways {
189
 
190
  $gateway = $gateways[ $key ];
191
 
 
 
 
 
192
  if ( $gateway->get_option( 'fee' ) )
193
  $this->set_fee( $gateway );
194
  }
68
  $this->manipulate_gateways();
69
  }
70
 
71
+ public function gateway_supports_fees( $id ) {
72
+ return in_array( $id, apply_filters( 'woocommerce_gzd_fee_supporting_gateways', array( 'cod' ) ) ) ? true : false;
73
+ }
74
+
75
  public function manipulate_gateways() {
76
 
77
  $gateways = WC()->payment_gateways->get_available_payment_gateways();
83
  if ( ! isset( $gateway->force_order_button_text ) || $gateway->force_order_button_text )
84
  $gateway->order_button_text = apply_filters( 'woocommerce_gzd_order_button_payment_gateway_text', __( get_option( 'woocommerce_gzd_order_submit_btn_text' ), 'woocommerce-germanized' ), $gateway->id );
85
 
86
+ if ( $this->gateway_supports_fees( $gateway->id ) && $gateway->get_option( 'fee' ) ) {
87
 
88
  $gateway_description = $this->gateway_data[ $gateway->id ][ 'description' ];
89
 
116
  */
117
  public function set_title( $title, $id ) {
118
  $gateways = WC()->payment_gateways->get_available_payment_gateways();
119
+
120
  foreach ( $gateways as $gateway ) {
121
 
122
  if ( $gateway->id != $id )
123
  continue;
124
 
125
+ if ( ! $this->gateway_supports_fees( $gateway->id ) ) {
126
+ return $title;
127
+ }
128
+
129
  $this->maybe_set_gateway_data( $gateway );
130
 
131
  $title = $this->gateway_data[ $gateway->id ][ 'title' ];
142
  */
143
  public function init_fields() {
144
  $gateways = WC()->payment_gateways->payment_gateways;
145
+
146
  if ( ! empty( $gateways ) ) {
147
+ foreach ( $gateways as $key => $gateway ) {
148
+
149
+ if ( ! $this->gateway_supports_fees( $gateway->id ) ) {
150
+ continue;
151
+ }
152
+
153
+ add_filter( 'woocommerce_settings_api_form_fields_' . $gateway->id, array( $this, "set_fields" ) );
154
  }
155
  }
156
  }
178
  'default' => 'no',
179
  );
180
 
181
+ if ( 'wc_gateway_cod' === $gateway || 'cod' === $gateway ) {
182
 
183
  $fields[ 'forwarding_fee' ] = array(
184
  'title' => __( 'Forwarding Fee', 'woocommerce-germanized' ),
204
 
205
  $gateway = $gateways[ $key ];
206
 
207
+ if ( ! $this->gateway_supports_fees( $gateway->id ) ) {
208
+ return;
209
+ }
210
+
211
  if ( $gateway->get_option( 'fee' ) )
212
  $this->set_fee( $gateway );
213
  }
includes/compatibility/class-wc-gzd-compatibility-woo-paypalplus.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * PayPal Plus Helper for Inpsyde
4
+ *
5
+ * Specific configuration for Woo PayPal Plus by Inspyde
6
+ *
7
+ * @class WC_GZD_Compatibility_Woo_Paypalplus
8
+ * @category Class
9
+ * @author vendidero
10
+ */
11
+ class WC_GZD_Compatibility_Woo_Paypalplus extends WC_GZD_Compatibility {
12
+
13
+ public function __construct() {
14
+ parent::__construct(
15
+ 'PayPal Plus for WooCommerce',
16
+ 'woo-paypalplus/paypalplus-woocommerce.php'
17
+ );
18
+ }
19
+
20
+ public function load() {
21
+ // Clear session on updating order review via AJAX
22
+ add_action( 'woocommerce_checkout_update_order_review', array( $this, 'clear_paypal_session' ) );
23
+ }
24
+
25
+ /**
26
+ * This method tries to clear PayPal Plus session data to allow our plugin to manipulate item data within checkout.
27
+ * Needed e.g. for payment gateway fees or vat_exempts.
28
+ */
29
+ public function clear_paypal_session() {
30
+ $gateways = WC_Payment_Gateways::instance()->get_available_payment_gateways();
31
+ $current = empty( $_POST['payment_method'] ) ? '' : wc_clean( $_POST['payment_method'] );
32
+
33
+ foreach( $gateways as $gateway ) {
34
+ if ( $current === $gateway->id && 'paypal_plus' === $gateway->id ) {
35
+ if ( is_callable( array( $gateway, 'clear_session_data' ) ) ) {
36
+ $gateway->clear_session_data();
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
includes/gateways/direct-debit/class-wc-gzd-gateway-direct-debit.php CHANGED
@@ -105,29 +105,31 @@ Please notice: Period for pre-information of the SEPA direct debit is shortened
105
 
106
  $this->admin_fields = array(
107
  'direct_debit_holder' => array(
108
- 'label' => __( 'Account Holder', 'woocommerce-germanized' ),
109
- 'id' => '_direct_debit_holder',
110
- 'class' => '',
111
- 'type' => 'text',
112
- 'encrypt' => false,
113
  ),
114
  'direct_debit_iban' => array(
115
- 'label' => __( 'IBAN', 'woocommerce-germanized' ),
116
- 'id' => '_direct_debit_iban',
117
- 'type' => 'text',
118
- 'encrypt' => true,
 
119
  ),
120
  'direct_debit_bic' => array(
121
- 'label' => __( 'BIC/SWIFT', 'woocommerce-germanized' ),
122
- 'id' => '_direct_debit_bic',
123
- 'type' => 'text',
124
- 'encrypt' => true,
 
125
  ),
126
  'direct_debit_mandate_id' => array(
127
- 'label' => __( 'Mandate Reference ID', 'woocommerce-germanized' ),
128
- 'id' => '_direct_debit_mandate_id',
129
- 'type' => 'text',
130
- 'encrypt' => false,
131
  ),
132
  );
133
 
@@ -226,6 +228,10 @@ Please notice: Period for pre-information of the SEPA direct debit is shortened
226
 
227
  $data = wc_clean( $_POST[ $field[ 'id' ] ] );
228
 
 
 
 
 
229
  if ( ! empty( $data ) && $field[ 'encrypt' ] ) {
230
  $data = $this->maybe_encrypt( $data );
231
  }
@@ -361,8 +367,8 @@ Please notice: Period for pre-information of the SEPA direct debit is shortened
361
  $directDebit->addPaymentInfo( $payment_id, apply_filters( 'woocommerce_gzd_direct_debit_sepa_xml_exporter_payment_args', array(
362
  'id' => $payment_id,
363
  'creditorName' => $this->company_account_holder,
364
- 'creditorAccountIBAN' => $this->clean_whitespaces( $this->company_account_iban ),
365
- 'creditorAgentBIC' => $this->clean_whitespaces( $this->company_account_bic ),
366
  'seqType' => $mandate_type,
367
  'creditorId' => $this->clean_whitespaces( $this->company_identification_number ),
368
  'dueDate' => date_i18n( 'Y-m-d', $this->get_debit_date( $order ) ),
@@ -371,8 +377,8 @@ Please notice: Period for pre-information of the SEPA direct debit is shortened
371
  foreach( $orders as $order ) {
372
  $directDebit->addTransfer( $payment_id, apply_filters( 'woocommerce_gzd_direct_debit_sepa_xml_exporter_transfer_args', array(
373
  'amount' => $order->get_total(),
374
- 'debtorIban' => $this->clean_whitespaces( $this->maybe_decrypt( wc_gzd_get_crud_data( $order, 'direct_debit_iban' ) ) ),
375
- 'debtorBic' => $this->clean_whitespaces( $this->maybe_decrypt( wc_gzd_get_crud_data( $order, 'direct_debit_bic' ) ) ),
376
  'debtorName' => wc_gzd_get_crud_data( $order, 'direct_debit_holder' ),
377
  'debtorMandate' => $this->get_mandate_id( $order ),
378
  'debtorMandateSignDate' => date_i18n( 'Y-m-d', $this->get_mandate_sign_date( $order ) ),
@@ -495,8 +501,8 @@ Please notice: Period for pre-information of the SEPA direct debit is shortened
495
  return;
496
 
497
  $holder = ( isset( $_POST[ 'direct_debit_account_holder' ] ) ? wc_clean( $_POST[ 'direct_debit_account_holder' ] ) : '' );
498
- $iban = ( isset( $_POST[ 'direct_debit_account_iban' ] ) ? $this->maybe_encrypt( $this->clean_whitespaces( wc_clean( $_POST[ 'direct_debit_account_iban' ] ) ) ) : '' );
499
- $bic = ( isset( $_POST[ 'direct_debit_account_bic' ] ) ? $this->maybe_encrypt( $this->clean_whitespaces( wc_clean( $_POST[ 'direct_debit_account_bic' ] ) ) ) : '' );
500
 
501
  $user_id = wc_gzd_get_crud_data( $order, 'user_id' );
502
 
@@ -545,8 +551,8 @@ Please notice: Period for pre-information of the SEPA direct debit is shortened
545
 
546
  $params = array(
547
  'account_holder' => wc_clean( isset( $_GET[ 'debit_holder' ] ) ? $_GET[ 'debit_holder' ] : '' ),
548
- 'account_iban' => wc_clean( isset( $_GET[ 'debit_iban' ] ) ? $_GET[ 'debit_iban' ] : '' ),
549
- 'account_swift' => wc_clean( isset( $_GET[ 'debit_swift' ] ) ? $_GET[ 'debit_swift' ] : '' ),
550
  'street' => wc_clean( isset( $_GET[ 'address' ] ) ? $_GET[ 'address' ] : '' ),
551
  'postcode' => wc_clean( isset( $_GET[ 'postcode' ] ) ? $_GET[ 'postcode' ] : '' ),
552
  'city' => wc_clean( isset( $_GET[ 'city' ] ) ? $_GET[ 'city' ] : '' ),
@@ -940,8 +946,9 @@ Please notice: Period for pre-information of the SEPA direct debit is shortened
940
  * @return array
941
  */
942
  public function process_payment( $order_id ) {
943
- $order = wc_get_order( $order_id );
944
- // Mark as on-hold (we're awaiting the cheque)
 
945
  $order->update_status( apply_filters( 'woocommerce_gzd_direct_debit_default_status', 'on-hold' ), __( 'Awaiting Direct Debit Payment', 'woocommerce-germanized' ) );
946
 
947
  // Reduce stock level
@@ -952,6 +959,7 @@ Please notice: Period for pre-information of the SEPA direct debit is shortened
952
  // Remove cart
953
  WC()->cart->empty_cart();
954
  }
 
955
  // Return thankyou redirect
956
  return array(
957
  'result' => 'success',
105
 
106
  $this->admin_fields = array(
107
  'direct_debit_holder' => array(
108
+ 'label' => __( 'Account Holder', 'woocommerce-germanized' ),
109
+ 'id' => '_direct_debit_holder',
110
+ 'class' => '',
111
+ 'type' => 'text',
112
+ 'encrypt' => false,
113
  ),
114
  'direct_debit_iban' => array(
115
+ 'label' => __( 'IBAN', 'woocommerce-germanized' ),
116
+ 'id' => '_direct_debit_iban',
117
+ 'type' => 'text',
118
+ 'encrypt' => true,
119
+ 'toupper' => true,
120
  ),
121
  'direct_debit_bic' => array(
122
+ 'label' => __( 'BIC/SWIFT', 'woocommerce-germanized' ),
123
+ 'id' => '_direct_debit_bic',
124
+ 'type' => 'text',
125
+ 'encrypt' => true,
126
+ 'toupper' => true,
127
  ),
128
  'direct_debit_mandate_id' => array(
129
+ 'label' => __( 'Mandate Reference ID', 'woocommerce-germanized' ),
130
+ 'id' => '_direct_debit_mandate_id',
131
+ 'type' => 'text',
132
+ 'encrypt' => false,
133
  ),
134
  );
135
 
228
 
229
  $data = wc_clean( $_POST[ $field[ 'id' ] ] );
230
 
231
+ if ( ! empty( $data ) && isset( $field['toupper'] ) && $field['toupper'] ) {
232
+ $data = strtoupper( $data );
233
+ }
234
+
235
  if ( ! empty( $data ) && $field[ 'encrypt' ] ) {
236
  $data = $this->maybe_encrypt( $data );
237
  }
367
  $directDebit->addPaymentInfo( $payment_id, apply_filters( 'woocommerce_gzd_direct_debit_sepa_xml_exporter_payment_args', array(
368
  'id' => $payment_id,
369
  'creditorName' => $this->company_account_holder,
370
+ 'creditorAccountIBAN' => strtoupper( $this->clean_whitespaces( $this->company_account_iban ) ),
371
+ 'creditorAgentBIC' => strtoupper( $this->clean_whitespaces( $this->company_account_bic ) ),
372
  'seqType' => $mandate_type,
373
  'creditorId' => $this->clean_whitespaces( $this->company_identification_number ),
374
  'dueDate' => date_i18n( 'Y-m-d', $this->get_debit_date( $order ) ),
377
  foreach( $orders as $order ) {
378
  $directDebit->addTransfer( $payment_id, apply_filters( 'woocommerce_gzd_direct_debit_sepa_xml_exporter_transfer_args', array(
379
  'amount' => $order->get_total(),
380
+ 'debtorIban' => strtoupper( $this->clean_whitespaces( $this->maybe_decrypt( wc_gzd_get_crud_data( $order, 'direct_debit_iban' ) ) ) ),
381
+ 'debtorBic' => strtoupper( $this->clean_whitespaces( $this->maybe_decrypt( wc_gzd_get_crud_data( $order, 'direct_debit_bic' ) ) ) ),
382
  'debtorName' => wc_gzd_get_crud_data( $order, 'direct_debit_holder' ),
383
  'debtorMandate' => $this->get_mandate_id( $order ),
384
  'debtorMandateSignDate' => date_i18n( 'Y-m-d', $this->get_mandate_sign_date( $order ) ),
501
  return;
502
 
503
  $holder = ( isset( $_POST[ 'direct_debit_account_holder' ] ) ? wc_clean( $_POST[ 'direct_debit_account_holder' ] ) : '' );
504
+ $iban = ( isset( $_POST[ 'direct_debit_account_iban' ] ) ? $this->maybe_encrypt( strtoupper( $this->clean_whitespaces( wc_clean( $_POST[ 'direct_debit_account_iban' ] ) ) ) ) : '' );
505
+ $bic = ( isset( $_POST[ 'direct_debit_account_bic' ] ) ? $this->maybe_encrypt( strtoupper( $this->clean_whitespaces( wc_clean( $_POST[ 'direct_debit_account_bic' ] ) ) ) ) : '' );
506
 
507
  $user_id = wc_gzd_get_crud_data( $order, 'user_id' );
508
 
551
 
552
  $params = array(
553
  'account_holder' => wc_clean( isset( $_GET[ 'debit_holder' ] ) ? $_GET[ 'debit_holder' ] : '' ),
554
+ 'account_iban' => strtoupper( wc_clean( isset( $_GET[ 'debit_iban' ] ) ? $_GET[ 'debit_iban' ] : '' ) ),
555
+ 'account_swift' => strtoupper( wc_clean( isset( $_GET[ 'debit_swift' ] ) ? $_GET[ 'debit_swift' ] : '' ) ),
556
  'street' => wc_clean( isset( $_GET[ 'address' ] ) ? $_GET[ 'address' ] : '' ),
557
  'postcode' => wc_clean( isset( $_GET[ 'postcode' ] ) ? $_GET[ 'postcode' ] : '' ),
558
  'city' => wc_clean( isset( $_GET[ 'city' ] ) ? $_GET[ 'city' ] : '' ),
946
  * @return array
947
  */
948
  public function process_payment( $order_id ) {
949
+ $order = wc_get_order( $order_id );
950
+
951
+ // Mark as on-hold (we're awaiting the cheque)
952
  $order->update_status( apply_filters( 'woocommerce_gzd_direct_debit_default_status', 'on-hold' ), __( 'Awaiting Direct Debit Payment', 'woocommerce-germanized' ) );
953
 
954
  // Reduce stock level
959
  // Remove cart
960
  WC()->cart->empty_cart();
961
  }
962
+
963
  // Return thankyou redirect
964
  return array(
965
  'result' => 'success',
includes/wc-gzd-legacy-functions.php CHANGED
@@ -154,8 +154,8 @@ function wc_gzd_get_order_currency( $order ) {
154
  }
155
 
156
  function wc_gzd_reduce_order_stock( $order_id ) {
157
- if ( wc_gzd_get_dependencies()->woocommerce_version_supports_crud() ) {
158
- wc_reduce_stock_levels($order_id);
159
  } else {
160
  $order = wc_get_order( $order_id );
161
  $order->reduce_order_stock();
154
  }
155
 
156
  function wc_gzd_reduce_order_stock( $order_id ) {
157
+ if ( wc_gzd_get_dependencies()->woocommerce_version_supports_crud() && function_exists( 'wc_maybe_reduce_stock_levels' ) ) {
158
+ wc_maybe_reduce_stock_levels($order_id);
159
  } else {
160
  $order = wc_get_order( $order_id );
161
  $order->reduce_order_stock();
readme.txt CHANGED
@@ -5,7 +5,7 @@ Requires at least: 3.8
5
  Tested up to: 4.9
6
  WC requires at least: 2.4
7
  WC tested up to: 3.3
8
- Stable tag: 1.9.8
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -169,6 +169,12 @@ Bug reports may be filed via our [GitHub repository](https://github.com/vendider
169
 
170
  == Changelog ==
171
 
 
 
 
 
 
 
172
  = 1.9.8 =
173
  * Improvement: Extended type check to support services
174
  * Improvement: Cache helper for double opt in activation key
5
  Tested up to: 4.9
6
  WC requires at least: 2.4
7
  WC tested up to: 3.3
8
+ Stable tag: 1.9.9
9
  License: GPLv3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
169
 
170
  == Changelog ==
171
 
172
+ = 1.9.9 =
173
+ * Improvement: Adjusted payment gateway fee settings to only apply for COD for legal purposes
174
+ * Improvement: Added Woo Paypal Plus checkout price manipulation compatibility
175
+ * Fix: Stock update using wc_maybe_reduce_stock_levels
176
+ * Fix: Added strtoupper to IBAN and BIC for direct debit
177
+
178
  = 1.9.8 =
179
  * Improvement: Extended type check to support services
180
  * Improvement: Cache helper for double opt in activation key
woocommerce-germanized.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce Germanized
4
  * Plugin URI: https://www.vendidero.de/woocommerce-germanized
5
  * Description: Extends WooCommerce to become a legally compliant store for the german market.
6
- * Version: 1.9.8
7
  * Author: Vendidero
8
  * Author URI: https://vendidero.de
9
  * Requires at least: 3.8
@@ -31,7 +31,7 @@ final class WooCommerce_Germanized {
31
  *
32
  * @var string
33
  */
34
- public $version = '1.9.8';
35
 
36
  /**
37
  * Single instance of WooCommerce Germanized Main Class
@@ -378,7 +378,8 @@ final class WooCommerce_Germanized {
378
  'polylang',
379
  'woo-poly-integration',
380
  'woocommerce-dynamic-pricing',
381
- 'woocommerce-role-based-prices'
 
382
  )
383
  );
384
 
@@ -592,13 +593,14 @@ final class WooCommerce_Germanized {
592
  * @param array $styles
593
  */
594
  public function add_styles( $styles ) {
 
595
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
596
 
597
  $styles['woocommerce-gzd-layout'] = array(
598
- 'src' => str_replace( array( 'http:', 'https:' ), '', WC_germanized()->plugin_url() ) . '/assets/css/woocommerce-gzd-layout' . $suffix . '.css',
599
- 'deps' => '',
600
- 'version' => WC_GERMANIZED_VERSION,
601
- 'media' => 'all',
602
  );
603
 
604
  return $styles;
3
  * Plugin Name: WooCommerce Germanized
4
  * Plugin URI: https://www.vendidero.de/woocommerce-germanized
5
  * Description: Extends WooCommerce to become a legally compliant store for the german market.
6
+ * Version: 1.9.9
7
  * Author: Vendidero
8
  * Author URI: https://vendidero.de
9
  * Requires at least: 3.8
31
  *
32
  * @var string
33
  */
34
+ public $version = '1.9.9';
35
 
36
  /**
37
  * Single instance of WooCommerce Germanized Main Class
378
  'polylang',
379
  'woo-poly-integration',
380
  'woocommerce-dynamic-pricing',
381
+ 'woocommerce-role-based-prices',
382
+ 'woo-paypalplus'
383
  )
384
  );
385
 
593
  * @param array $styles
594
  */
595
  public function add_styles( $styles ) {
596
+
597
  $suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
598
 
599
  $styles['woocommerce-gzd-layout'] = array(
600
+ 'src' => str_replace( array( 'http:', 'https:' ), '', WC_germanized()->plugin_url() ) . '/assets/css/woocommerce-gzd-layout' . $suffix . '.css',
601
+ 'deps' => '',
602
+ 'version' => WC_GERMANIZED_VERSION,
603
+ 'media' => 'all',
604
  );
605
 
606
  return $styles;