71513: Card tokenization [v3 test tweak] FREESIDE_3_BRANCH_71513
authorJonathan Prykop <jonathan@freeside.biz>
Wed, 4 Jan 2017 05:05:34 +0000 (23:05 -0600)
committerJonathan Prykop <jonathan@freeside.biz>
Wed, 4 Jan 2017 05:05:34 +0000 (23:05 -0600)
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 } );