v3.1.0
Security hardening of the payment callback (the trust boundary that confirms payments). The consumer-facing API (MB, MBWay, CreditCard classes, traits, events) is unchanged.
Upgrade note: this release adds a migration. After updating, run php artisan migrate (publish migrations first if you publish them).
Security
- Redact the API key and customer PII from logs (was logging the full URL + payload in clear text).
- Strip the API key from the
CallbackReceivedevent payload. - Confirm payments atomically (DB transaction +
lockForUpdate) to prevent duplicate "paid" events under concurrent callbacks. - Constant-time API key comparison (
hash_equals) and per-IP rate limiting (throttle:60,1). - Optional callback IP allowlist via
EUPAGO_ALLOWED_IPS, off by default.
Changed
- Unknown payment methods now return HTTP
422instead of raising aValueError(500). - Callback input is type-validated; validation failures return a generic
422(previously a302redirect). - Callback route no longer registered in the
webmiddleware group.
Fixed
- Store MB Way amounts as
decimal(10,2)instead offloat(new migration).
Full changelog: https://github.com/digitaldev-lx/laravel-eupago/blob/master/CHANGELOG.md