Post by Daniel » Sun Mar 07, 2010 11:32 pm

i ned to compare the 2.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by George Kinsman » Sun Mar 07, 2010 11:50 pm

Parameter Error
A parameter error was encountered when attempting to process this sale.
Please notify the supplier so that this can be resolved as soon as possible.

Sometimes when i submit it the URL is the POST string from the cart, while other times it's just "https://www.2checkout.com/2co/buyer/purchase".

Here is the POST string from the cart (some bits edited out):

https://www .2checkout.com /checkout/purchase?PTCOID=5dc445d5e61178ee2b1fb411b362ef58&sid=VENDOR_ID&total=177.45&cart_order_id=16&card_holder_name=George+Kinsman&street_address=My_Address&city=Brisbane&state=XX&zip=4125&country=Australia&email=MY_EMAIL&phone=Phone_Number&ship_street_address=My_Address&ship_state=Queensland&ship_zip=4625&ship_country=Australia&c_prod_1=96%2C1&c_name_1=Persian+Ottoman&c_description_1=Persian+Ottoman&c_price_1=145.00&c_prod_2=130%2C1&c_name_2=Arabian+Shumag&c_description_2=Arabian+Shumag&c_price_2=25.00&id_type=1&demo=Y&lang=en&skip_landing=1&x_receipt_link_url=URL_REMOVED


Posts

Joined
Fri Jan 29, 2010 3:57 pm

Post by ipse » Mon Mar 08, 2010 12:11 am

George Kinsman wrote:Parameter Error
A parameter error was encountered when attempting to process this sale.
Please notify the supplier so that this can be resolved as soon as possible.
This is most likely because your 2CO account is disabled. Their risk dept should have contacted you and notified you about this fact. You need to get your account enabled to make this work again.

Check this topic on their site: http://www.2checkout.com/community/blog ... -correctly

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by George Kinsman » Wed Mar 10, 2010 8:46 am

Thanks, that was correct. It seems to be working now, however the 2CO page doesn't redirect back to the shopping cart now, and no order is made. Are you sure no return url needs to be set anywhere?

Thanks again

Edit: I'm in demo mode if that makes a difference.
Last edited by George Kinsman on Wed Mar 10, 2010 8:52 am, edited 1 time in total.


Posts

Joined
Fri Jan 29, 2010 3:57 pm

Post by ipse » Wed Mar 10, 2010 8:50 am

George Kinsman wrote:Thanks, that was correct. It seems to be working now, however the 2CO page doesn't redirect back to the shopping cart now, and no order is made. Are you sure no return url needs to be set anywhere?
Have you set "Direct Return" to "Immediately returned to my website"?

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by George Kinsman » Wed Mar 10, 2010 8:52 am

ipse wrote:
George Kinsman wrote:Thanks, that was correct. It seems to be working now, however the 2CO page doesn't redirect back to the shopping cart now, and no order is made. Are you sure no return url needs to be set anywhere?
Have you set "Direct Return" to "Immediately returned to my website"?
Yes.

Could it be that demo mode is preventing anything from being passed back?

Also, 2Checkout registered the demo orders and emailed me, however they just weren't passed back to OC.


Posts

Joined
Fri Jan 29, 2010 3:57 pm

Post by ipse » Wed Mar 10, 2010 9:06 pm

George Kinsman wrote:Could it be that demo mode is preventing anything from being passed back?
No, demo mode can't prevent this.
Check your web-server log to see were there access to the callback page from a 2CO server. They fetch from the server on behalf of the user.

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by George Kinsman » Wed Mar 10, 2010 9:40 pm

There is this line in the access log:

64.128.185.196 - - [10/Mar/2010:07:36:36 -0600] "POST /cart/index.php HTTP/1.1" 401 - "-" "2Checkout.com-purchase libwww-perl/5.814"

That IP is a 2checkout IP. It seems to be posting to the wrong URL, however the correct URL is being passed from the cart, which is

cart/index.php?route=payment/twocheckout/callback

which does give the error "We response from 2checkout.com can't be parsed. Contact site adimistrator, please!" as it should when accessed normally.


Posts

Joined
Fri Jan 29, 2010 3:57 pm

Post by ipse » Wed Mar 10, 2010 9:58 pm

George Kinsman wrote:There is this line in the access log:

64.128.185.196 - - [10/Mar/2010:07:36:36 -0600] "POST /cart/index.php HTTP/1.1" 401 - "-" "2Checkout.com-purchase libwww-perl/5.814"

That IP is a 2checkout IP. It seems to be posting to the wrong URL, however the correct URL is being passed from the cart, which is

cart/index.php?route=payment/twocheckout/callback

which does give the error "We response from 2checkout.com can't be parsed. Contact site adimistrator, please!" as it should when accessed normally.
I'm not sure I understand you, but have you applied this patch? http://forum.opencart.com/viewtopic.php?f=31&t=11559
You should apply it to get callbacks to work correctly.

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by George Kinsman » Wed Mar 10, 2010 10:19 pm

I have applied that, although I had to apply the diff manually :/

Here is what the block looks like:

// Router
if (isset($request->get['route'])) {
$action = new Action($request->get['route']);
} else if (isset($request->post['route'])) {
$action = new Action($request->post['route']);
} else {
$action = new Action('common/home');
}

What part did you not understand? Your script passes "http://www.site.com/cart/index.php?rout ... t/callback" as the callback URL to 2checkout, and responds correctly to that url when I access it myself.


Posts

Joined
Fri Jan 29, 2010 3:57 pm

Post by ipse » Wed Mar 10, 2010 10:35 pm

George Kinsman wrote:I have applied that, although I had to apply the diff manually :/
...
This looks correct
George Kinsman wrote:What part did you not understand? Your script passes "http://www.site.com/cart/index.php?rout ... t/callback" as the callback URL to 2checkout, and responds correctly to that url when I access it myself.
2CO passes route parameter as POST request, that's why you don't see it in the log.

Do you use HTTP Auth in your shop? 401 response suggest that server requires auth:
http://en.wikipedia.org/wiki/List_of_HT ... ient_Error

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by George Kinsman » Wed Mar 10, 2010 11:17 pm

Haha oh I am indeed a clown, I've got an .htaccess file running till we open the site.

Sorry to be such a bother, looks like it'll be fine!


Posts

Joined
Fri Jan 29, 2010 3:57 pm

Post by ipse » Wed Mar 10, 2010 11:45 pm

2 moderators:

I created FAQ based on the questions in this thread:
http://wiki.opencart.com/index.php?title=2checkout

Could one modify first message in the topic and add this URL there?

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by doremi » Thu Jun 03, 2010 11:45 am

Can this fix be applied to version 1.4.7? I downloaded the patch twocheckout-1.4.0-fix1.zip but when i tried to unzip, I got "Unexpected end of archive" and "The archive is corrupt". Pls help! Tq.

New member

Posts

Joined
Thu May 13, 2010 11:58 pm

Post by ipse » Fri Jun 04, 2010 1:26 pm

I updated the first post of the topic with the fix for 1.4.7.

Is there any way to get it into official distribution?

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by doremi » Fri Jun 04, 2010 9:42 pm

I've applied the fixes and ran a demo sale. I received this msg "We response from 2checkout.com can't be parsed. Contact site adimistrator, please! " the same thing faced by George Kinsman above. However, I don't understand the part "Do you use HTTP Auth in your shop? 401 response suggest that server requires auth:" So should I be using HTTP Auth or not? How do i know I'm using it or not? Sorry for the dumb question.

New member

Posts

Joined
Thu May 13, 2010 11:58 pm

Post by ipse » Fri Jun 04, 2010 9:54 pm

doremi wrote:I've applied the fixes and ran a demo sale. I received this msg "We response from 2checkout.com can't be parsed. Contact site adimistrator, please! " the same thing faced by George Kinsman above. However, I don't understand the part "Do you use HTTP Auth in your shop? 401 response suggest that server requires auth:" So should I be using HTTP Auth or not? How do i know I'm using it or not? Sorry for the dumb question.
Go google for "http auth". If this don't help - attach logs here.

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by doremi » Fri Jun 04, 2010 10:30 pm

I've tried but I really have no idea how to go about it...do i edit the .htaccess file? 401.html file? what should i put in there?

this is what i get from the access log:

64.128.185.196 - - [04/Jun/2010:07:34:31 -0600] "POST /index.php HTTP/1.1" 200 1547 "-" "2Checkout.com-purchase libwww-perl/5.814"

If it's of any help, i selected the option "Direct Return (2CO's URL) " at 2co's site management page and I entered "http://www.store.com/index.php?route=pa ... t/callback" as the Approved URL.
Last edited by doremi on Sat Jun 05, 2010 12:16 am, edited 2 times in total.

New member

Posts

Joined
Thu May 13, 2010 11:58 pm

Post by ipse » Sat Jun 05, 2010 12:05 am

doremi wrote:I've tried but I really have no idea how to go about it...do i edit the .htaccess file? 401.html file? what should i put in there?

this is what i get from the access log:

64.128.185.196 - - [04/Jun/2010:07:34:31 -0600] "POST /index.php HTTP/1.1" 200 1547 "-" "2Checkout.com-purchase libwww-perl/5.814"

If it's of any help, i selected the option "Direct Return (2CO's URL) " at 2co's site management page and I entered "http://www.store.com/index.php?route=pa ... t/callback" as the Approved URL.
This looks fine. You need to somehow log POST parameters, sent by 2checkout to understand what's going wrong.

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by doremi » Sat Jun 05, 2010 12:17 am

Also, I have earlier removed the line "RewriteBase /" from my .htaccess file in order to use SEO URLs. I'm not sure if this affects the outcome or not.

When I tried to access "http://www.store.com/index.php?route=pa ... t/callback" I received the following error msg:

"Notice: Undefined index: cart_order_id in /home2/xxxxx/public_html/catalog/controller/payment/twocheckout.php on line 92Notice: Undefined index: order_number in /home2/xxxxx/public_html/catalog/controller/payment/twocheckout.php on line 95Notice: Undefined index: total in /home2/xxxxx/public_html/catalog/controller/payment/twocheckout.php on line 102Notice: Undefined index: key in /home2/xxxxx/public_html/catalog/controller/payment/twocheckout.php on line 104We response from 2checkout.com can't be parsed. Contact site adimistrator, please!"

Line 92 is "$order_info = $this->model_checkout_order->getOrder($this->request->post['cart_order_id']);"
Line 95 is "$hash_order_number = $this->request->post['order_number'];"
Line 102 is "$hash = md5($this->config->get('twocheckout_secret') . $this->config->get('twocheckout_account') . $hash_order_number . $this->request->post['total']);"
line 104 is "if ($hash == $this->request->post['key']) {"

I hope these are useful. Thank you in advance.

New member

Posts

Joined
Thu May 13, 2010 11:58 pm
Who is online

Users browsing this forum: No registered users and 3 guests