ticket 1568 config options for new echeck fields and addition to selfservice interface
[freeside.git] / FS / FS / ClientAPI / Signup.pm
index ac211ec..6dded4c 100644 (file)
@@ -67,14 +67,24 @@ sub signup_info {
 
     'card_types' => card_types(),
 
+    'paytypes' => [ @FS::cust_main::paytypes ],
+
     'cvv_enabled' => defined dbdef->table('cust_main')->column('paycvv'), # 1,
 
+    'stateid_enabled' => $conf->exists('show_stateid'),
+
+    'paystate_enabled' => $conf->exists('show_bankstate'),
+
     'ship_enabled' => defined dbdef->table('cust_main')->column('ship_last'),#1,
 
     'msgcat' => { map { $_=>gettext($_) } qw(
       passwords_dont_match invalid_card unknown_card_type not_a empty_password illegal_or_empty_text
     ) },
 
+    'label' => { map { $_ => FS::Msgcat::_gettext($_) } qw(
+      stateid stateid_state
+    ) },
+
     'statedefault' => $conf->config('statedefault') || 'CA',
 
     'countrydefault' => $conf->config('countrydefault') || 'US',
@@ -181,8 +191,9 @@ sub signup_info {
       unless @{ $signup_info->{'part_pkg'} };
   }
 
-  if ( $agentnum && ! @{ $signup_info->{'part_pkg'} } ) {
-    $signup_info->{'part_pkg'} = $signup_info->{'agentnum2part_pkg'}{$agentnum};
+  if ( $agentnum ) {
+    $signup_info->{'part_pkg'} = $signup_info->{'agentnum2part_pkg'}{$agentnum}
+      unless @{ $signup_info->{'part_pkg'} };
 
     $signup_info->{'part_referral'} =
       [
@@ -258,14 +269,14 @@ sub new_customer {
 
       last first ss company address1 address2
       city county state zip country
-      daytime night fax
+      daytime night fax stateid stateid_state
 
       ship_last ship_first ship_ss ship_company ship_address1 ship_address2
       ship_city ship_county ship_state ship_zip ship_country
       ship_daytime ship_night ship_fax
 
       payby
-      payinfo paycvv paydate payname
+      payinfo paycvv paydate payname paystate paytype
       paystart_month paystart_year payissue
       payip