Recently we implemented Ubercart in our test environment with Ogone as payment gateway. This worked immediately, but like Kees mentions on his project page, there are still some features or todo's which need to implemented to support all Ogone features. Since we needed more advanced control over the payment status of orders in a multi language site, I completed some of the todo items:
- Automatic currency detection (now based on the setting in Ubercart)
- Automatic language detection
- Handle payment status feedback more specifically
Additionally I transformed the ogone payment table in to a history table with all status updates from ogone regarding a certain order.
To achieve this I had to rewrite almost the whole module, since it would have been a mess otherwise. The major changes are:
- The transformation of the ogone payment table into a history table to keep track of all (online and offline) status updates
- The implementation of one callback method used for all HTTP requests by Ogone
- The modification of the redirect url's
- The removal of the redirect page between the final submit of the order and the ogone payment site
- The addition of Ogone specific statuses into UC
The basics are already working fine (language detection and keeping the correct language, online status updates, integration with secure pages, ...), but there needs to be more testing regarding the offline status callbacks.
At this moment there are some issues with the new release of Ogone on their test environment: it doesn't send offline status notifications and HTTP requests at this moment due to a bug in their test release.
Attached you'll find the new install and module file (css file is not required anymore, readme and info file should be updated). I hope this could be interesting to others wanting to use the Ogone payment gateway.
I could also attach the patch files if someone wants them, but I think they are useless in this case.
Tom
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | uc_ogone-591092.patch | 41.35 KB | arnebrasseur |
| #2 | uc_ogone_payment.install.patch | 4.76 KB | tom.vda |
| #2 | uc_ogone_payment.module.patch | 41.11 KB | tom.vda |
| uc_ogone_payment.module.txt | 25.16 KB | tom.vda | |
| uc_ogone_payment.install.txt | 4.01 KB | tom.vda |
Comments
Comment #1
keesje commentedHi Tom,
Thanks for your work and for sharing it.
It would be more helpfull though if you could post patches instead of full module/install code. Its easier to review your changes, and less likely the issue cue gets polluted with all kind of module variants.
Right now I would not now where to start implementing your useful changes in a solid way.
Comment #2
tom.vda commentedKees,
Like I wrote in the issue description, I can provide you the patches, but since there were some many changes I found it easier to rewrite some stuff instead of just patching or adding/removing lines to the existing module.
Though, the most important modification is the implementation of the uc_ogone_payment_callback() function which takes care of all order payment updates coming from Ogone.
About the original uc_payment_ogone table: I don't what the actual purpose was for that table, besides keeping track of matching sha1 signatures. I could see a description field, but the only thing that ever came into that field in the database was the word 'description'. So that's why I changed the table into a history table to keep track of all updates and the exact timestamps. Was there another pupose for that?
I did not have time yet to check whether the bug has already been fixed at the Ogone payment test environment.
At last, there is the issue of the translation of messages being inserted into the database: It seems that UC does all the translations before inserting into the database which means that the language of a message in the database depends on the chosen language of the user submitting or causing the message, not the user that is reading the message. I chose not to use t() when saving comment in an order or when inserting a record in the ogone history table. I don't don't if there are already some comments or issues related to this in UC?
You'll find the patches attached to this comment ;)
Comment #3
Maikel commentedHi,
I downloaded the module and configured it as i thought would be good. It did not work. The return url's were not loaded correctly. The ogone page redirects to https://secure.ogone.com/cart/ogone_payment_accepted/22 for example but instead it should be http://www.urlofyourshop.com/cart/ogone_payment_accepted/22.
To achieve this with this module i added this at line 699 $url = $base_url . $url; i don't know if this is the way to do it but it works for me. I presume it would be better to add a config-field?
I am now testing the rest of the module, but for now it seems ok. Thanks!
Comment #4
arnebrasseur commentedI can confirm that this new version works well, and is a real improvement over the current 6.x version. The server-to-server status update is indispensable IMHO. It does suffer from #566168: amount too long or not numeric as well though, and the fix in #3 needs to applied as well.
The included patch can be applied on top of the latest CVS 6.x-1.x. It includes the changes in the patch 'uc_ogone_payment.module.patch' posted earlier in this thread, as well as the changes to fix #566168: amount too long or not numeric and the problem reported here at #3 by Maikel.
Comment #5
keesje commented@arnebrasseur: thanks for combining the changes into a valid patch.
Patch is applied to CVS. I do not have the resources to test properly, so relying on community feedback before a new release.
Comment #6
nitebreedThe fix in #3 doesn't change anything for me. It still takes the ogone page as base domain and therefore I'm not redirected to my own webshop...
Comment #7
ygerasimov commentedHi Guys,
Thank you for the nice module.
I have done testing of the module that Tom provided. For my personal feeling it is much nicer then first version as it stores respond status to the order comments.
Regarding the problem of the redirection. This can be fixed changing function _uc_ogone_payment_url() to:
As this module works differently and even supply different menu pathes I think it would be reasonable to move it to 2 branch. What I found buggy is non existence of function uc_ogone_payment_template that is declared in menu callback for 'cart/ogone_payment_template'. Tom could you please fix this?
I have also some other improvements that needed (like using t() for text of messages, adding comments etc. but they are minor). Also cron function should be written properly. I am ready to participate in this project with patches but we need to commit Tom's version to 6.x-2.x branch.
Kees please let me know your comments about this.
Comment #8
keesje commentedMore feedback: http://drupal.org/node/782028
Comment #9
arnebrasseur commentedHi Kees,
Is it really applied to CVS? In what branch?
I'm very much in favor of creating a 6.x-2.x-dev branch for this. It's getting hard to keep track of all the patches and fixes in the issue queue. The 1.4 version is close to a year old. We could keep a 1.x branch with only bugfixes, and a 2.x branch with these server-to-server calls and other new functionality.
Thanks,
Arne
Comment #10
bartezz commentedKees,
I'm wondering the same as in #9, where can we find the version to which this was committed?
Cheers