[ic] Payment.pm module problem

J P interchange-users@icdevgroup.org
Tue Jul 1 12:37:01 2003

I'm hoping someone might be able to help with this. 
I'm sorry this is pretty long complicated, let me try
to explain what's going wrong.  And I really do need
some help fixing this, please :)

We have a different gateway than the standard packages
included in the tarball so we coded our own module
like the BofA.pm module.  We've been running it for a
while and just started noticing some problems when we
turned debug on and they may or may not have been
there since the beginning.  Basically about 60% of my
pre-authorizations from the gateway are coming back
with a 500 server error message in the debug log for
the response from the gateway and not the
authorization or decline that should be coming back. 
However in our merchant account admin, the
transactions are processed just fine.  I'm pretty sure
it's being caused by either our server / interchange
and not the gateway processor.  And we did modify our
Payment module so that if this error comes up we'll
capture the order and deal with the declines and such

Below I have an the code from Payment.pm with the
extra debugging lines added in (otherwise there are no
changes I'm aware of to Payment.pm) and the responses
returned in the debug log.  And FWIW we are running on
FreeBSD with MySQL.  LWP and SSLeay are both installed
and working fine.

The reason we turned on debug is we started noticing a
lot of "Auto-create of user failed" messages in the
error log and it turned out that if a person didn't
fill in shipping info (just billing) then when it
tried the insert using zip instead of b_zip, the
insert failed.  I went into log_transactions (3
changes) and log_entry (1 change) and changed zip to
b_zip and that fixed the first problem, but it still
doesn't help with the server error problem.  In our
case we have it so a billing info is required (which
is should be) and shipping info is optional (only
filled in when it's different usually).

We did upgrade LWP to the newest version and that
didn't help.  We also wrote a test script to take the
same exact data we are sending to the gateway using
LWP and process it outside of IC to rule out the
gateway and LWP being the issue and it processed fine,
no server errors.  And I have searched and searched
through the archives for anything even closely related
to the problem with no luck.

And I've also looked at all of these transactions to
find any commonality that all of the server error
transactions had, but nothing.  Some were approved,
others declined.  Some had shipping addresses, others
had none.  Didn't matter what type of credit card or
how much the order was, how many items there were,

Here goes, first for the relevant area of Payment.pm
(the lines with mask are the new debug lines we added)

::logDebug("mask: placing LWP request to " .
$submit_url );
::logDebug("mask: placing LWP request with params: " .
join(",",@query) );
::logDebug("mask: placing LWP request with header: " .
::uneval_it(\%header) );
::logDebug("placing LWP request: " . ::uneval_it($req)
                 my $resp = $ua->request($req);
::logDebug("mask: LWP response request: " .
$resp->content() );
                $result{status_line} =
                $result{status_line} =~ /(\d+)/
                        and $result{response_code} =
                $result{header_string} =
                $result{header_string} =~
::logDebug("received LWP header: " .
                $result{result_page} =
::logDebug("received response page: " .
::logDebug("returning thing: " . ::uneval_it(\%result)

Now for the info in the debug log (I have replace real
info with dummy info for security purposes)

Vend::Payment:debug: mask: placing LWP request to
Vend::Payment:debug: mask: placing LWP request with
params: (params listed here removed for security)
Vend::Payment:debug: mask: placing LWP request with
header: {'User-Agent' => "Vend::Payment (Interchange
version 4.8.6)",}
Vend::Payment:debug: placing LWP request: 'something
Vend::Payment:debug: mask: LWP response request:
Vend::Payment:debug: received LWP header: 500
(Internal Server Error) read failed:
Client-Date: Tue, 01 Jul 2003 07:14:02 GMT
Vend::Payment:debug: received response page:
Vend::Payment:debug: returning thing: {'result_page'
=> "",'response_code' => "500",'header_string' => "500
(Internal Server Error) read failed:

If you need any additional info, please let me know. 
If anyone can help I would appreciate it SO much.


Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!