Stripe integration: payment links and webhook for service requests #125

Open
opened 2026-06-06 20:55:59 +00:00 by ldraney · 0 comments
Owner

Type

Feature

Lineage

Child of spike #121 (client request flow design). Spans Phase 3-4. Depends on admin request management ticket.

Repo

ldraney/landscaping-assistant

User Story

As admin, I want to generate Stripe payment links from the app (not manually) and have payments auto-update request status so the workflow is seamless.

Context

V1 of admin request management uses manually pasted Stripe links. This ticket adds Stripe API integration: admin clicks "Send Payment Link" and the app generates it via Stripe's API. A webhook endpoint listens for payment confirmation and auto-transitions the ServiceRequest to "paid" status.

Requires a public endpoint for Stripe webhooks — the existing Tailscale Funnel setup provides this.

File Targets

  • app/services/stripe_service.rb (new)
  • app/controllers/webhooks/stripe_controller.rb (new)
  • config/routes.rb (add webhook endpoint)
  • Gemfile (add stripe gem)
  • spec/services/stripe_service_spec.rb (new)
  • spec/requests/webhooks/stripe_spec.rb (new)

Acceptance Criteria

  • Admin clicks "Send Payment Link" → Stripe payment link generated via API
  • Payment link URL stored on ServiceRequest
  • Stripe webhook endpoint receives payment confirmation
  • Webhook auto-updates ServiceRequest status to "paid" with paid_at timestamp
  • Webhook signature verification (Stripe signing secret)
  • Env vars: STRIPE_API_KEY, STRIPE_WEBHOOK_SECRET added to k8s secret

Test Expectations

  • spec/services/stripe_service_spec.rb: link generation (stubbed HTTP)
  • spec/requests/webhooks/stripe_spec.rb: valid webhook, invalid signature, idempotency
  • Run: bundle exec rspec

Constraints

  • Use Stripe Payment Links API (not Checkout Sessions) — simpler for this use case
  • Webhook endpoint must be publicly accessible (Tailscale Funnel)
  • Stripe test mode for dev, live mode for prod

Checklist

  • PR opened
  • Tests pass
  • No unrelated changes
  • #121 — parent spike
  • #107 — auth parent
  • docs/networking.md — Tailscale Funnel for public webhook endpoint
### Type Feature ### Lineage Child of spike #121 (client request flow design). Spans Phase 3-4. Depends on admin request management ticket. ### Repo `ldraney/landscaping-assistant` ### User Story As admin, I want to generate Stripe payment links from the app (not manually) and have payments auto-update request status so the workflow is seamless. ### Context V1 of admin request management uses manually pasted Stripe links. This ticket adds Stripe API integration: admin clicks "Send Payment Link" and the app generates it via Stripe's API. A webhook endpoint listens for payment confirmation and auto-transitions the ServiceRequest to "paid" status. Requires a public endpoint for Stripe webhooks — the existing Tailscale Funnel setup provides this. ### File Targets - `app/services/stripe_service.rb` (new) - `app/controllers/webhooks/stripe_controller.rb` (new) - `config/routes.rb` (add webhook endpoint) - `Gemfile` (add stripe gem) - `spec/services/stripe_service_spec.rb` (new) - `spec/requests/webhooks/stripe_spec.rb` (new) ### Acceptance Criteria - [ ] Admin clicks "Send Payment Link" → Stripe payment link generated via API - [ ] Payment link URL stored on ServiceRequest - [ ] Stripe webhook endpoint receives payment confirmation - [ ] Webhook auto-updates ServiceRequest status to "paid" with paid_at timestamp - [ ] Webhook signature verification (Stripe signing secret) - [ ] Env vars: STRIPE_API_KEY, STRIPE_WEBHOOK_SECRET added to k8s secret ### Test Expectations - `spec/services/stripe_service_spec.rb`: link generation (stubbed HTTP) - `spec/requests/webhooks/stripe_spec.rb`: valid webhook, invalid signature, idempotency - Run: `bundle exec rspec` ### Constraints - Use Stripe Payment Links API (not Checkout Sessions) — simpler for this use case - Webhook endpoint must be publicly accessible (Tailscale Funnel) - Stripe test mode for dev, live mode for prod ### Checklist - [ ] PR opened - [ ] Tests pass - [ ] No unrelated changes ### Related - #121 — parent spike - #107 — auth parent - `docs/networking.md` — Tailscale Funnel for public webhook endpoint
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ldraney/landscaping-assistant#125
No description provided.