Skip to content

Commit 73da81f

Browse files
Release 3.3.13
1 parent f5d9446 commit 73da81f

11 files changed

+78
-31
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This repository contains the PostFinance Checkout plugin that enables WooCommerc
1414

1515
## Documentation
1616

17-
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.12/docs/en/documentation.html)
17+
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.13/docs/en/documentation.html)
1818

1919
## Support
2020

@@ -31,7 +31,7 @@ ____________________________________________________________________________
3131

3232
## License
3333

34-
Please see the [license file](https://github.com/pfpayments/woocommerce/blob/3.3.12/LICENSE) for more information.
34+
Please see the [license file](https://github.com/pfpayments/woocommerce/blob/3.3.13/LICENSE) for more information.
3535

3636
## Privacy Policy
3737

changelog.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,3 +953,12 @@ Please ensure that in woocommerce->settings->tax, the "Round tax at subtotal lev
953953
- [Tested Against] Woocommerce 9.8.5
954954
- [Tested Against] PHP SDK 4.8.0
955955

956+
= 3.3.13 - July 1st 2025 =
957+
- [Bugfix] Remove pay button for already paid orders
958+
- [Bugfix] Fix error when manually extending a subscription
959+
- [Bugfix] Fix incorrect handling of orders containing 0 amount line items
960+
- [Tested Against] PHP 8.2
961+
- [Tested Against] Wordpress 6.7
962+
- [Tested Against] Woocommerce 9.9.5
963+
- [Tested Against] PHP SDK 4.8.0
964+

docs/en/documentation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h2>Documentation</h2> </div>
2323
</a>
2424
</li>
2525
<li>
26-
<a href="https://github.com/pfpayments/woocommerce/releases/tag/3.3.12/">
26+
<a href="https://github.com/pfpayments/woocommerce/releases/tag/3.3.13/">
2727
Source
2828
</a>
2929
</li>

includes/admin/class-wc-postfinancecheckout-admin-settings-page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function get_default_settings() {
205205
$settings = array(
206206
array(
207207
'links' => array(
208-
'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.12/docs/en/documentation.html' => esc_html__( 'Documentation', 'woo-postfinancecheckout' ),
208+
'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.13/docs/en/documentation.html' => esc_html__( 'Documentation', 'woo-postfinancecheckout' ),
209209
'https://checkout.postfinance.ch/en-ch/user/signup' => esc_html__( 'Sign Up', 'woo-postfinancecheckout' ),
210210
),
211211
'type' => 'postfinancecheckout_links',

includes/class-wc-postfinancecheckout-blocks-support.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function is_active() {
5757
*/
5858
public function get_payment_method_script_handles() {
5959
$dependencies = array();
60-
$version = '3.3.12';
60+
$version = '3.3.13';
6161

6262
wp_register_script(
6363
'WooCommerce_PostFinanceCheckout_blocks_support',

includes/class-wc-postfinancecheckout-gateway.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,13 @@ public function is_available() {
328328
return false; // prevent reentry/loop
329329
}
330330
$checking = true;
331-
331+
332332
try {
333333
// Step 1: Respect parent availability
334334
if ( ! parent::is_available() ) {
335335
return false;
336336
}
337-
337+
338338
// Step 2: Prevent conflict with tax rounding
339339
if ( wc_tax_enabled() && 'yes' === get_option( 'woocommerce_tax_round_at_subtotal' ) ) {
340340
if ( 'yes' === get_option( WooCommerce_PostFinanceCheckout::POSTFINANCECHECKOUT_CK_ENFORCE_CONSISTENCY ) ) {
@@ -343,16 +343,16 @@ public function is_available() {
343343
return false;
344344
}
345345
}
346-
346+
347347
// Step 3: Use session cache if available
348348
$gateway_available = WC()->session && WC()->session->has_session()
349349
? WC()->session->get( 'postfinancecheckout_payment_gateways' )
350350
: array();
351-
351+
352352
if ( isset( $gateway_available[ $this->pfc_payment_method_configuration_id ] ) ) {
353353
return $gateway_available[ $this->pfc_payment_method_configuration_id ];
354354
}
355-
355+
356356
// Step 4: Allow admin and non-checkout pages to pass
357357
if ( apply_filters(
358358
'postfinancecheckout_is_method_available',
@@ -361,13 +361,13 @@ public function is_available() {
361361
) ) {
362362
return $this->get_payment_method_configuration()->get_state() === WC_PostFinanceCheckout_Entity_Method_Configuration::POSTFINANCECHECKOUT_STATE_ACTIVE;
363363
}
364-
364+
365365
// Step 5: Handle "order received" page logic
366366
global $wp;
367367
if ( is_checkout() && isset( $wp->query_vars['order-received'] ) ) {
368368
return ! empty( $gateway_available[ $this->pfc_payment_method_configuration_id ] );
369369
}
370-
370+
371371
// Step 6: Handle "order pay" endpoint
372372
if ( apply_filters( 'wc_postfinancecheckout_is_order_pay_endpoint', is_checkout_pay_page() ) ) {
373373
$order = WC_Order_Factory::get_order( $wp->query_vars['order-pay'] ?? 0 );
@@ -378,7 +378,7 @@ public function is_available() {
378378
} else {
379379
$possible_methods = $this->get_safe_possible_payment_methods_for_cart();
380380
}
381-
381+
382382
// Step 7: Check if this gateway is among the possible ones
383383
$possible = false;
384384
foreach ( $possible_methods as $method_id ) {
@@ -387,19 +387,19 @@ public function is_available() {
387387
break;
388388
}
389389
}
390-
390+
391391
if ( ! $possible ) {
392392
return false;
393393
}
394-
394+
395395
// Step 8: Cache success in session
396396
if ( WC()->session && WC()->session->has_session() ) {
397397
$gateway_available[ $this->pfc_payment_method_configuration_id ] = true;
398398
WC()->session->set( 'postfinancecheckout_payment_gateways', $gateway_available );
399399
}
400-
400+
401401
return true;
402-
402+
403403
} finally {
404404
$checking = false;
405405
}
@@ -432,7 +432,7 @@ protected function get_safe_possible_payment_methods_for_cart() {
432432
} catch ( Exception $e ) {
433433
WooCommerce_PostFinanceCheckout::instance()->log( $e->getMessage(), WC_Log_Levels::DEBUG );
434434
}
435-
435+
436436
return false;
437437
}
438438

includes/class-wc-postfinancecheckout-migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public static function check_version() {
268268
public static function plugin_row_meta( $links, $file ) {
269269
if ( WC_POSTFINANCECHECKOUT_PLUGIN_BASENAME === $file ) {
270270
$row_meta = array(
271-
'docs' => '<a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.12/docs/en/documentation.html" aria-label="' . esc_html__( 'View Documentation', 'woo-postfinancecheckout' ) . '">' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '</a>',
271+
'docs' => '<a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.13/docs/en/documentation.html" aria-label="' . esc_html__( 'View Documentation', 'woo-postfinancecheckout' ) . '">' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '</a>',
272272
);
273273

274274
return array_merge( $links, $row_meta );

includes/class-wc-postfinancecheckout-zero-gateway.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ public function init_form_fields() {
5252
}
5353

5454
public function is_available() {
55+
if (isset($_GET['pay_for_order']) && boolval($_GET['pay_for_order']) === true) {
56+
$order_id = get_query_var( 'order-pay' );
57+
$order = wc_get_order( $order_id );
58+
59+
if ( $order instanceof WC_Order && floatval( $order->get_total() ) == 0 ) {
60+
return true;
61+
}
62+
63+
return false;
64+
}
5565
return ( WC()->cart && WC()->cart->total == 0 ) && $this->enabled === 'yes';
5666
}
5767

@@ -76,6 +86,15 @@ public function hide_gateways_for_zero_order_total( $available_gateways ) {
7686
return $available_gateways;
7787
}
7888

89+
if (isset($_GET['pay_for_order']) && boolval($_GET['pay_for_order']) === true) {
90+
$order_id = get_query_var( 'order-pay' );
91+
$order = wc_get_order( $order_id );
92+
93+
if ( $order instanceof WC_Order && floatval( $order->get_total() ) > 0 ) {
94+
return $available_gateways;
95+
}
96+
}
97+
7998
$has_subscription = self::cart_has_subscription();
8099
if ( WC()->cart && WC()->cart->total == 0 && !$has_subscription ) {
81100
foreach ( $available_gateways as $gateway_id => $gateway ) {

includes/packages/coupon/class-wc-postfinancecheckout-packages-coupon-discount.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,23 @@ public static function get_coupons_discount_totals_including_tax( $currency ) {
117117
}
118118

119119
$order_id = $session->get( 'postfinancecheckout_order_id' );
120-
if ( WC()->cart->get_cart_contents_count() == 0 && ! is_null( $order_id ) ) {
120+
$cart = WC()->cart;
121+
if ( ! class_exists( 'WC_Cart' ) || ! ( $cart instanceof WC_Cart ) ) {
122+
return $coupons_discount_total;
123+
}
124+
if ( $cart->get_cart_contents_count() == 0 && ! is_null( $order_id ) ) {
121125
$order = wc_get_order( $order_id );
122126
if ( $order ) {
123127
$coupons_discount_total += $order->get_total_discount();
124128
}
125129
}
126130

127131
// guard clause if the cart is empty, nothing to do here. This applies to subscription renewals.
128-
if ( empty( WC()->cart->get_cart_contents_count() ) ) {
132+
if ( empty( $cart->get_cart_contents_count() ) ) {
129133
return $coupons_discount_total;
130134
}
131135

132-
foreach ( WC()->cart->get_coupon_discount_totals() as $coupon_discount_total ) {
136+
foreach ( $cart->get_coupon_discount_totals() as $coupon_discount_total ) {
133137
$coupons_discount_total += WC_PostFinanceCheckout_Helper::instance()->round_amount( $coupon_discount_total, $currency );
134138
}
135139

readme.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: postfinancecheckout AG
33
Tags: woocommerce PostFinance Checkout, woocommerce, PostFinance Checkout, payment, e-commerce, webshop, psp, invoice, packing slips, pdf, customer invoice, processing
44
Requires at least: 4.7
55
Tested up to: 6.7
6-
Stable tag: 3.3.12
6+
Stable tag: 3.3.13
77
License: Apache-2.0
88
License URI: http://www.apache.org/licenses/LICENSE-2.0
99

@@ -23,7 +23,7 @@ To use this extension, a PostFinance Checkout account is required. Sign up on [P
2323

2424
== Documentation ==
2525

26-
Additional documentation for this plugin is available [here](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.12/docs/en/documentation.html).
26+
Additional documentation for this plugin is available [here](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.13/docs/en/documentation.html).
2727

2828
== External Services ==
2929

@@ -81,9 +81,11 @@ Enquiries about our terms of use can be made on the [PostFinance Checkout terms
8181
== Changelog ==
8282

8383

84-
= 3.3.12 - June 4th 2025 =
85-
- [Hotfix] Incorrect index name
84+
= 3.3.13 - July 1st 2025 =
85+
- [Bugfix] Remove pay button for already paid orders
86+
- [Bugfix] Fix error when manually extending a subscription
87+
- [Bugfix] Fix incorrect handling of orders containing 0 amount line items
8688
- [Tested Against] PHP 8.2
8789
- [Tested Against] Wordpress 6.7
88-
- [Tested Against] Woocommerce 9.8.5
90+
- [Tested Against] Woocommerce 9.9.5
8991
- [Tested Against] PHP SDK 4.8.0

0 commit comments

Comments
 (0)