Checkout
A shopper pays for their cart by card. The payment provider asks the card issuer, which either wants approval in the shopper's bank app or refuses the card. Approving lands on Order confirmed, declining goes back to Checkout to try another card, and a refused card ends the checkout. Pay later (planned) and Bank transfer (legacy) sit beside the card payment.
What UJN shows here Point at a note to see its part of the drawing
The source (35 lines)
checkout.puml
@startujnrender { arrow_spacing: 24 }journey CHECKOUT "Checkout"description: "Pay by card and approve in the bank app. Pay later is planned."unique_id_friendly: checkout start from_cart { description: "From the cart" }view checkout { title: "Checkout"; description: "Address and card"; route: /checkout }action authorize { title: "Authorize payment"; description: "Asks the card issuer" }handoff bank_app { title: "Bank app"; description: "Approve the payment"; channel: bank app; timeout: 5 min }view confirmed{ title: "Order confirmed" route: /orders/:id trace: [req:PAY-04, test:e2e/checkout.spec.ts] unique_id: bd51a9c2824 ' AUTO GENERATED - DO NOT CHANGE}end paid { type: success; description: "Order paid" }system psp { type: external; title: "Payment provider"; host: api.pay.example }end refused { type: failure; description: "Card refused" }view pay_later { title: "Pay later"; description: "Invoice in 30 days"; route: /checkout/later; flags: [future] }view transfer { title: "Bank transfer"; description: "IBAN and reference"; route: /checkout/transfer; flags: [legacy] } from_cart --> checkoutcheckout --> authorize : [Pay] { payload: [card, amount] }authorize --> bank_app : approval neededbank_app ..> confirmed : [Approve]confirmed -down-> paid : [Done]authorize -up-> psp { payload: [card, amount] }psp ..> authorize { payload: [result] }authorize -down-x-> refused : card refusedbank_app .x.> checkout : [Decline] ' back to try another cardcheckout -down-> pay_later : [Pay later] { flags: [future] }checkout -up-> transfer : [Bank transfer]@endujn