Payment Processing System
Internal system that orchestrates payment for orders. It authorizes payments, requests charges from the external payment processor, handles the outcome, and issues refunds.
Overview
The Payment Processing System is the internal heart of the Payments domain. When the Ordering domain sends Authorize PaymentAuthorize PaymentCommandv1.0.0Command to authorize payment for the total of a checked-out cart.
Ownerordering-platformSchemaMapView docs, the Payment APIPayment APIServicev1.0.0Receives payment authorization requests from the Ordering domain and records the payment intent, kicking off the charge ...Subscribesauthorize-paymentOwnerpayments-platformMapRepoView docs records the intent in the Payment DatabasePayment DatabaseContainerv1.0.0
PostgreSQL database that is the system of record for payments and refunds.MapView docs and the Payment WorkerPayment WorkerServicev1.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 requests a charge from the external StripeStripeSystemv1.0.0External payment processor used by Acme Inc to charge cards and issue refunds. It receives payment and refund requests a...Ownerpayments-platformMapView docs via Payment RequestedPayment RequestedEventv1.0.0Published when the Payment Processing System requests a charge from the payment processor.
Ownerpayments-platformSchemaMapView docs. Stripe reports the outcome back as Payment SucceededPayment SucceededEventv1.0.0Published by Stripe when a charge succeeds.
Ownerpayments-platformSchemaMapView docs or Payment FailedPayment FailedEventv1.0.0Published by Stripe when a charge fails.
Ownerpayments-platformSchemaMapView docs, which the worker records. The system also issues refunds via Refund RequestedRefund RequestedEventv1.0.0Published when the Payment Processing System requests a refund from the payment processor.
Ownerpayments-platformSchemaMapView docs.
Context Diagram
How this system relates to the other systems around it.
Resource Diagram
The services, data stores and messages that make up this system.
What’s inside
| Component | Type | Responsibility |
|---|---|---|
| Payment APIPayment APIServicev1.0.0 | Service | Receives authorization requests and records payment intent. |
| Payment WorkerPayment WorkerServicev1.0.0 | Service | Drives charges and refunds against Stripe and records outcomes. |
| Payment DatabasePayment DatabaseContainerv1.0.0 | Data store | PostgreSQL system of record for payments and refunds. |
Messages this system publishes
- Payment RequestedPayment RequestedEventv1.0.0Published when the Payment Processing System requests a charge from the payment processor. Ownerpayments-platformSchemaMapView docs — a charge has been requested from the payment processor.
- Refund RequestedRefund RequestedEventv1.0.0Published when the Payment Processing System requests a refund from the payment processor. Ownerpayments-platformSchemaMapView docs — a refund has been requested from the payment processor.