Checking access…

Skip to main content
Version: v2

V2 Implementations β€” Engineering Guide

πŸ”’ InternalInternal information β€” not visible in the public (merchant) site.

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 Why β†’ Shared Standards β†’ Commons Library β†’ relevant domain section
Backend engineer β€” working on paymentsPayment Lifecycle States β†’ Split-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 issueTroubleshooting β†’ Observability

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)
V2 Endpoint Environment ControlsOperation readiness, routing, and @V2NotImplemented stubsV2 is available in production; confirm each operation and merchant enablement; stubs return 501 where routed
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
GET/v2/checkout-sessions/{checkoutSessionId}Checkout SessionsGet checkout session status
PATCH/v2/checkout-sessions/{checkoutSessionId}Checkout SessionsUpdate checkout session (operation-based)
PATCH/v2/checkout-sessions/{checkoutSessionId}/cancelCheckout SessionsCancel checkout session
POST/v2/checkout-sessions/{checkoutSessionId}/child-sessionsCheckout SessionsCreate child session

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