# Changelog

All notable changes to this project will be documented in this file.
## [1.0.3] - 2025-12-22
### Added
- Admin setting: "Additional CSS for Payment Fields" (textarea) so merchants can inject scoped CSS for the AhaPay payment UI.
- Payment fields wrapper element (`.ahapay-payment-fields`) to scope custom CSS reliably.

### Changed
- Frontend now attaches the admin-provided CSS as inline styles to the `ahapaybuynowpaylater-block-style` stylesheet (strips surrounding `<style>` tags and skips empty input).
- Improved payment fields HTML output to avoid accidental literal newline characters and ensure markup is valid.
- Documentation: `README.md` updated with step-by-step instructions, a verification example CSS snippet, and troubleshooting tips for the Additional CSS feature.

### Fixed
- Hardened inline CSS handling to avoid malformed inline styles when administrators paste `<style>` tags.

## [1.0.2] - 2025-12-06
### Improved
- Update success and error page URLs to default to site URL if not set

## [1.0.1] - 2025-11-26

### Fixed
- Checkout styles not being applied for AhaPay UI (selectors: `ahapay-gateway-icon`, `ahapay-subtitle`, `ahapay-progress-bar`, `ahapay-timeline`) — ensured frontend stylesheet is enqueued correctly and markup selectors scoped so styles load on checkout.

## [Unreleased]

### Added
- Customizable label background and text color options
- Minimum order amount check and warning message
- Status check button on order page with UI status display
- New badge positioning options (top and bottom of product)
- Block enhancement with correct icon implementation

### Changed
- Updated default BNPL message
- Improved modal functionality and documentation
- Enhanced AhaPay styles and scripts
- Updated logo and transaction creation body
- Refined refund condition to check 'success' key in AhaPay response

### Improved
- Major code refactoring for better organization and maintainability
- Enhanced error handling in AhaPay Callback Handler
- Improved documentation across the codebase
- Integration of status handler with callback handling
- Better order filtering to show only AhaPay orders where relevant

### Fixed
- Value casting to integer for better type safety
- Callback handling and response processing
- Various code structure and organization improvements

### Technical
- Reorganized payment gateway code structure
- Enhanced class organization in class-ahapay-gateway.php
- Implemented various code review suggestions and improvements
