you're describing a lightning payment flow. this is exactly how it works:
1. payer sends invoice with optional deposit 2. receiver pays invoice and gets locked funds in channel 3. if receiver "clicks on ok", payment is settled and deposit is returned