# Changelog

All notable changes to AnimFX Store are documented here.

Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

---

## [Unreleased] - Development

### Added
- PayPal integration (Orders API v2 + webhook verification)
- Admin "Create User" feature with role selection (user/admin)
- Password policy: minimum 12 characters for admin-created accounts
- Comprehensive E2E test for PayPal (`tests/manual/_paypal_e2e_test.php`)
- Migration `2026-09-27-000001_AddPaypalSettings` for PayPal settings keys

### Fixed
- `Orders::pay()` — undefined `$productModel` variable causing fatal error on "Pay Now" for Paddle orders
- `Orders::index()` — now shows all users (including admins) with role badges

### Security
- PayPal webhook signature verification via `verify-webhook-signature` API
- PayPal cert URL host validation (`*.paypal.com` only)
- Idempotent capture confirmation (prevents duplicate order confirmation)

---

## [1.2.0] - 2026-09-22

### Added
- **Paddle Billing** integration (automatic card/global payments)
  - Catalog sync (auto-create product + price on first checkout)
  - `transaction.completed` webhook with Ed25519 verification
  - Sandbox/production toggle
- **Binance Pay** integration (USDT/crypto)
  - HMAC-SHA256 webhook verification
  - Testnet/production toggle
- Payment gateway abstraction in `PaymentGateway` library
- Admin settings for Paddle & Binance credentials
- Order detail page shows "Pay Now" for pending automatic orders
- Manual test script for Paddle (`tests/manual/_paddle_e2e_test.php`)

### Changed
- Orders table: added `payment_txn_id` column (migration `2026-09-21-000002`)
- Products table: added `paddle_price_id` column (migration `2026-09-22-000001`)

### Fixed
- Webhook idempotency for all gateways
- Currency/amount validation before order confirmation

---

## [1.1.0] - 2026-09-21

### Added
- Banners management (admin CRUD + hero carousel on homepage)
- Categories management (admin CRUD + slug-based URLs)
- Featured products toggle
- Product tags (JSON array)
- Download counter on products
- Free products (price = 0) with instant download
- Admin order export (CSV)

### Changed
- Homepage now shows hero banner + featured products
- Product listing supports category filter + search

---

## [1.0.0] - 2026-09-20

### Added
- Initial release: SVGA/Lottie/GIF/WebM marketplace
- User authentication (register, login, logout, profile)
- Shopping cart (session-based)
- Checkout with Bank Transfer (manual) + payment proof upload
- Admin panel:
  - Dashboard (stats, recent orders)
  - Products CRUD
  - Orders list/detail/confirm/reject
  - Users list/detail/toggle active
  - Settings (store branding, bank details, maintenance mode)
- Download system (secured, one-time links after payment)
- SQLite database with migrations
- MainSeeder (admin + demo user, sample products/categories)
- CSRF protection, bcrypt passwords, role-based access

---

## Versioning Policy

| Version | Meaning |
|---------|---------|
| **MAJOR** (X.0.0) | Breaking changes: DB schema incompatible, API changes, removed features |
| **MINOR** (1.X.0) | New features, backward-compatible, new payment gateways, admin modules |
| **PATCH** (1.2.X) | Bug fixes, security patches, config updates, documentation |

### Release Process
1. Update `CHANGELOG.md` with `[Unreleased]` → `[X.Y.Z] - YYYY-MM-DD`
2. Tag release: `git tag -a vX.Y.Z -m "Release vX.Y.Z"`
3. Deploy via CI/CD or manual process
4. Verify production health checks

---

## Upgrade Notes

### From 1.1.x → 1.2.0
- Run migrations: `php spark migrate --all`
- Configure Paddle/Binance in `/admin/settings`
- Update webhook URLs in provider dashboards

### From 1.2.x → 1.3.0 (Unreleased)
- Run migration: `php spark migrate --all` (adds PayPal settings)
- Configure PayPal in `/admin/settings`
- Update PayPal webhook URL in PayPal Developer dashboard

---

## Support Policy

| Version | Status | Supported Until |
|---------|--------|-----------------|
| 1.3.x (Current) | Active | 2027-09-27 |
| 1.2.x | Security only | 2026-12-31 |
| 1.1.x | EOL | 2026-09-30 |
| 1.0.x | EOL | 2026-09-30 |

EOL = End of Life (no more patches, upgrade recommended)

---

## Contributors

- Core development: [Your Name/Team]
- Payment integrations: Paddle, Binance, PayPal SDK references
- Testing: Manual E2E test framework

---

*For detailed commit history, see `git log --oneline --graph`*