125 lines
5.1 KiB
Markdown
125 lines
5.1 KiB
Markdown
# Phase 18.1: Payment Gateway Subscriptions - Discussion Log
|
|
|
|
> **Audit trail only.** Do not use as input to planning, research, or execution agents.
|
|
> Decisions are captured in CONTEXT.md — this log preserves the alternatives considered.
|
|
|
|
**Date:** 2026-10-09
|
|
**Phase:** 18.1-payment-gateway-subscriptions
|
|
**Areas discussed:** Source and core scope, Package layout and subscribers, Webhook surface, Customer API and frontend
|
|
|
|
Phase 18.1 was inserted into the roadmap at the start of this session (`phase.insert 18`), as 18-CONTEXT D-01 asked.
|
|
|
|
---
|
|
|
|
## Source and core scope
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| ac3d73c + 5fb9dac | Horoskopia develop plus QuestStream's unmerged `syncPlanToGateway` | ✓ |
|
|
| ac3d73c only | Strictly Horoskopia's checkout | |
|
|
| Merge all five copies | Union of every app's copy | |
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| Generic core only | Lead fees, placements and analytics go to Quotify's port; their tables stay | ✓ |
|
|
| Port everything 1:1 | One plugin, all features | |
|
|
| Core + metering | Keep metered billing as a generic capability | |
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| Opaque string keys | `HasFeature(key)`, no constants | ✓ |
|
|
| App-registered feature catalogue | Keys plus labels registered at build time | |
|
|
| Keep constants 1:1 | Port the `FEATURE_*` constants | |
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| Squashed v2.4.0 baseline | Final schema including dormant tables; idempotent; no seed, ALTER or conversion | ✓ |
|
|
| Replay the PHP chain | One Go migration per PHP file | |
|
|
| Baseline without dormant tables | Quotify creates its tables itself | |
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| Keep constant, no impl | `google_play` stays valid; only Stripe is implemented | ✓ |
|
|
| Drop it | Only `stripe` is valid | |
|
|
|
|
---
|
|
|
|
## Package layout and subscribers
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| pgstripe subpackage | pgsub in its own repo; Stripe gateway in a `sm-pgstripe-plugin` subpackage | ✓ |
|
|
| Inside pgsub | pgsub imports pgstripe | |
|
|
| Third repo | `sm-pgstripe-subscriptions-plugin` | |
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| Build-time registry, user built in | Morph alias plus resolver; opt-in `user` subscribable | ✓ |
|
|
| Registry only, nothing built in | Every app writes its own adapter | |
|
|
| Hard-wire to user | Drop polymorphism | |
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| users.stripe_customer_id | Horoskopia's column, added idempotently | ✓ |
|
|
| pgsub mapping table | New `golem15_pgsub_customers` | |
|
|
| Built-in user leaves it to the app | Column name from config | |
|
|
|
|
---
|
|
|
|
## Webhook surface
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| Both URLs, one handler | Canonical pgstripe URL plus the legacy pgsub alias | ✓ |
|
|
| Canonical only | Repoint the legacy endpoint at cutover | |
|
|
| Merge into _paymentgateway route | New URL everywhere | |
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| Verify + enqueue conga job | Marker written in the job transaction after success | ✓ |
|
|
| Synchronous in the handler | One transaction in the request | |
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| Own setting per mode | A separate encrypted subscription signing secret for test and live | ✓ |
|
|
| Reuse the P18 secret | One secret for both endpoints | |
|
|
|
|
---
|
|
|
|
## Customer API and frontend
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| Go service API + headless /_x/api/v1 | Horoskopia keeps its own routes; new apps use the generic API | ✓ |
|
|
| Go service API only | No HTTP routes in the plugin | |
|
|
| Headless API replaces app routes | Breaks frontend parity | |
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| Extend vue-paymentgateway-layer | Subscription client and components in the P18 layer | ✓ |
|
|
| Separate vue-pgsub-layer | Own repo | |
|
|
| No layer in 18.1 | API only | |
|
|
|
|
| Option | Description | Selected |
|
|
|--------|-------------|----------|
|
|
| Yes, Quotify port | AnalyticsDashboard not ported | |
|
|
| Port a generic subscription dashboard | Admin MRR/churn widget | ✓ (then deferred) |
|
|
|
|
**Notes:** The user chose a generic dashboard. It was flagged as a new capability, and the user then placed it in Deferred Ideas instead of 18.1 scope.
|
|
|
|
---
|
|
|
|
## Claude's Discretion
|
|
|
|
- Go names for the registries, interfaces, events and service API
|
|
- Typed festival event shapes for the six `golem15.pgsub.*` events
|
|
- Admin plan editing (`currency_prices`, `stripe_prices`), the reorder and the Sync to Stripe bulk actions, and the `manage_placements` permission code
|
|
- The test-host proof flows and mapping pgstripe's tests to Go cases
|
|
- Plan count and split
|
|
|
|
## Deferred Ideas
|
|
|
|
- Quotify lead fees and metering, featured placements and quote analytics: Quotify's port
|
|
- A Google Play subscription gateway plugin
|
|
- A generic admin subscription dashboard (MRR, churn), after the Horoskopia port
|