Problem with reducing the package limit (+solution)

I’ve tested this solution, but it doesn’t work fully. Packages are calculated correctly, but listing is also added if the payment is not completed.
I propose another change that works for me:

in file
\plugins\hivepress-paid-listings\includes\components\class-listing-package.php

there is

if ( in_array( $new_status, [ ‘processing’, ‘completed’ ], true ) ) {

Changed to:

if ( in_array( $new_status, [ ‘processing’ ], true ) ) {

( without ‘completed’ - when the order status is changed to “completed” )

I only have instant payments and I always get the “processing” status after a successful payment. When I change the status of the order to “completed” then nothing happens, no additional package for the user is added.
For me this solves the problem of packets, so far I do not see the error of this solution.