projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RT# 79902 - fixed so change payment information link will still work when upgraded...
[freeside.git]
/
fs_selfservice
/
FS-SelfService
/
cgi
/
selfservice.cgi
diff --git
a/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
b/fs_selfservice/FS-SelfService/cgi/selfservice.cgi
index
aadb4ac
..
dcfccdc
100755
(executable)
--- a/
fs_selfservice/FS-SelfService/cgi/selfservice.cgi
+++ b/
fs_selfservice/FS-SelfService/cgi/selfservice.cgi
@@
-127,7
+127,7
@@
unless ( $nologin_actions{$action} ) {
$cgi->param('password') =~ /^(.{0,$form_max})$/;
my $password = $1;
$cgi->param('password') =~ /^(.{0,$form_max})$/;
my $password = $1;
- if ( $cgi->param('email') =~ /^\s*([a-z0-9_\-\.\@]{1,$form_max})\s*$/i ) {
+ if ( $cgi->param('email') =~ /^\s*([a-z0-9_\-\.\
+\
@]{1,$form_max})\s*$/i ) {
my $email = $1;
$login_rv = login(
my $email = $1;
$login_rv = login(
@@
-306,8
+306,9
@@
sub process_change_ship {
sub process_change_pay {
my $postal = $cgi->param( 'postal_invoicing' );
my $payby = $cgi->param( 'payby' );
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 =
my @list =
- qw( payby payinfo payinfo1 payinfo2 month year pay
name
+ qw( payby payinfo payinfo1 payinfo2 month year pay
date payname custpaybynum
address1 address2 city county state zip country auto paytype
paystate ss stateid stateid_state invoicing_list
);
address1 address2 city county state zip country auto paytype
paystate ss stateid stateid_state invoicing_list
);
@@
-325,7
+326,11
@@
sub process_change_pay {
};
}
};
}
- _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 view_invoice {
}
sub view_invoice {
@@
-599,33
+604,33
@@
sub payment_results {
#the rest, it gives better error messages
$cgi->param('amount') =~ /^\s*(\d+(\.\d{2})?)\s*$/
#the rest, it gives better error messages
$cgi->param('amount') =~ /^\s*(\d+(\.\d{2})?)\s*$/
- or
die "Illegal amount: ". $cgi->param('amount')
; #!!!
+ or
return { 'error' => "Illegal amount: ". $cgi->param('amount') }
; #!!!
my $amount = $1;
my $payinfo = $cgi->param('payinfo');
$payinfo =~ s/[^\dx]//g;
my $amount = $1;
my $payinfo = $cgi->param('payinfo');
$payinfo =~ s/[^\dx]//g;
- $payinfo =~ /^([\dx]{13,1
6
}|[\dx]{8,9})$/
+ $payinfo =~ /^([\dx]{13,1
9
}|[\dx]{8,9})$/
#or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo;
#or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo;
- or
die "illegal card"
; #!!!
+ or
return { 'error' => "illegal card" }
; #!!!
$payinfo = $1;
unless ( $payinfo =~ /x/ ) {
validate($payinfo)
#or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo;
$payinfo = $1;
unless ( $payinfo =~ /x/ ) {
validate($payinfo)
#or $error ||= $init_data->{msgcat}{invalid_card}; #. $self->payinfo;
- or
die "invalid card"
; #!!!
+ or
return { 'error' => "invalid card" }
; #!!!
}
if ( $cgi->param('card_type') ) {
cardtype($payinfo) eq $cgi->param('card_type')
#or $error ||= $init_data->{msgcat}{not_a}. $cgi->param('CARD_type');
}
if ( $cgi->param('card_type') ) {
cardtype($payinfo) eq $cgi->param('card_type')
#or $error ||= $init_data->{msgcat}{not_a}. $cgi->param('CARD_type');
- or
die "not a ". $cgi->param('card_type')
;
+ or
return { 'error' => "not a ". $cgi->param('card_type') }
;
}
$cgi->param('paycvv') =~ /^\s*(.{0,4})\s*$/ or die "illegal CVV2";
my $paycvv = $1;
}
$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;
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";
my $year = $1;
$cgi->param('payname') =~ /^(.{0,80})$/ or die "illegal payname";
@@
-1222,5
+1227,3
@@
sub include {
);
}
);
}
-
-