Payments and fraud
How payment authorization, Stripe integration, refunds and fraud screening are represented in the Payments domain.
PaymentsDomainv1.0.0PaymentsThe Payments domain takes payment for orders and processes refunds. It orchestrates authorization and capture through an...Ownerpayments-platformDiagramOpen docs owns payment intent and payment outcomes. It integrates with external providers but keeps Acme’s internal payment state in Payment DatabaseContainerv1.0.0Payment DatabasePostgreSQL database that is the system of record for payments and refunds.Ownerpayments-platformDiagramOpen docs.
System context map
Payment Processing System
Payment Processing SystemSystemv1.0.0Payment Processing SystemInternal system that orchestrates payment for orders. It authorizes payments, requests charges from the external payment...Ownerpayments-platformDiagramOpen docs is composed of Payment APIServicev1.0.0Payment APIReceives payment authorization requests from the Ordering domain and records the payment intent, kicking off the charge ...Subscribesauthorize-paymentOwnerpayments-platformDiagramRepositoryOpen docs and Payment WorkerServicev1.0.0Payment WorkerDrives charges and refunds against the external payment processor and records the outcomes. It requests payments and ref...Publishespayment-requested, refund-requestedSubscribespayment-succeeded, payment-failed +1Ownerpayments-platformDiagramRepositoryOpen docs.
Payment APIServicev1.0.0Payment APIReceives payment authorization requests from the Ordering domain and records the payment intent, kicking off the charge ...Subscribesauthorize-paymentOwnerpayments-platformDiagramRepositoryOpen docs receives Authorize PaymentCommandv1.0.0Authorize PaymentCommand to authorize payment for the total of a checked-out cart. Ownerordering-platformSchemaDiagramOpen docs from checkout and records the intent. Payment WorkerServicev1.0.0Payment WorkerDrives charges and refunds against the external payment processor and records the outcomes. It requests payments and ref...Publishespayment-requested, refund-requestedSubscribespayment-succeeded, payment-failed +1Ownerpayments-platformDiagramRepositoryOpen docs drives the external charge/refund process and records outcomes.
Important events:
- Payment RequestedEventv1.0.0Payment RequestedPublished when the Payment Processing System requests a charge from the payment processor. Ownerpayments-platformSchemaDiagramOpen docs
- Payment SucceededEventv1.0.0Payment SucceededPublished by Stripe when a charge succeeds. Ownerpayments-platformSchemaDiagramOpen docs
- Payment FailedEventv1.0.0Payment FailedPublished by Stripe when a charge fails. Ownerpayments-platformSchemaDiagramOpen docs
- Refund RequestedEventv1.0.0Refund RequestedPublished when the Payment Processing System requests a refund from the payment processor. Ownerpayments-platformSchemaDiagramOpen docs
External providers
StripeSystemv1.0.0StripeExternal payment processor used by Acme Inc to charge cards and issue refunds. It receives payment and refund requests a...Ownerpayments-platformDiagramOpen docs is the external payment processor. It reports outcomes through Webhook EndpointServicev1.0.0Webhook EndpointStripe's webhook delivery for payment and refund outcomes. It notifies Acme Inc whether a charge succeeded or failed, an...Publishespayment-succeeded, payment-failed +1Ownerpayments-platformDiagramRepositoryOpen docs events such as Payment SucceededEventv1.0.0Payment SucceededPublished by Stripe when a charge succeeds. Ownerpayments-platformSchemaDiagramOpen docs, Payment FailedEventv1.0.0Payment FailedPublished by Stripe when a charge fails. Ownerpayments-platformSchemaDiagramOpen docs and Refund ProcessedEventv1.0.0Refund ProcessedPublished by Stripe when a refund has been processed. Ownerpayments-platformSchemaDiagramOpen docs.
Fraud DetectionSystemv1.0.0Fraud DetectionExternal provider that screens payments for fraud. It consumes payment requests and returns a pass or fail verdict. Ownerpayments-platformDiagramOpen docs screens payment attempts and reports Fraud Check PassedEventv1.0.0Fraud Check PassedPublished when a payment passes fraud screening. Ownerpayments-platformSchemaDiagramOpen docs or Fraud Check FailedEventv1.0.0Fraud Check FailedPublished when a payment fails fraud screening. Ownerpayments-platformSchemaDiagramOpen docs.
Failure handling
Payments cross external boundaries, so every step should be durable and retryable. Do not assume webhook delivery order. Payment state transitions should be idempotent and traceable through the payment database.