Ubercart Cybersource Module - Refunds (SOAP)

Greg's picture

Just throwing this out there to gauge demand...we just created a module (for 98main.com) which processes refunds for Cybersource transactions created through Ubercart. We don't use the Cybersource module for Ubercart because at the time we set up the site I believe SOAP was either not integrated into that module or perhaps it didn't do specifically what we needed.

So we've been working off a custom module that does authorizations when we take the order, then does a capture when we ship. All in all, after briefly looking over the code in the UC Cybersource Module it looks like it won't be too difficult to integrate what I wrote back into that module. The code doesn't seem too different from an implementation point of view.

Basically right now when we capture funds from a card, we store the token and reference id and whatnot in a table called cybersource_capture. We then reference that table when we process the refund. I created a pane in the admin order view page that has an input for the amount of refund requested and a comments box which then gets placed in the admin comments after the transaction. There's a bit of validation there, and a check to make sure it hasn't been over 60 days since we captured the funds (a cybersource SOAP API limitation; it's 120 days in the Business center).

Does this sound useful to anyone out there? If there is sufficient demand I can abstract it and port it into the uc_cybersource module. It's for Drupal 5, but I will have to port it to Drupal 6 soon anyhow for a new site, so I can create a D6 version too.

Leave a comment and let me know. What sort of features do you need out of Cybersource refunds? Are most of you just going into the Business center to do it manually?

We were doing that but the problem is one of communication. We can have someone go in and process the refund in Cybersource, but while viewing the order in Ubercart there is no indication that anything was done unless someone decided to post a comment after they processed the refund. That, and it's just easier to have it all in one interface.

I don't have a ton of free time on my hands but I've taken a lot from the Drupal community so this might be a chance to give a little back. If there's any demand that is. :)

An update...

Well, digging deeper into the Cybersource module in Ubercart 2 Beta 4 it seems there's a lot of stuff that I'm going to have to update.

Leaves me with the choice of creating a separate module that replicates a lot of the functionality already present, and adding in what I need...OR...making what I need more generic in nature and contributing that back to the Cybersource module.

Right off the bat I can see several things that must be added:

  1. Tax service: multiple locations (will most likely alter the form to allow several addresses
  2. Method to process multiple orders simultaneously upon shipment (right now it needs to be done one-by-one in the order invoice screen)
  3. Editable list of possible values to send to Cybersource upon authorization

I'll add more here as I find them.