X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FMyAccount.pm;h=a05c6f2048abbbec522b853ced92925b7110b454;hb=4cacb3fa439b56fc7c9a742b69ec3f6ffd660433;hp=a651a832274d9c1a4586714b82b979691ee58151;hpb=5fe84df65a55868bbc730bbcd8a8dbb4de7a7593;p=freeside.git diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index a651a8322..a05c6f204 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -74,8 +74,10 @@ sub skin_info { $agentnum = $sth->fetchrow_arrayref->[0] or die "no agentnum for custnum $custnum"; + #} elsif ( $context eq 'agent' ) { + } elsif ( $p->{'agentnum'} =~ /^(\d+)$/ ) { + $agentnum = $1; } - # elsif ( $context eq 'agent' ) { my $conf = new FS::Conf; @@ -94,10 +96,24 @@ sub skin_info { if $DEBUG > 1; $skin_info_cache_agent = { + 'agentnum' => $agentnum, ( map { $_ => scalar( $conf->config($_, $agentnum) ) } qw( company_name ) ), ( map { $_ => scalar( $conf->config("selfservice-$_", $agentnum ) ) } - qw( body_bgcolor box_bgcolor) ), + qw( body_bgcolor box_bgcolor + text_color link_color vlink_color hlink_color alink_color + font title_color title_align title_size menu_bgcolor menu_fontsize + ) + ), + ( map { $_ => $conf->exists("selfservice-$_", $agentnum ) } + qw( menu_skipblanks menu_skipheadings menu_nounderline ) + ), + ( map { $_ => scalar($conf->config_binary("selfservice-$_", $agentnum)) } + qw( title_left_image title_right_image + menu_top_image menu_body_image menu_bottom_image + ) + ), + 'logo' => scalar($conf->config_binary('logo.png', $agentnum )), ( map { $_ => join("\n", $conf->config("selfservice-$_", $agentnum ) ) } qw( head body_header body_footer company_address ) ), }; @@ -106,9 +122,6 @@ sub skin_info { } - use Data::Dumper; - warn Dumper($skin_info_cache_agent); - #{ %$skin_info_cache_agent }; $skin_info_cache_agent; @@ -261,7 +274,7 @@ sub access_info { return { %$info, 'custnum' => $custnum, 'access_pkgnum' => $session->{'pkgnum'}, - 'svcnum' => $session->{'svcnum'}, + 'access_svcnum' => $session->{'svcnum'}, }; } @@ -571,6 +584,11 @@ sub process_payment { my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ) or return { 'error' => "unknown custnum $custnum" }; + $p->{'amount'} =~ /^\s*(\d+(\.\d{2})?)\s*$/ + or return { 'error' => gettext('illegal_amount') }; + my $amount = $1; + return { error => 'Amount must be greater than 0' } unless $amount > 0; + $p->{'payname'} =~ /^([\w \,\.\-\']+)$/ or return { 'error' => gettext('illegal_name'). " payname: ". $p->{'payname'} }; my $payname = $1; @@ -641,7 +659,7 @@ sub process_payment { 'CHEK' => [ qw( ss paytype paystate stateid stateid_state payip ) ], ); - my $error = $cust_main->realtime_bop( $FS::payby::payby2bop{$payby}, $p->{'amount'}, + my $error = $cust_main->realtime_bop( $FS::payby::payby2bop{$payby}, $amount, 'quiet' => 1, 'payinfo' => $payinfo, 'paydate' => $p->{'year'}. '-'. $p->{'month'}. '-01', @@ -680,7 +698,6 @@ sub process_payment { } sub realtime_collect { - my $p = shift; my $session = _cache->get($p->{'session_id'}) @@ -695,6 +712,7 @@ sub realtime_collect { 'method' => $p->{'method'}, 'pkgnum' => $session->{'pkgnum'}, 'session_id' => $p->{'session_id'}, + 'apply' => 1, ); return { 'error' => $error } unless ref( $error ); @@ -931,7 +949,7 @@ sub list_svcs { # @svc_x; { - #no#'svcnum' => $session->{'svcnum'}, + 'svcnum' => $session->{'svcnum'}, 'custnum' => $custnum, 'svcs' => [ map {