fix using encryption produces non-decrypted data in payment receipts, RT#5536
authorivan <ivan>
Mon, 22 Jun 2009 23:42:19 +0000 (23:42 +0000)
committerivan <ivan>
Mon, 22 Jun 2009 23:42:19 +0000 (23:42 +0000)
FS/FS/cust_pay.pm

index 0caba75..201b427 100644 (file)
@@ -216,11 +216,15 @@ sub insert {
       my $payby = $self->payby;
       my $payinfo = $self->payinfo;
       $payby =~ s/^BILL$/Check/ if $payinfo;
       my $payby = $self->payby;
       my $payinfo = $self->payinfo;
       $payby =~ s/^BILL$/Check/ if $payinfo;
-      $payinfo = $self->paymask if $payby eq 'CARD' || $payby eq 'CHEK';
+      if ( $payby eq 'CARD' || $payby eq 'CHEK' ) {
+        $payinfo = $self->paymask
+      } else {
+        $payinfo = $self->decrypt($payinfo);
+      }
       $payby =~ s/^CHEK$/Electronic check/;
 
       $error = send_email(
       $payby =~ s/^CHEK$/Electronic check/;
 
       $error = send_email(
-        'from'    => $conf->config('invoice_from', $self->cust_main->agentnum),
+        'from'    => $conf->config('invoice_from', $cust_main->agentnum),
                                    #invoice_from??? well as good as any
         'to'      => \@invoicing_list,
         'subject' => 'Payment receipt',
                                    #invoice_from??? well as good as any
         'to'      => \@invoicing_list,
         'subject' => 'Payment receipt',