2checkout payment not registering

Project:Payment Method Adjustments
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description
Project: 
payment->uc_paypal.modul

Using Ubercart 7.3beta.

I just tried a demo sale with 2checkout, configured it appropriately, and on the return page, I got the message:

An error has occurred during payment.

Could it have something to do with the error message that is displaying at the same time?

Many thanks!

Notice: Undefined index: merchant_order_id in uc_2checkout_complete() (line 12 of /home/rawvegan/addons/drupalebookstore.com/sites/all/modules/ubercart/payment/uc_2checkout/uc_2checkout.pages.inc).
Notice: Undefined index: merchant_order_id in uc_2checkout_complete() (line 14 of /home/rawvegan/addons/drupalebookstore.com/sites/all/modules/ubercart/payment/uc_2checkout/uc_2checkout.pages.inc).

I wanted to make sure it was not because of the order number issue in demo mode, so I tested this live.

I got a payment confirmation mail from 2checkout.

The order remained in 'in checkout' status in ubercart.

Again same error message: an error has occured...

Any ideas? What else can I check?

the only thing I need to configure at 2co is:
- complete url: myurl/cart/checkout/complete
- secret word
- direct return: header redirect

undeadzed's picture
Offline
Joined: 01/08/2011
Juice: 21
#1

I took a look at this release and it appears that it still suffers from the same return issue as 2.4. 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']);

Also, the "Header Redirect" return method returns the sale parameter by GET instead of POST so you would need to select the "Given links back to my Website" return method in the 2Checkout admin or you would need to change the references of $_POST to $_REQUEST in "drupal/modules/ubercart/payment/uc_2checkout/uc_2checkout.pages.inc".