use vars qw($VERSION $DEBUG @ISA $me);
@ISA = qw(Business::OnlinePayment::HTTPS);
-$VERSION = '0.08';
+$VERSION = '0.09_03';
$VERSION = eval $VERSION; # modperlstyle: convert the string into a number
$DEBUG = 0;
response_page response_code response_headers
));
- # module specific data
- if ( $opts{debug} ) {
- $self->debug( $opts{debug} );
- delete $opts{debug};
- }
+ $DEBUG = exists($opts{debug}) ? $opts{debug} : 0;
+ # module specific data
my %_defaults = ();
foreach my $key (keys %opts) {
$key =~ /^default_(\w*)$/ or next;
$self->is_success(0);
$self->map_fields();
- my @required_fields = qw(action login type);
+ my @required_fields = qw(action login password type);
my $action = lc($self->{_content}->{action});
my $type = $self->transaction_type();
"(HTTPS headers: ".
join(", ", map { "$_ => ". $headers{$_} } keys %headers ). ") ".
"(Raw HTTPS content: $page)"
- if $DEBUG;
+ if $DEBUG > 1;
return unless $server_response=~ /^200/;
$transaction_id = $page;
}
UserHost => 'UserHost',
UDField1 => 'UDField1',
UDField2 => 'UDField2',
- UDField3 => 'UDField3',
+ UDField3 => \"$me $VERSION", #'UDField3',
ActionCode => 'ActionCode',
IndustryInfo => \%industryinfo,
ShippingInfo => \%shippinginfo,
$writer->endTag('JetPay');
$writer->end();
- warn "$post_data\n" if $DEBUG;
+ warn "$post_data\n" if $DEBUG > 1;
my ($page,$server_response,%headers) = $self->https_post($post_data);
- warn "$page\n" if $DEBUG;
+ warn "$page\n" if $DEBUG > 1;
my $response = {};
if ($server_response =~ /^200/){
$self->is_success($self->result_code() eq '000' ? 1 : 0);
unless ($self->is_success()) {
- unless ( $self->error_message() ) { #additional logging information
- $self->error_message(
- "(HTTPS response: $server_response) ".
- "(HTTPS headers: ".
- join(", ", map { "$_ => ". $headers{$_} } keys %headers ). ") ".
- "(Raw HTTPS content: $page)"
- );
+ unless ( $self->error_message() ) {
+ if ( $DEBUG ) {
+ #additional logging information, possibly too sensitive for an error msg
+ # (IPPay seems to have a failure mode where they return the full
+ # original request including card number)
+ $self->error_message(
+ "(HTTPS response: $server_response) ".
+ "(HTTPS headers: ".
+ join(", ", map { "$_ => ". $headers{$_} } keys %headers ). ") ".
+ "(Raw HTTPS content: $page)"
+ );
+ } else {
+ $self->error_message('No ResponseText or ErrMsg was returned by IPPay (enable debugging for raw HTTPS response)');
+ }
}
}
UserHost => 'UserHost',
UDField1 => 'UDField1',
UDField2 => 'UDField2',
- UDField3 => 'UDField3',
ActionCode => 'ActionCode',
IndustryInfo
Type => 'IndustryInfo',