php-commerce/Migrations
Snider c19e467735 security: add webhook idempotency and payment amount verification
Idempotency (replay attack protection):
- Add WebhookEvent model for tracking processed events
- Add webhook_events migration with unique constraint
- Add isAlreadyProcessed() to BTCPay and Stripe controllers
- Reject duplicate events with 200 response

Payment amount verification (BTCPay):
- Add verifyPaymentAmount() method
- Reject underpayments (mark order failed, create audit record)
- Reject currency mismatches
- Log overpayments for manual review
- Add 0.01 tolerance for floating point precision

Add comprehensive tests for both features.
Update TODO.md to mark P1 issues as fixed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:32:25 +00:00
..
0001_01_01_000001_create_commerce_tables.php monorepo sepration 2026-01-27 00:24:22 +00:00
0001_01_01_000002_create_credit_notes_table.php fix: remove FK constraints to non-existent orders/refunds tables 2026-01-28 17:23:48 +00:00
0001_01_01_000003_create_payment_methods_table.php monorepo sepration 2026-01-27 00:24:22 +00:00
2026_01_26_000000_create_usage_billing_tables.php fix: remove FK to non-existent invoice_items, shorten index names 2026-01-28 19:46:15 +00:00
2026_01_26_000001_create_exchange_rates_table.php monorepo sepration 2026-01-27 00:24:22 +00:00
2026_01_26_000001_create_referral_tables.php monorepo sepration 2026-01-27 00:24:22 +00:00
2026_01_29_000001_create_webhook_events_table.php security: add webhook idempotency and payment amount verification 2026-01-29 12:32:25 +00:00