Authorize.net integration problem

Discussion in 'Python' started by Lakshman, Mar 31, 2009.

  1. Lakshman

    Lakshman Guest

    I am trying to integrate Authorize.net SIM API into django views.

    I am facing a problem in the fingerprint generation. I am repeatedly
    getting that the fingerprint generated doesn't match the one the
    server generates.

    I have generated the md5 hash with the key provided as specified in
    the SIM documentation.

    Here is the code:

    params = {
    'x_login' : '4ffrBT36La',
    'x_amount' : '100.00',
    'x_show_form' : 'PAYMENT_FORM',
    'x_type' : 'AUTH_CAPTURE',
    'x_method' : 'CC',
    'x_fp_sequence' : '123',
    'x_version' : '3.1',
    'x_relay_response' : 'FALSE',
    }
    params['x_fp_timestamp'] = int(time.time())

    msg = '^'.join([params['x_login'],
    str(params['x_fp_sequence']),
    str(params['x_fp_timestamp']),
    str(params['x_amount'])
    ])+'^'

    fingerprint = hmac.new('9LyEU8t87h9Hj49Y',msg).hexdigest()


    I would be glad if some one that has dealt with this earlier, points
    out what the glitch is. Thanks in advance.
     
    Lakshman, Mar 31, 2009
    #1
    1. Advertising

  2. Lakshman

    Aahz Guest

    In article <>,
    Lakshman <> wrote:
    >
    >I am facing a problem in the fingerprint generation. I am repeatedly
    >getting that the fingerprint generated doesn't match the one the
    >server generates.


    How are you getting this? Server error? You're not giving us enough
    information.
    --
    Aahz () <*> http://www.pythoncraft.com/

    "Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it." --Brian W. Kernighan
     
    Aahz, Mar 31, 2009
    #2
    1. Advertising

  3. Are they expecting the results in a specific order... because as you
    probably know a dictionary is never in the order that you add the items.

    Lakshman Prasad wrote:
    > Yup. Unusual, it is.
    >
    > But thats how their string specification syntax is. It includes a ^ at
    > the end.
    >
    >
    > On Tue, Mar 31, 2009 at 6:13 PM, andrew cooke <
    > <mailto:>> wrote:
    >
    >
    > have you printed msg and checked it is formatted correctly? i
    > have node
    > idea what the protocol is, but your use of join and string
    > concatenation
    > in the generation of msg looks unusual to me.
    >
    > andrew
    >
    > Lakshman wrote:
    > > I am trying to integrate Authorize.net SIM API into django views.
    > >
    > > I am facing a problem in the fingerprint generation. I am repeatedly
    > > getting that the fingerprint generated doesn't match the one the
    > > server generates.
    > >
    > > I have generated the md5 hash with the key provided as specified in
    > > the SIM documentation.
    > >
    > > Here is the code:
    > >
    > > params = {
    > > 'x_login' : '4ffrBT36La',
    > > 'x_amount' : '100.00',
    > > 'x_show_form' : 'PAYMENT_FORM',
    > > 'x_type' : 'AUTH_CAPTURE',
    > > 'x_method' : 'CC',
    > > 'x_fp_sequence' : '123',
    > > 'x_version' : '3.1',
    > > 'x_relay_response' : 'FALSE',
    > > }
    > > params['x_fp_timestamp'] = int(time.time())
    > >
    > > msg = '^'.join([params['x_login'],
    > > str(params['x_fp_sequence']),
    > > str(params['x_fp_timestamp']),
    > > str(params['x_amount'])
    > > ])+'^'
    > >
    > > fingerprint = hmac.new('9LyEU8t87h9Hj49Y',msg).hexdigest()
    > >
    > >
    > > I would be glad if some one that has dealt with this earlier, points
    > > out what the glitch is. Thanks in advance.
    > > --
    > > http://mail.python.org/mailman/listinfo/python-list
    > >
    > >

    >
    >
    >
    >
    >
    > --
    > Regards,
    > Lakshman
    > becomingguru.com <http://becomingguru.com>
    > lakshmanprasad.com <http://lakshmanprasad.com>
    > ------------------------------------------------------------------------
    >
    > --
    > http://mail.python.org/mailman/listinfo/python-list
    >
     
    Stephen Chapman, Mar 31, 2009
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Chen
    Replies:
    1
    Views:
    364
    =?Utf-8?B?UHJhdmVlbiBL?=
    Oct 11, 2004
  2. Blue

    Problem with Authorize.net

    Blue, Dec 28, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,186
    Chris Gunn
    Dec 30, 2005
  3. Bobby Edward

    Authorize.NET SIM Implementation

    Bobby Edward, Jan 19, 2009, in forum: ASP .Net
    Replies:
    9
    Views:
    713
    George
    Jan 21, 2009
  4. Authorize.net AIM ASP Script

    , Mar 19, 2005, in forum: ASP General
    Replies:
    0
    Views:
    118
  5. dave the spazz
    Replies:
    2
    Views:
    123
    David H. Adler
    Oct 29, 2003
Loading...

Share This Page