# Changelog

## [Unreleased]

## [v1.0.3] - 2026-03-16

### Changed
- Full gateway implementation switched from Redsys to **Computop Paygate REST API v2.2.0**
- `Paygate::getPayload()` implemented: creates Computop checkout session via OAuth2 + REST POST, returns `paymentUrl`
- `Paygate::processResponse()` implemented: decodes JSON webhook body and verifies `X-Computop-Signature` HMAC-SHA-256
- `Paygate::getSecretKey()` implemented; `getDsKey()` retained as deprecated alias
- `Paygate::getApiUrl()` and `Paygate::getBasicAuthHeader()` added
- URL constants corrected: `SANDBOX_URL`, `PRODUCTION_URL`, `SANDBOX_OAUTH_URL`, `PRODUCTION_OAUTH_URL`
- `Payment::paygatecreate()` returns redirect URL for Computop hosted payment page
- `Payment::paygatepay()` handles Computop webhook (POST) and redirect (GET); checks `status === CAPTURED/AUTHORIZED`
- `Module.php` connection config updated to `merchant_id`, `api_key`, `client_id`, `client_secret`
- `PaymentsController::handleWebhook()` reads raw body + `X-Computop-Signature` header
- Settings UI and form labels updated for Computop credentials
- All documentation rewritten for Computop (README, SETTINGS, docs/*)

### Fixed
- Removed 309-line orphaned pre-`<?php` block from `Paygate.php`
- `getBasicAuthHeader()` no longer incorrectly prefixed with `'Authorization: '`
- `Module.php` no longer references undefined `Paygate::Ds_KEY`

### Added
- PHPUnit test suite under `tests/unit/`
- `docs/TEST_PLAN.md`, `docs/DEPLOYMENT.md`, `docs/SETTINGS.md`, `docs/computop/index.json`
- `.gitignore` updated

## [v1.0.2] - 2026-02-26

### Added
- Initial module scaffold with stub `Paygate.php`, `Payment.php`, `SettingsForm.php`
- Admin settings UI
- REST payment endpoints
