Greetings all,
I've recently become involved in a project that requires me use Authorize.Net's payment gateway to process credit cards. Being a good little perler I used the modules that already exist to talk with AuthNet, Business::OnlinePayment and Business::OnlinePayment::AuthorizeNet.
Unfortunately I've discovered an issue that, while not causing the module to die, gives me a bunch of redefine errors that I'm sure shouldn't be.

The code snippet below is missing a bunch of the information you're supposed to pass through, but its not relevant for our immediate purposes.

my $tx = new Business::OnlinePayment("AuthorizeNet"); $tx->content( type => $cardtype, login => $login, password => $pass, amount => $amount, card_number => $ccnum, expiration => $ccexp); $tx->submit(); if($tx->is_success()) { &do_something; } else { &another; } $tx = new Business::OnlinePayment("AuthorizeNet"); $tx->content( type => $cardtype, login => $login, password => $pass, amount => $amount, card_number => $ccnum, expiration => $ccexp); $tx->submit if($tx->is_success()) { &do_something; } else { &another; }
This code is, of course, contrived, and only for demonstration purposes. My actual code has a single instance stored in a subroutine which I call to and pass along the transaction details.
When example is run I get a lovely stack of errors for the second transaction like:
Subroutine server_response redefined at (eval 19) line 1. Subroutine path redefined at (eval 20) line 1. Subroutine require_avs redefined at (eval 21) line 1. Subroutine port redefined at (eval 22) line 1.
Plus a number more I didn't want to spam you all with.

While these errors aren't fatal, I know it shouldn't doing this... Can anyone enlighten me what I can do to the module to "fix" this... Or whether its safe to simply ignore them...

My thanks,
JP
-- Alexander Widdlemouse undid his bellybutton and his bum dropped off --


In reply to Business::OnlinePayment redefined subroutines, or the little module that doesn't like being used twice by JPaul

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.