Authorize.net integration problem

L

Lakshman

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.
 
A

Aahz

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 ([email protected]) <*> 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
 
S

Stephen Chapman

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 said:
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 <[email protected]


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
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.





--
Regards,
Lakshman
becomingguru.com <http://becomingguru.com>
lakshmanprasad.com <http://lakshmanprasad.com>
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top