Payment
The payment of an order, after the classic eShop's PaymentProcessor; its id is the order's:
REQUESTED -> SUCCEEDED -> REFUNDED
\-> FAILEDRequestPayment creates it: OrderPaymentSaga sends it once the ordering context confirms the order's stock.
PaymentGatewaySaga charges the gateway for a requested payment and records the outcome: ConfirmPayment or FailPayment. OrderPaymentSaga then pays the order, or cancels it.
RefundPayment refunds a confirmed payment the order refused.
Recording an outcome the payment already has changes nothing, so a command sent again is harmless; recording the other outcome is a rejection.
Types
The codes the aggregate rejects a command with, by their local names: the compiler and the kernel name them <context>.payment.<code>, as its peers read them from the api's generated contract.