=== Changelog ===

*** WooCommerce ***
2026.06.25 - version 2.1.1
    * Fix: Card `exp_month` / `exp_year` are now sent as 2/4-character strings (e.g. "05"/"2027") so the backend stops rejecting tokens with `card.expiration_month length must be 2 characters long`.
    * Fix: Webhook race condition with `process_payment` resolved (retry + 200 response when transaction_id is not stored yet).
    * Fix: Webhook responses are flushed clean so PHP notices/debug output cannot corrupt the JSON the backend reads.
    * Fix: PHP 8.2+ "dynamic property" deprecation notices removed across `EcartPayGateway`, `EcartPayApi`, `EcartPaySettings`, `EcartPayOrders` and `EcartPayRefunds`.
    * Fix: Idempotent `confirm_ecartpay_order` prevents duplicate payment_complete calls when several webhooks land at the same time.
    * Fix: Direct mode tolerates intermediate backend statuses and lets the webhook close the transaction (no more failed checkouts when the backend responds asynchronously).
    * Fix: Popup checkout redirect time reduced from 15s to 5s; asynchronous payment methods (OXXO, bank transfer) no longer block the customer on the checkout page.
    * Fix: Safety net on the "thank you" page re-syncs the order status if the webhook never arrived.
    * Feat: Unified, modern card form design across classic checkout and Cart/Checkout Blocks (`direct` mode).
    * Feat: Automatic card brand detection (Visa / Mastercard / AMEX) with active state inside the input.
    * Feat: Client-side validation (Luhn, expiration, brand-aware CVC length) with inline error messages.
    * Feat: CVC masked by default with a show/hide eye toggle.
    * Feat: Installments selector loaded with debounce and hidden when no options are available.
    * Chore: Centralised card data extraction in a single helper, removing duplicated code in three call sites.

2026.05.21 - version 2.1.0
    * Fix: Cart/Checkout Blocks payment method registration race condition removed.
    * Fix: Payment method now appears in Block Checkout when settings have not yet been saved (defaults applied).
    * Fix: `woocommerce_rest_checkout_missing_payment_method` error resolved by returning paymentMethodData and bridging payment_data to $_POST through `woocommerce_rest_checkout_process_payment_with_context`.
    * Fix: Removed unreliable `is_block_based_checkout()` page detection; SDK is now enqueued via both the shortcode and the Blocks checkout enqueue hooks.
    * Fix: Removed duplicate registration on `woocommerce_payment_gateways` (gateway no longer added twice).
    * Fix: Subscription hooks no longer registered multiple times per request.
    * Feat: React-based card form for `direct` mode inside Cart/Checkout Blocks.
    * Feat: Declared HPOS (`custom_order_tables`) and `cart_checkout_blocks` compatibility.
    * Feat: Block script now uses canonical `onPaymentSetup` API with `emitResponse.responseTypes`, decoded HTML entities for title/description and `Pay.Popup` guard for `window` mode.
    * Chore: Tested up to WordPress 6.8 and WooCommerce 10.7.

2024.07.23 - version 2.0.0
    * Initial release.
