# PayPal via Stripe Setup

Scriba supports PayPal only as a Stripe payment method through Stripe Payment Element.
There is no standalone PayPal SDK, API, or webhook flow in the app.

## Implementation Model

- Frontend uses Stripe Elements (`payment` element) for all methods.
- Backend uses Stripe SetupIntents and Stripe customer payment methods.
- Saved methods may include `card`, `sepa_debit`, `paypal`, and `link` depending on Stripe account settings.

## Required Environment

Only Stripe variables are required for payment method setup:

```env
STRIPE_SECRET_KEY=...
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=...
```

Do not configure PayPal client secrets in this app. PayPal onboarding/configuration is handled in the Stripe Dashboard.

## Stripe Dashboard Checklist

1. Enable PayPal in Stripe payment methods.
2. Ensure the account/country supports PayPal.
3. Keep Payment Element enabled in checkout/setup flows.

## API Endpoints (Stripe-only)

- `POST /api/billing/setup-intent`
- `GET /api/billing/payment-method`
- `POST /api/billing/payment-method`
- `DELETE /api/billing/payment-method`
- `GET /api/billing/status`

## Notes

- If PayPal does not appear in UI, verify Stripe Dashboard payment method settings and account eligibility.
- Billing status now checks all saved Stripe payment method types, including PayPal.
