eliminate some false laziness in FS::Misc::send_email vs. msg_template/email.pm send_...
[freeside.git] / FS / FS / agent_payment_gateway.pm
index bd99d0c..16979d8 100644 (file)
@@ -1,11 +1,8 @@
 package FS::agent_payment_gateway;
+use base qw(FS::Record);
+use FS::Record qw( qsearch );
 
 use strict;
-use vars qw( @ISA );
-use FS::Record qw( qsearch qsearchs );
-use FS::payment_gateway;
-
-@ISA = qw(FS::Record);
 
 =head1 NAME
 
@@ -115,15 +112,23 @@ sub check {
   $self->SUPER::check;
 }
 
-=item payment_gateway
-
-=cut
-
-sub payment_gateway {
-  my $self = shift;
-  qsearchs('payment_gateway', { 'gatewaynum' => $self->gatewaynum } );
+sub _upgrade_data {
+  # to simplify tokenization upgrades
+  die "Agent taxclass override no longer supported"
+    if qsearch({
+      'table' => 'agent_payment_gateway',
+      'extra_sql' => ' WHERE taxclass IS NOT NULL AND taxclass != \'\'',
+    });
+  die "Non ACH (E-check) Agent cardtype override no longer supported"
+    if qsearch({
+      'table' => 'agent_payment_gateway',
+      'extra_sql' => ' WHERE cardtype IS NOT NULL AND cardtype != \'\' AND cardtype != \'ACH\'',
+    });
+  return '';
 }
 
+=item payment_gateway
+
 =back
 
 =head1 BUGS