Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

hi all

I am having a bit of difficulty with a little script I have written to post my customers orders to authorize.net. I am using something very similar to the example below:

http://www.authorizenet.com/alliances/info.php?id=1

The problem is, most orders go through ok, but quite a few just get no data back from authorize.net so the script thinks it has failed but authorize.net process the transaction. I think this is due to a timeout on the sctipt, but I cant find anywhere to set a timeout with Net::SSLeay

Am I missing a glaring solution? Please help!!

anonymous editor pops in and sticks some braces around that url

Replies are listed 'Best First'.
Re: Authorize.Net
by dws (Chancellor) on Aug 07, 2003 at 20:45 UTC
    Am I missing a glaring solution?

    Without some indication of how you're trying to post, we can only speculate. If you want help, please post (as a reply to this thread) a small sample of code that demonstrates the problem.

      Well my code resembles that of the example I gave above, but here is where it fails...

      my $post_data = &make_form(%submit_data); my ($page,$response,%headers) = &post_https($server,$port,$path,'',$ +post_data); if (defined $page) { $csv = new Text::CSV(); $csv->parse($page); @col = $csv->fields(); ...... }

      The problem is that @col is empty .. which makes me think the process is timimg out and not getting the page back from authorize.net.
        I should have said a small, complete example that demonstrates the failure. There might be a problem in post_https(), but without seeing the code, how can we know.

        I don't see any evidence, for example, that you're looking for error codes in $response.

        What does $reponse look like when you see a failure? For that matter, what does $page look like? Perhaps you're getting back an error page that can't be parsed.

        I must stress that this only happens in about 1/3 so I know it does work .. but I think it is a timeout
Re: Authorize.Net
by derby (Abbot) on Aug 08, 2003 at 12:23 UTC
    Aack! Use Online::Business::Payment::AuthorizeNet.

    -derby

    update:

    The problem is that @col is empty .. which makes me think the process is timimg out and not getting the page back from authorize.net.

    Right. Sometimes that happens. You need to then check %headers for any clues.