Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-23 11:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found