Checkout is a tricky thing, so it would be better to discuss here eventual solutions. I'm still not sure we'd need a state_machine to manage this.
For our experience on Spree, having a rigid schema (such as a set of states managed by state machine) it's not that useful, especially when working with APIs.
One possibile solution might be to have stand-alone functions to run for each step, then it's up to developers to customize the order of steps in the workflow. After all, it's not a rule to follow a set of steps to do a checkout, right? :-)
As a reference, check this simple example of a checkout payment with Phoenix: https://github.com/joshnuss/phoenix-billing-demo
However, I'm open to suggestions, hints and similar
Checkout is a tricky thing, so it would be better to discuss here eventual solutions. I'm still not sure we'd need a state_machine to manage this.
For our experience on Spree, having a rigid schema (such as a set of states managed by state machine) it's not that useful, especially when working with APIs.
One possibile solution might be to have stand-alone functions to run for each step, then it's up to developers to customize the order of steps in the workflow. After all, it's not a rule to follow a set of steps to do a checkout, right? :-)
As a reference, check this simple example of a checkout payment with Phoenix: https://github.com/joshnuss/phoenix-billing-demo
However, I'm open to suggestions, hints and similar