CyberSource: Issuing Credits back to a Card

Background

I’ve been working on a system to improve our returns process and ran across a problem using the CyberSource API. Now it may be my eyes missed it, but every credit I issued I was receiving a 102 response code. This normally means “missing required fields,” and the response object contains exactly which fields were missing.

Nope.

Solution

Ah-ha! If I’d only signed in to my testing business center I could have seen what 102 means in this context:

There is a problem processing this request: Original transaction data could not be found in online system-it may have been archived.

102 is a legitimate message, and the accounting office will have to take appropriate action. I’ll put this on the exception report. Additionally, I noticed my testing box was issuing an auth-only – not a capture – so there really really wasn’t anything to credit!

Adventures in SOAP and WSDL

Got my first real SOAP challenge: I’ve got to integrate Cybersource’s payment system into our newish RHEL5 servers. The challenge is that our OS is now 64-bit, and we were using their Simple Order 32-bit API in the form of php and perl extensions.

Bzzt. No go. Wisely, Cybersource has decided to go the Web Services direction, so the implementation isn’t all that tricky. Although Cybersource says the SOAP kit is supported by php 5.2.1 and above, 5.1.6 seems to be working just fine for me – at least to their test servers.

Cybersource’s docs say that you should do a php -i | grep soap to see if your php is enabled. Don’t do that. Instead yum install php-soap. Same for php-xml. Install those two and you should be fine.

Another thing I found challenging is figuring out what functions and types are available in the Cybersource interface. There is no documentation – only WSDL for that. So I wrote a quick-n-dirty ditty to dump the functions and types of their WSDL.

Of course 30 minutes later I found out I was going to have to cobble together a SOAP client for a Gift/ Loyalty Card service that we’re implementing.

The long and short of it is, I couldn’t find an easy way to gimme the WSDL details. It’s probably been invented somewhere else, but I needed the practice anyway, so here’s the MXWest gimme-gimme page that will dump WSDL for you. Might even be helpful if you’re writing your own WSDL as it should complain about errors.

Bang it here for Gimme-Gimme a WSDL Dump.

P.S. Yes, I stole Firefox’s background for this little fellow. But it had balloons, and my company is sponsoring the New Jersey Festival of Ballooning this weekend. Tweet me if you’re there @MXWest and stop by the booth!