There are instances where an invoice that is open may have multiple Stripe Payment Intents. In order to close out Stripe Payment Intents when an invoice status changes to paid, you will need to add a Saved Search ID.
Saved Search Template Name: PayPack Payment Intent Cancellation
After saving your Payment Intent Cancellation Saved Search ID, you will need to deploy the script nm PayPack for Payment Intent Cancel.