Payments and fraud
How payment authorization, Stripe integration, refunds and fraud screening are represented in the Payments domain.
PaymentsPaymentsDomain•v1.0.0The Payments domain takes payment for orders and processes refunds. It orchestrates authorization and capture through an...Ownerpayments-platformMapView docs owns payment intent and payment outcomes. It integrates with external providers but keeps Acme’s internal payment state in Payment DatabasePayment DatabaseContainer•v1.0.0PostgreSQL database that is the system of record for payments and refunds.MapView docs.
System context map
Payment Processing System
Payment Processing SystemPayment Processing SystemSystem•v1.0.0Internal system that orchestrates payment for orders. It authorizes payments, requests charges from the external payment...Ownerpayments-platformMapView docs is composed of Payment APIPayment APIService•v1.0.0Receives payment authorization requests from the Ordering domain and records the payment intent, kicking off the charge ...Subscribesauthorize-paymentOwnerpayments-platformMapRepoView docs and Payment WorkerPayment WorkerService•v1.0.0
Drives charges and refunds against the external payment processor and records the outcomes. It requests payments and ref...Publishespayment-requested, refund-requestedSubscribespayment-succeeded, payment-failedOwnerpayments-platformMapRepoView docs.
Payment APIPayment APIService•v1.0.0Receives payment authorization requests from the Ordering domain and records the payment intent, kicking off the charge ...Subscribesauthorize-paymentOwnerpayments-platformMapRepoView docs receives Authorize PaymentAuthorize PaymentCommand•v1.0.0Command to authorize payment for the total of a checked-out cart.
Ownerordering-platformSchemaMapView docs from checkout and records the intent. Payment WorkerPayment WorkerService•v1.0.0
Drives charges and refunds against the external payment processor and records the outcomes. It requests payments and ref...Publishespayment-requested, refund-requestedSubscribespayment-succeeded, payment-failedOwnerpayments-platformMapRepoView docs drives the external charge/refund process and records outcomes.
Important events:
- Payment RequestedPayment RequestedEvent•v1.0.0Published when the Payment Processing System requests a charge from the payment processor. Ownerpayments-platformSchemaMapView docs
- Payment SucceededPayment SucceededEvent•v1.0.0Published by Stripe when a charge succeeds. Ownerpayments-platformSchemaMapView docs
- Payment FailedPayment FailedEvent•v1.0.0Published by Stripe when a charge fails. Ownerpayments-platformSchemaMapView docs
- Refund RequestedRefund RequestedEvent•v1.0.0Published when the Payment Processing System requests a refund from the payment processor. Ownerpayments-platformSchemaMapView docs
External providers
StripeStripeSystem•v1.0.0External payment processor used by Acme Inc to charge cards and issue refunds. It receives payment and refund requests a...Ownerpayments-platformMapView docs is the external payment processor. It reports outcomes through Webhook EndpointWebhook EndpointService•v1.0.0Stripe's webhook delivery for payment and refund outcomes. It notifies Acme Inc whether a charge succeeded or failed, an...Publishespayment-succeeded, payment-failed +1Ownerpayments-platformMapRepoView docs events such as Payment SucceededPayment SucceededEvent•v1.0.0Published by Stripe when a charge succeeds.
Ownerpayments-platformSchemaMapView docs, Payment FailedPayment FailedEvent•v1.0.0Published by Stripe when a charge fails.
Ownerpayments-platformSchemaMapView docs and Refund ProcessedRefund ProcessedEvent•v1.0.0Published by Stripe when a refund has been processed.
Ownerpayments-platformSchemaMapView docs.
Fraud DetectionFraud DetectionSystem•v1.0.0External provider that screens payments for fraud. It consumes payment requests and returns a pass or fail verdict. Ownerpayments-platformMapView docs screens payment attempts and reports Fraud Check PassedFraud Check PassedEvent•v1.0.0Published when a payment passes fraud screening. Ownerpayments-platformSchemaMapView docs or Fraud Check FailedFraud Check FailedEvent•v1.0.0Published when a payment fails fraud screening. Ownerpayments-platformSchemaMapView 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.