summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorjeff <jeff>2006-11-27 07:11:53 +0000
committerjeff <jeff>2006-11-27 07:11:53 +0000
commitb5bd90f5ee35af1ca7989bf92dc50ada7c2cbcb8 (patch)
tree83f002ad9c43424027b7f9aff9c0b541a0eabbe8 /FS
parentd1688630a1f43fcd0e780d98556282de3e756f6a (diff)
order package from self-service
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/ClientAPI/Signup.pm15
1 files changed, 14 insertions, 1 deletions
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'};