[freeside-commits] branch master updated. 96af02574ea6b1b59f81a1215330b682a8dee635

Ivan ivan at 420.am
Mon Oct 24 11:34:46 PDT 2016


The branch, master has been updated
       via  96af02574ea6b1b59f81a1215330b682a8dee635 (commit)
      from  f675734f1eda5b39f891a6fc8f2f29cbd2e36c35 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 96af02574ea6b1b59f81a1215330b682a8dee635
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Oct 24 11:34:43 2016 -0700

    PCI compliance section showing tokenization/encryption status and SAQ level

diff --git a/httemplate/view/Status.html b/httemplate/view/Status.html
index 7fb9d0b..1ea19e9 100644
--- a/httemplate/view/Status.html
+++ b/httemplate/view/Status.html
@@ -14,6 +14,10 @@
 <& /elements/footer.html &>
 <%init>
 
+###
+# Basics and Daemons
+###
+
 my $os;
 -e '/usr/bin/lsb_release' and run( ['lsb_release', '-d'], '>',\$os );
 if ( ! $@ && $os =~ /^\s*Description:\s*(.+)$/ ) {
@@ -97,6 +101,11 @@ tie my %status, 'Tie::IxHash',
   ],
 ;
 
+
+###
+# Replication
+###
+
 if ( $db eq 'PostgreSQL' ) {
 
   my $enabled =    FS::Record->scalar_sql('SHOW wal_level')    eq 'hot_standby'
@@ -141,6 +150,11 @@ if ( $db eq 'PostgreSQL' ) {
 
 }
 
+
+###
+# CDR Processing
+###
+
 if ( _is_running('cdrd') ) {
 
   my $delay = FS::Record->scalar_sql('
@@ -200,6 +214,75 @@ if ( _is_running('cdrd') ) {
 
 }
 
+
+###
+# PCI Compliance
+###
+
+my($store, $tokenize) = (0,0);
+foreach my $agent (
+  qsearch({
+    'table'     => 'agent',
+    'hashref'   => { 'disabled' => '', },
+    'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+  })
+) {
+  my $gateway = $agent->payment_gateway('method'=>'VISA card');
+  next unless $gateway->gateway_namespace eq 'Business::OnlinePayment';
+  eval "use Business::OnlinePayment";
+  die $@ if $@; #die?
+  my $bop = new Business::OnlinePayment( $gateway->gateway_module,
+                                         $gateway->gatewaynum
+                                           ? $gateway->options
+                                           : @{ $gateway->get('options') }
+                                       );
+  my %actions = $bop->info('supported_actions');
+  if ( $actions{'CC'} && grep /^Tokenize$/, @{$actions{'CC'}} ) {
+    $tokenize++;
+  } else {
+    $store++;
+  }
+  
+}
+warn $tokenize;
+warn $store;
+
+if ( $tokenize && ! $store ) {
+
+  $status{'PCI Compliance'} = [
+    { 'title' => 'Tokenization',
+      'value' => 'Enabled',
+    },
+    { 'title' => 'SAQ type',
+      'value' => 'A / A-EP',
+    },
+  ];
+
+} elsif ( $store ) {
+
+  my $conf = new FS::Conf; #wow, didn't need this before?
+
+  $status{'PCI Compliance'} = [
+    { 'title' => 'Tokenization',
+      'value' => $tokenize ? 'Partialy enabled (some agents)' : 'Disabled'
+    },
+    { 'title' => 'Encryption',
+      'value' =>
+        ( $conf->exists('encryption') && $conf->config('encryptionpublickey')
+            ? 'Enabled' : 'Disabled'
+        ),
+    },
+    { 'title' => 'SAQ type',
+      'value' => 'D (enable tokenization for A / A-EP)',
+    },
+  ];
+
+}
+
+###
+# Subroutines
+###
+
 sub _is_running {
   my $thing = shift;
 

-----------------------------------------------------------------------

Summary of changes:
 httemplate/view/Status.html |   83 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 83 insertions(+)




More information about the freeside-commits mailing list