Skip to content

Release: Phase 15 — PaymentProvider boundary (Stripe deferred, #59) - #75

Merged
Poojithvsc merged 2 commits into
mainfrom
dev
Jun 5, 2026
Merged

Release: Phase 15 — PaymentProvider boundary (Stripe deferred, #59)#75
Poojithvsc merged 2 commits into
mainfrom
dev

Conversation

@Poojithvsc

Copy link
Copy Markdown
Owner

Phase 15, rescoped. Ships the PaymentProvider gateway + SimulatedProvider Service Stub and deliberately defers the live Stripe adapter as a documented engineering decision (ADR-0015).

Why the rescope

The original plan was a live Stripe Test-Mode provider behind a config toggle. On building it, the abstraction proved to be the whole value and the live adapter proved to be speculative weight that would add an external account + credential the project would essentially never exercise. The books line up behind deferring it:

  • PoEAAPaymentProvider is the Gateway; SimulatedProvider is the Service Stub you develop and test the whole system against. The valuable half shipped.
  • XP YAGNI — a real processor earns its keep only when a real charge must clear, which isn't a project goal.
  • APoSD — keeps the SDK/network/secret complexity out from behind the deep interface until it's wanted.
  • PragProg reversibility — the seam makes reintroducing Stripe a no-rework change; deferring forecloses nothing.
  • DDD — clean port on the Payment context; the adapter behind it is irrelevant to the model.

ShopSphere keeps its defining property: runs end-to-end with zero external dependency, in simulator mode.

What shipped

  • PaymentProvider interface — charge(token, amount) → ChargeOutcome (Succeeded/Failed).
  • SimulatedProvider — resolves token→last-four, delegates to the existing PaymentSimulator; every approve/decline/insufficient branch preserved.
  • PaymentOrderingConsumer routed through the interface (no longer resolves tokens or knows the backend).
  • PaymentConfig bean wiring; SimulatedProviderTests (4); PaymentMetricsTests updated to construct via the provider.
  • ADR-0015 (code + vault mirror), article stub.

Deliberately NOT done (deferred, see ADR-0015)

  • StripeProvider, Stripe Java SDK dependency, shopsphere.payment.provider toggle (one-value toggle = speculative), network-gated Stripe profile IT, stripe-mode QA. All cheap to add later behind the shipped seam.

Acceptance criteria (#59) — reconciled

  • PaymentProvider interface in Payment (charge(token, amount) → ChargeOutcome; Money carries currency)
  • SimulatedProvider wraps existing simulator; unit tests pass (approve/decline/insufficient/unknown-token)
  • No Catalog module changes; no OrderPlaced event-shape change
  • mvn verify green (98 tests)
  • ADR-0015 written (gateway + Service Stub; Stripe deferred), books cited; article stub
  • [~] Deferred (ADR-0015): StripeProvider, config toggle, network-gated Stripe IT, stripe-mode QA

Closes #59.

🤖 Generated with Claude Code

Poojithvsc and others added 2 commits June 5, 2026 18:54
… (Phase 15)

Extract a PaymentProvider interface (charge(token, amount) → ChargeOutcome)
so the OrderPlaced consumer depends on an abstraction, not the concrete
simulator. SimulatedProvider wraps the existing PaymentSimulator: it resolves
the token to its redacted last-four and delegates, preserving every
approve/decline/insufficient branch. The consumer now switches on
ChargeOutcome and no longer resolves tokens itself.

Pure refactor — no behaviour, event-shape, or API change; the Stripe slice
will add a second implementation behind the same interface and a config
toggle. mvn verify green (98 tests; PaymentFlowIT unchanged).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tub, Stripe deferred (Phase 15)

Records the Phase-15 decision: ship the PaymentProvider boundary + the
SimulatedProvider Service Stub (slice 1), and deliberately DEFER the live
Stripe adapter rather than build it. Rationale cited to PoEAA (Gateway +
Service Stub), XP YAGNI, APoSD (keep unearned complexity out), PragProg
(reversibility — the seam makes reintroducing Stripe no-rework) and DDD
(clean port on the Payment context). No config toggle added: a switch with
one valid value is itself speculative. The project keeps zero external
dependency.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@Poojithvsc
Poojithvsc merged commit e6b6ea4 into main Jun 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 15: Stripe Test Mode PaymentProvider

1 participant