How to remove data from outstanding transactions in automated payment processing

I am looking to process automated customer payments in a batch process.
I have written the following code to do this, but when I run the batch process again, the same data is processed as the first time, because the data is not removed from CustTransOpen after the series of processes is completed.
How can I remove it from CustTransOpen?

Below is the code used in the payment process.

                ttsbegin;
                SpecTransExecutionContext specTransExecutionContext = SpecTransExecutionContext::newFromSource(custTable);
                SpecTransManager specTransManager = SpecTransManager::construct(specTransExecutionContext.parmSpecContext());

                specTransManager.insert(custTransOpen.company(), custTransOpen.TableId, custTransOpen.RecId, custTransOpen.AmountCur, custTrans.CurrencyCode);
                ttscommit;
                ttsbegin;
                CustTrans::settleTransaction(specTransExecutionContext, CustTransSettleTransactionParameters::construct());
                ttscommit;

Anybody can help.
Thanks.