this sucks
[Business-OnlinePayment-PaymentsGateway.git] / PaymentsGateway.pm
index 9d69b4c..956aed5 100644 (file)
@@ -11,7 +11,7 @@ require Exporter;
 @ISA = qw( Exporter AutoLoader Business::OnlinePayment);
 @EXPORT = qw();
 @EXPORT_OK = qw();
-$VERSION = '0.01';
+$VERSION = '0.02';
 
 $DEBUG = 0;
 
@@ -70,7 +70,6 @@ sub set_defaults {
   my $self = shift;
   $self->server('paymentsgateway.net');
   $self->port( 5050 );
-  $self->build_subs(qw(test_transaction));
 }
 
 sub map_fields {
@@ -92,6 +91,7 @@ sub map_fields {
     'discover'         => 10,
     'cc'               => 10,
     'check'            => 20,
+    'echeck'           => 20,
   );
 
   #pg_type/action = action + type  
@@ -175,7 +175,7 @@ sub submit {
     )
   );
 
-  if ( $content{'type'} =~ /^check$/i ) {
+  if ( $content{'type'} =~ /^e?check$/i ) {
     push @fields, qw( ecom_payment_check_trn
                       ecom_payment_check_account
                       ecom_payment_check_account_type );
@@ -184,7 +184,7 @@ sub submit {
   }
 
   my $request = join("\n", map { "$_=". $content{$_} }
-                           grep { $content{$_} ne '' }
+                           grep { defined($content{$_}) && $content{$_} ne '' }
                            @fields                     ).
                 "\nendofdata\n";