use Date::Parse 'str2time';
use Number::Format 1.50;
use FS::SelfService qw(
- access_info login_info login customer_info edit_info insert_payby update_payby
+ access_info login_info login customer_info edit_info insert_payby update_payby
invoice payment_info process_payment realtime_collect process_prepay
list_pkgs order_pkg signup_info order_recharge
part_svc_info provision_acct provision_external provision_phone provision_forward
}
return $payment_info if ( $payment_info->{'error'} );
- my $customer_info = customer_info(
- mask_ss => 1,
- mask_stateid => 1,
- session_id => $session_id,
- );
+ my $customer_info =
+ customer_info( 'session_id' => $session_id );
return {
%$payment_info,
%$customer_info,
};
}
sub change_ship { change_bill(@_); }
-sub change_pay { change_bill(@_); }
+sub change_pay {
+ my @payby = ('CARD', 'CHEK', 'DCHK');
+ change_bill(@_);
+}
sub change_creditcard_pay { change_bill('CARD'); }
sub change_check_pay { change_bill('CHEK'); }
sub process_change_pay {
my $postal = $cgi->param( 'postal_invoicing' );
my $payby = $cgi->param( 'payby' );
+ $cgi->param('paydate', $cgi->param('year') . '-' . $cgi->param('month') . '-01');
my @list =
- qw( payby payinfo payinfo1 payinfo2 month year payname
+ qw( payby payinfo payinfo1 payinfo2 month year paydate payname custpaybynum
address1 address2 city county state zip country auto paytype
paystate ss stateid stateid_state invoicing_list
);
};
}
- _process_change_info( 'change_pay', @list );
+ if (FS::SelfService->can('update_payby')) {
+ if ($cgi->param( 'custpaybynum' )) { _process_change_payby( 'change_pay', @list ); }
+ else { _process_insert_payby( 'change_pay', @list ); }
+ }
+ else { _process_change_info( 'change_pay', @list ); }
}
sub process_change_creditcard_pay {
$cgi->param('paycvv') =~ /^\s*(.{0,4})\s*$/ or die "illegal CVV2";
my $paycvv = $1;
- $cgi->param('month') =~ /^(\d{2})$/ or die "illegal month";
+ $cgi->param('month') =~ /^(\d{2})/ or die "illegal month";
my $month = $1;
- $cgi->param('year') =~ /^(\d{4})$/ or die "illegal year";
+ $cgi->param('year') =~ /^(\d{4})/ or die "illegal year";
my $year = $1;
$cgi->param('payname') =~ /^(.{0,80})$/ or die "illegal payname";