Come together with the global Drupal community in Rotterdam, 28 Sept – 1 Oct 2026. Sessions, contribution, connection, and Early Bird savings until 8 June.
Looks fairly good. A couple of things will need to be done as we go, adding some notes here to kick off. Are you still keen to collab on getting this in?
Need to handle the case where curl is not available. We should probably just use drupal_http_request() in its place if possible (see below).
The two functions null2unknown() and getResponseDescription() need to be namespaced in order to ensure there's no clash with other modules implementing similarly named functions.
There's a $_POST[] reference which seems unused. It should go. (It's not an issue in this instance, but we've just released a security fix on uc_migs for similar code.)
If $response is empty after the cURL request, we'll end up at // ERROR! need to finish ERROR code function, and then record an order comment with an empty $msg.
There's an instruction to contact Salva if the payment declines. We should include his cellphone number, or maybe make the error message more generic :D
I see you had some drupal_http_request() code in there but went with cURL - can you tell me more about this decision? Looks like a lot of Ubercart payment modules use cURL instead of drupal_http_request() - I wonder if there's a specific issue with drupal_http_request() or whether it's just historic?
Again a little bit of loose-end-tieing that needs doing. i will get on it
I think making this more generic is better. Might add an admin field for client/site owner details
my code is based on the example code my clients bank provided (i basically just 'drupalfied' their Merchant hosted code), so that is why i used curl. as for why it used in Ubercart instead of drupal_http_request() i am not sure.
i will make those changes and upload a new version of the module as soon as i can.
* curl is fine, whatever works. just wondering out loud :)
* cool!
* your code is fine for SA-CONTRIB-2010-064, but coder module will prob say "what's that doing there". the $_POST reference isn't used anyway so it can go.
* admin field - no need to add that i think as ppl can just use the details alrady in UC and/or t() (string overrides etc)?
Comments
Comment #1
xurizaemonHey Matt
Thanks for submitting this. Somehow I missed it until now, for which I apologise.
Will review shortly - much appreciate your work.
Comment #2
xurizaemonHey Matt
Looks fairly good. A couple of things will need to be done as we go, adding some notes here to kick off. Are you still keen to collab on getting this in?
// ERROR! need to finish ERROR code function, and then record an order comment with an empty $msg.I see you had some drupal_http_request() code in there but went with cURL - can you tell me more about this decision? Looks like a lot of Ubercart payment modules use cURL instead of drupal_http_request() - I wonder if there's a specific issue with drupal_http_request() or whether it's just historic?
Comment #3
emTque commentedHey grobot,
sure i can help out (not sure how much help i will be), just let me know what you need.
my code is based on the example code my clients bank provided (i basically just 'drupalfied' their Merchant hosted code), so that is why i used curl. as for why it used in Ubercart instead of drupal_http_request() i am not sure.
i will make those changes and upload a new version of the module as soon as i can.
Comment #4
xurizaemon* curl is fine, whatever works. just wondering out loud :)
* cool!
* your code is fine for SA-CONTRIB-2010-064, but coder module will prob say "what's that doing there". the $_POST reference isn't used anyway so it can go.
* admin field - no need to add that i think as ppl can just use the details alrady in UC and/or t() (string overrides etc)?
thx
Comment #5
emTque commentedHey grobot,
here is the updated module code. let me know what you think.
cheers