+
+ #for third-party payments only, remove pending payments if they're in the
+ #'thirdparty' (waiting for customer action) state.
+ if ( $namespace eq 'Business::OnlineThirdPartyPayment' ) {
+ foreach ( grep { $_->status eq 'thirdparty' } @pending ) {
+ my $error = $_->delete;
+ warn "error deleting unfinished third-party payment ".
+ $_->paypendingnum . ": $error\n"
+ if $error;
+ }
+ @pending = grep { $_->status ne 'thirdparty' } @pending;
+ }
+