Skip to content

Commit 0a8f32a

Browse files
author
root
committed
Release 2.1.18
1 parent 443ac7d commit 0a8f32a

9 files changed

+46
-15
lines changed

README.md

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

1616
## Documentation
1717

18-
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.17/docs/en/documentation.html)
18+
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.18/docs/en/documentation.html)
1919

2020
## Support
2121

@@ -24,4 +24,4 @@ Support queries can be issued on the [PostFinance Checkout support site](https:/
2424

2525
## License
2626

27-
Please see the [license file](https://github.com/pfpayments/woocommerce/blob/2.1.17/LICENSE) for more information.
27+
Please see the [license file](https://github.com/pfpayments/woocommerce/blob/2.1.18/LICENSE) for more information.

changelog.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,3 +617,14 @@ Tested against:
617617
* [Tested Against] Woocommerce 7.7.0
618618
* [Tested Against] PHP SDK 3.2.0
619619

620+
* [Features] Support of Wordpress 6.2.1
621+
* [Features] Support of Wordpress 6.2.2
622+
* [Features] Support of Woocommerce 7.7.1
623+
* [BugFix] Fix the fatal error raised when using non-whitelabel payment method
624+
* [BugFix] Fix the error raised when using the Coupon *Sign Up Fee % Discount*
625+
626+
* [Tested Against] PHP 8.0.28
627+
* [Tested Against] Wordpress 6.2.0
628+
* [Tested Against] Woocommerce 7.7.0
629+
* [Tested Against] PHP SDK 3.2.0
630+

docs/en/documentation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h2>Documentation</h2> </div>
2222
</a>
2323
</li>
2424
<li>
25-
<a href="https://github.com/pfpayments/woocommerce/releases/tag/2.1.17/">
25+
<a href="https://github.com/pfpayments/woocommerce/releases/tag/2.1.18/">
2626
Source
2727
</a>
2828
</li>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function get_settings() {
187187
$settings = array(
188188
array(
189189
'links' => array(
190-
'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.17/docs/en/documentation.html' => __( 'Documentation', 'woo-postfinancecheckout' ),
190+
'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.18/docs/en/documentation.html' => __( 'Documentation', 'woo-postfinancecheckout' ),
191191
'https://checkout.postfinance.ch/en-ch/user/signup' => __( 'Sign Up', 'woo-postfinancecheckout' ),
192192
),
193193
'type' => 'postfinancecheckout_links',

includes/class-wc-postfinancecheckout-gateway.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,23 @@ public function is_available() {
315315
return $this->get_payment_method_configuration()->get_state() == WC_PostFinanceCheckout_Entity_Method_Configuration::STATE_ACTIVE;
316316
}
317317

318+
global $wp;
319+
if (is_checkout() && isset($wp->query_vars['order-received'])) {
320+
// Sometimes, when the Thank you page is loaded, there are new attemps to get
321+
// gateways availability. In this particular case, we retrieve the availability
322+
// information from the session, so the plugin does not have to ask the portal
323+
// for this information, creating an unused transaction in the process.
324+
$gateway_available = WC()->session->get('whitelabel_payment_gateways');
325+
if (!empty($gateway_available[$this->pfc_payment_method_configuration_id])) {
326+
return $gateway_available[$this->pfc_payment_method_configuration_id];
327+
}
328+
else {
329+
return false;
330+
}
331+
}
332+
318333
if ( apply_filters( 'wc_postfinancecheckout_is_order_pay_endpoint', is_checkout_pay_page() ) ) {
319334
// We have to use the order and not the cart for this endpoint.
320-
global $wp;
321335
$order = WC_Order_Factory::get_order( $wp->query_vars['order-pay'] );
322336
if ( ! $order ) {
323337
return false;
@@ -367,6 +381,10 @@ public function is_available() {
367381
return false;
368382
}
369383

384+
// Store the availability information in the session.
385+
$gateway_available = WC()->session->get('whitelabel_payment_gateways');
386+
$gateway_available[$this->pfc_payment_method_configuration_id] = true;
387+
$gateway_available = WC()->session->set('whitelabel_payment_gateways', $gateway_available);
370388
return true;
371389
}
372390

includes/class-wc-postfinancecheckout-migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public static function check_version() {
249249
public static function plugin_row_meta( $links, $file ) {
250250
if ( WC_POSTFINANCECHECKOUT_PLUGIN_BASENAME === $file ) {
251251
$row_meta = array(
252-
'docs' => '<a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.17/docs/en/documentation.html" aria-label="' . esc_attr__( 'View Documentation', 'woo-postfinancecheckout' ) . '">' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '</a>',
252+
'docs' => '<a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.18/docs/en/documentation.html" aria-label="' . esc_attr__( 'View Documentation', 'woo-postfinancecheckout' ) . '">' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '</a>',
253253
);
254254

255255
return array_merge( $links, $row_meta );

includes/service/class-wc-postfinancecheckout-service-line-item.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,13 @@ protected function create_product_line_items_from_session( WC_Cart $cart, $curre
102102
$amount = $discount_including_tax;
103103
$discount = $amount_including_tax - $discount_including_tax;
104104

105-
$coupon_discount = apply_filters( 'wc_postfinancecheckout_packages_coupon_percentage_discounts_by_item', $values['key'] );
106-
if ( $coupon_discount > 0 ) {
107-
//there is some coupon discount applied
108-
$amount = $amount_including_tax;
109-
$discount = $amount_including_tax - $discount_including_tax - $coupon_discount;
105+
if (isset($values['key'])) {
106+
$coupon_discount = apply_filters( 'wc_postfinancecheckout_packages_coupon_percentage_discounts_by_item', $values['key'] );
107+
if ( $coupon_discount > 0 ) {
108+
//there is some coupon discount applied
109+
$amount = $amount_including_tax;
110+
$discount = $amount_including_tax - $discount_including_tax - $coupon_discount;
111+
}
110112
}
111113

112114
$line_item = new \PostFinanceCheckout\Sdk\Model\LineItemCreate();

readme.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: customwebgmbh
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.2
6-
Stable tag: 2.1.17
6+
Stable tag: 2.1.18
77
License: Apache 2
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/2.1.17/docs/en/documentation.html).
26+
Additional documentation for this plugin is available [here](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/2.1.18/docs/en/documentation.html).
2727

2828
== Support ==
2929

woocommerce-postfinancecheckout.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: PostFinance Checkout
44
* Plugin URI: https://wordpress.org/plugins/woo-postfinancecheckout
55
* Description: Process WooCommerce payments with PostFinance Checkout.
6-
* Version: 2.1.17
6+
* Version: 2.1.18
77
* License: Apache2
88
* License URI: http://www.apache.org/licenses/LICENSE-2.0
99
* Author: wallee AG
@@ -46,7 +46,7 @@ final class WooCommerce_PostFinanceCheckout {
4646
*
4747
* @var string
4848
*/
49-
private $version = '2.1.17';
49+
private $version = '2.1.18';
5050

5151
/**
5252
* The single instance of the class.

0 commit comments

Comments
 (0)