Seems fairly easy: When the customer swipes to end, it notifies the driver. If the driver agrees, the ride ends there. If the driver doesn't agree, he tells the customer to undo the swipe or they will stop driving and the customer can get out.
What if the customer gives her phone to a friend (through a car window) during the ride?
Similar thing happened to me abroad. A couple of us used a single phone with a local card, so the phone exchanged hands frequently.