Page 1 of 3

[1.4.7] [FIX] 2checkout module

Posted: Tue Mar 02, 2010 9:47 pm
by ipse
This patch depends on http://forum.opencart.com/viewtopic.php?f=31&t=11559

It seems no one really used 2checkout module before - it was in completely broken state. Took me the whole night to get into and fix all major problems. :-\
I wanted to spend this documenting how to setup 2CO with OpenCart, but alas, I had to spend it fixing it...

List of fixes:
  • Our order ID is "cart_order_id", not "order_number".
  • In demo mode "order_number" is set to 1 for hash calculation, but is passed as usual. Ugh.
  • MD5 value should be uppercased before comparison.
  • We should check that requested sum and actual sum returned are equal to prevent cheating. I just set order status to Denied, but should probably act more. E.g. send e-mail to admin and show error to user.
  • redirect() can't be used because of the way 2CO works, as described in comments to the code.
  • If hash check fails - display at least some information about the error. We should probably create special "failed" or "error" page to which we can redirect user.
  • Return address is set to callback instead of main page.
  • Return address enforced to point to our callback with "x_receipt_link_url" parameter. So no need to set "approved" link in your 2CO admin interface. Kinda more plug'n'play.
  • Skip order review on 2CO site with "skip_landing" parameter. Should me made configurable, but I'm out of steam now... may be later.
  • Start "c_prod" numbering from 1, as recommended by 2CO.
  • If country is not US or Canada, we send XX as State to select "Outside US and Canada" in State drop down.
News
04 Jun 2010

Fixes for 2checkout.com payment module for OpenCart 1.4.7


Re: [1.4.0] [FIX] 2checkout module

Posted: Wed Mar 03, 2010 12:39 am
by i2Paq
Thanks, also for the 2 other patch/fixes!

Re: [1.4.0] [FIX] 2checkout module

Posted: Wed Mar 03, 2010 1:43 am
by ipse
i2Paq wrote:Thanks, also for the 2 other patch/fixes!
Actually I posted 5 patches. Which ones are you referring to?

Will this patch and others be merged into upcoming release?

Re: [1.4.0] [FIX] 2checkout module

Posted: Wed Mar 03, 2010 2:18 am
by i2Paq
ipse wrote:
i2Paq wrote:Thanks, also for the 2 other patch/fixes!
Actually I posted 5 patches. Which ones are you referring to?

Will this patch and others be merged into upcoming release?
Well, I only saw 2 others ;)

I'm not the developer of OC, Daniel is and he only can say if he will use your patches.

Maybe just contact him with the links to your patches/contris?

Re: [1.4.0] [FIX] 2checkout module

Posted: Wed Mar 03, 2010 3:13 am
by ipse
i2Paq wrote:I'm not the developer of OC, Daniel is and he only can say if he will use your patches.

Maybe just contact him with the links to your patches/contris?
I hope he saw them, as I posted patches to Bug Reports forum.

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 3:20 am
by Daniel
already fixed in 1.4.1

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 4:40 am
by ipse
Daniel wrote:already fixed in 1.4.1
Yuck. That's what I hate. Spend my time on what is already done and duplicating work.

How stable 1.4.1 is? If it's usable, I'll switch to it and see how well it works there.

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 7:31 pm
by elwood
Please let me download these two fixed file

twocheckout.php
twocheckout.tpl

I can not install the patch, I do not understand php :-\

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 8:15 pm
by ipse
Attached.

I should note that while this module works technically, more fixes needed to comply to 2CO requirements for shops. I will continue working on this when I get some free time (and if this is not yet fixed in 1.4.1).

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 8:40 pm
by George Kinsman
So is this currently functioning? I foolishly chose 2Checkout thinking it would work with the integrated plugin, and now that I've applied the patches I need to do some testing.

Also question regarding 2CO, is it necessary to have all products entered into 2CO as well as OC? My cart will be used for large numbers of unique products, so this could be a problem...

Cheers

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 8:52 pm
by ipse
George Kinsman wrote:So is this currently functioning? I foolishly chose 2Checkout thinking it would work with the integrated plugin, and now that I've applied the patches I need to do some testing.
Hehe, how familiar. I chose OpenCart because I thought it supports 2CO... And then I spent full night fixing it.

I is functioning as afar as I can see. I test it in demo mode only, though. There should be done some improvements too e.g. distinguish between tangible and digital products, notify 2CO about shipping cost, etc, but is not required, just for sanity.

But more importantly, this plugin does not comply with wording required by 2CO:
http://www.2checkout.com/language_guidelines.html
So they disabled my 2CO account until I fix this (and few more things on my web-site). I think we should change "Credit Card / Debit Card (2Checkout)" to smth. like "Buy from 2checkout (Credit Card / Debit Card)" to comply with their rules.
George Kinsman wrote:Also question regarding 2CO, is it necessary to have all products entered into 2CO as well as OC? My cart will be used for large numbers of unique products, so this could be a problem...
I had the same question. From what I read, answer is "No, you can sell without entering your products into 2CO". As far as I understand, you can enter your products if you want to use their "Plug'n'play cart" feature.

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 9:34 pm
by elwood
ipse wrote:Attached.

I should note that while this module works technically, more fixes needed to comply to 2CO requirements for shops. I will continue working on this when I get some free time (and if this is not yet fixed in 1.4.1).
Thank you, everything is fine.

Another such question: after payment 2CO want to specify a reverse link (i sell digital goods):

"Approved URL

Input a url for your customers to be sent to on a successful purchase."


I need to indicate here?

wwwsite/catalog/controller/checkout/success.php

Thanks for any help

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 9:40 pm
by George Kinsman
I'm still getting a parameter error when submitting to 2CO.

I'm not really sure what's going wrong...:(

Is there a way of debugging the param url so that I can find the problem?

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 10:31 pm
by Daniel
can u just post the fixed version so i can include it in the next release.

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 10:35 pm
by George Kinsman
He posted the 1.4.0 fix above, although I thought you said it was already fixed? :V

This module is currently the one thing between me and a working shopping cart :/

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 11:10 pm
by Qphoria
elwood wrote: Another such question: after payment 2CO want to specify a reverse link (i sell digital goods):

"Approved URL

Input a url for your customers to be sent to on a successful purchase."


I need to indicate here?

wwwsite/catalog/controller/checkout/success.php

Thanks for any help

Code: Select all

http://www.yoursite.com/index.php?route=payment/twocheckout/callback

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 11:22 pm
by ipse
elwood wrote:Another such question: after payment 2CO want to specify a reverse link (i sell digital goods):

"Approved URL

Input a url for your customers to be sent to on a successful purchase."


I need to indicate here?

wwwsite/catalog/controller/checkout/success.php
My version of the module don't need setting this, because it is done automatically. Moreover, if you set "Approved URL" in the 2CO admin interface, it will be ignored. I use "x_receipt_link_url" parameter for this (see .tpl).

I haven't tested this with digital goods, though. I'd appreciate if you test it and report results here.

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 11:26 pm
by ipse
Daniel wrote:can u just post the fixed version so i can include it in the next release.
1) Zip'ed version is attached to this post: http://forum.opencart.com/viewtopic.php ... 561#p57460
Patch which you can apply is at top post. It applies cleanly to 1.4.0.

2) Did you said this all is already fixed in 1.4.1? Could you elaborate what exactly is fixed and what needs fixing? I'm kind of confused with your posts.

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 11:28 pm
by ipse
George Kinsman wrote:I'm still getting a parameter error when submitting to 2CO.

I'm not really sure what's going wrong...:(

Is there a way of debugging the param url so that I can find the problem?
It would be very helpful if you provide more information:
1) Exact error text (screenshot or copy-paste).
2) Form information, generated by the module (from checkout page of OpenCart).

Alternatively you may post an URL of your shop so we can test it ourselves.

Re: [1.4.0] [FIX] 2checkout module

Posted: Sun Mar 07, 2010 11:29 pm
by ipse
Qphoria wrote:

Code: Select all

http://www.yoursite.com/index.php?route=payment/twocheckout/callback
Not needed. See my post above.