add separate mobile # to signup api
[freeside.git] / FS / FS / ClientAPI / Signup.pm
index 57091c4..5029598 100644 (file)
@@ -174,6 +174,7 @@ sub signup_info {
       'card_types'         => card_types(),
       'paytypes'           => [ @FS::cust_main::paytypes ],
       'cvv_enabled'        => 1,
+      'require_cvv'        => $conf->exists('signup-require_cvv'),
       'stateid_enabled'    => $conf->exists('show_stateid'),
       'paystate_enabled'   => $conf->exists('show_bankstate'),
       'ship_enabled'       => 1,
@@ -530,7 +531,7 @@ sub new_customer {
                          || $conf->config('signup_server-default_refnum'),
 
       ( map { $_ => $template_cust->$_ } qw( 
-              last first company daytime night fax 
+              last first company daytime night fax mobile
             )
       ),
 
@@ -561,7 +562,8 @@ sub new_customer {
 
       map { $_ => $packet->{$_} } qw(
         last first ss company 
-        daytime night fax stateid stateid_state
+        daytime night fax mobile
+        stateid stateid_state
         payby
         payinfo paycvv paydate payname paystate paytype
         paystart_month paystart_year payissue
@@ -631,6 +633,11 @@ sub new_customer {
       if $gw && $gw->gateway_namespace eq 'Business::OnlineThirdPartyPayment';
   }
 
+  return { 'error' => "CVV2 is required" }
+    if $cust_main->payby =~ /^(CARD|DCRD)$/
+    && ! $cust_main->paycvv
+    && $conf->exists('signup-require_cvv');
+
   $cust_main->payinfo($cust_main->daytime)
     if $cust_main->payby eq 'LECB' && ! $cust_main->payinfo;