Post by ipse » Tue Mar 02, 2010 9:47 pm

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

Last edited by ipse on Fri Jun 04, 2010 1:31 pm, edited 3 times in total.

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by i2Paq » Wed Mar 03, 2010 12:39 am

Thanks, also for the 2 other patch/fixes!

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by ipse » Wed Mar 03, 2010 1:43 am

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?

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by i2Paq » Wed Mar 03, 2010 2:18 am

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?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by ipse » Wed Mar 03, 2010 3:13 am

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.

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by Daniel » Sun Mar 07, 2010 3:20 am

already fixed in 1.4.1

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by ipse » Sun Mar 07, 2010 4:40 am

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.

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by elwood » Sun Mar 07, 2010 7:31 pm

Please let me download these two fixed file

twocheckout.php
twocheckout.tpl

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

Newbie

Posts

Joined
Sun Mar 07, 2010 6:47 pm

Post by ipse » Sun Mar 07, 2010 8:15 pm

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).

Attachments

Fixed version of twocheckout module. Revision 1


New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by George Kinsman » Sun Mar 07, 2010 8:40 pm

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
Last edited by George Kinsman on Sun Mar 07, 2010 9:36 pm, edited 2 times in total.


Posts

Joined
Fri Jan 29, 2010 3:57 pm

Post by ipse » Sun Mar 07, 2010 8:52 pm

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.

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by elwood » Sun Mar 07, 2010 9:34 pm

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

Newbie

Posts

Joined
Sun Mar 07, 2010 6:47 pm

Post by George Kinsman » Sun Mar 07, 2010 9:40 pm

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?


Posts

Joined
Fri Jan 29, 2010 3:57 pm

Post by Daniel » Sun Mar 07, 2010 10:31 pm

can u just post the fixed version so i can include it in the next release.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by George Kinsman » Sun Mar 07, 2010 10:35 pm

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 :/


Posts

Joined
Fri Jan 29, 2010 3:57 pm

Post by Qphoria » Sun Mar 07, 2010 11:10 pm

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

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by ipse » Sun Mar 07, 2010 11:22 pm

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.

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by ipse » Sun Mar 07, 2010 11:26 pm

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.

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by ipse » Sun Mar 07, 2010 11:28 pm

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.
Last edited by ipse on Sun Mar 07, 2010 11:41 pm, edited 1 time in total.

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am

Post by ipse » Sun Mar 07, 2010 11:29 pm

Qphoria wrote:

Code: Select all

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

New member

Posts

Joined
Mon Mar 01, 2010 5:00 am
Who is online

Users browsing this forum: No registered users and 55 guests