[freeside-commits] branch FREESIDE_3_BRANCH updated. 85c406c3ceb14f4b6c3f325f498a79a443103c18
Ivan
ivan at 420.am
Tue Jan 26 20:29:48 PST 2016
The branch, FREESIDE_3_BRANCH has been updated
via 85c406c3ceb14f4b6c3f325f498a79a443103c18 (commit)
from bdc111f8cce007c0129c9b399b827b190cbf2d98 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 85c406c3ceb14f4b6c3f325f498a79a443103c18
Author: Ivan Kohler <ivan at freeside.biz>
Date: Tue Jan 26 20:29:47 2016 -0800
respect card-types config in backend (one-off payments), RT#39861
diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm
index 23eb591..ff9be69 100644
--- a/FS/FS/Mason.pm
+++ b/FS/FS/Mason.pm
@@ -142,6 +142,7 @@ if ( -e $addl_handler_use_file ) {
use FS::Msgcat qw(gettext geterror);
use FS::Misc qw( send_email send_fax ocr_image
states_hash counties cities state_label
+ card_types
);
use FS::Misc::eps2png qw( eps2png );
use FS::Report::FCC_477;
diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi
index efba9ed..b7d427e 100644
--- a/httemplate/misc/process/payment.cgi
+++ b/httemplate/misc/process/payment.cgi
@@ -105,14 +105,22 @@ if ( $payby eq 'CHEK' ) {
}
$payinfo =~ s/\D//g;
$payinfo =~ /^(\d{13,16}|\d{8,9})$/
- or errorpage(gettext('invalid_card')); # . ": ". $self->payinfo;
+ or errorpage(gettext('invalid_card'));
$payinfo = $1;
validate($payinfo)
- or errorpage(gettext('invalid_card')); # . ": ". $self->payinfo;
+ or errorpage(gettext('invalid_card'));
- errorpage(gettext('unknown_card_type'))
- if $payinfo !~ /^99\d{14}$/ #token
- && cardtype($payinfo) eq "Unknown";
+ unless ( $self->payinfo =~ /^99\d{14}$/ ) { #token
+
+ my $cardtype = cardtype($payinfo);
+
+ errorpage(gettext('unknown_card_type'))
+ if $cardtype eq "Unknown";
+
+ my %bop_card_types = map { $_=>1 } values %{ card_types() };
+ errorpage("$cardtype not accepted") unless $bop_card_types{$cardtype};
+
+ }
if ( defined $cust_main->dbdef_table->column('paycvv') ) {
if ( length($cgi->param('paycvv') ) ) {
-----------------------------------------------------------------------
Summary of changes:
FS/FS/Mason.pm | 1 +
httemplate/misc/process/payment.cgi | 18 +++++++++++++-----
2 files changed, 14 insertions(+), 5 deletions(-)
More information about the freeside-commits
mailing list