From b5bd90f5ee35af1ca7989bf92dc50ada7c2cbcb8 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 27 Nov 2006 07:11:53 +0000 Subject: order package from self-service --- FS/FS/ClientAPI/Signup.pm | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'FS') diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm index 3daab9d81..8eeab1a47 100644 --- a/FS/FS/ClientAPI/Signup.pm +++ b/FS/FS/ClientAPI/Signup.pm @@ -119,6 +119,19 @@ sub signup_info { } else { return { 'error' => "Can't resume session" }; #better error message } + }elsif( exists $packet->{'customer_session_id'} ) { + my $cache = new FS::ClientAPI_SessionCache( { + 'namespace' => 'FS::ClientAPI::MyAccount', + } ); + $session = $cache->get($packet->{'customer_session_id'}); + if ( $session ) { + my $custnum = $session->{'custnum'}; + my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum }); + return { 'error' => "Can't find your customer record" } unless $cust_main; + $agentnum = $cust_main->agentnum; + } else { + return { 'error' => "Can't resume session" }; #better error message + } } $signup_info->{'part_pkg'} = []; @@ -159,7 +172,7 @@ sub signup_info { # delete $signup_info->{'part_pkg'}; #} - if ( $session ) { + if ( exists $packet->{'session_id'} ) { my $agent_signup_info = { %$signup_info }; delete $agent_signup_info->{agentnum2part_pkg}; $agent_signup_info->{'agent'} = $session->{'agent'}; -- cgit v1.2.1