payment-sequence-two-step.puml 1.1 KB

12345678910111213141516171819202122232425262728
  1. @startuml
  2. !include theme.puml
  3. title Payment Integration - two-step flow
  4. skinparam SequenceBoxBorderColor #
  5. hide footbox
  6. participant Storefront #555
  7. box "Vendure Server" #Lightblue
  8. participant "Shop API" as ShopAPI
  9. participant "Admin API" as AdminAPI
  10. participant PaymentMethodHandler
  11. end box
  12. participant "Payment Provider" as PaymentProvider #39a4ac
  13. Storefront -> ShopAPI: **addPaymentToOrder**\nmutation
  14. ShopAPI -> PaymentMethodHandler++
  15. PaymentMethodHandler -> PaymentProvider: **createPayment()**
  16. note right: The Payment Provider\n**authorizes** the payment
  17. PaymentProvider --> PaymentMethodHandler: Transaction ID
  18. PaymentMethodHandler --> ShopAPI: creates new **Payment**\nfor the Order
  19. deactivate PaymentMethodHandler
  20. ShopAPI --> Storefront: Order in\n**PaymentAuthorized** state
  21. == Second step done via Admin UI / Admin API ==
  22. AdminAPI -> PaymentMethodHandler: **settlePayment** mutation
  23. PaymentMethodHandler -> PaymentProvider: **settlePayment()**
  24. note right: The Payment Provider\n**captures** the payment
  25. PaymentProvider --> PaymentMethodHandler: Confirmation data
  26. PaymentMethodHandler --> AdminAPI: Order in\n**PaymentSettled** state
  27. @enduml