Skip to content

Commit 1d9d9dd

Browse files
committed
[Fix] Some methods were not showing up
1 parent 90c29db commit 1d9d9dd

12 files changed

+71
-49
lines changed

CHANGELOG.MD

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
# 2.2.0
2-
* Add - PayU – standard via WooCommerce Blocks
3-
* Add - PayU – payment card via WooCommerce Blocks
1+
# 2.2.1 - 2024-06-17
2+
* [Fix] Some methods were not showing up
3+
* [Fix] PHP Deprecated: Creation of dynamic property
4+
5+
# 2.2.0 - 2024-06-17
6+
* [Add] PayU – standard via WooCommerce Blocks
7+
* [Add] PayU – payment card via WooCommerce Blocks
48

59
# 2.1.0
610
* Added Klarna as a separate payment method

changelog.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
*** Changelog ***
22

3+
= 2.2.1 - 2024-06-17 =
4+
* [Fix] Some methods were not showing up
5+
* [Fix] PHP Deprecated: Creation of dynamic property
6+
37
= 2.2.0 - 2024-06-17 =
4-
* Add - PayU – standard via WooCommerce Blocks
5-
* Add - PayU – payment card via WooCommerce Blocks
8+
* [Add] PayU – standard via WooCommerce Blocks
9+
* [Add] PayU – payment card via WooCommerce Blocks
610

711
= 2.1.0 =
812
* Added Klarna as a separate payment method

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.2.0",
3+
"version": "2.2.1",
44
"description": "PayU GPO Payment Gateway for WooCommerce",
55
"type": "woocommerce-plugin",
66
"license": "Apache License 2.0",

composer.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

includes/WC_Gateway_PayuInstallments.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ class WC_Gateway_PayuInstallments extends WC_Payu_Gateways {
77

88
function __construct() {
99
parent::__construct( 'payuinstallments' );
10+
}
1011

11-
if ( $this->is_enabled() ) {
12-
if ( ! is_admin() ) {
13-
if ( ! $this->try_retrieve_banks() ) {
14-
add_filter( 'woocommerce_available_payment_gateways', [ $this, 'unset_gateway' ] );
15-
} else {
16-
wp_enqueue_style( 'payu-installments-widget', plugins_url( '/assets/css/payu-installments-widget.css', PAYU_PLUGIN_FILE ), [], PAYU_PLUGIN_VERSION );
17-
add_filter( 'woocommerce_gateway_description', [
18-
$this,
19-
'installments_filter_gateway_description'
20-
], 10, 2 );
21-
}
22-
}
12+
public function is_available() {
13+
if ( ! $this->try_retrieve_banks() ) {
14+
return false;
2315
}
16+
17+
wp_enqueue_style( 'payu-installments-widget', plugins_url( '/assets/css/payu-installments-widget.css', PAYU_PLUGIN_FILE ), [], PAYU_PLUGIN_VERSION );
18+
add_filter( 'woocommerce_gateway_description', [
19+
$this,
20+
'installments_filter_gateway_description'
21+
], 10, 2 );
22+
23+
return parent::is_available();
2424
}
2525

2626
public function installments_filter_gateway_description( $description, $id ) {

includes/WC_Gateway_PayuKlarna.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ function __construct() {
1010

1111
if ( $this->is_enabled() ) {
1212
$this->icon = apply_filters( 'woocommerce_payu_icon', plugins_url( '/assets/images/klarna.svg', PAYU_PLUGIN_FILE ) );
13+
}
14+
}
1315

14-
if ( ! is_admin() ) {
15-
if ( ! $this->try_retrieve_banks() ) {
16-
add_filter( 'woocommerce_available_payment_gateways', [ $this, 'unset_gateway' ] );
17-
}
18-
}
16+
public function is_available() {
17+
if ( ! $this->try_retrieve_banks() ) {
18+
return false;
1919
}
20+
21+
return parent::is_available();
2022
}
2123

2224
public function payment_fields() {

includes/WC_Gateway_PayuListBanks.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ function __construct() {
1010

1111
if ( $this->is_enabled() ) {
1212
$this->show_terms_info = true;
13-
14-
if ( ! is_admin() ) {
15-
if ( ! $this->try_retrieve_banks() ) {
16-
add_filter( 'woocommerce_available_payment_gateways', [ $this, 'unset_gateway' ] );
17-
}
18-
}
1913
}
2014
}
2115

16+
public function is_available() {
17+
if ( ! $this->try_retrieve_banks() ) {
18+
return false;
19+
}
20+
21+
return parent::is_available();
22+
}
2223
function init_form_fields() {
2324
parent::payu_init_form_fields( true );
2425
}

includes/WC_Gateway_PayuPaypo.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ function __construct() {
1010

1111
if ( $this->is_enabled() ) {
1212
$this->icon = apply_filters( 'woocommerce_payu_icon', plugins_url( '/assets/images/paypo.svg', PAYU_PLUGIN_FILE ) );
13-
14-
if ( ! is_admin() ) {
15-
if ( ! $this->try_retrieve_banks() ) {
16-
add_filter( 'woocommerce_available_payment_gateways', [ $this, 'unset_gateway' ] );
17-
}
18-
}
1913
}
2014
}
2115

16+
public function is_available() {
17+
if ( ! $this->try_retrieve_banks() ) {
18+
return false;
19+
}
20+
21+
return parent::is_available();
22+
}
2223
public function payment_fields() {
2324
parent::payment_fields();
2425
$this->agreements_field();

includes/WC_Gateway_PayuSecureForm.php

+8-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,18 @@ function __construct() {
1717
//refresh card iframe after checkout change
1818
if ( ! is_admin() ) {
1919
add_action( 'wp_footer', [ $this, 'minicart_checkout_refresh_script' ] );
20-
if ( ! $this->try_retrieve_banks() ) {
21-
add_filter( 'woocommerce_available_payment_gateways', [ $this, 'unset_gateway' ] );
22-
}
2320
}
2421
}
2522
}
2623

24+
public function is_available() {
25+
if ( ! $this->try_retrieve_banks() ) {
26+
return false;
27+
}
28+
29+
return parent::is_available();
30+
}
31+
2732
/**
2833
* @return null
2934
*/

includes/WC_Gateway_PayuTwistoPl.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ function __construct() {
1010

1111
if ( $this->is_enabled() ) {
1212
$this->icon = apply_filters( 'woocommerce_payu_icon', plugins_url( '/assets/images/twisto-pl.svg', PAYU_PLUGIN_FILE ) );
13-
14-
if ( ! is_admin() ) {
15-
if ( ! $this->try_retrieve_banks() ) {
16-
add_filter( 'woocommerce_available_payment_gateways', [ $this, 'unset_gateway' ] );
17-
}
18-
}
1913
}
2014
}
2115

16+
public function is_available() {
17+
if ( ! $this->try_retrieve_banks() ) {
18+
return false;
19+
}
20+
21+
return parent::is_available();
22+
}
2223
public function payment_fields() {
2324
parent::payment_fields();
2425
$this->agreements_field();

readme.txt

+7-3
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.2.0
6+
Stable tag: 2.2.1
77
Requires PHP: 7.4
88
License: Apache License 2.0
99

@@ -50,9 +50,13 @@ Yes, it does.
5050

5151
== Changelog ==
5252

53+
= 2.2.1 - 2024-06-17 =
54+
* [Fix] Some methods were not showing up
55+
* [Fix] PHP Deprecated: Creation of dynamic property
56+
5357
= 2.2.0 - 2024-06-17 =
54-
* Add - PayU – standard via WooCommerce Blocks
55-
* Add - PayU – payment card via WooCommerce Blocks
58+
* [Add] PayU – standard via WooCommerce Blocks
59+
* [Add] PayU – payment card via WooCommerce Blocks
5660

5761
= 2.1.0 =
5862
* Added Klarna as a separate payment method

woocommerce-gateway-payu.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
require __DIR__ . '/vendor/autoload.php';
2323

24-
define( 'PAYU_PLUGIN_VERSION', '2.2.0' );
24+
define( 'PAYU_PLUGIN_VERSION', '2.2.1' );
2525
define( 'PAYU_PLUGIN_FILE', __FILE__ );
2626
define( 'PAYU_PLUGIN_STATUS_WAITING', 'payu-waiting' );
2727

0 commit comments

Comments
 (0)