I've got an application that processes payments using Stripe.com. The problem is that occasionally the payment will process successfully, but then there is a database error that prevents me from saving the payment details. What is the best way to handle a situation like this to ensure that I don't end up with side effects outside of my application (orphaned credit card charges, etc) ?