X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FClientAPI%2FSignup.pm;h=d3e534cd02a3062f329f95100b6ea7796568dc13;hb=817c1ce0e1cbcfd1f684222c66f46dd13b2d6dd7;hp=6116609c8b8427f4f10df9ccbd66c50758dbd1eb;hpb=403bd5f61004717ecfecf8c5211141939e3b7176;p=freeside.git diff --git a/FS/FS/ClientAPI/Signup.pm b/FS/FS/ClientAPI/Signup.pm index 6116609c8..d3e534cd0 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); @@ -530,6 +531,7 @@ sub new_customer { 'tagnum' => [ FS::part_tag->default_tags ], ( map { $_ => $packet->{$_} } qw( + salesnum ss stateid stateid_state payby @@ -624,7 +626,7 @@ sub new_customer { ); } - $cust_main->payby('BILL') # MCRD better? + $cust_main->payby('BILL') # MCRD better? no, that's for something else if $gw && $gw->gateway_namespace eq 'Business::OnlineThirdPartyPayment'; } @@ -930,15 +932,30 @@ 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 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 ), } ); + 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'} ) : (); @@ -1031,10 +1048,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,