71513: Card tokenization [v3 test tweak]
[freeside.git] / FS / t / suite / 13-tokenization.t
index 019b61c..a7226e6 100755 (executable)
@@ -30,10 +30,10 @@ ok( !$err, 'schema upgrade' ) or BAIL_OUT('Error string: '.$!);
 # some pre-upgrade cleanup, upgrade will fail if these are still configured
 foreach my $cust_main ( $fs->qsearch('cust_main') ) {
   my @count = $fs->qsearch('agent_payment_gateway', { agentnum => $cust_main->agentnum } );
-  if (@count > 1) {
+  if (@count > 0) {
     note("DELETING CARDTYPE GATEWAYS");
     foreach my $apg (@count) {
-      $err = $apg->delete if $apg->cardtype;
+      $err = $apg->delete;
       last if $err;
     }
     @count = $fs->qsearch('agent_payment_gateway', { agentnum => $cust_main->agentnum } );