X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=FS%2FFS%2FClientAPI%2FSignup.pm;h=abfcac88280522bcb189ae9032a40d088fb31612;hb=697ca3ce9ca4a6a357d6d2b1cfc31525edf252dc;hp=9d0bcf322d78758b9b015e6bf0c6ea5aebe4dd08;hpb=ffa2c69b3170181065cfe3f249d6f0508c06b48e;p=freeside.git diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm index 9d0bcf322..abfcac882 100644 --- 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 subs qw( _myaccount_cache ); use Data::Dumper; use Tie::RefHash; use Digest::SHA qw(sha512_hex); @@ -931,7 +932,6 @@ sub new_customer_minimal { 'refnum' => $packet->{refnum} || $conf->config('signup_server-default_refnum'), 'tagnum' => [ FS::part_tag->default_tags ], - 'payby' => 'BILL', map { $_ => $packet->{$_} } qw( salesnum @@ -941,6 +941,16 @@ sub new_customer_minimal { } ); + if ( grep length($packet->{$_}), FS::cust_main->location_fields ) { + my $bill_hash; + foreach my $f (FS::cust_main->location_fields) { + $bill_hash->{$f} = $packet->{$f}; + } + my $bill_location = FS::cust_location->new($bill_hash); + $cust_main->set('bill_location' => $bill_location); + $cust_main->set('ship_location' => $bill_location); + } + my @invoicing_list = $packet->{'invoicing_list'} ? split( /\s*\,\s*/, $packet->{'invoicing_list'} ) : (); @@ -1033,10 +1043,10 @@ sub new_customer_minimal { my $session_id; do { - $session_id = sha1_hex(time(). {}. rand(). $$) + $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,