Skip to content

Commit

Permalink
Merge pull request #250 from pay-now/release/2.5.7
Browse files Browse the repository at this point in the history
Release/2.5.7
  • Loading branch information
DeveloperMovecloser authored Oct 8, 2024
2 parents e424ffb + e5a2d09 commit 56e79b8
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 6 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
== Changelog ==
= 2.5.7 (2024-10-08) =

- Purchasing process improvements and fixes
- Add support for PHP 8+

= 2.5.6 (2024-08-12) =

- Purchasing process improvements and fixes
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pay-now/paynow-woocommerce",
"description": "paynow.pl plugin for WooCommerce",
"license": "GPLv3",
"version": "2.5.6",
"version": "2.5.7",
"authors": [
{
"name": "mElements S.A.",
Expand All @@ -13,7 +13,7 @@
"minimum-stability": "stable",
"require": {
"php": ">=7.2",
"pay-now/paynow-php-sdk": "^2.4.1",
"pay-now/paynow-php-sdk": "2.4.2",
"nyholm/psr7": "^1.2",
"php-http/curl-client": "^2.1",
"ext-json": "*"
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Tags: payment, payment gateway, paynow, woocommerce, płatności, payments, bramka płatności
Tested up to: 6.4
Requires PHP: 7.2
Stable tag: 2.5.6
Stable tag: 2.5.7
License: GPLv3

**pay**now is a secure online payment by bank transfers, BLIK and card.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function ( $payment ) {

$this->icon = $this->generate_icon( $payments );

return count( $payments ) > 0;
return parent::is_available() && count( $payments ) > 0 && $this->show_payment_methods;
}

public function get_paynow_icon_url(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,33 @@ public function __construct() {
$this->payment_method_id = null;
parent::__construct();
$this->title = $this->generate_title();

add_filter(
'woocommerce_gateway_title',
function ( $title, $payment_id ) {
if ( WC_PAY_BY_PAYNOW_PL_PLUGIN_PREFIX . 'paywall' === $payment_id ) {
return $this->generate_title();
}

return $title;
},
10,
2
);
}

public function is_available(): bool {
$is_paynow_enabled = false;
$paynow_payment_gateways = wc_pay_by_paynow()->payment_gateways();

foreach ( WC()->payment_gateways()->payment_gateways() as $payment_gateway ) {
if ( in_array( get_class( $payment_gateway ), $paynow_payment_gateways, true ) && 'yes' === $payment_gateway->enabled ) {
$is_payment_in_array = in_array(
get_class( $payment_gateway ),
$paynow_payment_gateways,
true
);

if ( $is_payment_in_array && 'yes' === $payment_gateway->enabled ) {
$is_paynow_enabled = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/pay-by-paynow-pl.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Pay by paynow.pl
* Plugin URI: https://github.com/pay-now/paynow-woocommerce
* Description: Accepts secure BLIK, credit cards payments and fast online transfers by paynow.pl
* Version: 2.5.6
* Version: 2.5.7
* Requires PHP: 7.2
* Author: mElements S.A.
* Author URI: https://www.paynow.pl
Expand Down

0 comments on commit 56e79b8

Please sign in to comment.