Now Linda needs to schedule the batch that runs the direct debit of the invoices.
.png?sv=2026-02-06&spr=https&st=2026-12-02T18%3A06%3A30Z&se=2026-12-02T18%3A18%3A30Z&sr=b&sp=r&sig=jH2OVeNirzfTieWJzY%2Bn4KNuAZ2jDaS%2FDTkfOiWErk8%3D)
This article explains how to schedule a direct debit batch that debits invoices on the requested dates (in this article, for example, on the 5th of the month). The batch only debits invoices whose payment date is today or earlier.
Schedule a direct debit batch
To schedule the direct debit batch, Linda goes to Setup > Apex Classes > Schedule Apex and enters a job name (for example, Direct debit batch).
She then clicks the magnifying glass next to Apex Class and selects PspInvoiceScheduled.
Together, Linda and Mary define when the direct debit batch runs (for example, once a month on the 5th), the start date, the end date, and the time.

You can also run a script from the Developer Console to test the batch:
Open the Salesforce Developer Console.

Click Open Execute Anonymous Window.

Copy and paste the script below and click Execute. Never use a value higher than 100 in the command.
Sofactoapp.PspInvoiceScheduled batch = new sofactoapp.PspInvoiceScheduled(); Database.executeBatch(batch, 100);
Trigger conditions
Well done!
Once scheduled, the batch sends the payment records linked to an invoice to Stripe when the following conditions are met:
The payment method is Stripe Recurring.
There is a PSP payment method with the status Active.
The payment date is today or earlier.
The invoice is issued or in draft, depending on the configuration of your legal entity.
The payment has the Pending checkbox selected (considered an unpaid invoice).
Use case: An invoice has a payment date of January 5, 2024. The PSP payment method was set to Active on January 10, 2024. The direct debit batch on February 5, 2024 debits both the January 5 and the February 5 invoices.
Trigger a direct debit manually from a payment
Outside the batch, you can exceptionally trigger the direct debit of a payment manually, for various reasons: the payment was rejected the first time and you want to try again, the payment should be debited instead of being paid by bank transfer, and so on.
On the payment record, the Collect this payment button sends the payment to Stripe:
As a Frisbii administrator, you can add filter conditions to the button so that it respects the trigger conditions described above.
Bank reconciliation
The direct debit batch ran successfully, without errors. After the batch has run, an invoice has been recreated in Stripe, together with the account and the contact. Stripe, as the PSP, handles the transaction.
The Pending checkbox on the payment is cleared automatically (the payment is considered paid).
The payment status changes to Cashed.
The payment date is filled in with the date of the direct debit batch.
The invoice is settled.
The Fees field (
sofactoapp__Fee__c) on the payment is filled in automatically: it brings the transaction fees charged by Stripe into Frisbii. Linda adds this field to the payment page layout so that Mary can see them.
The direct debit batch encountered an error. Linda reads the next article: Stripe recurring: API error logs
Frisbii tip
By default, after the customer has paid the invoice via Stripe, the payment record changes to Status: Cashed and the payment is no longer pending.
If you activate the UpdateRelatedPayment flow, the status changes to Collected instead and the payment stays pending.
This is because when a customer pays an invoice via Stripe, the amount is transferred to the company's bank account a few days later. The Collected status records a payment that has been made but is not yet visible in the bank account.