How to enable a form to process payments and deduct inventory stock.

I want the purchase to be completed exclusively through the form.