14 replies [Last post]
daniel.sanchez's picture
Offline
Joined: 11/27/2009
Juice: 9
Was this information Helpful?

I've just set up Ubercart with a 2checkout.com account to sell one year memberships on a website.
I set up a role that has access to restricted content. When users pay for a product node, they are given the according role. I have two related issues:

The user is sent to 2checkout to complete payment so the status on the order remains as "in checkout." As it is now, I would have to go into every order and change the status after checking with 2checkout.com for purchase info. Is there another way to do this that would be automatic?

2checkout give the option to enter the Approved URL and Pending URL to redirect the user to after purchase. What are the optimal URLS to use here? Something that would trigger the status change???

Thanks for any input on this. I'm falling in love with Ubercart. Rough love.

PreviewAttachmentSize
Screen shot of options on 2checkout.com settings page.Screen shot of options on 2checkout.com settings page.32.51 KB
ratinakage's picture
Offline
Joined: 05/12/2010
Juice: 78
Did you ever solve this?? I

Did you ever solve this??

I have the same question...

Thanks...

kcwebplaza's picture
Offline
Joined: 04/27/2010
Juice: 16
Re: 2checkout.com Approved URL Pending URL and Order Status

Anyone have a solution for this? I'm using Ubercart to offer downloadable products.

In 2checkout.com, the default value in Account Settings is After Completing Order, Given links back to my website. The buyer has to click the yellow Click Here to Finalize Order Button to get back to your website, and to get the Ubercart emails with their login information. The problem is, 90% of my buyers are not clicking the button on the 2checkout.com website. Therefore, I have to manually create the order/user for every order, and have upset customer because they expect to be able to immediately download their product.

tisabelle's picture
Offline
Joined: 12/27/2009
Juice: 85
Still searching for the answer?

Hello,

Sorry I don't have the answer, but I was hoping that by now someone who does could have posted it. Anyone? I am trying to use 2Checkout as a payment option for my customers.

I tried "http://www.(your site)/uc_2checkout/wps/complete" following the pattern I was successfully able to use with PayPal (see: http://www.ubercart.org/forum/support/18675/how_get_ubercart_automatical...), but it didn't work.

I would think that it would be similar to this. Can someone please post the correct answer? Many grateful Ubercart users await. Smiling

Thank you!

~ Tom

undeadzed's picture
Offline
Joined: 01/08/2011
Juice: 21
I think I fond the problem

Their is an error in the ubercart 2Checkout return script that is causing this return issue. Ubercart is trying to verify the MD5 hash that is being passed back using a hash of secret word, vendor number, merchant_order_id, total which is incorrect and causing the validation to fail. To correct the issue please open the following file "drupal/modules/ubercart/payment/uc_2checkout/uc_2checkout.pages.inc" and edit line 20 so that it matches the following:

$valid = md5(variable_get('uc_2checkout_secret_word', 'tango') . $_POST['sid'] . $_POST['order_number'] . $_POST['total']);

This should correct the issue you are experiencing. Please also note that ubercart dynamically passes in the return URL on each sale using the x_receipt_link_url parameter which will only work if the domain matches the domain registered to your 2Checkout account so if you are working in a test environment the return process may not work properly.

tisabelle's picture
Offline
Joined: 12/27/2009
Juice: 85
Hello, I did exactly as you

Hello,

I did exactly as you suggested. I am not working in a test environment. It still is not working.

On the 2Checkout side, I have "http://www.isabelleslighting.com/cart/2checkout/complete/1" listed for the "Approved URL", but I am thinking this may be the issue. Exactly what should I have for an address here?

Thank you!

~ Tom

undeadzed's picture
Offline
Joined: 01/08/2011
Juice: 21
Re: Hello, I did exactly as you

You do not need to have anything setup in the approved URl field as ubercart will populate/override this automatically. The return script only works with the "Given links back to my Website" return method so please change this setting on your 2Checkout Site Management page and let me know the result so I can further troubleshoot.

tisabelle's picture
Offline
Joined: 12/27/2009
Juice: 85
Re: Re: Hello, I did exactly as you

EXCELLENT!!! IT WORKS! After executing the point about "Given links back to my Website" and the above instructions, everything worked fine.

I think it is important to give credit where credit is due. This information was fed by an employee of 2Checkout. I appreciate you taking care of those of us in the Ubercart community who use your services! We value your support!

Best,

Tom

ratinakage's picture
Offline
Joined: 05/12/2010
Juice: 78
Hi, I followed the

Hi,

I followed the instructions above exactly.

1) Changed the code in uc_2checkout.pages.inc line 20.
2) Removed the approved URL in my 2checkout vendor page and set it to link back to my website.

I then did a test with demo mode on. It works up until the point that I click the link to return to my site. It returns me to the following URL:

http://mysite.com/cart/2checkout/complete/c8f40d93884dd354286d0d686fc0cb6b

And I get the following error:

Quote:

You are not authorized to access this page.

Any ideas???

My user is not logged in...

undeadzed's picture
Offline
Joined: 01/08/2011
Juice: 21
Re: Hi, I followed the

I can duplicate this error on demo sales as well. 2Checkout intentionally beaks the hash that is passed back on demo sales by forcing the order_number being computed to 1. This should not occur on live transactions so I suggest placing a live transaction to test your cart's integration. If I have a chance I will fix the ubercart return script so that it properly handles demo sales and provide the necessary files on this thread.

Tom Isabelle's picture
Offline
Joined: 12/27/2009
Juice: 5
Re: Re: Hi, I followed the

Valid point. My successful test on IsabellesLighting.com was an actual live transaction. After doing the test, you can REFUND the sale without 2checkout charging you a transaction fee. So for me (my site being live anyhow), this option is sufficient.

Best, Tom

ratinakage's picture
Offline
Joined: 05/12/2010
Juice: 78
Thanks!!!! It now works and

Thanks!!!!

It now works and the order is completing.

I did get one error saying:

"Unable to send e-mail. Please contact the site administrator if the problem persists."

But I guess this is related to something else...

Thanks again... Smiling

perceptum's picture
Offline
Joined: 05/01/2011
Juice: 6
D.O Fix

At http://drupal.org/node/892876#comment-3828704 you'll find a piece of code and the subsequent fix for this.

Worked for me Smiling

Bryan

johangsl's picture
Offline
Joined: 11/09/2011
Juice: 12
how to make it work in demo mode

So examining the code on the file we have being changing I found that the MD5 validation was failing in demo mode, what I did to solve it while I test on demo mode is to remove the lines 20 to 23

basically this if statement

if (strtolower($key) != strtolower($valid)) {
uc_order_comment_save($order->order_id, 0, t('Attempted unverified 2Checkout completion for this order.'), 'admin');
return MENU_ACCESS_DENIED;
}

this will let it work on demo mode.

aticom's picture
Offline
Joined: 05/10/2012
Juice: 3
access denied

hi guys!

I dont know what i am doing wrong. i tried everything but this is not working. I am now trying in live mode. do i have to change any permissions or smth. i tried to edit the file likw described above but no success.