[bop-devel] AuthorizeNet MD5 Check

Bill Moseley moseley at hank.org
Fri Sep 28 12:00:25 PDT 2007


On Thu, Sep 27, 2007 at 07:26:57AM -0700, Bill Moseley wrote:
> Finally, if I add this validation to AuthorizeNet do you want the
> changes?  If so, is there a repo I can provide a diff against?

Ok, my updated version is at:

    http://hank.org/modules/AuthorizeNet.pm

A diff will not be very helpful as I changed quite a bit.

Do what you want with it.


Changes include:

    Add validate_response() method to validate the md5 as discussed
    here.

    Removed CSV::XS and replaced with split. The delimiter is picked
    by looking for a character that is not in any of the data being
    passed in.  This was discussed off-list.

    Removed Exporter.

    Added a bit of debugging when $DEBUG is true.

    Defined a %processor_field_map hash so that the processor
    fields are not in the code twice.  A diff of the two collections
    showed:

        < x_Bank_Acct_Name
        ---
        > x_Bank_Account_Name
        13a14
        > x_Country
        24a26
        > x_Email_Customer
        34d35
        < x_Recurring_Billing
        47a49
        > 

    Added an amount() method so that the user can see what amount
    the processor, eh, processed.  Also needed for md5 check.

    Removed remap_fields and get_fields.  They are in the base class
    (v3) and were the same.

    refactored submit and the required fields checks.


    I left this in, but it would be nice to know in what situations
    this is needed.  I assume it was added for a reason.

        #escape NULL (binary 0x00) values
        $page =~ s/\x00/\^0/g;


    A little code clean up in some places.





-- 
Bill Moseley
moseley at hank.org



More information about the bop-devel mailing list