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
This commit is contained in:
17
docs/update_schema_merchants.sql
Normal file
17
docs/update_schema_merchants.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
-- 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);
|
||||
Reference in New Issue
Block a user