How do form payments post back to open invoices or orders?

When a customer pays through your form, the payment is synced to your accounting system and applied against the matching open invoice or sales order, reducing the balance in real time.