use vars qw($VERSION $DEBUG @ISA $me);
@ISA = qw(Business::OnlinePayment::HTTPS);
-$VERSION = '0.09_01';
+$VERSION = '0.11_01';
$VERSION = eval $VERSION; # modperlstyle: convert the string into a number
$DEBUG = 0;
sub _info {
{
- 'info_version' => '0.01',
+ 'info_compat' => '0.01',
'module_version' => $VERSION,
'supported_types' => [ qw( CC ECHECK ) ],
'supported_actions' => { 'CC' => [
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();
}
if ($self->test_transaction()) {
$content{'login'} = 'TESTTERMINAL';
+ $self->server('testgtwy.ippay.com') if $self->server eq 'gtwy.ippay.com';
}
$self->content(%content);
"(HTTPS headers: ".
join(", ", map { "$_ => ". $headers{$_} } keys %headers ). ") ".
"(Raw HTTPS content: $page)"
- if $DEBUG;
+ if $DEBUG > 1;
return unless $server_response=~ /^200/;
$transaction_id = $page;
}
BillingCountry => \$country,
BillingPhone => 'phone',
Email => 'email',
- UserIPAddr => 'customer_ip',
+ UserIPAddress => 'customer_ip',
UserHost => 'UserHost',
UDField1 => 'UDField1',
UDField2 => 'UDField2',
ENCODING => 'us-ascii',
);
$writer->xmlDecl();
- $writer->startTag('JetPay');
+ $writer->startTag('ippay');
foreach ( keys ( %req ) ) {
$self->_xmlwrite($writer, $_, $req{$_});
}
- $writer->endTag('JetPay');
+ $writer->endTag('ippay');
$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)');
+ }
}
}
if ( $item eq 'ACH' ) {
$att{'Type'} = $self->{_content}->{'account_type'}
if $self->{_content}->{'account_type'}; #necessary so we don't pass empty?
- $att{'SEC'} = 'PPD';
+ $att{'SEC'} = $self->{_content}->{'nacha_sec_code'}
+ || ( $att{'Type'} =~ /business/i ? 'CCD' : 'PPD' );
}
$writer->startTag($item, %att);
BillingCountry => 'country', # forced to ISO-3166-alpha-3
BillingPhone => 'phone',
Email => 'email',
- UserIPAddr => 'customer_ip',
+ UserIPAddress => 'customer_ip',
UserHost => 'UserHost',
UDField1 => 'UDField1',
UDField2 => 'UDField2',
Reverse Authorization patch from dougforpres
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (c) 1999 Jason Kohles
+Copyright (c) 2002-2003 Ivan Kohler
+Copyright (c) 2008-2021 Freeside Internet Services, Inc.
+
+All rights reserved. This program is free software; you can redistribute it
+and/or modify it under the same terms as Perl itself.
+
+=head1 ADVERTISEMENT
+
+Need a complete, open-source back-office and customer self-service solution?
+The Freeside software includes support for credit card and electronic check
+processing with IPPay and over 50 other gateways, invoicing, integrated
+trouble ticketing, and customer signup and self-service web interfaces.
+
+http://freeside.biz/freeside/
+
=head1 SEE ALSO
perl(1). L<Business::OnlinePayment>.