[freeside-commits] freeside/httemplate/edit/process payment_gateway.html, 1.5, 1.5.2.1

Jeff Finucane,420,, jeff at wavetail.420.am
Sun Mar 8 20:51:12 PDT 2009


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv17014/httemplate/edit/process

Modified Files:
      Tag: webpay_support_branch
	payment_gateway.html 
Log Message:
webpay support #4103

Index: payment_gateway.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/payment_gateway.html,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- payment_gateway.html	13 Jan 2008 21:35:53 -0000	1.5
+++ payment_gateway.html	9 Mar 2009 03:51:10 -0000	1.5.2.1
@@ -1,35 +1,22 @@
-%if ( $error ) {
-%  $cgi->param('error', $error);
-<% $cgi->redirect(popurl(2). "payment_gateway.html?". $cgi->query_string ) %>
-%} else { 
-<% $cgi->redirect(popurl(3). "browse/payment_gateway.html") %>
-%}
+<% include( 'elements/process.html',
+            'table'         => 'payment_gateway',
+            'viewall_dir'   => 'browse',
+            'args_callback' => $args_callback,
+          )
+%>
 <%init>
 
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
 
-my $gatewaynum = $cgi->param('gatewaynum');
-
-my $old = qsearchs('payment_gateway',{'gatewaynum'=>$gatewaynum}) if $gatewaynum;
-
-my $new = new FS::payment_gateway ( {
-  map {
-    $_, scalar($cgi->param($_));
-  } fields('payment_gateway')
-} );
+my $args_callback = sub {
+  my ( $cgi, $new ) = @_;
 
-my @options = split(/\r?\n/, $cgi->param('gateway_options') );
-pop @options
-  if scalar(@options) % 2 && $options[-1] =~ /^\s*$/;
-my %options = @options;
+  my @options = split(/\r?\n/, $cgi->param('gateway_options') );
+  pop @options
+    if scalar(@options) % 2 && $options[-1] =~ /^\s*$/;
+  (@options)
+};
 
-my $error;
-if ( $gatewaynum ) {
-  $error=$new->replace($old, \%options);
-} else {
-  $error=$new->insert(\%options);
-  $gatewaynum=$new->getfield('gatewaynum');
-}
 
 </%init>



More information about the freeside-commits mailing list