# Smoke Test — nimsforeststripe

## Local Development

1. Start in dev mode:
```bash
STRIPE_SECRET_KEY=sk_test_... make run
```

2. Health check:
```bash
curl http://localhost:8080/api/v1/health
# Expected: {"status":"ok","stripe_healthy":true}
```

3. Get balance:
```bash
curl -H "X-API-Token: <token>" http://localhost:8080/api/v1/balance
# Expected: {"object":"balance","available":[...],"pending":[...]}
```

4. List customers:
```bash
curl -H "X-API-Token: <token>" http://localhost:8080/api/v1/customers
# Expected: {"data":[...],"has_more":false}
```

5. Create customer:
```bash
curl -X POST -H "X-API-Token: <token>" \
  -H "Content-Type: application/json" \
  -d '{"email":"test@example.com","name":"Test User"}' \
  http://localhost:8080/api/v1/customers
# Expected: 201 with customer object
```

6. List charges:
```bash
curl -H "X-API-Token: <token>" http://localhost:8080/api/v1/charges
```

7. Create payment intent:
```bash
curl -X POST -H "X-API-Token: <token>" \
  -H "Content-Type: application/json" \
  -d '{"amount":1000,"currency":"eur","description":"Test payment"}' \
  http://localhost:8080/api/v1/payment-intents
# Expected: 201 with payment intent (client_secret included)
```

## With NATS (Production)

8. Verify taproot:
```bash
# Publish tap.stripe.customers.create to NATS
nats pub tap.stripe.customers.create '{"subject":"tap.stripe.customers.create","data":{"email":"taproot@test.com","name":"Taproot Test"},"source":"test","ts":"2026-01-01T00:00:00Z"}'
# Connector should create customer and publish tap.stripe.customer.created
```

9. Verify sync:
```bash
# Check logs for periodic sync messages
# "[Sync] polling Stripe events..."
# "[Sync] emitted N events"
```

## Docker

10. Build and run:
```bash
GOOS=linux GOARCH=amd64 go build -o nimsforeststripe ./cmd/nimsforeststripe
docker build -t nimsforeststripe:test .
docker run --rm -p 8097:8097 -v /path/to/config.yaml:/root/.nimsforeststripe/config.yaml nimsforeststripe:test
```
