-- Step 3: API/idempotency + webhook audit fields
ALTER TABLE transactions
  ADD COLUMN idempotency_key VARCHAR(100) DEFAULT NULL AFTER transaction_id,
  ADD COLUMN provider_reference VARCHAR(150) DEFAULT NULL AFTER customer_reference,
  ADD COLUMN signature VARCHAR(128) DEFAULT NULL AFTER callback_url,
  ADD INDEX idx_tx_merchant_idempotency (merchant_id, idempotency_key),
  ADD INDEX idx_tx_provider_reference (provider_reference);
