Introduce PaymentStateMachineHelper and RetryStateMachineHelper to encapsulate (hide) required knowledge about the state machines
and refactor the payment code to rely on those new abstractions.

(We could remove some of the hardcoing existing in these classes by introducing additional attributes on the state machine xml (isTerminal, isSuccess, isInit,...)
but there will always be a bootstrap issue to solve, and so those classes need to exist)