Plugin Directory

Changeset 3756971


Ignore:
Timestamp:
10/20/2026 03:07:23 PM (6 hours ago)
Author:
flizpay
Message:

Update to version 2.7.1 from GitHub

Location:
flizpay-for-woocommerce
Files:
4 deleted
40 edited
1 copied

Legend:

Unmodified
Added
Removed
  • flizpay-for-woocommerce/tags/2.7.1/CHANGELOG.txt

    r3748891 r3756971  
    11== FLIZpay for WooCommerce Changelog ==
     2
     32026-10-20 - version 2.7.1
     4* Fixed   - Mini-cart discount messages now appear below the subtotal and align with the cart buttons instead of colliding with totals in some themes.
     5* Changed - Removed obsolete local cashback handling now that hosted FLIZpay components provide the current discount information.
    26
    372026-10-15 - version 2.7.0
  • flizpay-for-woocommerce/tags/2.7.1/README.txt

    r3748891 r3756971  
    44Requires at least: 6.4
    55Tested up to: 7.0
    6 Stable tag: 2.7.0
     6Stable tag: 2.7.1
    77Requires PHP: 8.2
    88License: GPLv2 or later
    … …  
    344344  - Added   - Declared compatibility with WooCommerce High-Performance Order Storage (HPOS).
    345345
     346- v2.7.1
     347  - Fixed   - Mini-cart discount messages now appear below the subtotal and align with the cart buttons instead of colliding with totals in some themes.
     348  - Changed - Removed obsolete local cashback handling now that hosted FLIZpay components provide the current discount information.
     349
    346350== Upgrade Notice ==
     351
     352= v2.7.1 =
     353Fixes mini-cart widget placement and alignment and removes obsolete local cashback handling. No settings changes are required.
    347354
    348355= v2.7.0 =
  • flizpay-for-woocommerce/tags/2.7.1/admin/class-flizpay-admin.php

    r3748891 r3756971  
    9898                }
    9999
    100                 wp_enqueue_script('select2');
    101                 wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/flizpay-admin.js', array('jquery', 'select2'), $this->version, false);
     100                wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/flizpay-admin.js', array('jquery'), $this->version, false);
    102101
    103102                $gateways = function_exists('WC') && WC()->payment_gateways() ? WC()->payment_gateways()->payment_gateways() : array();
    … …  
    113112
    114113                wp_localize_script($this->plugin_name, 'flizpayParams', array(
    115                         'nonce' => wp_create_nonce('test_connection_nonce'),
    116114                        'loading_icon' => "$this->assets_url/loading.svg",
    117115                        'checkout_preview' => $checkout_preview,
  • flizpay-for-woocommerce/tags/2.7.1/admin/class-flizpay-connect.php

    r3748891 r3756971  
    126126        $settings['flizpay_webhook_url'] = $connection['webhook_url'];
    127127        $settings['flizpay_webhook_key'] = $connection['webhook_key'];
    128         $settings['flizpay_cashback'] = $connection['cashback'];
    129128        update_option(self::SETTINGS_OPTION, $settings);
    130129
  • flizpay-for-woocommerce/tags/2.7.1/admin/css/flizpay-admin.css

    r3748891 r3756971  
    44 */
    55
    6 #test_connection_button {
    7   background-color: #001f3f;
    8   border: none;
    9   color: white;
    10   padding: 14px 28px;
    11   text-align: center;
    12   text-decoration: none;
    13   display: inline-block;
    14   font-size: 16px;
    15   cursor: pointer;
    16   border-radius: 5px;
    17 }
    18 
    19 #test_connection_button .hidden {
    20   display: none;
    21 }
    22 
    23 #test_connection_button:hover {
    24   padding: 13px 27px;
    25   border: 1px solid #80ed99;
    26 }
    27 
    28 #test_connection_button:active {
    29   background-color: #80ed99;
    30   color: #001f3f;
    31   padding: 12px 26px;
    32   border: 2px solid #001f3f;
    33 }
    346#woocommerce_flizpay_connection_result {
    357  text-align: center;
  • flizpay-for-woocommerce/tags/2.7.1/admin/js/flizpay-admin.js

    r3748891 r3756971  
    99   */
    1010  jQuery(document).ready(function ($) {
    11     new Promise((resolve) => setTimeout(resolve, 1000)).then(() => {
    12       console.log("FlizPay Admin JS loaded");
    13     });
    14 
    1511    const connectionAttempts =
    1612      Number.parseInt(
    … …  
    3430      ? "Admin Display Options"
    3531      : "Anzeigeoptionen für Admins";
    36     const testButton = document.createElement("div");
    3732    const resultField = document.createElement("div");
    3833    const apiKeyInput = document.querySelector(
    … …  
    162157            .setAttribute("style", "display: none;");
    163158
    164       testButton.setAttribute("id", "woocommerce_flizpay_test_connection");
    165159      resultField.setAttribute("id", "woocommerce_flizpay_connection_result");
    166160      // Only append if apiKeyInput exists
    167161      if (apiKeyInput && apiKeyInput.parentNode) {
    168         apiKeyInput.parentNode.appendChild(testButton);
    169162        apiKeyInput.parentNode.appendChild(resultField);
    170163      }
  • flizpay-for-woocommerce/tags/2.7.1/flizpay.php

    r3748891 r3756971  
    1717 * Plugin URI:        https://www.flizpay.de/companies
    1818 * Description:       FLIZpay: 100% free!
    19  * Version:           2.7.0
     19 * Version:           2.7.1
    2020 * Author:            FLIZpay
    2121 * Author URI:        https://www.flizpay.de/companies
    … …  
    4040 * Start at version 1.0.0 and use SemVer - https://semver.org
    4141 */
    42 define('FLIZPAY_VERSION', '2.7.0');
     42define('FLIZPAY_VERSION', '2.7.1');
    4343
    4444/**
  • flizpay-for-woocommerce/tags/2.7.1/includes/class-flizpay-api-service.php

    r3748891 r3756971  
    1818
    1919    /**
    20      * @return array{cashback: array|null, webhook_key: string, webhook_url: string}|WP_Error
     20     * @return array{webhook_key: string, webhook_url: string}|WP_Error
    2121     */
    2222    public function establish_connection(): array|WP_Error
    … …  
    2525            $webhook_url = $this->generate_webhook_url();
    2626            $webhook_key = $this->get_webhook_key();
    27             $cashback_data = $this->fetch_cashback_data();
    2827        } catch (\Exception $e) {
    2928            Flizpay_Sentry::with_scope(static function ($scope) use ($e): void {
    … …  
    4746
    4847        return array(
    49             'cashback' => $cashback_data,
    5048            'webhook_key' => $webhook_key,
    5149            'webhook_url' => $webhook_url,
    … …  
    150148            ? (string) $response["publicId"]
    151149            : null;
    152     }
    153 
    154     /**
    155      * Fetch normalized cashback percentages configured for the merchant.
    156      *
    157      * @return array{first_purchase_amount: float, standard_amount: float}
    158      */
    159     public function fetch_cashback_data(): ?array
    160     {
    161         $client = WC_Flizpay_API::get_instance($this->api_key);
    162         $response = $client->dispatch("fetch_cashback_data");
    163 
    164         if (
    165             is_array($response) &&
    166             isset($response["cashbacks"]) &&
    167             is_array($response["cashbacks"]) &&
    168             count($response["cashbacks"]) > 0
    169         ) {
    170             foreach ($response["cashbacks"] as $cashback) {
    171                 $firstPurchaseAmount = floatval(
    172                     $cashback["firstPurchaseAmount"],
    173                 );
    174                 $amount = floatval($cashback["amount"]);
    175 
    176                 if (
    177                     $cashback["active"] &&
    178                     ($firstPurchaseAmount > 0 || $amount > 0)
    179                 ) {
    180                     return [
    181                         "first_purchase_amount" => $firstPurchaseAmount,
    182                         "standard_amount" => $amount,
    183                     ];
    184                 }
    185             }
    186         }
    187 
    188         return null;
    189150    }
    190151
  • flizpay-for-woocommerce/tags/2.7.1/includes/class-flizpay-api.php

    r3748891 r3756971  
    138138                    )
    139139                );
    140             },
    141             'fetch_cashback_data' => function ($body) {
    142                 return array(
    143                     'path' => $this->base_url . '/business/cashback',
    144                     'method' => 'get',
    145                     'options' => array(
    146                         'headers' => array(
    147                             'Content-type' => 'application/json',
    148                             'x-api-key' => $this->api_key
    149                         )
    150                     )
    151                 );
    152140            }
    153141        );
  • flizpay-for-woocommerce/tags/2.7.1/includes/class-flizpay-gateway.php

    r3748891 r3756971  
    55
    66if (!defined('FLIZPAY_VERSION')) {
    7     define('FLIZPAY_VERSION', '2.7.0');
     7    define('FLIZPAY_VERSION', '2.7.1');
    88}
    99
    … …  
    1919        public static string $VERSION = FLIZPAY_VERSION;
    2020
    21         public array|null $cashback;
    2221        public Flizpay_i18n $i18n;
    2322        public string $api_key;
    24         public string $webhook_key;
    25         public string $webhook_url;
    26         public string $flizpay_webhook_alive;
    2723        public string $flizpay_display_logo;
    28         public string $flizpay_display_description;
    29         public string $flizpay_display_headline;
    3024        public string $flizpay_order_status;
    31         public string $flizpay_sentry_enabled;
    32         public string $flizpay_restrict_to_germany;
    33         public Flizpay_Cashback_Helper $cashback_helper;
    3425        public Flizpay_Webhook_Helper $webhook_helper;
    3526        public Flizpay_API_Service $api_service;
    … …  
    3829        /**
    3930         * The class constructor will set FLIZ id, load translations, description, icon and etc.
    40          * It's also responsible for instantiating all FLIZ variables like API KEY and WEBHOOK KEY
    41          * Additionally it will obtain the Cashback information of the merchant from the transients
    42          * or from the API and also apply the translations.
     31         * It's also responsible for loading the API key and initializing payment helpers.
    4332         * The constructor will also register the template redirects for webhooks .
    4433         *
    … …  
    4736        public function __construct()
    4837        {
    49             require_once plugin_dir_path(__DIR__) . 'includes/class-flizpay-cashback-helper.php';
    5038            require_once plugin_dir_path(__DIR__) . 'includes/class-flizpay-webhook-helper.php';
    5139            require_once plugin_dir_path(__DIR__) . 'includes/class-flizpay-api-service.php';
    … …  
    6856            $this->enabled = $this->get_option('enabled', 'yes');
    6957            $this->api_key = $this->get_option('flizpay_api_key');
    70             $this->webhook_key = $this->get_option('flizpay_webhook_key');
    71             $this->webhook_url = $this->get_option('flizpay_webhook_url');
    72             $this->flizpay_webhook_alive = $this->get_option('flizpay_webhook_alive');
    7358            $this->flizpay_display_logo = $this->get_option('flizpay_display_logo');
    74             $this->flizpay_display_description = $this->get_option('flizpay_display_description');
    75             $this->flizpay_display_headline = $this->get_option('flizpay_display_headline');
    7659            $this->flizpay_order_status = $this->get_option('flizpay_order_status');
    77             $this->flizpay_sentry_enabled = $this->get_option('flizpay_sentry_enabled');
    78             $this->flizpay_restrict_to_germany = $this->get_option('flizpay_restrict_to_germany');
    7960            // Initialize helper classes
    80             $this->cashback_helper = new Flizpay_Cashback_Helper($this);
    8161            $this->settlement = new Flizpay_Settlement();
    8262            $this->webhook_helper = new Flizpay_Webhook_Helper($this, $this->settlement);
    … …  
    8666                $this->icon = plugins_url() . '/' . basename(dirname(__DIR__)) . '/assets/images/fliz-checkout-logo.svg';
    8767            }
    88 
    89             $this->cashback = $this->get_cashback_data();
    9068
    9169            $this->init_gateway_info();
    … …  
    232210                    $this->update_option('flizpay_webhook_url', $connection['webhook_url']);
    233211                    $this->update_option('flizpay_api_key', $api_key);
    234                     $this->update_option('flizpay_cashback', $connection['cashback']);
    235                     $this->cashback = $connection['cashback'];
    236212                }
    237213            }
    … …  
    241217            $this->init_gateway_info();
    242218            return $saved;
    243         }
    244 
    245         /**
    246          * Obtain the current cashback value of the merchant from the transient
    247          *
    248          * @return array{
    249          *     first_purchase_amount: float,
    250          *     standard_amount: float
    251          * }|null
    252          *
    253          * @since 1.0.0
    254          */
    255         public function get_cashback_data(): ?array
    256         {
    257             $cashback_data = $this->get_option('flizpay_cashback');
    258 
    259             if (
    260                 !is_array($cashback_data) ||
    261                 !isset(
    262                     $cashback_data['first_purchase_amount'],
    263                     $cashback_data['standard_amount']
    264                 )
    265             ) {
    266                 return null;
    267             }
    268 
    269             $first_purchase_amount = (float) $cashback_data['first_purchase_amount'];
    270             $standard_amount = (float) $cashback_data['standard_amount'];
    271 
    272             if ($first_purchase_amount <= 0 && $standard_amount <= 0) {
    273                 return null;
    274             }
    275 
    276             return [
    277                 'first_purchase_amount' => $first_purchase_amount,
    278                 'standard_amount' => $standard_amount,
    279             ];
    280219        }
    281220
  • flizpay-for-woocommerce/tags/2.7.1/includes/class-flizpay-webhook-helper.php

    r3671690 r3756971  
    7474                }
    7575
    76                 $this->update_cashback_info($data);
    77                 wp_send_json_success('Cashback information updated', 200);
     76                // Legacy notification: hosted components now own discount data.
     77                // Acknowledge it without persisting it or routing it to settlement.
     78                wp_send_json_success('Cashback information acknowledged', 200);
    7879            } else {
    7980                $this->finish_order($data);
    … …  
    127128
    128129    /**
    129      * @param array<string, mixed> $data
    130      */
    131     private function update_cashback_info(array $data): void
    132     {
    133         $first_purchase_amount = floatval($data['firstPurchaseAmount']);
    134         $standard_amount = floatval($data['amount']);
    135         $cashback = array(
    136             'first_purchase_amount' => $first_purchase_amount,
    137             'standard_amount' => $standard_amount
    138         );
    139         $this->gateway->cashback = $cashback;
    140         $this->gateway->update_option('flizpay_cashback', $cashback);
    141         $this->gateway->init_gateway_info();
    142     }
    143 
    144     /**
    145130     * @return array<string, mixed>|null
    146131     */
  • flizpay-for-woocommerce/tags/2.7.1/includes/class-flizpay.php

    r3748891 r3756971  
    255255        $this->loader->add_action('woocommerce_single_product_summary', $plugin_public, 'render_product_widget', 31);
    256256        $this->loader->add_action('woocommerce_proceed_to_checkout', $plugin_public, 'render_cart_widget', 15);
    257         $this->loader->add_action('woocommerce_widget_shopping_cart_total', $plugin_public, 'render_mini_cart_widget', 20);
     257        $this->loader->add_action('woocommerce_widget_shopping_cart_before_buttons', $plugin_public, 'render_mini_cart_widget', 20);
    258258        $this->loader->add_action('woocommerce_review_order_before_payment', $plugin_public, 'render_checkout_widget');
    259259        $this->loader->add_action('woocommerce_thankyou', $plugin_public, 'render_order_received_widget', 5);
  • flizpay-for-woocommerce/tags/2.7.1/languages/flizpay-for-woocommerce-de_DE.po

    r3748891 r3756971  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: FlizPay 2.7.0\n"
     3"Project-Id-Version: FlizPay 2.7.1\n"
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2024-07-30 10:00+0000\n"
    … …  
    1919msgid "Docs"
    2020msgstr "Dokumentation"
    21 
    22 #: includes/class-flizpay-gateway.php:100
    23 msgid "cashback-title"
    24 msgstr "FLIZpay - Bis zu %s%% Rabatt"
    25 
    26 #: includes/class-flizpay-gateway.php:106
    27 msgid "cashback-description-both"
    28 msgstr "Sichere Zahlungen in direkter Zusammenarbeit mit deiner Bank. Ab der zweiten Zahlung bei %s gibt es dauerhaft %s%% Rabatt."
    29 
    30 #: includes/class-flizpay-gateway.php:108
    31 msgid "cashback-description-standard"
    32 msgstr "Sichere Zahlungen in direkter Zusammenarbeit mit deiner Bank.\n %s%% Rabatt für jede FLIZ-Zahlung bei %s."
    33 
    34 #: includes/class-flizpay-gateway.php:113
    35 msgid "cashback-description-first"
    36 msgstr "Sichere Zahlungen in direkter Zusammenarbeit mit deiner Bank. Nach deiner ersten FLIZ-Zahlung bei %s gibt es keinen weiteren Rabatt."
    37 
    38 #: includes/class-flizpay-gateway.php:47
    39 msgid "title"
    40 msgstr "FLIZpay - Die Zahlungsrevolution"
    41 
    42 #: includes/class-flizpay-gateway.php:49
    43 msgid "description"
    44 msgstr "Sichere Zahlungen in direkter Zusammenarbeit mit deiner Bank, deine Daten bleiben privat und in Deutschland, und du unterstützt mit FLIZpay kleine Unternehmen."
    45 
    46 #: includes/class-flizpay-gateway.php:144
    47 msgid "cashback-express-title"
    48 msgstr "Bis zu %s%% Rabatt"
    49 
    50 #: includes/class-flizpay-gateway.php:170
    51 msgid "express-title"
    52 msgstr "Die Zahlungsrevolution"
    5321
    5422#: flizpay.php:18
  • flizpay-for-woocommerce/tags/2.7.1/languages/flizpay-for-woocommerce-en_GB.po

    r3748891 r3756971  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: FlizPay 2.7.0\n"
     3"Project-Id-Version: FlizPay 2.7.1\n"
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2024-07-30 10:00+0000\n"
    … …  
    1919msgid "Docs"
    2020msgstr "Docs"
    21 
    22 #: includes/class-flizpay-gateway.php:100
    23 msgid "cashback-title"
    24 msgstr "FLIZpay - Up to %s%% Discount"
    25 
    26 #: includes/class-flizpay-gateway.php:106
    27 msgid "cashback-description-both"
    28 msgstr "Secure payments in direct collaboration with your bank. After your first FLIZ payment at %s, you will continue to receive %s%% Discount."
    29 
    30 #: includes/class-flizpay-gateway.php:108
    31 msgid "cashback-description-standard"
    32 msgstr "Secure payments in direct collaboration with your bank.\n %s%% Discount for every FLIZ-payment at %s."
    33 
    34 #: includes/class-flizpay-gateway.php:113
    35 msgid "cashback-description-first"
    36 msgstr "Secure payments in direct collaboration with your bank. No additional discount after your first FLIZ-payment at %s."
    37 
    38 #: includes/class-flizpay-gateway.php:47
    39 msgid "title"
    40 msgstr "FLIZpay - The Payment Revolution"
    41 
    42 #: includes/class-flizpay-gateway.php:49
    43 msgid "description"
    44 msgstr "Secure payments in direct collaboration with your bank. We support small businesses and keep your data private – stored securely in Germany."
    45 
    46 #: includes/class-flizpay-gateway.php:144
    47 msgid "cashback-express-title"
    48 msgstr "Up to %s%% Discount"
    49 
    50 #: includes/class-flizpay-gateway.php:170
    51 msgid "express-title"
    52 msgstr "The payment revolution"
    5321
    5422#: flizpay.php:18
  • flizpay-for-woocommerce/tags/2.7.1/languages/flizpay-for-woocommerce-en_US.po

    r3748891 r3756971  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: FlizPay 2.7.0\n"
     3"Project-Id-Version: FlizPay 2.7.1\n"
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2024-07-30 10:00+0000\n"
    … …  
    1919msgid "Docs"
    2020msgstr "Docs"
    21 
    22 #: includes/class-flizpay-gateway.php:100
    23 msgid "cashback-title"
    24 msgstr "FLIZpay - Up to %s%% Discount"
    25 
    26 #: includes/class-flizpay-gateway.php:106
    27 msgid "cashback-description-both"
    28 msgstr "Secure payments in direct collaboration with your bank. After your first FLIZ payment at %s, you will continue to receive %s%% Discount."
    29 
    30 #: includes/class-flizpay-gateway.php:108
    31 msgid "cashback-description-standard"
    32 msgstr "Secure payments in direct collaboration with your bank.\n %s%% Discount for every FLIZ-payment at %s."
    33 
    34 #: includes/class-flizpay-gateway.php:113
    35 msgid "cashback-description-first"
    36 msgstr "Secure payments in direct collaboration with your bank. No additional discount after your first FLIZ-payment at %s."
    37 
    38 #: includes/class-flizpay-gateway.php:47
    39 msgid "title"
    40 msgstr "FLIZpay - The Payment Revolution"
    41 
    42 #: includes/class-flizpay-gateway.php:49
    43 msgid "description"
    44 msgstr "Secure payments in direct collaboration with your bank. We support small businesses and keep your data private – stored securely in Germany."
    45 
    46 #: includes/class-flizpay-gateway.php:144
    47 msgid "cashback-express-title"
    48 msgstr "Up to %s%% Discount"
    49 
    50 #: includes/class-flizpay-gateway.php:170
    51 msgid "express-title"
    52 msgstr "The payment revolution"
    5321
    5422#: flizpay.php:18
  • flizpay-for-woocommerce/tags/2.7.1/public/class-flizpay-public.php

    r3748891 r3756971  
    250250    public function render_mini_cart_widget()
    251251    {
    252         echo $this->widget_html('mini-cart', $this->cart_attributes()); // phpcs:ignore WordPress.Security.EscapeOutput -- escaped in widget_html()
     252        $widget = $this->widget_html('mini-cart', $this->cart_attributes());
     253        if ($widget !== '') {
     254            echo '<p class="buttons flizpay-mini-cart-widget">' . $widget . '</p>'; // phpcs:ignore WordPress.Security.EscapeOutput -- escaped in widget_html()
     255        }
    253256    }
    254257
    … …  
    438441        $variables = array(
    439442            'ajaxurl' => admin_url('admin-ajax.php'),
    440             'public_dir_path' => plugin_dir_url(__FILE__),
    441443            'order_finish_nonce' => wp_create_nonce('order_finish_nonce'),
    442444            'fliz_logo' => $this->assets_url . '/fliz-logo.svg',
    443445            'fliz_loading_wheel' => $this->assets_url . '/fliz-loading-wheel.svg',
    444             'cashback' => get_transient('flizpay_cashback_transient'),
    445             'flizpay_version' => $this->version,
    446446        );
    447447        wp_localize_script($this->plugin_name, "flizpay_frontend", $variables);
  • flizpay-for-woocommerce/tags/2.7.1/public/css/flizpay-public.css

    r3748891 r3756971  
    3333  margin-bottom: 8px;
    3434}
    35 
    36 .fliz-black-text {
    37   color: #001F3F;
    38   font-weight: 600;
    39 }
    40 
    41 .fliz-highlight-text {
    42   text-shadow: 0px 0px 4px #80ED99;
    43 }
    44 
    45 .flizpay-loader {
    46   width: 38px;
    47   height: 38px;
    48   border-radius: 50%;
    49   display: inline-block;
    50   border-top: 3px solid #001F3F;
    51   border-right: 3px solid transparent;
    52   box-sizing: border-box;
    53   animation: rotation 1s linear infinite;
    54 }
    55 
    56 @keyframes rotation {
    57   0% {
    58     transform: rotate(0deg);
    59   }
    60   100% {
    61     transform: rotate(360deg);
    62   }
    63 }
  • flizpay-for-woocommerce/trunk/CHANGELOG.txt

    r3748891 r3756971  
    11== FLIZpay for WooCommerce Changelog ==
     2
     32026-10-20 - version 2.7.1
     4* Fixed   - Mini-cart discount messages now appear below the subtotal and align with the cart buttons instead of colliding with totals in some themes.
     5* Changed - Removed obsolete local cashback handling now that hosted FLIZpay components provide the current discount information.
    26
    372026-10-15 - version 2.7.0
  • flizpay-for-woocommerce/trunk/README.txt

    r3748891 r3756971  
    44Requires at least: 6.4
    55Tested up to: 7.0
    6 Stable tag: 2.7.0
     6Stable tag: 2.7.1
    77Requires PHP: 8.2
    88License: GPLv2 or later
    … …  
    344344  - Added   - Declared compatibility with WooCommerce High-Performance Order Storage (HPOS).
    345345
     346- v2.7.1
     347  - Fixed   - Mini-cart discount messages now appear below the subtotal and align with the cart buttons instead of colliding with totals in some themes.
     348  - Changed - Removed obsolete local cashback handling now that hosted FLIZpay components provide the current discount information.
     349
    346350== Upgrade Notice ==
     351
     352= v2.7.1 =
     353Fixes mini-cart widget placement and alignment and removes obsolete local cashback handling. No settings changes are required.
    347354
    348355= v2.7.0 =
  • flizpay-for-woocommerce/trunk/admin/class-flizpay-admin.php

    r3748891 r3756971  
    9898                }
    9999
    100                 wp_enqueue_script('select2');
    101                 wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/flizpay-admin.js', array('jquery', 'select2'), $this->version, false);
     100                wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/flizpay-admin.js', array('jquery'), $this->version, false);
    102101
    103102                $gateways = function_exists('WC') && WC()->payment_gateways() ? WC()->payment_gateways()->payment_gateways() : array();
    … …  
    113112
    114113                wp_localize_script($this->plugin_name, 'flizpayParams', array(
    115                         'nonce' => wp_create_nonce('test_connection_nonce'),
    116114                        'loading_icon' => "$this->assets_url/loading.svg",
    117115                        'checkout_preview' => $checkout_preview,
  • flizpay-for-woocommerce/trunk/admin/class-flizpay-connect.php

    r3748891 r3756971  
    126126        $settings['flizpay_webhook_url'] = $connection['webhook_url'];
    127127        $settings['flizpay_webhook_key'] = $connection['webhook_key'];
    128         $settings['flizpay_cashback'] = $connection['cashback'];
    129128        update_option(self::SETTINGS_OPTION, $settings);
    130129
  • flizpay-for-woocommerce/trunk/admin/css/flizpay-admin.css

    r3748891 r3756971  
    44 */
    55
    6 #test_connection_button {
    7   background-color: #001f3f;
    8   border: none;
    9   color: white;
    10   padding: 14px 28px;
    11   text-align: center;
    12   text-decoration: none;
    13   display: inline-block;
    14   font-size: 16px;
    15   cursor: pointer;
    16   border-radius: 5px;
    17 }
    18 
    19 #test_connection_button .hidden {
    20   display: none;
    21 }
    22 
    23 #test_connection_button:hover {
    24   padding: 13px 27px;
    25   border: 1px solid #80ed99;
    26 }
    27 
    28 #test_connection_button:active {
    29   background-color: #80ed99;
    30   color: #001f3f;
    31   padding: 12px 26px;
    32   border: 2px solid #001f3f;
    33 }
    346#woocommerce_flizpay_connection_result {
    357  text-align: center;
  • flizpay-for-woocommerce/trunk/admin/js/flizpay-admin.js

    r3748891 r3756971  
    99   */
    1010  jQuery(document).ready(function ($) {
    11     new Promise((resolve) => setTimeout(resolve, 1000)).then(() => {
    12       console.log("FlizPay Admin JS loaded");
    13     });
    14 
    1511    const connectionAttempts =
    1612      Number.parseInt(
    … …  
    3430      ? "Admin Display Options"
    3531      : "Anzeigeoptionen für Admins";
    36     const testButton = document.createElement("div");
    3732    const resultField = document.createElement("div");
    3833    const apiKeyInput = document.querySelector(
    … …  
    162157            .setAttribute("style", "display: none;");
    163158
    164       testButton.setAttribute("id", "woocommerce_flizpay_test_connection");
    165159      resultField.setAttribute("id", "woocommerce_flizpay_connection_result");
    166160      // Only append if apiKeyInput exists
    167161      if (apiKeyInput && apiKeyInput.parentNode) {
    168         apiKeyInput.parentNode.appendChild(testButton);
    169162        apiKeyInput.parentNode.appendChild(resultField);
    170163      }
  • flizpay-for-woocommerce/trunk/flizpay.php

    r3748891 r3756971  
    1717 * Plugin URI:        https://www.flizpay.de/companies
    1818 * Description:       FLIZpay: 100% free!
    19  * Version:           2.7.0
     19 * Version:           2.7.1
    2020 * Author:            FLIZpay
    2121 * Author URI:        https://www.flizpay.de/companies
    … …  
    4040 * Start at version 1.0.0 and use SemVer - https://semver.org
    4141 */
    42 define('FLIZPAY_VERSION', '2.7.0');
     42define('FLIZPAY_VERSION', '2.7.1');
    4343
    4444/**
  • flizpay-for-woocommerce/trunk/includes/class-flizpay-api-service.php

    r3748891 r3756971  
    1818
    1919    /**
    20      * @return array{cashback: array|null, webhook_key: string, webhook_url: string}|WP_Error
     20     * @return array{webhook_key: string, webhook_url: string}|WP_Error
    2121     */
    2222    public function establish_connection(): array|WP_Error
    … …  
    2525            $webhook_url = $this->generate_webhook_url();
    2626            $webhook_key = $this->get_webhook_key();
    27             $cashback_data = $this->fetch_cashback_data();
    2827        } catch (\Exception $e) {
    2928            Flizpay_Sentry::with_scope(static function ($scope) use ($e): void {
    … …  
    4746
    4847        return array(
    49             'cashback' => $cashback_data,
    5048            'webhook_key' => $webhook_key,
    5149            'webhook_url' => $webhook_url,
    … …  
    150148            ? (string) $response["publicId"]
    151149            : null;
    152     }
    153 
    154     /**
    155      * Fetch normalized cashback percentages configured for the merchant.
    156      *
    157      * @return array{first_purchase_amount: float, standard_amount: float}
    158      */
    159     public function fetch_cashback_data(): ?array
    160     {
    161         $client = WC_Flizpay_API::get_instance($this->api_key);
    162         $response = $client->dispatch("fetch_cashback_data");
    163 
    164         if (
    165             is_array($response) &&
    166             isset($response["cashbacks"]) &&
    167             is_array($response["cashbacks"]) &&
    168             count($response["cashbacks"]) > 0
    169         ) {
    170             foreach ($response["cashbacks"] as $cashback) {
    171                 $firstPurchaseAmount = floatval(
    172                     $cashback["firstPurchaseAmount"],
    173                 );
    174                 $amount = floatval($cashback["amount"]);
    175 
    176                 if (
    177                     $cashback["active"] &&
    178                     ($firstPurchaseAmount > 0 || $amount > 0)
    179                 ) {
    180                     return [
    181                         "first_purchase_amount" => $firstPurchaseAmount,
    182                         "standard_amount" => $amount,
    183                     ];
    184                 }
    185             }
    186         }
    187 
    188         return null;
    189150    }
    190151
  • flizpay-for-woocommerce/trunk/includes/class-flizpay-api.php

    r3748891 r3756971  
    138138                    )
    139139                );
    140             },
    141             'fetch_cashback_data' => function ($body) {
    142                 return array(
    143                     'path' => $this->base_url . '/business/cashback',
    144                     'method' => 'get',
    145                     'options' => array(
    146                         'headers' => array(
    147                             'Content-type' => 'application/json',
    148                             'x-api-key' => $this->api_key
    149                         )
    150                     )
    151                 );
    152140            }
    153141        );
  • flizpay-for-woocommerce/trunk/includes/class-flizpay-gateway.php

    r3748891 r3756971  
    55
    66if (!defined('FLIZPAY_VERSION')) {
    7     define('FLIZPAY_VERSION', '2.7.0');
     7    define('FLIZPAY_VERSION', '2.7.1');
    88}
    99
    … …  
    1919        public static string $VERSION = FLIZPAY_VERSION;
    2020
    21         public array|null $cashback;
    2221        public Flizpay_i18n $i18n;
    2322        public string $api_key;
    24         public string $webhook_key;
    25         public string $webhook_url;
    26         public string $flizpay_webhook_alive;
    2723        public string $flizpay_display_logo;
    28         public string $flizpay_display_description;
    29         public string $flizpay_display_headline;
    3024        public string $flizpay_order_status;
    31         public string $flizpay_sentry_enabled;
    32         public string $flizpay_restrict_to_germany;
    33         public Flizpay_Cashback_Helper $cashback_helper;
    3425        public Flizpay_Webhook_Helper $webhook_helper;
    3526        public Flizpay_API_Service $api_service;
    … …  
    3829        /**
    3930         * The class constructor will set FLIZ id, load translations, description, icon and etc.
    40          * It's also responsible for instantiating all FLIZ variables like API KEY and WEBHOOK KEY
    41          * Additionally it will obtain the Cashback information of the merchant from the transients
    42          * or from the API and also apply the translations.
     31         * It's also responsible for loading the API key and initializing payment helpers.
    4332         * The constructor will also register the template redirects for webhooks .
    4433         *
    … …  
    4736        public function __construct()
    4837        {
    49             require_once plugin_dir_path(__DIR__) . 'includes/class-flizpay-cashback-helper.php';
    5038            require_once plugin_dir_path(__DIR__) . 'includes/class-flizpay-webhook-helper.php';
    5139            require_once plugin_dir_path(__DIR__) . 'includes/class-flizpay-api-service.php';
    … …  
    6856            $this->enabled = $this->get_option('enabled', 'yes');
    6957            $this->api_key = $this->get_option('flizpay_api_key');
    70             $this->webhook_key = $this->get_option('flizpay_webhook_key');
    71             $this->webhook_url = $this->get_option('flizpay_webhook_url');
    72             $this->flizpay_webhook_alive = $this->get_option('flizpay_webhook_alive');
    7358            $this->flizpay_display_logo = $this->get_option('flizpay_display_logo');
    74             $this->flizpay_display_description = $this->get_option('flizpay_display_description');
    75             $this->flizpay_display_headline = $this->get_option('flizpay_display_headline');
    7659            $this->flizpay_order_status = $this->get_option('flizpay_order_status');
    77             $this->flizpay_sentry_enabled = $this->get_option('flizpay_sentry_enabled');
    78             $this->flizpay_restrict_to_germany = $this->get_option('flizpay_restrict_to_germany');
    7960            // Initialize helper classes
    80             $this->cashback_helper = new Flizpay_Cashback_Helper($this);
    8161            $this->settlement = new Flizpay_Settlement();
    8262            $this->webhook_helper = new Flizpay_Webhook_Helper($this, $this->settlement);
    … …  
    8666                $this->icon = plugins_url() . '/' . basename(dirname(__DIR__)) . '/assets/images/fliz-checkout-logo.svg';
    8767            }
    88 
    89             $this->cashback = $this->get_cashback_data();
    9068
    9169            $this->init_gateway_info();
    … …  
    232210                    $this->update_option('flizpay_webhook_url', $connection['webhook_url']);
    233211                    $this->update_option('flizpay_api_key', $api_key);
    234                     $this->update_option('flizpay_cashback', $connection['cashback']);
    235                     $this->cashback = $connection['cashback'];
    236212                }
    237213            }
    … …  
    241217            $this->init_gateway_info();
    242218            return $saved;
    243         }
    244 
    245         /**
    246          * Obtain the current cashback value of the merchant from the transient
    247          *
    248          * @return array{
    249          *     first_purchase_amount: float,
    250          *     standard_amount: float
    251          * }|null
    252          *
    253          * @since 1.0.0
    254          */
    255         public function get_cashback_data(): ?array
    256         {
    257             $cashback_data = $this->get_option('flizpay_cashback');
    258 
    259             if (
    260                 !is_array($cashback_data) ||
    261                 !isset(
    262                     $cashback_data['first_purchase_amount'],
    263                     $cashback_data['standard_amount']
    264                 )
    265             ) {
    266                 return null;
    267             }
    268 
    269             $first_purchase_amount = (float) $cashback_data['first_purchase_amount'];
    270             $standard_amount = (float) $cashback_data['standard_amount'];
    271 
    272             if ($first_purchase_amount <= 0 && $standard_amount <= 0) {
    273                 return null;
    274             }
    275 
    276             return [
    277                 'first_purchase_amount' => $first_purchase_amount,
    278                 'standard_amount' => $standard_amount,
    279             ];
    280219        }
    281220
  • flizpay-for-woocommerce/trunk/includes/class-flizpay-webhook-helper.php

    r3671690 r3756971  
    7474                }
    7575
    76                 $this->update_cashback_info($data);
    77                 wp_send_json_success('Cashback information updated', 200);
     76                // Legacy notification: hosted components now own discount data.
     77                // Acknowledge it without persisting it or routing it to settlement.
     78                wp_send_json_success('Cashback information acknowledged', 200);
    7879            } else {
    7980                $this->finish_order($data);
    … …  
    127128
    128129    /**
    129      * @param array<string, mixed> $data
    130      */
    131     private function update_cashback_info(array $data): void
    132     {
    133         $first_purchase_amount = floatval($data['firstPurchaseAmount']);
    134         $standard_amount = floatval($data['amount']);
    135         $cashback = array(
    136             'first_purchase_amount' => $first_purchase_amount,
    137             'standard_amount' => $standard_amount
    138         );
    139         $this->gateway->cashback = $cashback;
    140         $this->gateway->update_option('flizpay_cashback', $cashback);
    141         $this->gateway->init_gateway_info();
    142     }
    143 
    144     /**
    145130     * @return array<string, mixed>|null
    146131     */
  • flizpay-for-woocommerce/trunk/includes/class-flizpay.php

    r3748891 r3756971  
    255255        $this->loader->add_action('woocommerce_single_product_summary', $plugin_public, 'render_product_widget', 31);
    256256        $this->loader->add_action('woocommerce_proceed_to_checkout', $plugin_public, 'render_cart_widget', 15);
    257         $this->loader->add_action('woocommerce_widget_shopping_cart_total', $plugin_public, 'render_mini_cart_widget', 20);
     257        $this->loader->add_action('woocommerce_widget_shopping_cart_before_buttons', $plugin_public, 'render_mini_cart_widget', 20);
    258258        $this->loader->add_action('woocommerce_review_order_before_payment', $plugin_public, 'render_checkout_widget');
    259259        $this->loader->add_action('woocommerce_thankyou', $plugin_public, 'render_order_received_widget', 5);
  • flizpay-for-woocommerce/trunk/languages/flizpay-for-woocommerce-de_DE.po

    r3748891 r3756971  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: FlizPay 2.7.0\n"
     3"Project-Id-Version: FlizPay 2.7.1\n"
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2024-07-30 10:00+0000\n"
    … …  
    1919msgid "Docs"
    2020msgstr "Dokumentation"
    21 
    22 #: includes/class-flizpay-gateway.php:100
    23 msgid "cashback-title"
    24 msgstr "FLIZpay - Bis zu %s%% Rabatt"
    25 
    26 #: includes/class-flizpay-gateway.php:106
    27 msgid "cashback-description-both"
    28 msgstr "Sichere Zahlungen in direkter Zusammenarbeit mit deiner Bank. Ab der zweiten Zahlung bei %s gibt es dauerhaft %s%% Rabatt."
    29 
    30 #: includes/class-flizpay-gateway.php:108
    31 msgid "cashback-description-standard"
    32 msgstr "Sichere Zahlungen in direkter Zusammenarbeit mit deiner Bank.\n %s%% Rabatt für jede FLIZ-Zahlung bei %s."
    33 
    34 #: includes/class-flizpay-gateway.php:113
    35 msgid "cashback-description-first"
    36 msgstr "Sichere Zahlungen in direkter Zusammenarbeit mit deiner Bank. Nach deiner ersten FLIZ-Zahlung bei %s gibt es keinen weiteren Rabatt."
    37 
    38 #: includes/class-flizpay-gateway.php:47
    39 msgid "title"
    40 msgstr "FLIZpay - Die Zahlungsrevolution"
    41 
    42 #: includes/class-flizpay-gateway.php:49
    43 msgid "description"
    44 msgstr "Sichere Zahlungen in direkter Zusammenarbeit mit deiner Bank, deine Daten bleiben privat und in Deutschland, und du unterstützt mit FLIZpay kleine Unternehmen."
    45 
    46 #: includes/class-flizpay-gateway.php:144
    47 msgid "cashback-express-title"
    48 msgstr "Bis zu %s%% Rabatt"
    49 
    50 #: includes/class-flizpay-gateway.php:170
    51 msgid "express-title"
    52 msgstr "Die Zahlungsrevolution"
    5321
    5422#: flizpay.php:18
  • flizpay-for-woocommerce/trunk/languages/flizpay-for-woocommerce-en_GB.po

    r3748891 r3756971  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: FlizPay 2.7.0\n"
     3"Project-Id-Version: FlizPay 2.7.1\n"
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2024-07-30 10:00+0000\n"
    … …  
    1919msgid "Docs"
    2020msgstr "Docs"
    21 
    22 #: includes/class-flizpay-gateway.php:100
    23 msgid "cashback-title"
    24 msgstr "FLIZpay - Up to %s%% Discount"
    25 
    26 #: includes/class-flizpay-gateway.php:106
    27 msgid "cashback-description-both"
    28 msgstr "Secure payments in direct collaboration with your bank. After your first FLIZ payment at %s, you will continue to receive %s%% Discount."
    29 
    30 #: includes/class-flizpay-gateway.php:108
    31 msgid "cashback-description-standard"
    32 msgstr "Secure payments in direct collaboration with your bank.\n %s%% Discount for every FLIZ-payment at %s."
    33 
    34 #: includes/class-flizpay-gateway.php:113
    35 msgid "cashback-description-first"
    36 msgstr "Secure payments in direct collaboration with your bank. No additional discount after your first FLIZ-payment at %s."
    37 
    38 #: includes/class-flizpay-gateway.php:47
    39 msgid "title"
    40 msgstr "FLIZpay - The Payment Revolution"
    41 
    42 #: includes/class-flizpay-gateway.php:49
    43 msgid "description"
    44 msgstr "Secure payments in direct collaboration with your bank. We support small businesses and keep your data private – stored securely in Germany."
    45 
    46 #: includes/class-flizpay-gateway.php:144
    47 msgid "cashback-express-title"
    48 msgstr "Up to %s%% Discount"
    49 
    50 #: includes/class-flizpay-gateway.php:170
    51 msgid "express-title"
    52 msgstr "The payment revolution"
    5321
    5422#: flizpay.php:18
  • flizpay-for-woocommerce/trunk/languages/flizpay-for-woocommerce-en_US.po

    r3748891 r3756971  
    11msgid ""
    22msgstr ""
    3 "Project-Id-Version: FlizPay 2.7.0\n"
     3"Project-Id-Version: FlizPay 2.7.1\n"
    44"Report-Msgid-Bugs-To: \n"
    55"POT-Creation-Date: 2024-07-30 10:00+0000\n"
    … …  
    1919msgid "Docs"
    2020msgstr "Docs"
    21 
    22 #: includes/class-flizpay-gateway.php:100
    23 msgid "cashback-title"
    24 msgstr "FLIZpay - Up to %s%% Discount"
    25 
    26 #: includes/class-flizpay-gateway.php:106
    27 msgid "cashback-description-both"
    28 msgstr "Secure payments in direct collaboration with your bank. After your first FLIZ payment at %s, you will continue to receive %s%% Discount."
    29 
    30 #: includes/class-flizpay-gateway.php:108
    31 msgid "cashback-description-standard"
    32 msgstr "Secure payments in direct collaboration with your bank.\n %s%% Discount for every FLIZ-payment at %s."
    33 
    34 #: includes/class-flizpay-gateway.php:113
    35 msgid "cashback-description-first"
    36 msgstr "Secure payments in direct collaboration with your bank. No additional discount after your first FLIZ-payment at %s."
    37 
    38 #: includes/class-flizpay-gateway.php:47
    39 msgid "title"
    40 msgstr "FLIZpay - The Payment Revolution"
    41 
    42 #: includes/class-flizpay-gateway.php:49
    43 msgid "description"
    44 msgstr "Secure payments in direct collaboration with your bank. We support small businesses and keep your data private – stored securely in Germany."
    45 
    46 #: includes/class-flizpay-gateway.php:144
    47 msgid "cashback-express-title"
    48 msgstr "Up to %s%% Discount"
    49 
    50 #: includes/class-flizpay-gateway.php:170
    51 msgid "express-title"
    52 msgstr "The payment revolution"
    5321
    5422#: flizpay.php:18
  • flizpay-for-woocommerce/trunk/public/class-flizpay-public.php

    r3748891 r3756971  
    250250    public function render_mini_cart_widget()
    251251    {
    252         echo $this->widget_html('mini-cart', $this->cart_attributes()); // phpcs:ignore WordPress.Security.EscapeOutput -- escaped in widget_html()
     252        $widget = $this->widget_html('mini-cart', $this->cart_attributes());
     253        if ($widget !== '') {
     254            echo '<p class="buttons flizpay-mini-cart-widget">' . $widget . '</p>'; // phpcs:ignore WordPress.Security.EscapeOutput -- escaped in widget_html()
     255        }
    253256    }
    254257
    … …  
    438441        $variables = array(
    439442            'ajaxurl' => admin_url('admin-ajax.php'),
    440             'public_dir_path' => plugin_dir_url(__FILE__),
    441443            'order_finish_nonce' => wp_create_nonce('order_finish_nonce'),
    442444            'fliz_logo' => $this->assets_url . '/fliz-logo.svg',
    443445            'fliz_loading_wheel' => $this->assets_url . '/fliz-loading-wheel.svg',
    444             'cashback' => get_transient('flizpay_cashback_transient'),
    445             'flizpay_version' => $this->version,
    446446        );
    447447        wp_localize_script($this->plugin_name, "flizpay_frontend", $variables);
  • flizpay-for-woocommerce/trunk/public/css/flizpay-public.css

    r3748891 r3756971  
    3333  margin-bottom: 8px;
    3434}
    35 
    36 .fliz-black-text {
    37   color: #001F3F;
    38   font-weight: 600;
    39 }
    40 
    41 .fliz-highlight-text {
    42   text-shadow: 0px 0px 4px #80ED99;
    43 }
    44 
    45 .flizpay-loader {
    46   width: 38px;
    47   height: 38px;
    48   border-radius: 50%;
    49   display: inline-block;
    50   border-top: 3px solid #001F3F;
    51   border-right: 3px solid transparent;
    52   box-sizing: border-box;
    53   animation: rotation 1s linear infinite;
    54 }
    55 
    56 @keyframes rotation {
    57   0% {
    58     transform: rotate(0deg);
    59   }
    60   100% {
    61     transform: rotate(360deg);
    62   }
    63 }
Note: See TracChangeset for help on using the changeset viewer.