After reading on another node that I should be using Business::OnlinePayment::AuthorizeNet, I decided to try it out. It seems to me that the package is completely broken, so I'm looking for people that are successfully using it with AIM (advanced integration method) 3.1 of Authorize.net.

First, this line:
$post_data{'ENCAPSULATE'} = "TRUE";
makes every field of the server response surrounded by the string "TRUE", for example:

'server_response' => 'TRUE3TRUE,TRUE2TRUE,TRUE33TRUE,TRUECredit card number is required.TRUE,...

Commenting that out in the module itself fixes that problem, but I think there is more wrong that just that.

First, it requires the "name" field which is not required by the specifications. Second, I specify card_number as it says in the documentation, but as you can see above, I keep getting "Credit card number is required." as an error message. So for some reason the mappings of field names isn't happening correctly. I'm a bit stumped, because the manual says every field should be prefixed with an
x_
, but nowhere in OnlinePayment.pm or Authorizenet.pm can I find anything like that. Perhaps I am brain-dead, but here is my code anyway:
use Business::OnlinePayment; my $tx = new Business::OnlinePayment("AuthorizeNet"); $tx->content( type => 'VISA', login => $login, transaction_key => 'omitted', password => 'omitted', action => 'Normal Authorization', description => 'Purchase', amount => $amount, customer_id => $customer_id, first_name => $billto_fname, last_name => $billto_lname, address => $billto_address, city => $billto_city, state => $billto_state, zip => $billto_zip, card_number => '4007000000027', expiration => $exp_date, cvv2 => $cv2, name => 'Test Name' ); $tx->submit(); if($tx->is_success()) { print "Card processed successfully: ".$tx->authorization()."\n"; } else { print STDERR "Card was rejected: ".$tx->error_message()."\n"; }
My account is in test mode, which is supposed to return a success for any credit card number.

In reply to Business::OnlinePayment::AuthorizeNet Problems by saberworks

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.