Files
go-cart-actor/pkg/order/flows/place-and-pay.json
T
mats aa8b2bdedc
Build and Publish / BuildAndDeployAmd64 (push) Failing after 5s
Build and Publish / BuildAndDeployArm64 (push) Failing after 6s
all the refactor
2026-06-28 17:51:52 +02:00

33 lines
932 B
JSON

{
"name": "place-and-pay",
"description": "Place an order and take payment in one transaction. Authorization is compensated (voided + order cancelled) if capture fails.",
"steps": [
{
"name": "place",
"action": "place_order",
"hooks": {
"after": [{ "type": "log", "params": { "message": "order placed" } }]
}
},
{
"name": "authorize",
"action": "authorize_payment",
"compensate": { "action": "void_payment" },
"hooks": {
"after": [{ "type": "log", "params": { "message": "payment authorized" } }],
"onError": [{ "type": "log", "params": { "message": "authorization failed" } }]
}
},
{
"name": "capture",
"action": "capture_payment",
"hooks": {
"after": [
{ "type": "log", "params": { "message": "payment captured" } },
{ "type": "emit_order_created" }
]
}
}
]
}