Changeset 3756971
- Timestamp:
- 10/20/2026 03:07:23 PM (6 hours ago)
- Location:
- flizpay-for-woocommerce
- Files:
-
- 4 deleted
- 40 edited
- 1 copied
-
tags/2.7.1 (copied) (copied from flizpay-for-woocommerce/trunk )
-
tags/2.7.1/CHANGELOG.txt (modified) (1 diff)
-
tags/2.7.1/README.txt (modified) (2 diffs)
-
tags/2.7.1/admin/class-flizpay-admin.php (modified) (2 diffs)
-
tags/2.7.1/admin/class-flizpay-connect.php (modified) (1 diff)
-
tags/2.7.1/admin/css/flizpay-admin.css (modified) (1 diff)
-
tags/2.7.1/admin/js/flizpay-admin.js (modified) (3 diffs)
-
tags/2.7.1/assets/images/fliz-checkout-logo-with-banks.svg (deleted)
-
tags/2.7.1/flizpay.php (modified) (2 diffs)
-
tags/2.7.1/includes/class-flizpay-api-service.php (modified) (4 diffs)
-
tags/2.7.1/includes/class-flizpay-api.php (modified) (1 diff)
-
tags/2.7.1/includes/class-flizpay-cashback-helper.php (deleted)
-
tags/2.7.1/includes/class-flizpay-gateway.php (modified) (8 diffs)
-
tags/2.7.1/includes/class-flizpay-webhook-helper.php (modified) (2 diffs)
-
tags/2.7.1/includes/class-flizpay.php (modified) (1 diff)
-
tags/2.7.1/languages/flizpay-for-woocommerce-de_DE.mo (modified) ( previous)
-
tags/2.7.1/languages/flizpay-for-woocommerce-de_DE.po (modified) (2 diffs)
-
tags/2.7.1/languages/flizpay-for-woocommerce-en_GB.mo (modified) ( previous)
-
tags/2.7.1/languages/flizpay-for-woocommerce-en_GB.po (modified) (2 diffs)
-
tags/2.7.1/languages/flizpay-for-woocommerce-en_US.mo (modified) ( previous)
-
tags/2.7.1/languages/flizpay-for-woocommerce-en_US.po (modified) (2 diffs)
-
tags/2.7.1/public/class-flizpay-public.php (modified) (2 diffs)
-
tags/2.7.1/public/css/flizpay-public.css (modified) (1 diff)
-
trunk/CHANGELOG.txt (modified) (1 diff)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/class-flizpay-admin.php (modified) (2 diffs)
-
trunk/admin/class-flizpay-connect.php (modified) (1 diff)
-
trunk/admin/css/flizpay-admin.css (modified) (1 diff)
-
trunk/admin/js/flizpay-admin.js (modified) (3 diffs)
-
trunk/assets/images/fliz-checkout-logo-with-banks.svg (deleted)
-
trunk/flizpay.php (modified) (2 diffs)
-
trunk/includes/class-flizpay-api-service.php (modified) (4 diffs)
-
trunk/includes/class-flizpay-api.php (modified) (1 diff)
-
trunk/includes/class-flizpay-cashback-helper.php (deleted)
-
trunk/includes/class-flizpay-gateway.php (modified) (8 diffs)
-
trunk/includes/class-flizpay-webhook-helper.php (modified) (2 diffs)
-
trunk/includes/class-flizpay.php (modified) (1 diff)
-
trunk/languages/flizpay-for-woocommerce-de_DE.mo (modified) ( previous)
-
trunk/languages/flizpay-for-woocommerce-de_DE.po (modified) (2 diffs)
-
trunk/languages/flizpay-for-woocommerce-en_GB.mo (modified) ( previous)
-
trunk/languages/flizpay-for-woocommerce-en_GB.po (modified) (2 diffs)
-
trunk/languages/flizpay-for-woocommerce-en_US.mo (modified) ( previous)
-
trunk/languages/flizpay-for-woocommerce-en_US.po (modified) (2 diffs)
-
trunk/public/class-flizpay-public.php (modified) (2 diffs)
-
trunk/public/css/flizpay-public.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
flizpay-for-woocommerce/tags/2.7.1/CHANGELOG.txt
r3748891 r3756971 1 1 == FLIZpay for WooCommerce Changelog == 2 3 2026-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. 2 6 3 7 2026-10-15 - version 2.7.0 -
flizpay-for-woocommerce/tags/2.7.1/README.txt
r3748891 r3756971 4 4 Requires at least: 6.4 5 5 Tested up to: 7.0 6 Stable tag: 2.7. 06 Stable tag: 2.7.1 7 7 Requires PHP: 8.2 8 8 License: GPLv2 or later … … 344 344 - Added - Declared compatibility with WooCommerce High-Performance Order Storage (HPOS). 345 345 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 346 350 == Upgrade Notice == 351 352 = v2.7.1 = 353 Fixes mini-cart widget placement and alignment and removes obsolete local cashback handling. No settings changes are required. 347 354 348 355 = v2.7.0 = -
flizpay-for-woocommerce/tags/2.7.1/admin/class-flizpay-admin.php
r3748891 r3756971 98 98 } 99 99 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); 102 101 103 102 $gateways = function_exists('WC') && WC()->payment_gateways() ? WC()->payment_gateways()->payment_gateways() : array(); … … 113 112 114 113 wp_localize_script($this->plugin_name, 'flizpayParams', array( 115 'nonce' => wp_create_nonce('test_connection_nonce'),116 114 'loading_icon' => "$this->assets_url/loading.svg", 117 115 'checkout_preview' => $checkout_preview, -
flizpay-for-woocommerce/tags/2.7.1/admin/class-flizpay-connect.php
r3748891 r3756971 126 126 $settings['flizpay_webhook_url'] = $connection['webhook_url']; 127 127 $settings['flizpay_webhook_key'] = $connection['webhook_key']; 128 $settings['flizpay_cashback'] = $connection['cashback'];129 128 update_option(self::SETTINGS_OPTION, $settings); 130 129 -
flizpay-for-woocommerce/tags/2.7.1/admin/css/flizpay-admin.css
r3748891 r3756971 4 4 */ 5 5 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 }34 6 #woocommerce_flizpay_connection_result { 35 7 text-align: center; -
flizpay-for-woocommerce/tags/2.7.1/admin/js/flizpay-admin.js
r3748891 r3756971 9 9 */ 10 10 jQuery(document).ready(function ($) { 11 new Promise((resolve) => setTimeout(resolve, 1000)).then(() => {12 console.log("FlizPay Admin JS loaded");13 });14 15 11 const connectionAttempts = 16 12 Number.parseInt( … … 34 30 ? "Admin Display Options" 35 31 : "Anzeigeoptionen für Admins"; 36 const testButton = document.createElement("div");37 32 const resultField = document.createElement("div"); 38 33 const apiKeyInput = document.querySelector( … … 162 157 .setAttribute("style", "display: none;"); 163 158 164 testButton.setAttribute("id", "woocommerce_flizpay_test_connection");165 159 resultField.setAttribute("id", "woocommerce_flizpay_connection_result"); 166 160 // Only append if apiKeyInput exists 167 161 if (apiKeyInput && apiKeyInput.parentNode) { 168 apiKeyInput.parentNode.appendChild(testButton);169 162 apiKeyInput.parentNode.appendChild(resultField); 170 163 } -
flizpay-for-woocommerce/tags/2.7.1/flizpay.php
r3748891 r3756971 17 17 * Plugin URI: https://www.flizpay.de/companies 18 18 * Description: FLIZpay: 100% free! 19 * Version: 2.7. 019 * Version: 2.7.1 20 20 * Author: FLIZpay 21 21 * Author URI: https://www.flizpay.de/companies … … 40 40 * Start at version 1.0.0 and use SemVer - https://semver.org 41 41 */ 42 define('FLIZPAY_VERSION', '2.7. 0');42 define('FLIZPAY_VERSION', '2.7.1'); 43 43 44 44 /** -
flizpay-for-woocommerce/tags/2.7.1/includes/class-flizpay-api-service.php
r3748891 r3756971 18 18 19 19 /** 20 * @return array{ cashback: array|null,webhook_key: string, webhook_url: string}|WP_Error20 * @return array{webhook_key: string, webhook_url: string}|WP_Error 21 21 */ 22 22 public function establish_connection(): array|WP_Error … … 25 25 $webhook_url = $this->generate_webhook_url(); 26 26 $webhook_key = $this->get_webhook_key(); 27 $cashback_data = $this->fetch_cashback_data();28 27 } catch (\Exception $e) { 29 28 Flizpay_Sentry::with_scope(static function ($scope) use ($e): void { … … 47 46 48 47 return array( 49 'cashback' => $cashback_data,50 48 'webhook_key' => $webhook_key, 51 49 'webhook_url' => $webhook_url, … … 150 148 ? (string) $response["publicId"] 151 149 : 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(): ?array160 {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"]) > 0169 ) {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;189 150 } 190 151 -
flizpay-for-woocommerce/tags/2.7.1/includes/class-flizpay-api.php
r3748891 r3756971 138 138 ) 139 139 ); 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_key149 )150 )151 );152 140 } 153 141 ); -
flizpay-for-woocommerce/tags/2.7.1/includes/class-flizpay-gateway.php
r3748891 r3756971 5 5 6 6 if (!defined('FLIZPAY_VERSION')) { 7 define('FLIZPAY_VERSION', '2.7. 0');7 define('FLIZPAY_VERSION', '2.7.1'); 8 8 } 9 9 … … 19 19 public static string $VERSION = FLIZPAY_VERSION; 20 20 21 public array|null $cashback;22 21 public Flizpay_i18n $i18n; 23 22 public string $api_key; 24 public string $webhook_key;25 public string $webhook_url;26 public string $flizpay_webhook_alive;27 23 public string $flizpay_display_logo; 28 public string $flizpay_display_description;29 public string $flizpay_display_headline;30 24 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;34 25 public Flizpay_Webhook_Helper $webhook_helper; 35 26 public Flizpay_API_Service $api_service; … … 38 29 /** 39 30 * 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. 43 32 * The constructor will also register the template redirects for webhooks . 44 33 * … … 47 36 public function __construct() 48 37 { 49 require_once plugin_dir_path(__DIR__) . 'includes/class-flizpay-cashback-helper.php';50 38 require_once plugin_dir_path(__DIR__) . 'includes/class-flizpay-webhook-helper.php'; 51 39 require_once plugin_dir_path(__DIR__) . 'includes/class-flizpay-api-service.php'; … … 68 56 $this->enabled = $this->get_option('enabled', 'yes'); 69 57 $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');73 58 $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');76 59 $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');79 60 // Initialize helper classes 80 $this->cashback_helper = new Flizpay_Cashback_Helper($this);81 61 $this->settlement = new Flizpay_Settlement(); 82 62 $this->webhook_helper = new Flizpay_Webhook_Helper($this, $this->settlement); … … 86 66 $this->icon = plugins_url() . '/' . basename(dirname(__DIR__)) . '/assets/images/fliz-checkout-logo.svg'; 87 67 } 88 89 $this->cashback = $this->get_cashback_data();90 68 91 69 $this->init_gateway_info(); … … 232 210 $this->update_option('flizpay_webhook_url', $connection['webhook_url']); 233 211 $this->update_option('flizpay_api_key', $api_key); 234 $this->update_option('flizpay_cashback', $connection['cashback']);235 $this->cashback = $connection['cashback'];236 212 } 237 213 } … … 241 217 $this->init_gateway_info(); 242 218 return $saved; 243 }244 245 /**246 * Obtain the current cashback value of the merchant from the transient247 *248 * @return array{249 * first_purchase_amount: float,250 * standard_amount: float251 * }|null252 *253 * @since 1.0.0254 */255 public function get_cashback_data(): ?array256 {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 ];280 219 } 281 220 -
flizpay-for-woocommerce/tags/2.7.1/includes/class-flizpay-webhook-helper.php
r3671690 r3756971 74 74 } 75 75 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); 78 79 } else { 79 80 $this->finish_order($data); … … 127 128 128 129 /** 129 * @param array<string, mixed> $data130 */131 private function update_cashback_info(array $data): void132 {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_amount138 );139 $this->gateway->cashback = $cashback;140 $this->gateway->update_option('flizpay_cashback', $cashback);141 $this->gateway->init_gateway_info();142 }143 144 /**145 130 * @return array<string, mixed>|null 146 131 */ -
flizpay-for-woocommerce/tags/2.7.1/includes/class-flizpay.php
r3748891 r3756971 255 255 $this->loader->add_action('woocommerce_single_product_summary', $plugin_public, 'render_product_widget', 31); 256 256 $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); 258 258 $this->loader->add_action('woocommerce_review_order_before_payment', $plugin_public, 'render_checkout_widget'); 259 259 $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 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: FlizPay 2.7. 0\n"3 "Project-Id-Version: FlizPay 2.7.1\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2024-07-30 10:00+0000\n" … … 19 19 msgid "Docs" 20 20 msgstr "Dokumentation" 21 22 #: includes/class-flizpay-gateway.php:10023 msgid "cashback-title"24 msgstr "FLIZpay - Bis zu %s%% Rabatt"25 26 #: includes/class-flizpay-gateway.php:10627 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:10831 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:11335 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:4739 msgid "title"40 msgstr "FLIZpay - Die Zahlungsrevolution"41 42 #: includes/class-flizpay-gateway.php:4943 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:14447 msgid "cashback-express-title"48 msgstr "Bis zu %s%% Rabatt"49 50 #: includes/class-flizpay-gateway.php:17051 msgid "express-title"52 msgstr "Die Zahlungsrevolution"53 21 54 22 #: flizpay.php:18 -
flizpay-for-woocommerce/tags/2.7.1/languages/flizpay-for-woocommerce-en_GB.po
r3748891 r3756971 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: FlizPay 2.7. 0\n"3 "Project-Id-Version: FlizPay 2.7.1\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2024-07-30 10:00+0000\n" … … 19 19 msgid "Docs" 20 20 msgstr "Docs" 21 22 #: includes/class-flizpay-gateway.php:10023 msgid "cashback-title"24 msgstr "FLIZpay - Up to %s%% Discount"25 26 #: includes/class-flizpay-gateway.php:10627 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:10831 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:11335 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:4739 msgid "title"40 msgstr "FLIZpay - The Payment Revolution"41 42 #: includes/class-flizpay-gateway.php:4943 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:14447 msgid "cashback-express-title"48 msgstr "Up to %s%% Discount"49 50 #: includes/class-flizpay-gateway.php:17051 msgid "express-title"52 msgstr "The payment revolution"53 21 54 22 #: flizpay.php:18 -
flizpay-for-woocommerce/tags/2.7.1/languages/flizpay-for-woocommerce-en_US.po
r3748891 r3756971 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: FlizPay 2.7. 0\n"3 "Project-Id-Version: FlizPay 2.7.1\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2024-07-30 10:00+0000\n" … … 19 19 msgid "Docs" 20 20 msgstr "Docs" 21 22 #: includes/class-flizpay-gateway.php:10023 msgid "cashback-title"24 msgstr "FLIZpay - Up to %s%% Discount"25 26 #: includes/class-flizpay-gateway.php:10627 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:10831 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:11335 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:4739 msgid "title"40 msgstr "FLIZpay - The Payment Revolution"41 42 #: includes/class-flizpay-gateway.php:4943 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:14447 msgid "cashback-express-title"48 msgstr "Up to %s%% Discount"49 50 #: includes/class-flizpay-gateway.php:17051 msgid "express-title"52 msgstr "The payment revolution"53 21 54 22 #: flizpay.php:18 -
flizpay-for-woocommerce/tags/2.7.1/public/class-flizpay-public.php
r3748891 r3756971 250 250 public function render_mini_cart_widget() 251 251 { 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 } 253 256 } 254 257 … … 438 441 $variables = array( 439 442 'ajaxurl' => admin_url('admin-ajax.php'), 440 'public_dir_path' => plugin_dir_url(__FILE__),441 443 'order_finish_nonce' => wp_create_nonce('order_finish_nonce'), 442 444 'fliz_logo' => $this->assets_url . '/fliz-logo.svg', 443 445 'fliz_loading_wheel' => $this->assets_url . '/fliz-loading-wheel.svg', 444 'cashback' => get_transient('flizpay_cashback_transient'),445 'flizpay_version' => $this->version,446 446 ); 447 447 wp_localize_script($this->plugin_name, "flizpay_frontend", $variables); -
flizpay-for-woocommerce/tags/2.7.1/public/css/flizpay-public.css
r3748891 r3756971 33 33 margin-bottom: 8px; 34 34 } 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 1 1 == FLIZpay for WooCommerce Changelog == 2 3 2026-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. 2 6 3 7 2026-10-15 - version 2.7.0 -
flizpay-for-woocommerce/trunk/README.txt
r3748891 r3756971 4 4 Requires at least: 6.4 5 5 Tested up to: 7.0 6 Stable tag: 2.7. 06 Stable tag: 2.7.1 7 7 Requires PHP: 8.2 8 8 License: GPLv2 or later … … 344 344 - Added - Declared compatibility with WooCommerce High-Performance Order Storage (HPOS). 345 345 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 346 350 == Upgrade Notice == 351 352 = v2.7.1 = 353 Fixes mini-cart widget placement and alignment and removes obsolete local cashback handling. No settings changes are required. 347 354 348 355 = v2.7.0 = -
flizpay-for-woocommerce/trunk/admin/class-flizpay-admin.php
r3748891 r3756971 98 98 } 99 99 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); 102 101 103 102 $gateways = function_exists('WC') && WC()->payment_gateways() ? WC()->payment_gateways()->payment_gateways() : array(); … … 113 112 114 113 wp_localize_script($this->plugin_name, 'flizpayParams', array( 115 'nonce' => wp_create_nonce('test_connection_nonce'),116 114 'loading_icon' => "$this->assets_url/loading.svg", 117 115 'checkout_preview' => $checkout_preview, -
flizpay-for-woocommerce/trunk/admin/class-flizpay-connect.php
r3748891 r3756971 126 126 $settings['flizpay_webhook_url'] = $connection['webhook_url']; 127 127 $settings['flizpay_webhook_key'] = $connection['webhook_key']; 128 $settings['flizpay_cashback'] = $connection['cashback'];129 128 update_option(self::SETTINGS_OPTION, $settings); 130 129 -
flizpay-for-woocommerce/trunk/admin/css/flizpay-admin.css
r3748891 r3756971 4 4 */ 5 5 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 }34 6 #woocommerce_flizpay_connection_result { 35 7 text-align: center; -
flizpay-for-woocommerce/trunk/admin/js/flizpay-admin.js
r3748891 r3756971 9 9 */ 10 10 jQuery(document).ready(function ($) { 11 new Promise((resolve) => setTimeout(resolve, 1000)).then(() => {12 console.log("FlizPay Admin JS loaded");13 });14 15 11 const connectionAttempts = 16 12 Number.parseInt( … … 34 30 ? "Admin Display Options" 35 31 : "Anzeigeoptionen für Admins"; 36 const testButton = document.createElement("div");37 32 const resultField = document.createElement("div"); 38 33 const apiKeyInput = document.querySelector( … … 162 157 .setAttribute("style", "display: none;"); 163 158 164 testButton.setAttribute("id", "woocommerce_flizpay_test_connection");165 159 resultField.setAttribute("id", "woocommerce_flizpay_connection_result"); 166 160 // Only append if apiKeyInput exists 167 161 if (apiKeyInput && apiKeyInput.parentNode) { 168 apiKeyInput.parentNode.appendChild(testButton);169 162 apiKeyInput.parentNode.appendChild(resultField); 170 163 } -
flizpay-for-woocommerce/trunk/flizpay.php
r3748891 r3756971 17 17 * Plugin URI: https://www.flizpay.de/companies 18 18 * Description: FLIZpay: 100% free! 19 * Version: 2.7. 019 * Version: 2.7.1 20 20 * Author: FLIZpay 21 21 * Author URI: https://www.flizpay.de/companies … … 40 40 * Start at version 1.0.0 and use SemVer - https://semver.org 41 41 */ 42 define('FLIZPAY_VERSION', '2.7. 0');42 define('FLIZPAY_VERSION', '2.7.1'); 43 43 44 44 /** -
flizpay-for-woocommerce/trunk/includes/class-flizpay-api-service.php
r3748891 r3756971 18 18 19 19 /** 20 * @return array{ cashback: array|null,webhook_key: string, webhook_url: string}|WP_Error20 * @return array{webhook_key: string, webhook_url: string}|WP_Error 21 21 */ 22 22 public function establish_connection(): array|WP_Error … … 25 25 $webhook_url = $this->generate_webhook_url(); 26 26 $webhook_key = $this->get_webhook_key(); 27 $cashback_data = $this->fetch_cashback_data();28 27 } catch (\Exception $e) { 29 28 Flizpay_Sentry::with_scope(static function ($scope) use ($e): void { … … 47 46 48 47 return array( 49 'cashback' => $cashback_data,50 48 'webhook_key' => $webhook_key, 51 49 'webhook_url' => $webhook_url, … … 150 148 ? (string) $response["publicId"] 151 149 : 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(): ?array160 {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"]) > 0169 ) {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;189 150 } 190 151 -
flizpay-for-woocommerce/trunk/includes/class-flizpay-api.php
r3748891 r3756971 138 138 ) 139 139 ); 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_key149 )150 )151 );152 140 } 153 141 ); -
flizpay-for-woocommerce/trunk/includes/class-flizpay-gateway.php
r3748891 r3756971 5 5 6 6 if (!defined('FLIZPAY_VERSION')) { 7 define('FLIZPAY_VERSION', '2.7. 0');7 define('FLIZPAY_VERSION', '2.7.1'); 8 8 } 9 9 … … 19 19 public static string $VERSION = FLIZPAY_VERSION; 20 20 21 public array|null $cashback;22 21 public Flizpay_i18n $i18n; 23 22 public string $api_key; 24 public string $webhook_key;25 public string $webhook_url;26 public string $flizpay_webhook_alive;27 23 public string $flizpay_display_logo; 28 public string $flizpay_display_description;29 public string $flizpay_display_headline;30 24 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;34 25 public Flizpay_Webhook_Helper $webhook_helper; 35 26 public Flizpay_API_Service $api_service; … … 38 29 /** 39 30 * 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. 43 32 * The constructor will also register the template redirects for webhooks . 44 33 * … … 47 36 public function __construct() 48 37 { 49 require_once plugin_dir_path(__DIR__) . 'includes/class-flizpay-cashback-helper.php';50 38 require_once plugin_dir_path(__DIR__) . 'includes/class-flizpay-webhook-helper.php'; 51 39 require_once plugin_dir_path(__DIR__) . 'includes/class-flizpay-api-service.php'; … … 68 56 $this->enabled = $this->get_option('enabled', 'yes'); 69 57 $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');73 58 $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');76 59 $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');79 60 // Initialize helper classes 80 $this->cashback_helper = new Flizpay_Cashback_Helper($this);81 61 $this->settlement = new Flizpay_Settlement(); 82 62 $this->webhook_helper = new Flizpay_Webhook_Helper($this, $this->settlement); … … 86 66 $this->icon = plugins_url() . '/' . basename(dirname(__DIR__)) . '/assets/images/fliz-checkout-logo.svg'; 87 67 } 88 89 $this->cashback = $this->get_cashback_data();90 68 91 69 $this->init_gateway_info(); … … 232 210 $this->update_option('flizpay_webhook_url', $connection['webhook_url']); 233 211 $this->update_option('flizpay_api_key', $api_key); 234 $this->update_option('flizpay_cashback', $connection['cashback']);235 $this->cashback = $connection['cashback'];236 212 } 237 213 } … … 241 217 $this->init_gateway_info(); 242 218 return $saved; 243 }244 245 /**246 * Obtain the current cashback value of the merchant from the transient247 *248 * @return array{249 * first_purchase_amount: float,250 * standard_amount: float251 * }|null252 *253 * @since 1.0.0254 */255 public function get_cashback_data(): ?array256 {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 ];280 219 } 281 220 -
flizpay-for-woocommerce/trunk/includes/class-flizpay-webhook-helper.php
r3671690 r3756971 74 74 } 75 75 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); 78 79 } else { 79 80 $this->finish_order($data); … … 127 128 128 129 /** 129 * @param array<string, mixed> $data130 */131 private function update_cashback_info(array $data): void132 {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_amount138 );139 $this->gateway->cashback = $cashback;140 $this->gateway->update_option('flizpay_cashback', $cashback);141 $this->gateway->init_gateway_info();142 }143 144 /**145 130 * @return array<string, mixed>|null 146 131 */ -
flizpay-for-woocommerce/trunk/includes/class-flizpay.php
r3748891 r3756971 255 255 $this->loader->add_action('woocommerce_single_product_summary', $plugin_public, 'render_product_widget', 31); 256 256 $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); 258 258 $this->loader->add_action('woocommerce_review_order_before_payment', $plugin_public, 'render_checkout_widget'); 259 259 $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 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: FlizPay 2.7. 0\n"3 "Project-Id-Version: FlizPay 2.7.1\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2024-07-30 10:00+0000\n" … … 19 19 msgid "Docs" 20 20 msgstr "Dokumentation" 21 22 #: includes/class-flizpay-gateway.php:10023 msgid "cashback-title"24 msgstr "FLIZpay - Bis zu %s%% Rabatt"25 26 #: includes/class-flizpay-gateway.php:10627 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:10831 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:11335 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:4739 msgid "title"40 msgstr "FLIZpay - Die Zahlungsrevolution"41 42 #: includes/class-flizpay-gateway.php:4943 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:14447 msgid "cashback-express-title"48 msgstr "Bis zu %s%% Rabatt"49 50 #: includes/class-flizpay-gateway.php:17051 msgid "express-title"52 msgstr "Die Zahlungsrevolution"53 21 54 22 #: flizpay.php:18 -
flizpay-for-woocommerce/trunk/languages/flizpay-for-woocommerce-en_GB.po
r3748891 r3756971 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: FlizPay 2.7. 0\n"3 "Project-Id-Version: FlizPay 2.7.1\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2024-07-30 10:00+0000\n" … … 19 19 msgid "Docs" 20 20 msgstr "Docs" 21 22 #: includes/class-flizpay-gateway.php:10023 msgid "cashback-title"24 msgstr "FLIZpay - Up to %s%% Discount"25 26 #: includes/class-flizpay-gateway.php:10627 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:10831 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:11335 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:4739 msgid "title"40 msgstr "FLIZpay - The Payment Revolution"41 42 #: includes/class-flizpay-gateway.php:4943 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:14447 msgid "cashback-express-title"48 msgstr "Up to %s%% Discount"49 50 #: includes/class-flizpay-gateway.php:17051 msgid "express-title"52 msgstr "The payment revolution"53 21 54 22 #: flizpay.php:18 -
flizpay-for-woocommerce/trunk/languages/flizpay-for-woocommerce-en_US.po
r3748891 r3756971 1 1 msgid "" 2 2 msgstr "" 3 "Project-Id-Version: FlizPay 2.7. 0\n"3 "Project-Id-Version: FlizPay 2.7.1\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: 2024-07-30 10:00+0000\n" … … 19 19 msgid "Docs" 20 20 msgstr "Docs" 21 22 #: includes/class-flizpay-gateway.php:10023 msgid "cashback-title"24 msgstr "FLIZpay - Up to %s%% Discount"25 26 #: includes/class-flizpay-gateway.php:10627 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:10831 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:11335 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:4739 msgid "title"40 msgstr "FLIZpay - The Payment Revolution"41 42 #: includes/class-flizpay-gateway.php:4943 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:14447 msgid "cashback-express-title"48 msgstr "Up to %s%% Discount"49 50 #: includes/class-flizpay-gateway.php:17051 msgid "express-title"52 msgstr "The payment revolution"53 21 54 22 #: flizpay.php:18 -
flizpay-for-woocommerce/trunk/public/class-flizpay-public.php
r3748891 r3756971 250 250 public function render_mini_cart_widget() 251 251 { 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 } 253 256 } 254 257 … … 438 441 $variables = array( 439 442 'ajaxurl' => admin_url('admin-ajax.php'), 440 'public_dir_path' => plugin_dir_url(__FILE__),441 443 'order_finish_nonce' => wp_create_nonce('order_finish_nonce'), 442 444 'fliz_logo' => $this->assets_url . '/fliz-logo.svg', 443 445 'fliz_loading_wheel' => $this->assets_url . '/fliz-loading-wheel.svg', 444 'cashback' => get_transient('flizpay_cashback_transient'),445 'flizpay_version' => $this->version,446 446 ); 447 447 wp_localize_script($this->plugin_name, "flizpay_frontend", $variables); -
flizpay-for-woocommerce/trunk/public/css/flizpay-public.css
r3748891 r3756971 33 33 margin-bottom: 8px; 34 34 } 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)