Skip to content

Commit

Permalink
Release 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrowanwallee committed Sep 24, 2024
1 parent 5aec148 commit 2231128
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 57 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This repository contains the PostFinance Checkout plugin that enables WooCommerc

## Documentation

* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.1.3/docs/en/documentation.html)
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.2.0/docs/en/documentation.html)

## Support

Expand All @@ -33,7 +33,7 @@ ____________________________________________________________________________

## License

Please see the [license file](https://github.com/pfpayments/woocommerce/blob/3.1.3/LICENSE) for more information.
Please see the [license file](https://github.com/pfpayments/woocommerce/blob/3.2.0/LICENSE) for more information.

## Privacy Policy

Expand Down
9 changes: 8 additions & 1 deletion assets/js/frontend/blocks/build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
<?php return array('dependencies' => array('@woocommerce/blocks-registry', 'react', 'wp-polyfill'), 'version' => '7f92f9325421ea216f54');
<?php return array(
'dependencies' => array(
'@woocommerce/blocks-registry',
'react',
'wp-polyfill',
),
'version' => '95e2ee718829327fb379',
);
2 changes: 1 addition & 1 deletion assets/js/frontend/blocks/build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions build/index.asset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php return array(
'dependencies' => array(
'@woocommerce/blocks-registry',
'react',
'wp-element',
'wp-polyfill',
),
'version' => 'b53687c38b284a0c8c13',
);
1 change: 1 addition & 0 deletions build/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 7 additions & 16 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -822,22 +822,13 @@ Tested against:
- [Tested Against] Woocommerce 9.1.4 & Woocommerce 9.2.1
- [Tested Against] PHP SDK 4.5.0

= 3.1.1 - Sept 13 2024 =
- [Bugfix] Added migrations for 3.1.0 changes.
- [Tested Against] PHP 8.2
- [Tested Against] Wordpress 6.6
- [Tested Against] Woocommerce 9.3.1
- [Tested Against] PHP SDK 4.5.0

= 3.1.2 - Sept 13 2024 =
- [Bugfix] Fixed installation error.
- [Tested Against] PHP 8.2
- [Tested Against] Wordpress 6.6
- [Tested Against] Woocommerce 9.3.1
- [Tested Against] PHP SDK 4.5.0

= 3.1.3 - Sept 20 2024 =
- [Bugfix] Enchanced plugin performance on Checkout page.
= 3.2.0 - Sept 23 2024 =
- [Feature] Add privacy policy URL
- [Feature] Adhere to WP code standards
- [Feature] Add Support for WC 9.3.x
- [Bugfix] Fix for error when renewing subscriptions
- [Bugfix] Fix for deferred payments status being incorrect
- [Bugfix] Added migrations for 3.2.0 changes
- [Tested Against] PHP 8.2
- [Tested Against] Wordpress 6.6
- [Tested Against] Woocommerce 9.3.1
Expand Down
2 changes: 1 addition & 1 deletion docs/en/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ <h2>Documentation</h2> </div>
</a>
</li>
<li>
<a href="https://github.com/pfpayments/woocommerce/releases/tag/3.1.3/">
<a href="https://github.com/pfpayments/woocommerce/releases/tag/3.2.0/">
Source
</a>
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ public function get_settings() {
$settings = array(
array(
'links' => array(
'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.1.3/docs/en/documentation.html' => esc_html__( 'Documentation', 'woo-postfinancecheckout' ),
'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.2.0/docs/en/documentation.html' => esc_html__( 'Documentation', 'woo-postfinancecheckout' ),
'https://checkout.postfinance.ch/en-ch/user/signup' => esc_html__( 'Sign Up', 'woo-postfinancecheckout' ),
),
'type' => 'postfinancecheckout_links',
Expand Down
21 changes: 4 additions & 17 deletions includes/class-wc-postfinancecheckout-blocks-support.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function is_active() {
*/
public function get_payment_method_script_handles() {
$dependencies = array();
$version = '4';
$version = '1';

wp_register_script(
'WooCommerce_PostFinanceCheckout_blocks_support',
Expand Down Expand Up @@ -99,11 +99,7 @@ public function get_payment_method_data() {
* @return void
*/
public static function get_payment_methods() {

$paymentMethods = WC()->session->get( 'postfinancecheckout_payments_list' );
if ($paymentMethods) {
return wp_send_json( array_values( $paymentMethods ) );
}

if ( ! isset( $_POST['postfinancecheckout_nonce'] ) || ! wp_verify_nonce( $_POST['postfinancecheckout_nonce'], 'postfinancecheckout_nonce_block' ) ) { //phpcs:ignore
wp_send_json_error( 'Invalid request', 403 );
}
Expand All @@ -128,7 +124,6 @@ function ( WC_PostFinanceCheckout_Gateway $payment_gateway ) {
},
$payment_plugin
);
WC()->session->set( 'postfinancecheckout_payments_list', $payments_list );

// Send the list back to the requester in a JSON.
wp_send_json( array_values( $payments_list ) );
Expand All @@ -154,16 +149,8 @@ public static function is_payment_method_available() {
}

$configuration_id = isset( $_POST['configuration_id'] ) ? absint( sanitize_key( wp_unslash( $_POST['configuration_id'] ) ) ) : null; //phpcs:ignore

$cacheHash = $_POST['formHash'] ?? null;
$available_payment_methods = WC()->session->get( $cacheHash );

if (!$available_payment_methods) {
$available_payment_methods = WC_PostFinanceCheckout_Service_Transaction::instance()->get_possible_payment_methods_for_cart();
WC()->session->set( $cacheHash, $available_payment_methods );
}

wp_send_json( in_array( $configuration_id, $available_payment_methods ) );
$available_payment_methods = WC_PostFinanceCheckout_Service_Transaction::instance()->get_possible_payment_methods_for_cart();
wp_send_json( in_array( $configuration_id, $available_payment_methods, true ) );
}

/**
Expand Down
4 changes: 1 addition & 3 deletions includes/class-wc-postfinancecheckout-migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ class WC_PostFinanceCheckout_Migration {
const POSTFINANCECHECKOUT_DEPRECATED_TABLE_PREFIX = 'wc_';
const POSTFINANCECHECKOUT_DEPRECATED_PLUGIN_PREFIX = 'woo-';

// const POSTFINANCECHECKOUT_CK_DB_VERSION = 'wc_postfinancecheckout_db_version';

/**
* Database migrations.
*
Expand Down Expand Up @@ -269,7 +267,7 @@ public static function check_version() {
public static function plugin_row_meta( $links, $file ) {
if ( WC_POSTFINANCECHECKOUT_PLUGIN_BASENAME === $file ) {
$row_meta = array(
'docs' => '<a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.1.3/docs/en/documentation.html" aria-label="' . esc_html__( 'View Documentation', 'woo-postfinancecheckout' ) . '">' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '</a>',
'docs' => '<a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.2.0/docs/en/documentation.html" aria-label="' . esc_html__( 'View Documentation', 'woo-postfinancecheckout' ) . '">' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '</a>',
);

return array_merge( $links, $row_meta );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,7 @@ protected function get_payment_method_image( \PostFinanceCheckout\Sdk\Model\Tran
*/
private function get_possible_payment_methods( $transaction_source ) {
$id = ( $transaction_source instanceof WC_Order ) ? $transaction_source->get_id() : WC_PostFinanceCheckout_Helper::instance()->get_current_cart_id();

$cacheKey = 'postfinancecheckout_payment_methods-' . $id;
self::$possible_payment_method_cache[ $id ] = WC()->session->get( $cacheKey );

if ( ! isset( self::$possible_payment_method_cache[ $id ] ) || is_null( self::$possible_payment_method_cache[ $id ] ) ) {
try {
$transaction = ( $transaction_source instanceof WC_Order )
Expand Down Expand Up @@ -468,7 +466,6 @@ private function get_possible_payment_methods( $transaction_source ) {
self::$possible_payment_method_cache[ $id ] = array();
throw $e;
}
WC()->session->set( $cacheKey, self::$possible_payment_method_cache[ $id ] );
}
return self::$possible_payment_method_cache[ $id ];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ protected function get_webhook_url( $space_id ) {
return null;
}
} catch ( \Exception $e ) {
WooCommerce_PostFinanceCheckout::instance()->log( $e->getMessage(), WC_Log_Levels::ERROR );
PostFinanceCheckout_WooCommerce::instance()->log( $e->getMessage(), WC_Log_Levels::ERROR );
}
}

Expand Down
13 changes: 9 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: postfinancecheckout AG
Tags: woocommerce PostFinance Checkout, woocommerce, PostFinance Checkout, payment, e-commerce, webshop, psp, invoice, packing slips, pdf, customer invoice, processing
Requires at least: 4.7
Tested up to: 6.6
Stable tag: 3.1.3
Stable tag: 3.2.0
License: Apache 2
License URI: http://www.apache.org/licenses/LICENSE-2.0

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

== Documentation ==

Additional documentation for this plugin is available [here](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.1.3/docs/en/documentation.html).
Additional documentation for this plugin is available [here](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.2.0/docs/en/documentation.html).

== Support ==

Expand Down Expand Up @@ -64,8 +64,13 @@ Enquiries about our terms of use can be made on the [PostFinance Checkout terms
== Changelog ==


= 3.1.3 - Sept 20 2024 =
- [Bugfix] Enchanced plugin performance on Checkout page.
= 3.2.0 - Sept 23 2024 =
- [Feature] Add privacy policy URL
- [Feature] Adhere to WP code standards
- [Feature] Add Support for WC 9.3.x
- [Bugfix] Fix for error when renewing subscriptions
- [Bugfix] Fix for deferred payments status being incorrect
- [Bugfix] Added migrations for 3.2.0 changes
- [Tested Against] PHP 8.2
- [Tested Against] Wordpress 6.6
- [Tested Against] Woocommerce 9.3.1
Expand Down
12 changes: 6 additions & 6 deletions woocommerce-postfinancecheckout.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
* Plugin Name: PostFinance Checkout
* Plugin URI: https://wordpress.org/plugins/woo-postfinance-checkout
* Description: Process WooCommerce payments with PostFinance Checkout.
* Version: 3.1.3
* Version: 3.2.0
* Author: postfinancecheckout AG
* Author URI: https://postfinance.ch/en/business/products/e-commerce/postfinance-checkout-all-in-one.html
* Text Domain: postfinancecheckout
* Domain Path: /languages/
* Requires at least: 6.0
* Requires PHP: 7.4
* WC requires at least: 8.0.0
* WC tested up to: 9.2.3
* WC tested up to 9.3.1
* License: Apache 2
* License URI: http://www.apache.org/licenses/LICENSE-2.0
*/
Expand All @@ -38,15 +38,15 @@ final class WooCommerce_PostFinanceCheckout {
const POSTFINANCECHECKOUT_CK_INTEGRATION = 'wc_postfinancecheckout_integration';
const POSTFINANCECHECKOUT_CK_ORDER_REFERENCE = 'wc_postfinancecheckout_order_reference';
const POSTFINANCECHECKOUT_CK_ENFORCE_CONSISTENCY = 'wc_postfinancecheckout_enforce_consistency';
const POSTFINANCECHECKOUT_UPGRADE_VERSION = '3.1.2';
const WC_MAXIMUM_VERSION = '9.2.3';
const POSTFINANCECHECKOUT_UPGRADE_VERSION = '3.1.1';
const WC_MAXIMUM_VERSION = '9.3.1';

/**
* WooCommerce PostFinanceCheckout version.
*
* @var string
*/
private $version = '3.1.3';
private $version = '3.2.0';

/**
* The single instance of the class.
Expand Down Expand Up @@ -425,7 +425,7 @@ public static function migrate_plugin_data_on_activation() {
$old_option_prefix . self::POSTFINANCECHECKOUT_CK_INTEGRATION,
$old_option_prefix . self::POSTFINANCECHECKOUT_CK_ORDER_REFERENCE,
$old_option_prefix . self::POSTFINANCECHECKOUT_CK_ENFORCE_CONSISTENCY,
$old_option_prefix . self::WC_MAXIMUM_VERSION,
$old_option_prefix . self::POSTFINANCECHECKOUT_WC_MAXIMUM_VERSION,
];

// If the old plugin options exist, perform the migration
Expand Down

0 comments on commit 2231128

Please sign in to comment.