Skip to content

WR-18426 - Adds Payments API and migrates SDK to HTTP client - #16

Merged
steven-palomino merged 5 commits into
mainfrom
WR-18426-http-api
Jun 18, 2026
Merged

steven-palomino merged 5 commits into
mainfrom
WR-18426-http-api

Conversation

@steven-palomino

@steven-palomino steven-palomino commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds an HTTP API in front of the payments DynamoDB so composites read configs over HTTP instead of sharing the data layer (addresses prior PR
feedback). Rewrites Wayroo.Payments.SDK as a Refit client and adds a CDK Fargate construct mirroring Notification/ContentLibrary.

Changes

  • Wayroo.Payments.API (new) — GET /api/payments/v1.0/stores/{storeId}/configurations[/{providerId}]. No auth on the micro; composites enforce it.
  • Wayroo.Payments.SDK — rewritten as a Refit typed HTTP client. Same package name, IClient surface preserved.
  • Wayroo.Payments.Infrastructure — new PaymentsAPI Fargate construct, registers as payments.luci-{env} in Cloud Map.
  • Companion Luci.Management.Api PR — swaps to .AddWayrooPaymentsClient(...), manager catches Refit's 404. Controller/DTO/mapper unchanged.

Tests

5 new API controller tests, 6 new manager tests, all passing. Builds clean.

Before deploy

{env}-payments-service-role IAM role, wayroo.payments ECR repo, pipeline vars for ECS SG + Cloud Map, Docker build step,
{{Endpoints.Micro.WayrooPayments}} template entry.

This commit introduces the `Wayroo.Payments.SDK`, providing an in-process client for reading payment provider configurations. It mirrors the `Wayroo.Notification.SDK` pattern, allowing consumers to inject an `IClient` to retrieve data without directly depending on the data access layer.

To ensure binary compatibility across various consumers (e.g., applications targeting `net8.0` and services targeting `net10.0`), the `Wayroo.Payments.Models`, `Wayroo.Payments.DataAccess`, and `Wayroo.Payments.SDK` projects are updated to multi-target both frameworks. The `Wayroo.Payments.DataAccess` project is made an internal dependency of the SDK package, bundling its DLLs without exposing it as a direct dependency.
This commit introduces the Wayroo Payments HTTP API, decoupling the service from consumers that previously relied on its internal data access layer. The Wayroo.Payments.SDK is refactored to use Refit for HTTP communication with the new API, aligning the Payments service with the organization's standard microservice architecture and SDK patterns.

The changes include:
- New `Wayroo.Payments.API` project with API versioning, Swagger, OpenTelemetry (X-Ray), and health checks.
- Updated `Wayroo.Payments.SDK` to be a typed HTTP client.
- AWS CDK infrastructure for deploying the API as an ECS Fargate service with auto-scaling and Cloud Map service discovery.
@steven-palomino steven-palomino changed the title Adds Payments API and migrates SDK to HTTP client WR-18426 - Adds Payments API and migrates SDK to HTTP client Jun 4, 2026
Comment thread Wayroo.Payments.API/Wayroo.Payments.API/EnvironmentVariableKeys.cs
@steven-palomino
steven-palomino merged commit da8ab4d into main Jun 18, 2026
7 checks passed
@steven-palomino
steven-palomino deleted the WR-18426-http-api branch June 18, 2026 12:17
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.

2 participants