Files
Pay2Gateway/docs/update_schema_merchants.sql
mstfyldz 3562e10713 feat: implement merchant dashboard, secure auth, and short_id system
- Added dedicated merchant dashboard with analytics and transactions
- Implemented API Key based authentication for merchants
- Introduced 8-character Short IDs for merchants to use in URLs
- Refactored checkout and payment intent APIs to support multi-gateway
- Enhanced Landing Page with Merchant Portal access and marketing copy
- Fixed Next.js 15 async params build issues
- Updated internal branding to P2CGateway
- Added AyrisTech credits to footer
2026-01-20 21:58:41 +03:00

18 lines
637 B
SQL

-- Create merchants table
CREATE TABLE merchants (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
name TEXT NOT NULL,
api_key TEXT UNIQUE DEFAULT encode(gen_random_bytes(32), 'hex'),
webhook_url TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
-- Add merchant_id to transactions
ALTER TABLE transactions ADD COLUMN merchant_id UUID REFERENCES merchants(id);
-- Update RLS for transactions to support merchants (future proofing)
-- For now, we'll just keep the admin policy as is, but we'll add more later.
-- Optional: Add index for performance
CREATE INDEX idx_transactions_merchant_id ON transactions(merchant_id);