Skip to content

Instantly share code, notes, and snippets.

@anentropic
Last active June 23, 2020 17:00
Show Gist options
  • Save anentropic/84151dadfaaf9190836cf1ea0dfcc5f7 to your computer and use it in GitHub Desktop.
Save anentropic/84151dadfaaf9190836cf1ea0dfcc5f7 to your computer and use it in GitHub Desktop.
CHECKOUT FLOW
CHECKOUT FLOW
View bag*
checkout -> Checkout summary
Checkout summary
buy -> Reserve stock
Reserve stock
Lock product*
locked -> Insert purchase record
failed -> Error
Insert purchase record
inserted -> Unlock product
failed -> Unlock product with Error
Create shipping mandate
not needed -> Unlock product
created -> Unlock product
failed -> Rollback
Rollback
done -> Unlock product
Unlock product
unlocked -> User approve payment
Unlock product with Error
unlocked -> Error
User approve payment
approved -> Attempt to complete payment
not approved -> Cancel checkout
error -> Cancel checkout with Error
Attempt to complete payment
completed -> Checkout succeeded
indeterminate -> Attempt to complete payment
retryable error -> Attempt to complete payment
fatal error -> Cancel checkout with Error
Checkout succeeded
Broadcast event
Cancel checkout
cancelled -> View bag
Cancel checkout with Error
cancelled -> Error
Error
function render(model){
let current_state_name = model.active_states[0].name;
return $("h1",
{style: {color: "darkBlue"}},
`The current state is: ${current_state_name}`);
}
@anentropic
Copy link
Author

from this tool: https://sketch.systems/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment