card-payments
Card payment processing platform handling MOTO and e-commerce authorisations via multiple payment providers, with a payments database, notification/email listeners and a pending-receipts job.
Health score
0 to 100 across seven weighted factors; nothing is hidden. Green is 75 and above, amber 50 to 74, red below 50. How scoring works.
Facts
| Languages | csharp, sql, powershell |
| Frameworks | WCF, ASP.NET Web API 2, CQRSlite, Dapper, SimpleInjector |
| Runtimes | .NET Framework 4.5.2, .NET Framework 4.6.2, .NET Framework 4.7.2, .NET Core 3.1 |
| Tests / CI | some / CI in place |
| Last commit | 2025-06-30 |
| Owner | Owner unknown (mapping to be curated) |
| Domain | Payments and finance (system generated; curate in repo-owners.json to override) |
| Product area | Phenix |
| Hosted | On-prem Deployed to our own machines
|
| Releases | 6 release pipeline(s): \finance\payments\card-payments CI; \finance\payments\card-payments Database; \finance\payments\card-payments Nuget; \finance\payments\card-payments Stealth; \finance\payments\card-payments jobs CI; \finance\payments\card-payments notifications CI |
| Integration | wcf, rest |
| Source | Open in Azure DevOps |
Dependencies in context
Entanglement
kernel Bound into the core by 2 mechanism(s).
- Pinning dependency: mail-service
- Speaks WCF (host)
Detaches when its pinning dependencies are cut or multi-targeted (mail-service); and when its WCF surface gains a modern interface or its WCF calls move to one.
Migration playbooks
Generated from this repo's assessment data: what is feasible, what blocks it, and the steps in order. Ratings: green means actionable now, amber means sequence other work first, red means blocked, grey means not applicable.
ZDD adoption
A long roadTechnically eligible one day, but the blockers are structural: hosted WCF or SOAP contracts that cannot run two versions at once, or heavy legacy coupling. Sequence the modernisation work first. Hosts WCF or SOAP endpoints: strict serialization contracts cannot safely run two versions at once (the shared-enum trap). End-of-life runtime compounds the work.
- 4 system(s) depend on this repo; during a rolling deploy they will talk to old and new versions at once, so responses must stay compatible
- Adopt the four-stage discipline from the ZDD engineering standard: pre-deployment compatibility, deployment, feature activation behind a flag, post-release cleanup.
- Raise automated test coverage first: ZDD trades the end-of-sprint manual gate for continuous automated confidence, so the tests are the entry ticket.
- Make every change dual-version safe: backwards-compatible APIs (new major version for breaking wire changes), expand and contract for any schema change, and consumers tolerant of unknown fields.
- Audit serialized data: anything in Redis, queues or shared caches must deserialize cleanly across adjacent versions.
- Wrap behaviour changes in feature flags so code deploys dark and release becomes a business decision, not a deployment event.
- Route deployments through the Workflow Engine's automated drain, deploy, health-check, return cycle (the path proven by the first automated production run in mid-2026).
- Verify with area-scoped regression rather than the whole-platform cycle, and watch error rates after rollout with automated rollback on alert.
SQL Server exit
Feasible after replatforming (1 owned database)The database is solely owned so no other system has to move, but the runtime is end-of-life; sequence the replatform first, then the engine swap.
- Inventory the schema and query surface of sqlserver:CardPaymentsDatabase: tables, stored procedures, triggers, cross-database joins and anything else engine-specific.
- Confirm the target: PostgreSQL (relational model; keep transactions and joins, swap the engine).
- Replatform to modern .NET first (see the recommended actions): current PostgreSQL and MongoDB drivers and EF Core providers target modern .NET, and doing one risky change at a time is cheaper than doing two.
- Data access is not through an ORM, so port the SQL by hand: translate T-SQL constructs, replace stored procedures with application code or target-native equivalents, and add integration tests around the queries that matter first.
- Stand up the target alongside SQL Server, backfill with an ETL pass (pgloader or an export/import job), then dual-write or replicate until parity is proven.
- Move reads to the target, watch correctness and latency, then cut writes over and keep SQL Server read-only until confidence is earned.
- Decommission the SQL Server database and remove the connection strings and firewall paths that pointed at it.
Containerisation
Feasible after replatformingAppropriate eventually, but not from here: the legacy runtime and the hosted WCF surface both have to go first, and that work is already in this repo's recommended actions.
- .NET Framework only runs on Windows; practical (Linux) containers need modern .NET
- Hosts WCF or SOAP endpoints, which have no home on modern .NET; consumers need a modern interface first
- Replatform to modern .NET first (see the recommended actions), replacing the hosted WCF/SOAP surface with REST, gRPC or messaging so consumers can follow. Containerising then becomes routine.
- Add a Dockerfile and make the app read all configuration from environment variables and the secrets manager, never from machine-local files.
- Log to stdout and expose a health check endpoint so ECS can supervise it.
- Adopt the shared ci.yml pipeline template with the container parameters (awsRegion, containerAfterBuild, ecsTerraformRepo), which is exactly how the estate's existing AWS services deploy.
- Define the service in the Terraform repo, deploy to a non-production environment, then shift traffic and disarm the deployment-group release pipeline.
Recommended actions
Replatform card-payments to modern .NET
Runs on .NET Framework 4.5.2, .NET Framework 4.6.2, .NET Framework 4.7.2, .NET Core 3.1, out of mainstream support. Blocked until stage 2 cuts: mail-service.
Impact: Unblocks 4 dependent system(s)
proposedAssessment notes
card-payments
Purpose
The card payments platform: authorises MOTO and e-commerce card payments through pluggable provider adapters (Cybersource, Worldpay, Ogone, Realex), publishes payment events, listens for provider notifications, sends payment emails, and runs a pending-receipts query job. Client/contract NuGet packages are consumed by other TC services.
Tech stack
- Predominantly legacy C# on .NET Framework (4.5.2/4.6.2/4.7.2) with WCF service hosts and ASP.NET Web API; some
netstandard2.0contract libraries and twonetcoreapp3.1(EOL) projects for NetCore interop. - CQRSlite command/event pattern, SimpleInjector/Autofac DI, Dapper data access, Serilog, TC ConnectionBroker (Sql/Wcf/Api).
- SQL Server database project (
db/CardPaymentsDatabase.sqlproj); PowerShell build scripts.
Deployment
release_count 6 — the largest of this batch. Build pipelines: card-payments CI, card-payments DB CI, card-payments Notifications CI, card-payments jobs CI. Release pipelines under \finance\payments\ including Database, NuGet, Stealth, jobs and notifications. YAML exists for DB and notifications builds; three solutions (CardPayments.sln, CardPaymentsJobs.sln, CardPaymentsNotifications.sln).
Dependencies
- Internal: mail service (TC.Mail.ServiceClient), receipt service (TC.ReceiptService.Client), TC exceptions libraries/service, contact-centre service client, Phenix ApplicationFramework and Phenix service clients (repo mapping unconfirmed for the latter).
- External: Cybersource, Worldpay, Ogone (Ingenico) and Realex (Global Payments) payment gateways.
Data stores
- SQL Server
CardPaymentsDatabase(dedicated schema project in-repo, deployed via its own DB pipeline).
Integration points
- WCF service endpoints (SimpleInjector WCF integration) plus ASP.NET Web API hosts, including a
ServiceBusIngressHTTP ingress contract and a NotificationListener webhook app for provider callbacks; email publishing via MailKit listener services.
Code health
Nine test projects (unit + Cybersource integration tests), so coverage exists but is uneven across a large codebase. CI pipelines are in place. Last commit 2025-06-30 (~13 months ago), so effectively in maintenance mode.
Modernisation risks
High priority: EOL runtimes (.NET Framework 4.5.2/4.6.2 and .NET Core 3.1), WCF hosting, ASP.NET Web API on packages.config, old .vsmdi test artifacts, and PCI-sensitive payment logic spread across many legacy projects. A migration would need to preserve four provider integrations and the widely consumed contract packages.