Read-only mirror of the client's existing system as it stood before our work began. Taken from matthijsexpand@149.210.159.152 (TransIP VPS, Lelystad NL) with the client's written permission. Contents: - home-weddingcaketopper/ Next.js app, proxy.py, supabase schema - var-www/ static webroots for all three domains - etc-nginx/ vhost configs (previously unversioned, server-only) Excluded: node_modules (704M, regenerable), .next (17M, regenerable), and env file contents (present on local disk, gitignored — see README). Not our IP. Not covered by the proposal's assignment clause.
8 lines
709 B
TypeScript
8 lines
709 B
TypeScript
import { NextResponse } from 'next/server';
|
|
import { supabaseAdmin } from '@/lib/supabase';
|
|
export async function POST(req:Request){
|
|
const body=await req.json(); const sb=supabaseAdmin();
|
|
const items=body.notificationItems || [];
|
|
for(const item of items){ const n=item.NotificationRequestItem; if(n?.eventCode==='AUTHORISATION' && n?.success==='true'){ await sb.from('orders').update({payment_status:'paid',status:'paid'}).eq('id',n.merchantReference); await fetch(`${process.env.NEXT_PUBLIC_SITE_URL}/api/preview/generate`,{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({orderId:n.merchantReference})}); }}
|
|
return NextResponse.json({notificationResponse:'[accepted]'});
|
|
}
|