+
+###
+# 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++;
+ }
+
+}
+
+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
+###
+