Fix license generation and checkout domain field bugs

- Add WooCommerce Checkout Blocks support for domain field
- Create CheckoutBlocksIntegration for block-based checkout
- Create StoreApiExtension for Store API domain handling
- Add checkout-blocks.js for frontend domain field in blocks
- Fix LicenseManager product type check in generateLicense()
- Add multiple order status hooks for reliable license generation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 21:58:54 +01:00
parent 182dabebed
commit 319dfe357a
6 changed files with 427 additions and 3 deletions

View File

@@ -34,7 +34,13 @@ This project is proudly **"vibe-coded"** using Claude.AI - the entire codebase w
### Known Bugs
_No known bugs at this time.
_No known bugs at this time._
### Version 0.0.10
- Add a license related form section to the orders form in the admin area
- Make license domains editable in the backend
- Investigate checkout block integration improvements if issues persist
## Technical Stack
@@ -480,3 +486,30 @@ Full API documentation available in `openapi.json` (OpenAPI 3.1 specification).
- JavaScript client works in both browser and Node.js environments
- Python client uses dataclasses for type-safe responses
- C# client uses async/await patterns and System.Text.Json
### 2026-01-21 - Bug Fixes (pre-v0.0.10)
**Fixed bugs:**
- Fixed: No licenses generated when order is marked as done
- Fixed: No domain field in WooCommerce Checkout Blocks
**New files:**
- `src/Checkout/CheckoutBlocksIntegration.php` - WooCommerce Blocks checkout integration
- `src/Checkout/StoreApiExtension.php` - Store API extension for domain field handling
- `assets/js/checkout-blocks.js` - Frontend JavaScript for checkout block domain field
**Modified files:**
- `src/Plugin.php` - Added checkout blocks registration and multiple order status hooks
- `src/License/LicenseManager.php` - Fixed product type check in `generateLicense()`
**Technical notes:**
- Added support for WooCommerce Checkout Blocks (default since WC 8.3+)
- `CheckoutBlocksIntegration` implements `IntegrationInterface` for block checkout
- `StoreApiExtension` handles server-side domain data via Store API
- License generation now triggers on `completed`, `processing`, and `payment_complete` hooks
- Fixed `LicenseManager::generateLicense()` to properly check product type with `is_type()`
- Classic checkout (`woocommerce_after_order_notes`) still works for stores using classic checkout