Skip to main content
Version: v2

V2 Implementations — Engineering Guide

Purpose

This engineering guide is the single source of truth for any software engineer building, maintaining, or extending v2 implementations across the Convenient Checkout platform. It is not limited to a single service or endpoint — it spans every domain, every service, and the shared commons library that ties them together.

Whether you are implementing a new payment flow, adding a customer lookup strategy, onboarding a new merchant, or building a reporting pipeline, this guide provides the standards, patterns, architecture decisions, and best practices you must follow.


Who This Guide Is For

RoleStart Here
Backend engineer — new to V2V1 vs V2 — What Changed and WhyShared StandardsCommons Library → relevant domain section
Backend engineer — working on paymentsPayment Lifecycle StatesSplit-Tender Payment
Backend engineer — working on commons libraryCommons Library — Versioning & Deployment Strategy
QE / test engineerTesting Strategy + API Design Conventions + relevant domain section
Reviewing a PRCoding Standards + Error Strategy + relevant domain section
Investigating a production issueTroubleshootingObservability

Platform Ecosystem

The Convenient Checkout platform is a microservices architecture consisting of the following services, all sharing wallet-event-commons:

ServiceDomainDescription
wallet-payment-servicePaymentsPayment lifecycle: create, authorize, capture, cancel
wallet-customer-serviceCustomersCustomer identity, wallet, payment method management
wallet-merchant-serviceMerchantsMerchant configuration, onboarding, settings, and webhook event delivery to merchants (via wallet-merchant-webhook-proxy)
wallet-auth-serviceSessionsSession creation, checkout session management
wallet-stripe-adapter-serviceVendorStripe API abstraction layer
wallet-reporting-serviceReportingTransaction reporting and reconciliation
wallet-notification-serviceNotificationsEmail, SMS, and webhook dispatch
wallet-migration-serviceMigrationv1 → v2 data migration
wallet-api-internalInternalInternal operations and admin tools
wallet-achavs-serviceACHACH account verification
wallet-eimp-data-sync-serviceData SyncEnterprise identity data synchronization
wallet-telephonic-api-adapter-serviceTelephonicPhone-based payment entry
wallet-event-commonsSharedCommon library: DTOs, enums, events, rules, validators

Shared Standards

These apply to all domains and all services. Every v2 implementation must comply:

StandardWhat It GovernsKey Rule
V1 vs V2 GuideWhat changed, migration checklist, side-by-side comparisonsRead this first if coming from V1
API Design ConventionsURL patterns, HTTP methods, status codes, request/response envelopesResources as plural nouns, 202 for async, amounts in cents
Coding StandardsPackage structure, Lombok, Reactor, constants, exceptions, JavadocNo magic strings, no .block(), no swallowed exceptions
Security & ComplianceData protection, OAuth2 scopes, data masking, audit trailsNever log sensitive data; all state transitions audited
Commons LibraryShared DTOs, enums, events, versioning & deployment strategyAll cross-service contracts live in wallet-event-commons; V1 and V2 packages coexist during migration
Error HandlingError taxonomy, Problem DTO, error propagationUse ErrorGroup enum; 400/422/500 classification
IdempotencyDedup, retry semanticsDomain-specific idempotency keys (5 attempts max)
Architecture PatternsLayered architecture, async boundariesController → Service → Adapter → Repository
TestingTest pyramid, coverage, namingUnit + Integration + Contract tests on every PR
ObservabilityLogging, monitoring, alerting, dashboardsAzure Application Insights + Splunk; structured JSON logs

Domain Guides

Each domain has its own section covering domain-specific flows, data models, API contracts, and webhook events:

DomainServiceStatus
Paymentswallet-payment-service✅ Authored
Customerswallet-customer-service🔲 Planned
Merchantswallet-merchant-service🔲 Planned
Reportingwallet-reporting-service🔲 Planned
Sessionswallet-auth-service🔲 Planned
Disputeswallet-payment-service🔲 Planned
Notificationswallet-notification-service🔲 Planned

V2 API Inventory

MethodPathDomainOperation
POST/v2/paymentsPaymentsCreate payment (single or split-tender)
GET/v2/payments?merchantTransactionId={id}PaymentsGet payment by merchant ID
GET/v2/payments/{paymentId}PaymentsGet payment by platform ID
PATCH/v2/payments/{paymentId}/cancelPaymentsCancel a payment
PATCH/v2/payments/{paymentId}/capturePaymentsCapture a pre-authorized payment
POST/v2/token/paymentsPayments (Token)Create payment with raw card token
POST/v2/refundsPaymentsCreate a refund
GET/v2/refunds/{refund-id}PaymentsGet refund status
POST/v2/sessionsSessionsCreate checkout session
GET/v2/sessions/{sessionId}SessionsGet session details

Current State vs. Target State

This guide also serves as a living improvement roadmap. Each section documents:

  1. Current State — How things work today, including known limitations
  2. Target State — What a world-class implementation in a regulated payments platform should look like
  3. Migration Path — Concrete steps to get from current to target
AreaCurrent StateTarget StatePriority
Commons v1/v2 coexistencev1 DTOs (event/) and v2 DTOs (events/v2/) both activeAll services consume v2 models only; v1 deprecatedP1
Enum duplicationSome enums exist in both enums/ and event/shared/ packagesSingle canonical location in enums/P1
Error modelErrorResponse (v1) and Problem (v2) coexistAll v2 services use Problem; v1 ErrorResponse deprecatedP2
Domain separationServices have mixed domain concernsClear bounded contexts per serviceP2
Test coverageVaries by service, no enforced minimum≥80% unit, ≥60% integration across all servicesP2
ObservabilityBasic logging, partial tracingStructured logging + distributed tracing + domain dashboardsP3
API documentationOpenAPI spec maintained manuallySchema-first development; generated validation from specP3
Contract testingNot consistently appliedConsumer-driven contracts between all servicesP3

See the Improvement Roadmap for the full migration plan.


How This Guide Is Organized

10-v2-implementations/
├── 1-overview.md ← You are here
├── 2-architecture/ ← Service design, domain model, request lifecycle
├── 3-commons-library/ ← wallet-event-commons: DTOs, enums, events, rules
├── 4-shared-standards/ ← Cross-domain: API design, security, errors, idempotency
├── 5-domains/
│ ├── payments/ ← Payment flows, webhooks, error codes
│ ├── customers/ ← (planned) Customer resolution, wallet management
│ ├── merchants/ ← (planned) Merchant config, onboarding
│ └── reporting/ ← (planned) Transaction reports
├── 6-testing/ ← Strategy, unit/integration/contract, test data
├── 7-troubleshooting/ ← Error patterns, debugging workflow
└── 8-improvement-roadmap/ ← Current → target state, migration phases

Also see (engineering-guide-level, not v2-exclusive):
└── observability/ ← Logging, App Insights, Splunk, dashboards, alerting

ResourceLink
Payment API Reference (OpenAPI)API Reference V2
Webhook ReferenceWebhooks V2
Payment Error CodesError Codes
Business Guide — PaymentsBusiness Payments
Test Scenarios & DataTest Cards