[freeside-commits] freeside/httemplate/edit/process payment_gateway.html, 1.5, 1.6
Jeff Finucane,420,,
jeff at wavetail.420.am
Tue Mar 10 09:14:13 PDT 2009
Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory wavetail.420.am:/tmp/cvs-serv17517/httemplate/edit/process
Modified Files:
payment_gateway.html
Log Message:
merge webpay support in with autoselection of old realtime_bop and realtime_refund_bop
Index: payment_gateway.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/payment_gateway.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- payment_gateway.html 13 Jan 2008 21:35:53 -0000 1.5
+++ payment_gateway.html 10 Mar 2009 16:14:11 -0000 1.6
@@ -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