[bop-devel] quick fix for LinkPoint.pm
Jo Rhett
jrhett at netconsonance.com
Thu Jan 18 09:48:40 PST 2007
LinkPoint actually croaks when it receives input that it doesn't like,
instead of returning the error using the normal error_message mechanism.
This produces a server error for the user instead of a useful response.
This is a super-quick fix for that.
--
Jo Rhett
Network/Software Engineer
Net Consonance
-------------- next part --------------
--- LinkPoint.pm_orig Thu Jan 18 09:41:50 2007
+++ LinkPoint.pm Thu Jan 18 09:44:52 2007
@@ -4,7 +4,6 @@
use strict;
use vars qw($VERSION @ISA $DEBUG @EXPORT @EXPORT_OK);
-use Carp qw(croak);
use AutoLoader;
use Business::OnlinePayment;
@@ -109,12 +108,19 @@
/^(cc|visa|mastercard|american express|discover)$/i
) {
} else {
- Carp::croak("LinkPoint can't handle transaction type: ".
- $self->transaction_type());
+ $self->error_message("LinkPoint can't handle transaction type: ". $self->transaction_type());
+ $self->is_success(0);
+ $self->result_code('');
+ return;
}
$content{'expiration'} =~ /^(\d+)\D+\d*(\d{2})$/
- or croak "unparsable expiration $content{expiration}";
+ or do {
+ $self->error_message("unparsable expiration $content{expiration}");
+ $self->is_success(0);
+ $self->result_code('');
+ return;
+ }
( $month, $year ) = ( $1, $2 );
$month = '0'. $month if $month =~ /^\d$/;
More information about the bop-devel
mailing list