1, ##nobalance
);
- $return{name} = $cust_main->first. ' '. $cust_main->get('last');
+ $return{first} = $cust_main->first;
+ $return{'last'} = $cust_main->get('last');
+ $return{name} = $cust_main->first. ' '. $cust_main->get('last');
$return{payby} = $cust_main->payby;
}
#maybe a little more expensive, but it should be cached by now
for (@location_editable_fields) {
- $return{$_} = $cust_main->bill_location->get($_);
- $return{'ship_'.$_} = $cust_main->ship_location->get($_);
+ $return{$_} = $cust_main->bill_location->get($_)
+ if $cust_main->bill_locationnum;
+ $return{'ship_'.$_} = $cust_main->ship_location->get($_)
+ if $cust_main->ship_locationnum;
}
if ( $cust_main->payby =~ /^(CARD|DCRD)$/ ) {
'card_types' => card_types(),
+ 'withcvv' => $conf->exists('selfservice-require_cvv'), #or enable optional cvv?
+ 'require_cvv' => $conf->exists('selfservice-require_cvv'),
+
'paytypes' => [ @FS::cust_main::paytypes ],
'paybys' => [ $conf->config('signup_server-payby') ],
$payinfo = $p->{'payinfo'};
+ my $onfile = 0;
+
#more intelligent matching will be needed here if you change
#card_masking_method and don't remove existing paymasks
- $payinfo = $cust_main->payinfo
- if $cust_main->paymask eq $payinfo;
+ if ( $cust_main->paymask eq $payinfo ) {
+ $payinfo = $cust_main->payinfo;
+ $onfile = 1;
+ }
$payinfo =~ s/\D//g;
$payinfo =~ /^(\d{13,16}|\d{8,9})$/
or return { 'error' => "CVV2 (CVC2/CID) is three digits." };
$paycvv = $1;
}
+ } elsif ( !$onfile && $conf->exists('selfservice-require_cvv') ) {
+ return { 'error' => 'CVV2 is required' };
}
} else {
'inbound' => ( $_ eq 'inbound' ? 1 : 0 ),
'begin' => ($cust_pkg->last_bill || 0),
'nonzero' => 1,
+ 'disable_charged_party' => 1,
);
$hash{$_} = $sum_cdr->hashref;
}
# we have to return the results all at once...
my($svc_phone, $begin, $end, %opt) = @_;
map [ $_->downstream_csv(%opt, 'keeparray' => 1) ],
- $svc_phone->get_cdrs( 'begin'=>$begin, 'end'=>$end, %opt );
+ $svc_phone->get_cdrs(
+ 'begin'=>$begin,
+ 'end'=>$end,
+ 'disable_charged_party' => 1,
+ %opt
+ );
}
sub list_cdr_usage {
$svc_acct->set_password($p->{'new_password'});
$error ||= $svc_acct->replace();
+ #regular pw change in self-service should change contact pw too, otherwise its
+ #way too confusing. hell its confusing they're separate at all, but alas.
+ #need to support the "ISP provides email that's used as a contact email" case
+ #as well as we can.
+ my $contact = FS::contact->by_selfservice_email($svc_acct->email);
+ if ( $contact && $contact->custnum == $custnum ) {
+ #svc_acct was successful but this one returns an error? "shouldn't happen"
+ $error ||= $contact->change_password($p->{'new_password'});
+ }
+
my($label, $value) = $svc_acct->cust_svc->label;
return { 'error' => $error,
}
-#regular pw change in self-service should change contact pw too, otherwise its way too confusing. hell its confusing they're separate at all, but alas. need to support the "ISP provides email that's used as a contact email" case as well as we can.
# sub contact_passwd {
# my $p = shift;
# my($context, $session, $custnum) = _custoragent_session_custnum($p);