You need to login in order to make a new post. If you do not have a community account, you can get one here.

MD5 Problems

Ok, so I set up my 2checkout script, but I still have problems.
My customers are not returning to the site the way they should.

I’m using the MD5 encryption method with the secret word to verify my orders.
When I test this in DEMO mode, using “1″ (without the quotes) as the “order_number”, it works perfectly fine.

But, with real orders (not in DEMO mode), the script doesn’t work. When not using demo mode, I use $_POST['order_number'] as the order number coming from 2checkout.

For some reason, there is still something missing.

Any ideas?
I mean…if demo mode works, why can’t real orders work as well? The only difference is the “order_number”, right?

RSS feed

2 Comments »

# Comment by solar
2007-05-30 16:50:07

FWIW, this functionality works fine for me on both demo and real orders.

Here are some snippets from the custom Perl script that I use:

$demo = 0;
$secret = “wonttellwhatitis”;

$key =~ tr/A-Z/a-z/;
$check = md5_hex($secret . $sid . $order_number . $total);

# Demo mode requires this
$check = md5_hex($secret . $sid . “1″ . $total) if ($demo && $key ne $check);

fail undef, “bad key” unless ($key eq $check);

(where “fail” is a custom function).

 
 
# Comment by Antonie Potgieter
2007-05-31 03:19:14

I forgot to post back here.

The problem was that I kept checking for a “demo” parameter POSTED with the value “N”. With live orders, the “demo” parameter is never passed back.

So…instead…I check that there is NOT a “demo” parameter with the value “Y”. I realize that this is not necessary, since the MD5 encryption method caters for that. I just included it anyways.

Thanks for the help

 
 
You need to login before leaving a comment If you do not have an account, you can register one here.

Recent Activity:

Welcome to 2Checkout!

2Checkout is a full-service e-commerce solution recognized by Inc. Magazine as one of the fastest growing companies in the United States. 2CO’s proprietary technology supports back-office functions including financial reporting, tracking, fraud prevention, affiliate tracking, customer service and sales tracking. Click here to learn more.

Spotlight Supplier

Spotlight Supplier

Feng Shui Products


Popular Tags