projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
signup without a service
[freeside.git]
/
FS
/
FS
/
ClientAPI
/
Signup.pm
diff --git
a/FS/FS/ClientAPI/Signup.pm
b/FS/FS/ClientAPI/Signup.pm
index
468624c
..
67d11dc
100644
(file)
--- a/
FS/FS/ClientAPI/Signup.pm
+++ b/
FS/FS/ClientAPI/Signup.pm
@@
-2,6
+2,7
@@
package FS::ClientAPI::Signup;
use strict;
use vars qw( $DEBUG $me );
use strict;
use vars qw( $DEBUG $me );
+use subs qw( _myaccount_cache );
use Data::Dumper;
use Tie::RefHash;
use Digest::SHA qw(sha512_hex);
use Data::Dumper;
use Tie::RefHash;
use Digest::SHA qw(sha512_hex);
@@
-946,7
+947,12
@@
sub new_customer_minimal {
map { $_ => $packet->{$_} } qw(
salesnum
last first company daytime night fax mobile
map { $_ => $packet->{$_} } qw(
salesnum
last first company daytime night fax mobile
- ss
+ ss stateid stateid_state
+
+ payby
+ payinfo paycvv paydate payname paystate paytype
+ paystart_month paystart_year payissue
+ payip
),
} );
),
} );
@@
-977,7
+983,6
@@
sub new_customer_minimal {
my $part_pkg =
qsearchs( 'part_pkg', { 'pkgpart' => $pkgpart } )
or return { 'error' => "WARNING: unknown pkgpart: $pkgpart" };
my $part_pkg =
qsearchs( 'part_pkg', { 'pkgpart' => $pkgpart } )
or return { 'error' => "WARNING: unknown pkgpart: $pkgpart" };
- my $svcpart = $part_pkg->svcpart($svc_x);
my $cust_pkg = new FS::cust_pkg ( {
#later#'custnum' => $custnum,
my $cust_pkg = new FS::cust_pkg ( {
#later#'custnum' => $custnum,
@@
-986,35
+991,40
@@
sub new_customer_minimal {
#my $error = $cust_pkg->check;
#return { 'error' => $error } if $error;
#my $error = $cust_pkg->check;
#return { 'error' => $error } if $error;
- #should be all auto-magic and shit
- if ( $svc_x eq 'svc_acct' ) {
+ unless ( $svc_x eq 'none' ) {
- my $svc = new FS::svc_acct {
- 'svcpart' => $svcpart,
- map { $_ => $packet->{$_} }
- qw( username _password sec_phrase popnum domsvc ),
- };
+ my $svcpart = $part_pkg->svcpart($svc_x);
+ #should be all auto-magic and shit
+ if ( $svc_x eq 'svc_acct' ) {
- push @svc, $svc;
+ my $svc = new FS::svc_acct {
+ 'svcpart' => $svcpart,
+ map { $_ => $packet->{$_} }
+ qw( username _password sec_phrase popnum domsvc ),
+ };
- } elsif ( $svc_x eq 'svc_phone' ) {
-
- push @svc, new FS::svc_phone ( {
- 'svcpart' => $svcpart,
- map { $_ => $packet->{$_} }
- qw( countrycode phonenum sip_password pin ),
- } );
+ push @svc, $svc;
-
} elsif ( $svc_x eq 'svc_pbx
' ) {
+
} elsif ( $svc_x eq 'svc_phone
' ) {
-
push @svc, new FS::svc_pbx
( {
+
push @svc, new FS::svc_phone
( {
'svcpart' => $svcpart,
'svcpart' => $svcpart,
- map { $_ => $packet->{$_} }
- qw( id title ),
- } );
+ map { $_ => $packet->{$_} }
+ qw( countrycode phonenum sip_password pin ),
+ } );
+
+ } elsif ( $svc_x eq 'svc_pbx' ) {
+
+ push @svc, new FS::svc_pbx ( {
+ 'svcpart' => $svcpart,
+ map { $_ => $packet->{$_} }
+ qw( id title ),
+ } );
- } else {
- die "unknown signup service $svc_x";
+ } else {
+ die "unknown signup service $svc_x";
+ }
+
}
foreach my $svc ( @svc ) {
}
foreach my $svc ( @svc ) {
@@
-1056,12
+1066,13
@@
sub new_customer_minimal {
$session_id = sha512_hex(time(). {}. rand(). $$)
} until ( ! defined _myaccount_cache->get($session_id) ); #just in case
$session_id = sha512_hex(time(). {}. rand(). $$)
} until ( ! defined _myaccount_cache->get($session_id) ); #just in case
- _cache->set( $session_id, $session, '1 hour' ); # 1 hour?
+ _
myaccount_
cache->set( $session_id, $session, '1 hour' ); # 1 hour?
my %return = ( 'error' => '',
'signup_service' => $svc_x,
'custnum' => $cust_main->custnum,
'session_id' => $session_id,
my %return = ( 'error' => '',
'signup_service' => $svc_x,
'custnum' => $cust_main->custnum,
'session_id' => $session_id,
+ map { $_ => $cust_main->$_ } qw( first last company ),
);
if ( $svc[0] ) {
);
if ( $svc[0] ) {