# Compliance Rewrite & Manual Payment Implementation Plan

> **For Claude:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.

**Goal:** Remove all telehealth/medical terminology from the platform, replace with "digital educational services focused on scientific and wellness information" language, replace Stripe/PayPal with Zelle/CashApp manual payment flow, add manual payment verification statuses via WooCommerce, and delete the HIPAA page.

**Architecture:** The existing Stripe/PayPal checkout components and API routes are replaced by a simple manual payment instructions flow. After the user fills contact + billing info and clicks "Submit Order," the frontend POSTs to a new `/api/submit-order` endpoint that updates the WooCommerce order with addresses, sets status to a custom `pending-screenshot` status, and returns a confirmation. The success page shows Zelle/CashApp payment instructions. WooCommerce custom order statuses (`pending-screenshot`, `payment-received`, `approved-for-fulfillment`, `rejected`) are registered via the existing WooCommerce REST API or manually in WP admin.

**Tech Stack:** Next.js 16, WooCommerce REST API, Zod validation, existing UI components (shadcn/ui)

---

## Task 1: Remove High-Risk Terminology from Layout Metadata

**Files:**
- Modify: `app/layout.tsx:16-20`

**Step 1: Update metadata**

Replace the metadata object:

```typescript
export const metadata: Metadata = {
  title: "Factor Sciences - Digital Educational Services",
  description: "Digital educational services focused on scientific and wellness information. Access curated resources and professional guidance delivered entirely online.",
  generator: "v0.app",
  keywords: ["digital education", "wellness information", "scientific resources", "online services", "professional guidance"],
  // ... icons stay the same
}
```

**Step 2: Verify build compiles**

Run: `npx next build` (or just check for TypeScript errors)

**Step 3: Commit**

```bash
git add app/layout.tsx
git commit -m "fix(compliance): remove telehealth terms from layout metadata"
```

---

## Task 2: Rewrite Homepage (`app/page.tsx`) — Full Content Replacement

**Files:**
- Modify: `app/page.tsx` (entire file — all sections)

**Overview of all changes needed in this file:**

### 2a: Header & Hero Section (lines 27-98)

Replace:
- `"Professional Digital Healthcare Services"` → `"Professional Digital Educational Services"`
- `"Expert Consultations. Digital Access. Professional Care."` → `"Expert Resources. Digital Access. Professional Guidance."`
- `"Factor Sciences provides digital telehealth consultations and informational wellness services through licensed professionals."` → `"Factor Sciences provides digital educational services focused on scientific and wellness information through qualified professionals."`
- `"We operate exclusively online. No physical products are sold. No medications or prescriptions are dispensed."` → `"We operate exclusively online. All services are digital and informational in nature. No physical products are sold."`

### 2b: About Section (lines 100-137)

Replace:
- `"A professional platform for digital healthcare services"` → `"A professional platform for digital educational services"`
- `"Factor Sciences is a digital platform that connects individuals with licensed healthcare professionals for consultative and informational services."` → `"Factor Sciences is a digital platform that provides educational services focused on scientific and wellness information."`
- Remove: `"We do not provide medications, prescriptions, injectables, peptides, compounds, or any medical goods. Our services are strictly consultative, educational, and administrative in nature."` → `"We do not sell or ship physical products of any kind. Our services are strictly educational, informational, and administrative in nature."`
- `"professional consultations, educational resources"` → `"educational resources, informational content"`

### 2c: Services Section — Rewrite All 6 Cards (lines 142-235)

Replace the 6 service cards with these new titles and descriptions:

1. **"Digital Learning Sessions"** — `"Live virtual sessions with qualified professionals delivering scientific and wellness educational content"`
2. **"Educational Wellness Resources"** — `"Access to curated educational materials focused on scientific and wellness information"` (keep as-is, already compliant)
3. **"Documentation Review Services"** — `"Professional review and administrative support for documentation and records"` (remove "health-related")
4. **"Administrative Coordination"** — `"Scheduling, intake coordination, and administrative support services"` (keep as-is, already compliant)
5. **"Client Onboarding Services"** — `"Comprehensive intake and onboarding process management for new clients"` (keep as-is, already compliant)
6. **"Professional Guidance Sessions"** — `"One-time or recurring sessions with qualified specialists focused on educational content"`

Replace bottom disclaimer: `"All services are digital and non-physical. No products, medications, or medical goods are sold or shipped."` → `"All services are digital and non-physical. No physical products are sold or shipped."`

### 2d: Process Section (lines 239-347)

Replace step 2:
- `"Payment is collected securely at checkout through our encrypted payment processor. Charges occur immediately upon service purchase."` → `"Submit your order and complete payment via Zelle or CashApp. Your order is confirmed once payment is verified by our team."`

Replace step 3:
- `"Upon successful payment, you receive immediate access to schedule your consultation, access educational materials, or coordinate services with our team."` → `"Once payment is verified, you receive access to your educational materials, schedule sessions, or coordinate services with our team."`

Replace step 4:
- `"All services are delivered digitally through secure video consultations, online portals, or electronic document delivery. No physical shipping or product fulfillment occurs."` → `"All services are delivered digitally through online portals, video sessions, or electronic document delivery. No physical shipping or product fulfillment occurs."`

Replace "Payment and Service Confirmation" bullets:
- `"All charges are processed at checkout before service access is granted"` → `"Payment is submitted via Zelle or CashApp and verified by our team"`
- Keep: `"Services are non-physical and delivered entirely through digital means"`
- Keep: `"No shipping addresses required as no physical products are involved"`
- Keep: `"Service delivery timelines are communicated during the booking process"`

### 2e: Compliance Section (lines 352-457)

Replace "Service Nature and Limitations" card:
- `"Factor Sciences provides informational, educational, and consultative services only. Our platform facilitates access to licensed healthcare professionals for consultation purposes."` → `"Factor Sciences provides informational and educational services only. Our platform delivers digital educational content focused on scientific and wellness information."`
- Remove bullet: `"We do not diagnose, treat, cure, or prevent any medical conditions"`
- Remove bullet: `"We do not sell, dispense, or ship medications, prescriptions, or pharmaceutical products"`
- Remove bullet: `"We do not provide injectables, peptides, compounds, or any physical medical goods"`
- Remove bullet: `"We do not replace or substitute for in-person medical care from your physician"`
- Add new bullets:
  - `"Our services are educational and informational in nature"`
  - `"We do not sell or ship physical products of any kind"`
  - `"Content is provided for general informational purposes only"`
  - `"Individual results and experiences may vary"`

Replace "Professional Medical Advice" card → rename to **"Important Disclaimer"**:
- `"Information provided through Factor Sciences is for educational and informational purposes only. While our platform connects you with licensed healthcare professionals, you should always consult your primary care physician or qualified healthcare provider before making any healthcare decisions, starting new treatments, or changing existing treatment plans."` → `"Information provided through Factor Sciences is for educational and informational purposes only. Content is focused on scientific and wellness information and should not be considered professional advice. Always consult qualified professionals for decisions specific to your individual circumstances."`

Replace "Regulatory Compliance" card:
- `"Factor Sciences operates in compliance with applicable telehealth and healthcare service regulations. All licensed providers operating through our platform maintain current, valid licenses in their respective jurisdictions. Our payment processing is conducted through secure, PCI-compliant systems with appropriate regulatory oversight."` → `"Factor Sciences operates in compliance with applicable digital services regulations. Our platform maintains appropriate security measures and data protection practices. Payment processing is handled securely with appropriate oversight."`

Replace "No Medical Claims or Guarantees" card → rename to **"No Guarantees"**:
- `"Factor Sciences makes no claims, promises, or guarantees regarding medical outcomes, health improvements, treatment results, or therapeutic benefits. Our services are consultative and informational in nature."` → `"Factor Sciences makes no claims, promises, or guarantees regarding specific outcomes or results. Our services are educational and informational in nature."`
- `"Individual results may vary. Consultations with healthcare providers do not guarantee specific outcomes or medical solutions."` → `"Individual results may vary. Educational content does not guarantee specific outcomes."`

### 2f: Privacy Section (lines 461-539)

Replace "HIPAA-Aligned Practices" heading → **"Security Practices"**:
- Remove `"Our platform employs security practices aligned with HIPAA standards for protecting health information, including:"` → `"Our platform employs industry-standard security practices for protecting your information, including:"`
- Keep all 4 security bullets as-is (they're generic enough)

Replace "Data Privacy Commitment":
- `"all personal and health-related information"` → `"all personal information"`

### 2g: Contact Section (lines 543-626)

Replace:
- `"Digital Telehealth Services Platform"` → `"Digital Educational Services Platform"`
- `"For urgent medical matters, please contact your primary care physician or local emergency services immediately."` → Remove this sentence entirely.

### 2h: Footer (lines 628-710)

Replace:
- `"Professional digital telehealth services platform providing consultative and informational healthcare services. No physical products sold."` → `"Professional digital educational services platform providing scientific and wellness information. No physical products sold."`
- Remove HIPAA Notice link from footer navigation (line 663-666)
- `"This platform provides informational services only. Not a substitute for professional medical advice. No medications or physical products sold."` → `"This platform provides educational and informational services only. No physical products sold."`

### 2i: Clean up imports

Remove unused imports if any icons are no longer used after the rewrite (e.g., `HeartPulse` if no longer referenced).

**Step: Commit**

```bash
git add app/page.tsx
git commit -m "fix(compliance): rewrite homepage - remove all telehealth/medical terminology"
```

---

## Task 3: Rewrite Terms of Service (`app/terms/page.tsx`)

**Files:**
- Modify: `app/terms/page.tsx`

**Changes:**

1. **Metadata (line 8-10):** `"Terms and conditions for using Factor Sciences digital telehealth services platform"` → `"Terms and conditions for using Factor Sciences digital educational services platform"`

2. **Section 2 - Description of Services (lines 63-94):**
   - `"Digital telehealth consultations with licensed healthcare professionals"` → `"Digital educational sessions focused on scientific and wellness information"`
   - `"Client onboarding and professional consultation sessions"` → `"Client onboarding and professional guidance sessions"`
   - Important Notice: `"We do not sell, ship, or dispense medications, prescriptions, injectables, peptides, compounds, or any physical medical goods."` → `"We do not sell or ship physical products of any kind. All services are digital and informational."`

3. **Section 4 - Payment Terms (lines 126-145):**
   - `"We accept major credit cards and other payment methods"` → `"We accept payment via Zelle and CashApp"`
   - `"All transactions are processed through secure, PCI-compliant payment processors."` → `"All payments are manually verified by our team before orders are fulfilled."`

4. **Section 5 - Service Limitations (lines 149-181):**
   - Remove all medical-specific disclaimers (diagnose, treat, cure, medications, prescriptions, injectables, peptides)
   - Replace with:
     - `"Our services are educational and informational in nature"`
     - `"We do not sell or ship physical products of any kind"`
     - `"No guarantees are made regarding specific outcomes or results"`
     - `"Content is for general informational purposes only"`
   - `"All information and services provided are for educational and informational purposes only. You should always consult your primary care physician or qualified healthcare provider before making healthcare decisions."` → `"All information and services provided are for educational and informational purposes only. Always consult qualified professionals for decisions specific to your circumstances."`

5. **Section 6 - User Responsibilities (lines 186-213):**
   - `"Comply with all applicable healthcare privacy laws"` → `"Comply with all applicable laws and regulations"`

6. **Section 8 - Privacy and Data Protection (lines 232-241):**
   - `"We implement security practices aligned with HIPAA standards for protecting health information."` → `"We implement industry-standard security practices for protecting your information."`

7. **Footer Navigation (lines 320-335):** Remove HIPAA Notice link

**Commit:**
```bash
git add app/terms/page.tsx
git commit -m "fix(compliance): rewrite terms of service - remove telehealth terminology"
```

---

## Task 4: Rewrite Privacy Policy (`app/privacy/page.tsx`)

**Files:**
- Modify: `app/privacy/page.tsx`

**Changes:**

1. **Metadata (line 9):** `"Privacy policy and data protection practices for Factor Sciences digital telehealth platform"` → `"Privacy policy and data protection practices for Factor Sciences digital educational services platform"`

2. **Introduction (lines 49-59):**
   - `"digital telehealth services platform"` → `"digital educational services platform"`

3. **Section 1.2 Health Information (lines 91-112):** Rename to **"Service Information"**
   - `"In connection with consultative services, we may collect:"` → `"In connection with our services, we may collect:"`
   - Remove `"Medical history, current health conditions, and wellness goals"` → `"Information related to your service preferences and goals"`
   - `"Information shared during telehealth consultations with healthcare professionals"` → `"Information shared during educational sessions with professionals"`
   - `"Health-related documentation you upload or share with providers"` → `"Documentation you upload or share with our team"`
   - `"Notes and records created by healthcare professionals during consultations"` → `"Notes and records created during sessions"`

4. **Section 2 - How We Use (lines 140-175):**
   - `"To provide telehealth consultations, administrative services, and access to educational resources"` → `"To provide educational services, administrative support, and access to informational resources"`

5. **Section 3.1 Healthcare Providers (lines 187-191):** Rename to **"Service Providers"**
   - `"Your health information is shared with licensed healthcare professionals who provide consultative services through our Platform. These providers are bound by professional confidentiality obligations and HIPAA standards."` → `"Your information may be shared with qualified professionals who provide educational services through our Platform. These providers are bound by confidentiality obligations."`

6. **Section 3.2 Service Providers (lines 193-218):**
   - Keep mostly as-is, but change: `"Payment processing (e.g., Stripe, payment gateway providers)"` → `"Payment processing and verification services"`

7. **Section 4 - Data Security (lines 246-282):**
   - `"aligned with HIPAA security standards"` → `"following industry best practices"`

8. **Section 5 - Data Retention (lines 286-311):**
   - `"Medical Records: Health information may be retained according to applicable healthcare record retention laws (typically 7-10 years)"` → `"Service Records: Information related to services may be retained for reasonable periods as required by applicable regulations"`

9. **Section 11 - Contact (lines 431-444):**
   - Remove `"100 Healthcare Plaza, Suite 200"` → use `"Sheridan, Wyoming"` (match homepage)

10. **Footer Navigation:** Remove HIPAA Notice link

**Commit:**
```bash
git add app/privacy/page.tsx
git commit -m "fix(compliance): rewrite privacy policy - remove telehealth/HIPAA terminology"
```

---

## Task 5: Rewrite Refund Policy (`app/refund/page.tsx`)

**Files:**
- Modify: `app/refund/page.tsx`

**Changes:**

1. **Metadata (line 9):** `"Refund and cancellation policy for Factor Sciences digital telehealth services"` → `"Refund and cancellation policy for Factor Sciences digital educational services"`

2. **Overview (lines 49-63):**
   - `"digital telehealth platform"` → `"digital educational services platform"`
   - `"All payments are processed immediately at the time of purchase."` → `"All orders require payment verification before fulfillment. Payments are submitted via Zelle or CashApp."`

3. **Section 1 (lines 67-98):**
   - `"telehealth consultations, educational resources, and administrative support"` → `"educational sessions, informational resources, and administrative support"`
   - `"One-Time Consultations: Single telehealth consultation sessions"` → `"One-Time Sessions: Single educational sessions"`
   - `"Service Packages: Bundles of multiple consultations or services"` → `"Service Packages: Bundles of multiple sessions or services"`

4. **Section 2.1 - Pre-Service (lines 103-127):**
   - `"scheduled consultation"` → `"scheduled session"`

5. **Section 2.2 - Late Cancellations (lines 129-146):**
   - `"scheduled consultation"` → `"scheduled session"`

6. **Section 2.3 - Post-Service (lines 148-169):**
   - `"Dissatisfaction with consultation outcomes, medical advice, or health-related recommendations is not grounds for a refund"` → `"Dissatisfaction with session content or educational recommendations is not grounds for a refund"`
   - `"as consultations are informational and educational in nature"` → `"as sessions are informational and educational in nature"`

7. **Section 3 (lines 174-213):**
   - `"consultations"` → `"sessions"` throughout

8. **Section 4 (lines 217-237):**
   - `"3 Consultation Package"` → `"3 Session Package"`
   - `"consultations"` → `"sessions"`

9. **Section 5 (lines 241-269):**
   - `"Completed consultations where the service was delivered in full"` → `"Completed sessions where the service was delivered in full"`
   - `"Services rendered by third-party healthcare providers through our platform"` → `"Services rendered by third-party providers through our platform"`

10. **Footer Navigation:** Remove HIPAA Notice link

**Commit:**
```bash
git add app/refund/page.tsx
git commit -m "fix(compliance): rewrite refund policy - remove telehealth terminology"
```

---

## Task 6: Delete HIPAA Page & Remove All References

**Files:**
- Delete: `app/hipaa/page.tsx`
- Modify: `app/page.tsx` (already done in Task 2 — footer link removed)
- Modify: `app/terms/page.tsx` (already done in Task 3 — footer link removed)
- Modify: `app/privacy/page.tsx` (already done in Task 4 — footer link removed)
- Modify: `app/refund/page.tsx` (already done in Task 5 — footer link removed)

**Step 1: Delete the HIPAA page**

```bash
rm app/hipaa/page.tsx
```

If the `app/hipaa/` directory is now empty, remove it too:
```bash
rmdir app/hipaa
```

**Step 2: Search for any remaining references**

```bash
grep -r "hipaa\|HIPAA" --include="*.tsx" --include="*.ts" --include="*.json" .
```

Fix any remaining references found.

**Step 3: Commit**

```bash
git add -A
git commit -m "fix(compliance): delete HIPAA page and remove all references"
```

---

## Task 7: Add `PAYMENT_PROVIDER=manual` to Environment Configuration

**Files:**
- Modify: `lib/env.ts:10-12`
- Modify: `.env.example`

**Step 1: Update env schema**

In `lib/env.ts`, add `"manual"` to the payment provider enum:

```typescript
PAYMENT_PROVIDER: z.enum(["stripe", "paypal", "manual"]).default("manual"),
NEXT_PUBLIC_PAYMENT_PROVIDER: z.enum(["stripe", "paypal", "manual"]).default("manual"),
```

Add new env vars for manual payment:

```typescript
// Manual Payment Configuration (required when PAYMENT_PROVIDER=manual)
ZELLE_EMAIL: z.string().email().optional(),
CASHAPP_LINK: z.string().url().optional(),
SUPPORT_EMAIL: z.string().email().optional(),
```

In the `.superRefine()`, add validation for manual provider:

```typescript
if (data.PAYMENT_PROVIDER === "manual") {
  if (!data.ZELLE_EMAIL) {
    ctx.addIssue({
      code: z.ZodIssueCode.custom,
      message: "Zelle email is required for manual payment",
      path: ["ZELLE_EMAIL"],
    })
  }
  if (!data.CASHAPP_LINK) {
    ctx.addIssue({
      code: z.ZodIssueCode.custom,
      message: "CashApp link is required for manual payment",
      path: ["CASHAPP_LINK"],
    })
  }
}
```

**Step 2: Update .env.example**

Add to `.env.example`:

```env
# Payment Provider Selection
PAYMENT_PROVIDER=manual  # "stripe", "paypal", or "manual"
NEXT_PUBLIC_PAYMENT_PROVIDER=manual

# Manual Payment (required if PAYMENT_PROVIDER=manual)
ZELLE_EMAIL=factorsciencesfp@gmail.com
CASHAPP_LINK=https://cash.app/$FSnorthvaleGroup
SUPPORT_EMAIL=support@factorsciences.com
```

**Step 3: Commit**

```bash
git add lib/env.ts .env.example
git commit -m "feat: add manual payment provider to env configuration"
```

---

## Task 8: Create `/api/submit-order` API Route

**Files:**
- Create: `app/api/submit-order/route.ts`

This endpoint replaces `/api/payment-intent` for manual payment flow. It:
1. Validates the token
2. Fetches the WooCommerce order
3. Updates order with billing/shipping/contact info
4. Sets order status to `pending` (WooCommerce's built-in pending status — we use meta_data for our custom sub-statuses)
5. Returns order confirmation data

**Step 1: Create the route**

```typescript
/**
 * POST /api/submit-order
 * Submit order for manual payment verification (Zelle/CashApp)
 */

import { type NextRequest, NextResponse } from "next/server"
import { WooCommerce } from "@/lib/woo"
import { logger } from "@/lib/logger"
import { RateLimit, getClientIp } from "@/lib/rate-limit"
import { verifyCheckoutToken, validateOrigin } from "@/lib/security"
import { z } from "zod"

const rateLimiter = new RateLimit(10, 60000)

const submitOrderSchema = z.object({
  token: z.string().min(1),
  billing_address: z.object({
    first_name: z.string().min(1),
    last_name: z.string().min(1),
    address_1: z.string().min(1),
    city: z.string().min(1),
    state: z.string().min(1),
    postcode: z.string().min(1),
    country: z.string().min(1),
    address_2: z.string().optional(),
  }),
  shipping_address: z.object({
    first_name: z.string().min(1),
    last_name: z.string().min(1),
    address_1: z.string().min(1),
    city: z.string().min(1),
    state: z.string().min(1),
    postcode: z.string().min(1),
    country: z.string().min(1),
    address_2: z.string().optional(),
  }).nullable(),
  contact_info: z.object({
    email: z.string().email(),
    phone: z.string().min(1),
  }).optional(),
})

export async function POST(request: NextRequest) {
  try {
    // Rate limit
    const clientIp = getClientIp(request)
    const rateLimit = rateLimiter.check(clientIp)
    if (!rateLimit.allowed) {
      return NextResponse.json({ error: { message: "Too many requests" } }, { status: 429 })
    }

    // Validate origin
    const originError = validateOrigin(request)
    if (originError) {
      return NextResponse.json({ error: { message: originError } }, { status: 403 })
    }

    // Parse and validate body
    const body = await request.json()
    const parsed = submitOrderSchema.safeParse(body)
    if (!parsed.success) {
      return NextResponse.json({
        success: false,
        error: { message: "Invalid request", details: parsed.error.flatten() },
      }, { status: 400 })
    }

    const { token, billing_address, shipping_address, contact_info } = parsed.data

    // Verify token
    const tokenData = verifyCheckoutToken(token)
    if (!tokenData) {
      return NextResponse.json({
        success: false,
        error: { message: "Invalid or expired checkout token" },
      }, { status: 401 })
    }

    const orderId = tokenData.orderId

    // Fetch order
    const order = await WooCommerce.getOrder(orderId)

    // Verify order can still be paid
    if (!WooCommerce.canBePaid(order)) {
      return NextResponse.json({
        success: false,
        error: { message: "This order cannot be submitted for payment" },
      }, { status: 400 })
    }

    // Compute the effective shipping address
    const effectiveShipping = shipping_address || {
      first_name: billing_address.first_name,
      last_name: billing_address.last_name,
      address_1: billing_address.address_1,
      address_2: billing_address.address_2 || "",
      city: billing_address.city,
      state: billing_address.state,
      postcode: billing_address.postcode,
      country: billing_address.country,
    }

    // Update WooCommerce order
    await WooCommerce.updateOrder(orderId, {
      status: "pending",
      billing: {
        ...billing_address,
        email: contact_info?.email || order.billing?.email || "",
        phone: contact_info?.phone || order.billing?.phone || "",
      },
      shipping: effectiveShipping,
      meta_data: [
        ...order.meta_data,
        {
          key: "_payment_method",
          value: "manual",
        },
        {
          key: "_payment_method_title",
          value: "Zelle / CashApp",
        },
        {
          key: "_manual_payment_status",
          value: "pending-screenshot",
        },
        {
          key: "_order_submitted_at",
          value: new Date().toISOString(),
        },
        {
          key: "_checkout_address_updated",
          value: new Date().toISOString(),
        },
      ],
      customer_note: "Order submitted. Awaiting manual payment via Zelle or CashApp.",
    })

    // Get normalized order for total
    const normalizedOrder = WooCommerce.normalize(order)

    logger.info("v0", "Manual order submitted", {
      orderId,
      total_cents: normalizedOrder.total_cents,
    })

    return NextResponse.json({
      success: true,
      order_id: orderId,
      total: normalizedOrder.total_cents,
      currency: normalizedOrder.currency,
    })
  } catch (error) {
    logger.error("v0", "Submit order error", {
      error: error instanceof Error ? error.message : "Unknown error",
    })
    return NextResponse.json({
      success: false,
      error: { message: error instanceof Error ? error.message : "Failed to submit order" },
    }, { status: 500 })
  }
}
```

**Step 2: Commit**

```bash
git add app/api/submit-order/route.ts
git commit -m "feat: add /api/submit-order endpoint for manual payment flow"
```

---

## Task 9: Rewrite Checkout Page for Manual Payment Flow

**Files:**
- Modify: `components/checkout-page.tsx` (major rewrite)

**Overview:** Remove all Stripe and PayPal components/logic. Replace with a simple flow:
1. User fills contact info + billing address
2. User clicks "Submit Order"
3. POST to `/api/submit-order`
4. On success, redirect to `/success?token={token}` which shows payment instructions

**Step 1: Rewrite the component**

Remove:
- All Stripe imports (`Elements`, `@stripe/react-stripe-js`, `getStripe`, `getStripeAppearance`, `useStripePayment`)
- All PayPal imports (`PayPalScriptProvider`)
- `CheckoutFormWithStripe` component (lines 27-184)
- `CheckoutFormWithPayPal` component (lines 187-306)
- All Stripe/PayPal state variables (`clientSecret`, `paypalOrderId`, `isCreatingIntent`)
- `PAYMENT_PROVIDER` and `PAYPAL_CLIENT_ID` constants

Add:
- A simple `handleSubmitOrder` function that POSTs to `/api/submit-order`
- On success: redirect to `/success?token={token}`

The new checkout page structure:

```typescript
"use client"

import { useState, useCallback } from "react"
import { CheckoutHeader } from "@/components/checkout-header"
import { ContactInformation } from "@/components/contact-information"
import { BillingAddress } from "@/components/billing-address"
import { ShippingAddress } from "@/components/shipping-address"
import { OrderSummary } from "@/components/order-summary"
import { Button } from "@/components/ui/button"
import { Card } from "@/components/ui/card"
import { useCheckoutData } from "@/hooks/use-checkout-data"
import { ArrowRight, Loader2, Send } from "lucide-react"
import { toast } from "sonner"
import type { ContactInformation as ContactInfoType, BillingAddress as BillingAddressType, ShippingAddress as ShippingAddressType } from "@/lib/types/checkout"

export default function CheckoutPage() {
  const [shippingSameAsBilling, setShippingSameAsBilling] = useState(true)
  const { orderData, isLoading, error, token } = useCheckoutData()

  const [contactInfo, setContactInfo] = useState<ContactInfoType | null>(null)
  const [billingAddress, setBillingAddress] = useState<BillingAddressType | null>(null)
  const [shippingAddress, setShippingAddress] = useState<ShippingAddressType | null>(null)
  const [isSubmitting, setIsSubmitting] = useState(false)

  const canSubmit = contactInfo && billingAddress && (shippingSameAsBilling || shippingAddress) && !isSubmitting

  const handleSubmitOrder = useCallback(async () => {
    if (!token || !billingAddress || !contactInfo) return

    try {
      setIsSubmitting(true)

      const response = await fetch("/api/submit-order", {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({
          token,
          billing_address: billingAddress,
          shipping_address: shippingSameAsBilling ? null : shippingAddress,
          contact_info: contactInfo,
        }),
      })

      const data = await response.json()

      if (!response.ok || !data.success) {
        throw new Error(data.error?.message || "Failed to submit order")
      }

      // Redirect to success page with payment instructions
      window.location.href = `/success?token=${token}`
    } catch (err) {
      console.error("[v0] Failed to submit order:", err)
      toast.error(err instanceof Error ? err.message : "Failed to submit order")
    } finally {
      setIsSubmitting(false)
    }
  }, [token, billingAddress, shippingAddress, shippingSameAsBilling, contactInfo])

  if (error) {
    return (
      <div className="min-h-screen bg-texture flex items-center justify-center">
        <div className="max-w-md mx-auto p-6 text-center">
          <div className="inline-flex h-16 w-16 items-center justify-center rounded-full bg-destructive/10 mb-4">
            <svg className="h-8 w-8 text-destructive" fill="none" stroke="currentColor" viewBox="0 0 24 24">
              <path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
            </svg>
          </div>
          <h1 className="text-2xl font-bold text-foreground mb-2">Unable to Load Checkout</h1>
          <p className="text-muted-foreground">{error}</p>
        </div>
      </div>
    )
  }

  return (
    <div className="min-h-screen bg-texture">
      <CheckoutHeader />

      <div className="mx-auto max-w-[1400px] px-6 pt-16 pb-12 lg:px-12">
        <div className="max-w-3xl">
          <h1 className="text-5xl font-bold tracking-tight text-foreground lg:text-6xl">Complete Your Order</h1>
          <p className="mt-6 text-xl text-muted-foreground leading-relaxed">
            Fill in your details below, then submit your order. Payment instructions will be provided after submission.
          </p>
        </div>
      </div>

      <div className="mx-auto max-w-[1400px] px-6 pb-24 lg:px-12">
        <div className="flex flex-col gap-8 lg:flex-row lg:gap-12">
          <div className="flex-1 lg:max-w-[60%] space-y-8">
            <ContactInformation
              onChange={setContactInfo}
              defaultValues={orderData ? { email: orderData.email } : undefined}
              orderId={orderData?.id}
            />

            <div className="space-y-8">
              <BillingAddress onChange={setBillingAddress} />
              <ShippingAddress
                shippingSameAsBilling={shippingSameAsBilling}
                setShippingSameAsBilling={setShippingSameAsBilling}
                onChange={setShippingAddress}
              />
            </div>

            {/* Submit Order Button */}
            <div className="pt-8">
              <Card className="p-10 shadow-elevated border-primary/20 bg-gradient-to-br from-card to-card/50">
                <div className="mb-6">
                  <h2 className="text-2xl font-bold text-foreground tracking-tight mb-2">Payment Method</h2>
                  <p className="text-sm text-muted-foreground">
                    After submitting your order, you will receive instructions to pay via Zelle or CashApp. Your order will be processed once payment is verified.
                  </p>
                </div>

                <div className="space-y-4 mb-8">
                  <div className="flex items-center gap-3 p-4 rounded-lg bg-muted/50 border border-border">
                    <div className="h-10 w-10 rounded-lg bg-primary/15 flex items-center justify-center font-bold text-primary text-sm">Z</div>
                    <div>
                      <p className="text-sm font-medium text-foreground">Zelle</p>
                      <p className="text-xs text-muted-foreground">Send to: factorsciencesfp@gmail.com</p>
                    </div>
                  </div>
                  <div className="flex items-center gap-3 p-4 rounded-lg bg-muted/50 border border-border">
                    <div className="h-10 w-10 rounded-lg bg-green-500/15 flex items-center justify-center font-bold text-green-600 text-sm">$</div>
                    <div>
                      <p className="text-sm font-medium text-foreground">CashApp (Alternative)</p>
                      <p className="text-xs text-muted-foreground">$FSnorthvaleGroup</p>
                    </div>
                  </div>
                </div>

                <Button
                  size="lg"
                  className="w-full h-16 text-lg font-medium shadow-elevated hover:shadow-float transition-all duration-300 group"
                  onClick={handleSubmitOrder}
                  disabled={!canSubmit}
                >
                  {isSubmitting ? (
                    <>
                      <Loader2 className="mr-3 h-5 w-5 animate-spin" />
                      Submitting Order...
                    </>
                  ) : (
                    <>
                      <Send className="mr-3 h-5 w-5" />
                      Submit Order
                      <ArrowRight className="ml-3 h-5 w-5 group-hover:translate-x-1 transition-transform" />
                    </>
                  )}
                </Button>

                {!canSubmit && !isSubmitting && (
                  <p className="mt-4 text-center text-sm text-muted-foreground">
                    Please complete all required fields above
                  </p>
                )}
              </Card>
            </div>
          </div>

          <div className="lg:sticky lg:top-24 lg:self-start lg:max-w-[40%] flex-shrink-0 w-full">
            <OrderSummary orderData={orderData} isLoading={isLoading} error={error} />
          </div>
        </div>
      </div>
    </div>
  )
}
```

**Step 2: Commit**

```bash
git add components/checkout-page.tsx
git commit -m "feat: rewrite checkout for manual Zelle/CashApp payment flow"
```

---

## Task 10: Rewrite Success Page with Payment Instructions

**Files:**
- Modify: `app/success/page.tsx`

**Overview:** Replace the Stripe-specific success page (which polls for payment confirmation) with a page that:
1. Shows the order was submitted successfully
2. Displays clear Zelle and CashApp payment instructions
3. Shows the exact amount to pay
4. Explains the verification process
5. No auto-redirect (user needs to read instructions)

**Step 1: Rewrite the component**

Replace the entire `SuccessContent` component. Key changes:
- Remove `OrderStatusPolling` dependency
- Remove countdown/redirect logic
- Fetch order data from `/api/checkout-session?token={token}` to get the total
- Display payment instructions prominently

The new success page shows:
1. "Order Submitted!" header with order number
2. Prominent Zelle instructions card with:
   - Zelle email: `factorsciencesfp@gmail.com`
   - Requirements: exact order total, full name, order number in memo
3. CashApp alternative card with clickable link: `https://cash.app/$FSnorthvaleGroup`
4. "Send Screenshot" section explaining to email screenshot to support@factorsciences.com
5. "What Happens Next?" section:
   - Your order status is: Pending Payment Verification
   - Once we verify your payment, your order will be processed
   - You will receive an email confirmation when approved
6. Support contact info

**Step 2: Commit**

```bash
git add app/success/page.tsx
git commit -m "feat: rewrite success page with Zelle/CashApp payment instructions"
```

---

## Task 11: Update Payment-Failed Page

**Files:**
- Modify: `app/payment-failed/page.tsx`

**Overview:** Simplify since there's no card-specific failure. Change messaging to focus on order submission issues rather than card declines.

Replace card-specific "Common Solutions" with:
- "Try submitting your order again"
- "Check that all required fields are filled in correctly"
- "Contact support if the problem persists"

Remove references to "card details", "bank", "payment method".

**Commit:**
```bash
git add app/payment-failed/page.tsx
git commit -m "fix: update payment-failed page for manual payment flow"
```

---

## Task 12: Update/Remove Payment-Specific Components

**Files:**
- Modify: `components/payment-section.tsx` — Remove entirely or gut it (no longer needed)
- Keep: `components/stripe-payment-form.tsx` — Leave in codebase but unused (in case Stripe is re-enabled)
- Keep: `components/paypal-payment-form.tsx` — Leave in codebase but unused

Since `payment-section.tsx` is no longer imported by the new checkout page, it becomes dead code. Leave the file but it won't be imported anywhere.

No code changes needed — the checkout page rewrite in Task 9 already removes the import.

**Commit:** (skip — no changes needed)

---

## Task 13: Clean Up Hooks

**Files:**
- Keep: `hooks/use-checkout-data.ts` (still needed to fetch order data)
- Keep: `hooks/use-stripe-payment.ts` (unused but leave for potential re-enablement)

The new checkout page only imports `useCheckoutData`. The Stripe payment hook is no longer imported but doesn't need deletion.

**Commit:** (skip — no changes needed)

---

## Task 14: Verify WooCommerce Custom Order Status Workflow

**Files:** No code changes — this is a WooCommerce admin configuration task.

**Documentation for the user:**

The manual payment workflow uses WooCommerce's existing statuses plus custom metadata:

| WooCommerce Status | Custom Meta `_manual_payment_status` | Meaning |
|---|---|---|
| `pending` | `pending-screenshot` | Order submitted, awaiting payment |
| `pending` | `payment-received` | Screenshot received, admin reviewing |
| `processing` | `approved-for-fulfillment` | Payment verified, ready to fulfill |
| `cancelled` | `rejected` | Payment rejected or order cancelled |

**Why metadata instead of custom WC statuses:**
- Custom WooCommerce statuses require PHP plugin code in WordPress
- Using metadata on existing statuses works without WP plugin changes
- Admin can filter/search orders by `_manual_payment_status` meta field in WooCommerce

**Admin workflow in WooCommerce dashboard:**
1. Customer submits order → status: `pending`, meta: `pending-screenshot`
2. Customer sends screenshot → Admin updates meta to `payment-received`
3. Admin verifies payment → Admin changes order to `processing`, meta to `approved-for-fulfillment`
4. If rejected → Admin changes order to `cancelled`, meta to `rejected`

**Commit:** (documentation only — no code)

---

## Task 15: Final Sweep — Search for Remaining Flagged Terms

**Step 1: Search entire codebase for remaining flagged terms**

```bash
grep -ri "telehealth\|consultation\|consultant\|medical consultation\|healthcare professional\|licensed professional\|healthcare provider\|medical advice\|HIPAA\|hipaa\|PHI\|treatment plan\|diagnos\|prescri" --include="*.tsx" --include="*.ts" --include="*.json" --include="*.md" --include="*.css" .
```

**Step 2: Fix any remaining occurrences found**

For each occurrence:
- Replace "telehealth" → "digital educational services" or "online services"
- Replace "consultation" → "session" or "educational session"
- Replace "consultant" → "professional" or "specialist"
- Replace "healthcare professional/provider" → "qualified professional"
- Replace "medical advice" → "professional advice"
- Remove "HIPAA" references
- Remove "PHI" references
- Replace "treatment plan" → "service plan"
- Remove "diagnose/prescribe" references

**Step 3: Verify build**

```bash
npm run build
```

**Step 4: Final commit**

```bash
git add -A
git commit -m "fix(compliance): final sweep - remove all remaining flagged terminology"
```

---

## Task 16: Update Project Memory

**Files:**
- Modify: `.claude/projects/.../memory/MEMORY.md`

Update the memory file to reflect:
- Payment provider is now `manual` (Zelle/CashApp)
- Stripe/PayPal code is still present but unused
- HIPAA page deleted
- All telehealth terminology removed
- Manual payment flow: submit-order API → success page with instructions → admin verifies in WooCommerce
- Custom metadata `_manual_payment_status` tracks payment verification workflow

---

## Summary of All Files Changed

| Action | File | Task |
|--------|------|------|
| Modify | `app/layout.tsx` | 1 |
| Modify | `app/page.tsx` | 2 |
| Modify | `app/terms/page.tsx` | 3 |
| Modify | `app/privacy/page.tsx` | 4 |
| Modify | `app/refund/page.tsx` | 5 |
| Delete | `app/hipaa/page.tsx` | 6 |
| Modify | `lib/env.ts` | 7 |
| Modify | `.env.example` | 7 |
| Create | `app/api/submit-order/route.ts` | 8 |
| Modify | `components/checkout-page.tsx` | 9 |
| Modify | `app/success/page.tsx` | 10 |
| Modify | `app/payment-failed/page.tsx` | 11 |
