use FS::payby;
use FS::banned_pay;
use FS::part_tag;
+use FS::cust_payby;
$DEBUG = 1;
$me = '[FS::ClientAPI::Signup]';
'security_phrase' => $conf->exists('security_phrase'),
- 'nomadix' => $conf->exists('signup_server-nomadix'),
-
'payby' => [ $conf->config('signup_server-payby') ],
'payby_longname' => [ map { FS::payby->longname($_) }
'agentnum2part_pkg' => $agentnum2part_pkg,
'svc_acct_pop' => [ map $_->hashref, qsearch('svc_acct_pop',{} ) ],
- 'nomadix' => $conf->exists('signup_server-nomadix'),
'payby' => [ $conf->config('signup_server-payby') ],
'card_types' => card_types(),
- 'paytypes' => [ @FS::cust_main::paytypes ],
+ 'paytypes' => [ FS::cust_payby->paytypes ],
'cvv_enabled' => 1,
'require_cvv' => $conf->exists('signup-require_cvv'),
'stateid_enabled' => $conf->exists('show_stateid'),
( map { $_ => $packet->{$_} } qw(
salesnum
ss stateid stateid_state
-
- payby
- payinfo paycvv paydate payname paystate paytype
- paystart_month paystart_year payissue
- payip
-
locale
-
referral_custnum comments
)
),
);
+ my %insert_options = ();
+ if ( $packet->{payby} =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) {
+ $insert_options{cust_payby} = [
+ new FS::cust_payby {
+ map { $_ => $packet->{$_} } qw(
+ payby
+ payinfo paycvv paydate payname paystate paytype
+ paystart_month paystart_year payissue
+ payip
+ ),
+ }
+ ];
+ }
+
my $template_custnum = $conf->config('signup_server-prepaid-template-custnum');
my $cust_main;
if ( $template_custnum && $packet->{prepaid_shortform} ) {
&& ! $cust_main->paycvv
&& $conf->exists('signup-require_cvv');
- $cust_main->payinfo($cust_main->daytime)
- if $cust_main->payby eq 'LECB' && ! $cust_main->payinfo;
-
my @invoicing_list = $packet->{'invoicing_list'}
? split( /\s*\,\s*/, $packet->{'invoicing_list'} )
: ();
- my %insert_options = ();
-
my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups');
my @tax_exempt = grep { $packet->{"tax_$_"} eq 'Y' } @exempt_groups;
$insert_options{'tax_exemption'} = {
map { $_ => $packet->{$_} }
qw( username _password sec_phrase popnum domsvc ),
};
+
+ my $error = $svc->is_password_allowed($packet->{_password});
+ return { error => $error } if $error;
my @acct_snarf;
my $snarfnum = 1;
#this used to apply a credit, but now we can void invoices...
foreach my $cust_bill (@cust_bill) {
- my $voiderror = $cust_bill->void();
- warn "Error voiding cust bill after decline: $voiderror";
+ my $voiderror = $cust_bill->void('automatic payment failed');
+ warn "Error voiding cust bill after decline: $voiderror" if $voiderror;
}
#should check list for errors...
last first company daytime night fax mobile
ss stateid stateid_state
- payby
- payinfo paycvv paydate payname paystate paytype
- paystart_month paystart_year payissue
- payip
-
locale
),
} );
+ my %opt = ();
+ if ( $packet->{payby} =~ /^(CARD|DCRD|CHEK|DCHK)$/ ) {
+ $opt{cust_payby} = [
+ new FS::cust_payby {
+ map { $_ => $packet->{$_} } qw(
+ 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) {
}
- my %opt = ();
if ( $invoicing_list[0] && $packet->{'_password'} ) {
$opt{'contact'} = [
new FS::contact { 'first' => $cust_main->first,