If a transaction result is declined (which you can simulate
in the sandbox with a test card
4242 4242 4242 4242),
then you should determine the next step.
Inspecting the decline reason may be helpful. For example, if the transaction was declined due to "no gateways available for this payment method" type of error, then you may want to ask the customer to try with a different payment method.
How you handle the declines can be quite important to preventing duplicated customers and orders.
If a customer supplies new payment information, you would create the payment token, and upsert the customer, and then you could skip upserting the order and go directly to initiate the transaction for the invoice. However, there is no harm in upserting the order, and it may be easier to have a consistent workflow by maintaining that step within your sequence.