Skip to content

Commit b7bd57b

Browse files
committed
Fix "Call to a member function get_total() on null", version update
1 parent a00fbba commit b7bd57b

7 files changed

+14
-6
lines changed

CHANGELOG.MD

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 2.3.1 - 2024-06-241
2+
* [Fix] "Call to a member function get_total() on null" for Installments
3+
14
# 2.3.0 - 2024-06-21
25
* [Add] PayU - installments via WooCommerce Blocks
36
* [Add] PayU - Klarna via WooCommerce Blocks

Payu/Gateways/WC_Gateway_PayuInstallments.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function get_additional_data(): array {
3333
'widgetOnCheckout' => $this->options['credit_widget_on_checkout_page'] === 'yes',
3434
'posId' => $this->pos_id,
3535
'widgetKey' => $this->pos_widget_key,
36-
'total' => WC()->cart->get_total( '' )
36+
'total' => $this->getTotal()
3737
];
3838
}
3939

Payu/Gateways/WC_Payu_Gateways.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ protected function check_min_max( $payMethod, $paytype = null ) {
11061106
return false;
11071107
}
11081108

1109-
private function getTotal(): float {
1109+
protected function getTotal(): float {
11101110
if ( $this->order_total !== null ) {
11111111
return $this->order_total;
11121112
} elseif ( WC()->cart && 0 !== count( WC()->cart->get_cart_contents() ) ) {

changelog.txt

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
*** Changelog ***
2+
= 2.3.1 - 2024-06-241 =
3+
* [Fix] "Call to a member function get_total() on null" for Installments
4+
25
= 2.3.0 - 2024-06-21 =
36
* [Add] PayU - installments via WooCommerce Blocks
47
* [Add] PayU - Klarna via WooCommerce Blocks

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "payu/payment_gateway",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"description": "PayU GPO Payment Gateway for WooCommerce",
55
"type": "woocommerce-plugin",
66
"license": "Apache License 2.0",

readme.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: payusa
33
Tags: PayU, payment, payment gateway, platnosci, PayU Poland, PayU EU, PayU GPO
44
Requires at least: 5.0
55
Tested up to: 6.5.4
6-
Stable tag: 2.3.0
6+
Stable tag: 2.3.1
77
Requires PHP: 7.4
88
License: Apache License 2.0
99

@@ -49,6 +49,8 @@ Yes, it does.
4949
* For presenting minimal installment amount we used [Widget Installments](https://developers.payu.com/en/installments.html#installments_best_practices_mini) and plugin loads the script from the static.payu.com domain.
5050

5151
== Changelog ==
52+
= 2.3.1 - 2024-06-241 =
53+
* [Fix] "Call to a member function get_total() on null" for Installments
5254

5355
= 2.3.0 - 2024-06-21 =
5456
* [Add] PayU - installments via WooCommerce Blocks

woocommerce-gateway-payu.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Plugin URI: https://github.com/PayU/woo-payu-payment-gateway
55
* GitHub Plugin URI: https://github.com/PayU-EMEA/woo-payu-payment-gateway
66
* Description: PayU payment gateway for WooCommerce
7-
* Version: 2.3.0
7+
* Version: 2.3.1
88
* Author: PayU SA
99
* Author URI: http://www.payu.com
1010
* License: Apache License 2.0
@@ -31,7 +31,7 @@
3131

3232
require __DIR__ . '/vendor/autoload.php';
3333

34-
define( 'PAYU_PLUGIN_VERSION', '2.3.0' );
34+
define( 'PAYU_PLUGIN_VERSION', '2.3.1' );
3535
define( 'PAYU_PLUGIN_FILE', __FILE__ );
3636
define( 'PAYU_PLUGIN_STATUS_WAITING', 'payu-waiting' );
3737

0 commit comments

Comments
 (0)