The attached patch adds autocapture support to the core Quickpay module, and to the Übercart module. Orders with no shippable items are automatically set to autocapture.
It also adds a crude test mode, by defining a constant QUICKPAY_ALWAYS_TEST which, if set to true, causes the 'testmode' parameter to be set, and appends a 'T' to the order number. The use case for this is having a git tree with a branch for a test server, that sets the constant to true.
I have not done extensive testing, but it seems to be working. The EC module support is missing, obviously, but I've tried to make the (minimal) changes to the core module compatible with an unchanged EC module.
Comments
Comment #1
tohojo commentedHmm, it seems something ate my patch. Lets try that again...
Comment #2
xen commentedLooks good, but need a bit of work:
The QUICKPAY_ALWAYS_TEST needs to be a variable instead, redefining constants is not nice, and variables can be overridden in settings.php.
Autocapture needs to be togglable via a setting, there's no guarantee that non-shippable orders can be autocaptured (one usecase might be paying for access, that needs manual approval).
Comment #3
xen commentedCommitted to -dev. Please test and report back on how it works.
Also, I'd like to hear about how UC handles autocaptured payments. There's an outstanding FIXME in uc_quickpay_complete regading whether it should do anything special if the transaction is paid.
Comment #4
tohojo commentedThe code in CVS HEAD seems to work, with a few small errors fixed in the attached patch.
With regards to UC and autocapture, it seems that UC does the right thing. I.e. that entering the payment of the full amount on the callback sets the order status to "completed" as it's supposed to. The log entries from a completed order (with autocapture enabled) looks like this:
Comment #5
xen commentedCommitted. It's included in the beta4 release.
I guess that makes the Übercart module ready for a 1.0 release.