=== Fusion Pay by tbi bank ===
Contributors: tbibank, gbizimtbibank
Tags: woocommerce, payments, installments, bnpl, financing
Requires at least: 5.0
Tested up to: 7.0
Stable tag: 3.3.2
Requires PHP: 7.4
Requires Plugins: woocommerce
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Offer tbi bank installment and BNPL payments in WooCommerce with financing options on product, cart, and checkout pages.

== Description ==

Fusion Pay by tbi bank adds tbi bank financing to WooCommerce stores, letting eligible customers apply for installment or Buy Now, Pay Later payments during the shopping journey.

The integration is designed for merchants working with tbi bank and supports the full purchase flow, from product discovery to checkout.

Key features:

* tbi bank payment gateway for WooCommerce checkout
* Financing buttons on product and cart pages
* Installment calculator popup for available payment plans
* Support for installment loans and BNPL flows
* Multi-country setup for Bulgaria, Romania, and Greece
* Country-specific configuration and feature flags
* API-based merchant credential validation and status sync
* WooCommerce Blocks checkout compatibility
* Compatibility with selected WooCommerce product option and bundle extensions

This plugin requires an active WooCommerce installation and valid tbi bank merchant credentials.

== Installation ==

1. Upload the `fusion-pay-tbi` folder to the `/wp-content/plugins/` directory.
2. Activate **Fusion Pay by tbi bank** through the **Plugins** screen in WordPress.
3. Make sure WooCommerce is installed and active.
4. Open the **Fusion Pay** settings page in WordPress admin.
5. Enter the merchant credentials provided by tbi bank.
6. Save the settings and confirm the connection is active.

== Frequently Asked Questions ==

= Who can use this plugin? =

Merchants who use WooCommerce and have an active commercial relationship with tbi bank.

= Does it require WooCommerce? =

Yes. WooCommerce must be installed and active for the plugin to work.

= Which payment flows are supported? =

Depending on country and merchant setup, the plugin supports installment financing and Buy Now, Pay Later flows.

= Which countries are supported? =

The plugin includes support for Bulgaria, Romania, and Greece, with country-specific configuration and availability.

= Does it work with the WooCommerce block checkout? =

Yes. The plugin includes WooCommerce Blocks checkout support.

== External Services ==

This plugin communicates with the following external services.

= tbi Bank API =

Used to validate merchant credentials, fetch installment configuration, register financing applications, and report plugin status to tbi bank.

Data sent: store URL, merchant ID, merchant key, cart and order details (product IDs, quantities, amounts), plugin version, and country/currency context.

Triggered on: settings save, product/cart/checkout page load for eligible merchants, and order placement.

* Service URL: https://tbibank.bg
* Terms of Service: https://tbibank.com/terms-and-conditions/
* Privacy Policy: https://tbibank.bg/legal/privacy-policy

= tbi CDN =

Used to load the tbi bank logo image displayed on product, cart, checkout, and admin settings pages.

Data sent: standard browser HTTP request — no personal data is transmitted.

Triggered on: any page where the financing button or payment gateway is displayed.

* CDN URL: https://cdn.tbibankgroup.com
* Terms of Service: https://tbibank.com/terms-and-conditions/
* Privacy Policy: https://tbibank.bg/legal/privacy-policy

== Changelog ==

= 3.3.2 =
* Settings are synchronized automatically after a plugin update, no manual "Save Settings" needed

= 3.3.1 =
* RO button redesign
* BG and RO bugfixing

= 3.2.4 =
* Fix Logger bug
* CKT-3633: send entry point (returnUrlTypeId) and merchant return URL (returnUrl) with every RegisterApplication request.
* Fix for bundle products
* WooCommerce Status Synchronization

= 3.2.2 =
* CDL changes applied in the new WooCoo versions.

= 3.2.1 =
* Update the flexible fusion pay logic to properly cehck for qty changes on page.


= 3.2.1 =
* Update the flexible fusion pay logic to properly cehck for qty changes on page.


= 3.2.1 =
* Restored plugin update logic; all three countries (BG, RO, GR) now share a single update endpoint until the plugin is ready for the WordPress.org marketplace.
* Updated references from `TBI_TEST_ENV` to `FUSIPATB_TEST_ENV` and `TBI_PLATFORM_URL` to `FUSIPATB_PLATFORM_URL` across all country configs.
* Replaced `TBI_ADVERTISEMENT_PAGE` and `TBI_WC_PLUGIN_PATH` with FUSIPATB equivalents in `Advertisement` and `BlocksCartIntegration`.
* Updated logo and CDN references in `CartButton` and `ProductButton`.
* Refactored `FrontendAssets` and `Popup` to use FUSIPATB paths.
* Adjusted `BlocksGateway` and `PaymentGateway` for FUSIPATB constants.
* Enhanced `SecurityHelper` for IP validation and origin checks.
* Cleaned up `StatusColumn` and `uninstall.php`.
* Bug fix for Romania.

= 3.1 =
* Added WooCommerce Blocks cart support: TBI installment button now renders inside Blocks-based cart themes via `BlocksCartIntegration`.
* Added add-to-cart handling for Romania (RO) in CartProcessor and ProductProcessor.
* WordPress.org plugin review compliance: prefixed AJAX action slugs (`fusipatb_*`), sanitized `$_POST`/`$_COOKIE`/`$_SERVER` inputs, replaced inline `<script>` with `wp_add_inline_script()`.
* Renamed gateway classes to `Fusipatb_PaymentGateway` and `Fusipatb_BlocksGateway`; backward-compat aliases retained for one release cycle.
* Removed `build/build-branch-zips.sh` (not permitted on WordPress.org).

= 3.0 =
* Added the current Fusion Pay by tbi bank release documentation and WordPress.org metadata.
* Supports WooCommerce financing flows for tbi bank merchants.

== Upgrade Notice ==

= 3.1 =
Update to 3.1 for WooCommerce Blocks cart support, Romania add-to-cart handling, WordPress.org compliance fixes, and improved input sanitization.

= 3.0 =
Update to the latest Fusion Pay by tbi bank release for the current WooCommerce integration, financing flow support, and metadata cleanup.
