Skip to content

Commit d16fae7

Browse files
Merge pull request #258 from pay-now/release/2.5.10
Release/2.5.10
2 parents 3979828 + ccd08bb commit d16fae7

File tree

7 files changed

+33
-7
lines changed

7 files changed

+33
-7
lines changed

changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
== Changelog ==
22

3+
= 2.5.10 (2025-10-21) =
4+
5+
- Purchasing process improvements and fixes
6+
37
= 2.5.9 (2025-08-13) =
48

59
- Security improvements – better protection for transactions against fraud.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "pay-now/paynow-woocommerce",
33
"description": "paynow.pl plugin for WooCommerce",
44
"license": "GPLv3",
5-
"version": "2.5.9",
5+
"version": "2.5.10",
66
"authors": [
77
{
88
"name": "mElements S.A.",

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Tags: payment, payment gateway, paynow, woocommerce, płatności, payments, bramka płatności
33
Tested up to: 6.4
44
Requires PHP: 7.2
5-
Stable tag: 2.5.9
5+
Stable tag: 2.5.10
66
License: GPLv3
77

88
**pay**now is a secure online payment by bank transfers, BLIK and card.
Lines changed: 14 additions & 0 deletions
Loading

src/includes/abstract/class-wc-gateway-pay-by-paynow-pl.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ public function payment_fields() {
142142
include WC_PAY_BY_PAYNOW_PL_PLUGIN_FILE_PATH . WC_PAY_BY_PAYNOW_PL_PLUGIN_TEMPLATES_PATH . 'payment_processor_info.php';
143143
}
144144

145-
public function process_payment( $order_id ): array {
145+
public function process_payment( $order_id ) {
146146

147147
$order = wc_get_order( $order_id );
148148
$response = array();
@@ -176,28 +176,36 @@ public function process_payment( $order_id ): array {
176176
! empty( $payment_method_fingerprint ) ? $payment_method_fingerprint : null
177177
);
178178
if ( isset( $payment_data['errors'] ) ) {
179-
$error_type = null;
180-
$message = null;
179+
$response['result'] = 'failure';
180+
$error_type = null;
181+
$message = null;
181182
if ( isset( $payment_data['errors'] [0] ) && $payment_data['errors'][0] instanceof \Paynow\Exception\Error ) {
182183
$error_type = $payment_data['errors'][0]->getType();
183184
$message = $payment_data['errors'][0]->getMessage();
184185
}
185186
switch ( $error_type ) {
186187
case 'AUTHORIZATION_CODE_INVALID':
187188
wc_add_notice( __( 'Wrong BLIK code', 'pay-by-paynow-pl' ), 'error' );
189+
$response['error'] = __( 'Wrong BLIK code', 'pay-by-paynow-pl' );
188190
break;
189191
case 'AUTHORIZATION_CODE_EXPIRED':
190192
wc_add_notice( __( 'BLIK code has expired', 'pay-by-paynow-pl' ), 'error' );
193+
$response['error'] = __( 'BLIK code has expired', 'pay-by-paynow-pl' );
191194
break;
192195
case 'AUTHORIZATION_CODE_USED':
193196
wc_add_notice( __( 'BLIK code already used', 'pay-by-paynow-pl' ), 'error' );
197+
$response['error'] = __( 'BLIK code already used', 'pay-by-paynow-pl' );
194198
break;
195199
case 'VALIDATION_ERROR':
196200
wc_add_notice( $this->get_validation_errors_message( $message ), 'error' );
201+
$response['error'] = $this->get_validation_errors_message( $message );
197202
break;
198203
default:
199204
wc_add_notice( __( 'An error occurred during the payment process and the payment could not be completed.', 'pay-by-paynow-pl' ), 'error' );
200205
}
206+
if ( did_action( 'woocommerce_store_api_checkout_order_processed' ) ) {
207+
throw new \Exception( $response['error'] );
208+
}
201209
return $response;
202210
}
203211

src/includes/class-wc-pay-by-paynow-pl-manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function instance(): WC_Pay_By_Paynow_Pl_Manager {
4848
public function __construct() {
4949

5050
add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ), 10 );
51-
add_action( 'woocommerce_init', array( $this, 'woocommerce_dependencies' ) );
51+
add_action( 'woocommerce_init', array( $this, 'woocommerce_dependencies' ), 9 );
5252
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );
5353
add_action( 'rest_api_init', 'wc_pay_by_paynow_pl_gateway_rest_init' );
5454
add_action( 'wp_enqueue_scripts', array( $this, 'wc_pay_by_paynow_pl_gateway_front_resources' ) );

src/pay-by-paynow-pl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Pay by paynow.pl
44
* Plugin URI: https://github.com/pay-now/paynow-woocommerce
55
* Description: Accepts secure BLIK, credit cards payments and fast online transfers by paynow.pl
6-
* Version: 2.5.9
6+
* Version: 2.5.10
77
* Requires PHP: 7.2
88
* Author: mElements S.A.
99
* Author URI: https://www.paynow.pl

0 commit comments

Comments
 (0)