Skip to content

Commit

Permalink
Release 3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrowanwallee committed Oct 14, 2024
1 parent 6cc4bc4 commit c88a486
Show file tree
Hide file tree
Showing 21 changed files with 2,082 additions and 37 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.3.0/docs/en/documentation.html)
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.1/docs/en/documentation.html)

## Support

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

## License

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

## Privacy Policy

Expand Down
1 change: 1 addition & 0 deletions assets/js/frontend/blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ If you need to modify the source code of this project, you need to build the pro
If you have not done it before, you need to first install the dependencies needed by the project by running:

`npm install`
You may need to run with sudo if errors happens: `sudo npm install`

Please notice that you need at least npm version 10 or up.

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

4 changes: 2 additions & 2 deletions assets/js/frontend/blocks/package-lock.json

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

2 changes: 1 addition & 1 deletion assets/js/frontend/blocks/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "woocommerce",
"version": "1.0.0",
"version": "1.1.0",
"description": "This JS app adds support for WooCommerce Blocks, implementing the checkout block so it can display payment methods.",
"main": "index.js",
"scripts": {
Expand Down
9 changes: 9 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -850,3 +850,12 @@ Tested against:

Please ensure that in woocommerce->settings->tax, the "Round tax at subtotal level, instead of rounding per line" is disabled

= 3.3.1 - October 14 2024 =
- [Feature] Added CH, FR and IT translations
- [Improvement] Improve payment method loading speed at checkout
- [Bugfix] Fix for incompatibility with Translatepress
- [Tested Against] PHP 8.2
- [Tested Against] Wordpress 6.6
- [Tested Against] Woocommerce 9.3.2
- [Tested Against] PHP SDK 4.6.0

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.3.0/">
<a href="https://github.com/pfpayments/woocommerce/releases/tag/3.3.1/">
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.3.0/docs/en/documentation.html' => esc_html__( 'Documentation', 'woo-postfinancecheckout' ),
'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.3.1/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
22 changes: 16 additions & 6 deletions includes/class-wc-postfinancecheckout-blocks-support.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,10 @@ public function get_payment_method_data() {
* This function is used for building the data that is expected by WooCommerce Blocks.
* The information is returned directly via a JSON response
*
* @return void
* @return array
*/
public static function get_payment_methods() {
public static function get_payment_methods(): array {

if ( ! isset( $_POST['postfinancecheckout_nonce'] ) || ! wp_verify_nonce( $_POST['postfinancecheckout_nonce'], 'postfinancecheckout_nonce_block' ) ) { //phpcs:ignore
wp_send_json_error( 'Invalid request', 403 );
}
$payment_gateways = WC()->payment_gateways()->payment_gateways();

// From all the payment gateways, only use the ones provided by this module.
Expand All @@ -126,7 +123,20 @@ function ( WC_PostFinanceCheckout_Gateway $payment_gateway ) {
);

// Send the list back to the requester in a JSON.
wp_send_json( array_values( $payments_list ) );
return array_values( $payments_list );
}

/**
* Send the list back to the requester in a JSON.
*
* @return void
*/
public static function get_payment_methods_json() {
if ( ! isset( $_POST['postfinancecheckout_nonce'] ) || ! wp_verify_nonce( $_POST['postfinancecheckout_nonce'], 'postfinancecheckout_nonce_block' ) ) { //phpcs:ignore
wp_send_json_error( 'Invalid request: missing nonce value', 403 );
}
$payment_methods = WC_PostFinanceCheckout_Blocks_Support::get_payment_methods();
wp_send_json( $payment_methods );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion includes/class-wc-postfinancecheckout-migration.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,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.3.0/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.3.1/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 @@ -73,7 +73,12 @@ private function translate_item_language( $items ) {
$strings[] = $item->get_name();
}

$query = TRP_Translate_Press::get_trp_instance()->get_component( 'query' );
$trp = TRP_Translate_Press::get_trp_instance();

if ( is_null( $trp ) ) {
return array();
}

$query = $trp->get_component( 'query' );
// we get the translations from the dictionary.
$dictionary = $query->get_string_rows( '', $strings, $postfinancecheckout_trp_language ); //phpcs:ignore
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 ) {
PostFinanceCheckout_WooCommerce::instance()->log( $e->getMessage(), WC_Log_Levels::ERROR );
WooCommerce_PostFinanceCheckout::instance()->log( $e->getMessage(), WC_Log_Levels::ERROR );
}
}

Expand Down
Binary file added languages/woo-postfinancecheckout-de_CH.mo
Binary file not shown.
Loading

0 comments on commit c88a486

Please sign in to comment.