Option to ignore old CDRs, RT#81480
[freeside.git] / httemplate / elements / handle_uri_query
index eb7ea1a..b86ef00 100644 (file)
@@ -1,8 +1,30 @@
+<%doc>
+
+Usage (before accessing any $cgi parameters):
+
+$m->comp('/elements/handle_uri_query');
+
+</%doc>
 <%init>
+
+#my %opt = @_;
+
 if ( $cgi->param('redirect') ) {
   my $session = $cgi->param('redirect');
+  my $maxrecords = $cgi->param('maxrecords');
+
   my $pref = $FS::CurrentUser::CurrentUser->option("redirect$session");
   die "unknown redirect session $session\n" unless length($pref);
   $cgi = new CGI($pref);
+
+  foreach my $param (grep /pay(info\d?|cvv)$/, $cgi->param) {
+    my $value = $cgi->param($param);
+    next unless length($value);
+    my $decrypted = FS::Record->decrypt( $value );
+    $cgi->param($param, $decrypted);
+  }
+
+  $cgi->param('maxrecords', $maxrecords) if $maxrecords =~ /^(\d+)$/;
+
 }
 </%init>