Releases: comfino/magento2
Releases · comfino/magento2
Release list
4.0.0
Breaking Changes
- Minimum PHP version raised to 8.1 — Magento 2.4.4+ now required.
- Dependency migration — Switched from
comfino/shop-plugins-sharedto dedicated SDKs (comfino/php-sdk,comfino/sdk-for-magento2). - Namespace consolidation — All plugin classes moved to
Comfino\ComfinoGateway\*namespace;src/directory and oldComfino\*bridges removed. - Bundled vendor libraries removed — Guzzle, Monolog, and Symfony components previously shipped inside the plugin are now provided by the
comfino/php-sdkandcomfino/sdk-for-magento2Composer packages.
Added
- Outbound request queue — API calls that fail transiently (order cancellations, error reports) are now enqueued in the
comfino_request_queueDB table and retried automatically instead of being lost. The queue is drained every 5 minutes by a new cron job (comfino_process_request_queue) and opportunistically after each incoming webhook. Configure viaretry_queue_enabled,retry_queue_max_attempts(default: 10),retry_queue_batch_size(default: 20),retry_queue_cooldown(default: 300 s),api_queue_connect_timeout(default: 1 s), andapi_queue_timeout(default: 2 s) inpayment/comfino/*. - Composer package distribution — Published to Packagist as
comfino/magento2for easier installation and updates. - Iframe-based payment architecture — Universal theme compatibility (Luma, Hyvä, custom themes).
- Hyvä Checkout integration — Separate
comfino/magento2-hyva-checkoutsub-module with automatic GitHub Actions subtree sync. - PostMessage API — Secure parent-iframe communication during checkout.
- SDK integration — Uses native PHP 8.1 enums, readonly properties, and Magento's native HTTP client, cache, and logging.
- Shop environment auto-reporting — On every admin config save the module sends the shop's platform, theme family, locale, and page-context data to the Comfino API. The API uses this to build a per-theme selector knowledge base and return automatic widget placement recommendations.
- Widget appearance settings — New admin options: show/hide provider logos (
COMFINO_WIDGET_SHOW_PROVIDER_LOGOS), custom banner CSS URL (COMFINO_WIDGET_CUSTOM_BANNER_CSS_URL), custom calculator CSS URL (COMFINO_WIDGET_CUSTOM_CALCULATOR_CSS_URL). - Structured shop environment in paywall and widget — The paywall iframe and product-page widget now receive an identical, structured shop environment object (platform, theme, locale, page context) so the CDN-side widget SDK can apply a consistent selector profile.
- Creditors configuration — The admin panel now exposes a per-product-type creditor/lender list fetched from the Comfino API. The data is passed to the paywall frontend so the checkout widget can display provider logos and names alongside each financing offer.
- Allowed Products Config — Per-product-type term limits (min/max instalment count) are now configurable via the admin panel and injected into the paywall frontend, allowing the widget SDK to filter and pre-select offers according to merchant preferences.
- Direct redirect mode — New
COMFINO_PAYWALL_DIRECT_REDIRECTadmin toggle. When enabled, clicking "Pay with Comfino" skips the embedded paywall and redirects the customer straight to the Comfino payment page. - Custom paywall CSS URL — New
COMFINO_PAYWALL_CUSTOM_CSS_URLadmin field allows injecting a merchant-supplied stylesheet into the paywall iframe for branding customization (separate from the product-widget CSS options). - Admin field server-side validation — Configuration fields in the Comfino admin section are now validated on save: required fields reject empty values, numeric fields reject non-numeric input, and URL fields reject malformed absolute URLs. Invalid values are reported with a user-friendly error message instead of being silently persisted.
Changed
comfino/sdk-for-magento2bumped to^1.0.0-beta4— required forRequestValidationErrorsupport and other SDK-side fixes included in this release.- Order cancellation suppression moved to the SDK — When the Comfino API reports an order as cancelled, the module no longer echoes a redundant cancel request back to the API. The suppression now relies on the SDK's
StatusApplicationContext(entered automatically byAbstractStatusAdapter::setStatus()):OrderObserverskips the cancel request whileStatusApplicationContext::isActive()is true. This replaces the previous module-local static flag onShopStatusManager, which is now a pure constants holder again. OrderManagerdelegated to SDK builders — Cart and customer construction fully moved toMagentoCartBuilderandMagentoCustomerBuilderinsdk-for-magento2;OrderManageris now a thin DI coordinator with no business logic.- Magento Marketplace EQP compliance — Module code validated against Magento Marketplace Extension Quality Program coding standards (PHP_CodeSniffer + PHPStan).
Fixed
- Product category filter category ID persistence and admin panel rendering.
- Widget type admin dropdown stuck on
errorvalue after a failed API call — the widget script endpoint now guards against stalecore_config_datarows that would otherwise serve a broken JS file. - PHP 8.1 compatibility: explicit
intcast added in monetary calculations (PLN → grosze conversion). - Loan amount accuracy — The paywall now reads live totals directly from the Magento quote model instead of using cached values, so the displayed instalment amount and shipping cost are always consistent with the current cart state (applied discounts, selected shipping method, etc.).
- Checkout validation error recovery — When the Comfino API rejects an order creation request (HTTP 400, e.g., invalid phone number format) or a local validation check fails, the module now automatically cancels the orphaned Magento order, restores the customer's cart, and displays the real error message inline at the payment step. Previously these errors were caught by the generic handler, the API message was replaced with a non-descriptive fallback string, the customer was redirected to the failure page, and the cart contents were lost.
- Inline payment error messages not rendered in Luma checkout — Fixed an incorrect Knockout.js binding (
$parent.getRegion('messages')→getRegion('messages')) in the Luma payment template. The message region was resolving against the parent payment-list component instead of the Comfino payment-method component, so errors reported viamessageContainer(including validation failures) were never displayed to the customer. - Spurious cancel API calls for orders never submitted to Comfino —
OrderObserverno longer sends a cancellation request to the Comfino API for orders that were cancelled locally before a Comfino application was ever created (e.g. cleaned up after a validation failure). Such requests produced unnecessary404errors on the Comfino side. The guard uses the newcomfino_order_createdpayment flag on orders created with this release; for older orders it falls back to checking whether the order previously held acomfino_*status.
Security
- Enhanced iframe sandboxing and origin validation via PostMessage API.
- CSP policy configuration for external widget scripts.
- XSS vulnerabilities fixed in admin config field templates and frontend output — all user-controlled values are now properly escaped.
- Log clearing CSRF protection — The admin "Clear log" action now requires a valid
form_keytoken, preventing the log from being wiped via a forged cross-site request.