X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=eSelectPlus.pm;fp=eSelectPlus.pm;h=8ef134f2dbb5498c3e5c5697b2c8eb8329d7576f;hb=80ce0eff9b7c99603ba4dff0e3bc4b9176f564a6;hp=8ba14958203b9e77bd5816d7ca58dda202862090;hpb=cb4e9138aa4caf1e38f24484d79e024d85a11ee5;p=Business-OnlinePayment-eSelectPlus.git diff --git a/eSelectPlus.pm b/eSelectPlus.pm index 8ba1495..8ef134f 100644 --- a/eSelectPlus.pm +++ b/eSelectPlus.pm @@ -8,7 +8,7 @@ use Business::OnlinePayment::HTTPS 0.03; use vars qw($VERSION $DEBUG @ISA); @ISA = qw(Business::OnlinePayment::HTTPS); -$VERSION = '0.04'; +$VERSION = '0.05'; $DEBUG = 0; sub set_defaults { @@ -125,6 +125,9 @@ sub submit { } elsif ( $action eq 'completion' || $action eq 'purchasecorrection' ) { + $self->{_content}{comp_amount} = delete $self->{_content}{amount} + if $action eq 'completion'; + $self->required_fields( qw( login password order_number authorization ) ); } elsif ( $action eq 'refund' ) { @@ -159,9 +162,10 @@ sub submit { my( $page, $response, @reply_headers) = $self->https_post( $post_data ); - #my %reply_headers = @reply_headers; - #warn join('', map { " $_ => $reply_headers{$_}\n" } keys %reply_headers ) - # if $DEBUG; + if ($DEBUG > 1) { + my %reply_headers = @reply_headers; + warn join('', map { " $_ => $reply_headers{$_}\n" } keys %reply_headers) + } if ($response !~ /^200/) { # Connection error @@ -169,7 +173,6 @@ sub submit { $self->is_success(0); my $diag_message = $response || "connection error"; die $diag_message; - } # avs_code - eSELECTplus_Perl_IG.pdf Appendix F @@ -205,10 +208,8 @@ sub submit { die "gateway error: ". $self->GetXMLProp( $page, 'Message' ) if $result =~ /^null$/i; - # New unique reference created by the gateway - $self->order_number($self->GetXMLProp($page, 'ReferenceNum')); # Original order_id supplied to the gateway - #$self->order_number($self->GetXMLProp($page, 'ReceiptId')); + $self->order_number($self->GetXMLProp($page, 'ReceiptId')); # We (Whizman & DonorWare) do not have enough info about "ISO" # response codes to make use of them. @@ -219,7 +220,7 @@ sub submit { if ( $result =~ /^\d+$/ && $result < 50 ) { $self->is_success(1); - $self->authorization($self->GetXMLProp($page, 'AuthCode')); + $self->authorization($self->GetXMLProp($page, 'TransID')); } elsif ( $result =~ /^\d+$/ ) { $self->is_success(0); my $tmp_msg = $self->GetXMLProp( $page, 'Message' ); @@ -343,15 +344,24 @@ Content required: type, login, password, action, amount, card_number, expiration For detailed information see L. -=head1 Note for Canadian merchants upgrading to 0.03 +=head1 NOTES + +=head2 Note for Canadian merchants upgrading to 0.03 As of version 0.03, this module now defaults to the US Moneris. Make sure to pass currency=>'CAD' for Canadian transactions. +=head2 Note for upgrading to 0.05 + +As of version 0.05, the bank authorization code is discarded (AuthCode), +so that authorization() and order_number() can return the 2 fields needed +for capture. See also +cpansearch.perl.org/src/IVAN/Business-OnlinePayment-3.02/notes_for_module_writers_v3 + =head1 AUTHOR Ivan Kohler -Randall Whitman +Randall Whitman L =head1 SEE ALSO