Using Commerce Kickstart 2.
A customer selects a Payment type at /checkout/123/payment Then he/she goes to Review /checkout/123/review
If the customer hits 'Go Back', the previous payment is still in the system. Obviously, what we want is to clear out the previous payment data connected to the order so that only one payment transaction is present for any given order at any given time.
I looked in Rules and there is a reaction rule called component_rules_payment_component_delete_all
but what it seems to do is zero out previous payments not actually remove them, which seems wrong. We want to delete any payments until the last one when the order is completed.
So... where do I hook into (and what function do I call) to delete payment data for the current transaction id when the user hits the Go Back button?