Skip to content

Commit

Permalink
Merge pull request #621 from krokedil/develop
Browse files Browse the repository at this point in the history
2.13.3
  • Loading branch information
mntzrr authored Sep 23, 2024
2 parents 666a295 + 0066e0c commit d5b7010
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 26 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
/.wp
/node_modules
/yarn.lock
# wp-scopify dependencies
dependencies/*
!dependencies/.gitkeep
/vendor

SyncToy_f76a6219-f902-4b34-8524-b4fd7b7279a4.dat
lib/selenium-server-standalone.jar
lib/drivers/chromedriver.exe
Expand All @@ -17,4 +21,5 @@ nightwatch.conf.js
# OS X metadata
.DS_Store
.vscode/settings.json
.idea/
.idea/

16 changes: 7 additions & 9 deletions classes/admin/class-klarna-for-woocommerce-addons.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,18 +275,16 @@ public function change_klarna_addon_status() {
$new_action = 'install';
$new_status_label = 'Not installed';
$new_action_label = 'Install';
} else {
if ( 'installed' === $result['status'] ) {
} elseif ( 'installed' === $result['status'] ) {
$new_status = 'installed';
$new_action = 'activate';
$new_status_label = 'Installed';
$new_action_label = 'Activate';
} else {
$new_status = 'not-installed';
$new_action = 'install';
$new_status_label = 'Not installed';
$new_action_label = 'Install';
}
} else {
$new_status = 'not-installed';
$new_action = 'install';
$new_status_label = 'Not installed';
$new_action_label = 'Install';
}
}
}
Expand Down Expand Up @@ -327,7 +325,7 @@ public function install_plugin( $url ) {
}
$skin = new Klarna_Skin();
$installer = new Plugin_Upgrader( $skin );
$result = $installer->install( $url );
$result = $installer->install( $url ); // nosemgrep: URL already escape, and user is authorized.

wp_cache_flush();
if ( is_wp_error( $result ) ) {
Expand Down
2 changes: 1 addition & 1 deletion classes/class-kco-credentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function get_credentials_from_session() {

$credentials = array(
'merchant_id' => $this->settings[ $test_string . 'merchant_id_' . $country_string ],
'shared_secret' => htmlspecialchars_decode( $this->settings[ $test_string . 'shared_secret_' . $country_string ] ),
'shared_secret' => htmlspecialchars_decode( $this->settings[ $test_string . 'shared_secret_' . $country_string ], ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401 ),
);

return apply_filters( 'kco_wc_credentials_from_session', $credentials, $this->settings['testmode'] );
Expand Down
2 changes: 1 addition & 1 deletion classes/class-kco-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ public static function fields() {
$settings = array_merge( array_slice( $settings, 0, $offset + 1, true ), array( 'checkout_flow' => $checkout_flow ), array_slice( $settings, $offset, null, true ) );
} else {
$option = 'woocommerce_kco_settings';
$stored_settings = get_option( $option );
$stored_settings = get_option( $option, array() );
$stored_settings['checkout_flow'] = 'embedded';
update_option( $option, $stored_settings );
}
Expand Down
Empty file added dependencies/.gitkeep
Empty file.
3 changes: 2 additions & 1 deletion includes/kco-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function kco_wc_show_snippet( $pay_for_order = false ) {

if ( isset( $klarna_order['html_snippet'] ) ) {
do_action( 'kco_wc_show_snippet', $klarna_order );
// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- We trust the HTML snippet.
echo kco_extract_script( $klarna_order['html_snippet'] );
}
}
Expand Down Expand Up @@ -747,7 +748,7 @@ function kco_validate_order_content( $klarna_order, $order ) {
$match = true;
$name = $klarna_item['name'];

if ( $quantity !== $klarna_item['quantity'] ) {
if ( strval( $quantity ) !== strval( $klarna_item['quantity'] ) ) {
// translators: %1$s: Product name, %2$d: Expected quantity, %3$d: Found quantity.
$notes[] = sprintf( __( 'The product "%1$s" has a quantity mismatch. Expected %2$d found %3$d.', 'klarna-checkout-for-woocommerce' ), $name, $klarna_item['quantity'], $quantity );
KCO_Logger::log( "$prefix WC order item reference: $reference ($name) has {$quantity} expected {$klarna_item['quantity']}." );
Expand Down
4 changes: 2 additions & 2 deletions klarna-checkout-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Klarna Checkout payment gateway for WooCommerce.
* Author: Klarna
* Author URI: https://klarna.com/
* Version: 2.13.2
* Version: 2.13.3
* Text Domain: klarna-checkout-for-woocommerce
* Domain Path: /languages
*
Expand Down Expand Up @@ -35,7 +35,7 @@
/**
* Required minimums and constants
*/
define( 'KCO_WC_VERSION', '2.13.2' );
define( 'KCO_WC_VERSION', '2.13.3' );
define( 'KCO_WC_MIN_PHP_VER', '5.6.0' );
define( 'KCO_WC_MIN_WC_VER', '3.9.0' );
define( 'KCO_WC_MAIN_FILE', __FILE__ );
Expand Down
20 changes: 10 additions & 10 deletions languages/klarna-checkout-for-woocommerce.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Language-Team: Krokedil <info@krokedil.se>\n"
"Last-Translator: Krokedil <info@krokedil.se>\n"
"POT-Creation-Date: 2024-09-11 12:45+0000\n"
"POT-Creation-Date: 2024-09-23 09:42+0000\n"
"Report-Msgid-Bugs-To: http://krokedil.se\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-KeywordsList: __;_e;_ex:1,2c;_n:1,2;_n_noop:1,2;_nx:1,2,4c;_nx_noop:1,2,3c;_x:1,2c;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
Expand All @@ -26,15 +26,15 @@ msgid "Support"
msgstr ""

#. translators: Klarna order ID.
#: ../classes/class-kco-api-callbacks.php:108, ../includes/kco-functions.php:621
#: ../classes/class-kco-api-callbacks.php:108, ../includes/kco-functions.php:622
msgid "Klarna order is under review, order ID: %s."
msgstr ""

#: ../classes/class-kco-api-callbacks.php:105
msgid "Klarna Checkout order was rejected."
msgstr ""

#: ../classes/class-kco-api-callbacks.php:101, ../includes/kco-functions.php:613
#: ../classes/class-kco-api-callbacks.php:101, ../includes/kco-functions.php:614
msgid "Payment via Klarna Checkout, order ID: %s"
msgstr ""

Expand Down Expand Up @@ -512,32 +512,32 @@ msgstr ""
msgid "Klarna Checkout is not available. Please choose a different payment option or contact the store for assistance."
msgstr ""

#: ../includes/kco-functions.php:162
#: ../includes/kco-functions.php:163
msgid "Select another payment method"
msgstr ""

#: ../includes/kco-functions.php:632
#: ../includes/kco-functions.php:633
msgid "Waiting for verification from Klarnas push notification"
msgstr ""

#: ../includes/kco-functions.php:627
#: ../includes/kco-functions.php:628
msgid "Klarna Checkout order was rejected"
msgstr ""

#: ../includes/kco-functions.php:671
#: ../includes/kco-functions.php:672
msgid "Klarna order total (%1$s) does not match WooCommerce order total (%2$s). Please verify the order with Klarna before processing."
msgstr ""

#: ../includes/kco-functions.php:701
#: ../includes/kco-functions.php:702
msgid "A mismatch between the WooCommerce and Klarna orders was identified. Please verify the order in the Klarna merchant portal before processing."
msgstr ""

#. translators: %1$s: Product name, %2$d: Expected quantity, %3$d: Found quantity.
#: ../includes/kco-functions.php:752
#: ../includes/kco-functions.php:753
msgid "The product \"%1$s\" has a quantity mismatch. Expected %2$d found %3$d."
msgstr ""

#: ../includes/kco-functions.php:761
#: ../includes/kco-functions.php:762
msgid "The product \"%s\" was not found in the Klarna order."
msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "klarna-checkout-for-woocommerce",
"version": "2.12.5",
"version": "2.13.3",
"description": "Klarna Checkout for WooCommerce",
"main": "gulpfile.js",
"repository": "https://github.com/krokedil/klarna-checkout-for-woocommerce.git",
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ Klarna Checkout works for merchants in Sweden, Finland, Norway, Germany, Austria
For help setting up and configuring Klarna Checkout for WooCommerce please refer to our [documentation](https://docs.krokedil.com/klarna-checkout-for-woocommerce/).

== Changelog ==
= 2024.09.23 - version 2.13.3 =
* Tweak - Adjusted the order comparison verification between Klarna and WooCommerce.
* Fix - Addressed Woo Quality Insights issues and recommendations.

= 2024.09.11 - version 2.13.2 =
* Fix - Fixed an undefined array key warning.

Expand Down

0 comments on commit d5b7010

Please sign in to comment.