CyberSource Integration

Contrib type: 
Module
Status: 
Work in progress

Downloads

Compatibility: 
Ubercart 1.x

This is the initial upload of the CyberSource module. It includes integration of the Silent Order POST method, which requires you to do a couple things in your account.

In Tools & Settings, there is a Hosted Order Page section. You need to go the security section and download the security script it offers for PHP. You'll place this in your uc_cybersource directory. The file contains a function that conflicts with a Drupal function. I'll probably make a script to fix this, but for now just open the file and do a find/replace to change all instances of L( to csL(.

You must also adjust the Hosted Order Page settings. Specifically you need set the Receipt Response URL and Decline Response URL to http://www.example.com/cs/receipt and check the box beneath both those textfields. This really just reports to a dummy URL defined by the module, but you have to check the checkboxes so the module can receive the transaction results and act on them. Use the same URL as your Merchant POST URL.

Once you've done these things, you should be ready to test it out! When testing with CyberSource's Silent Order POST service, you can't process anything over $1,000. This limitation will not apply in production mode.

Future plans include adding Simple Order API integration to this module.


PreviewAttachmentSize
uc_cybersource.tar.gz7.91 KB
atlas3650's picture
Offline
Bug Finder
Joined: 12/12/2007
Juice: 48
Update from cybersource

My company is talking to cybersource, and they've informed us that the $1000 limit is only applicable in test accounts; real (active) accounts are not limited.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15459
Re: Update from cybersource

Excellent news! Thanks a lot for posting. Smiling

atlas3650's picture
Offline
Bug Finder
Joined: 12/12/2007
Juice: 48
Apparently incorrect card_cardType codes

It seems like the card types being sent by the module do not work at Cybersource. The module sends strings like MasterCard, Visa, but they seem to want '001', '002', etc, as per

http://apps.cybersource.com/library/documentation/dev_guides/HOP_UG/html...

When I modified the code around line 135, in ubercart/uc_cybersource/uc_cybersource.module, to use the codes, payments worked. Do you know if this is due to the fact that I'm using a test account? Or has the PHP fallen behind Cybersource's choice of credit card codes?

Thanks!!

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15459
Re: Apparently incorrect card_cardType codes

You're correct, and those strings are adjusted in the latest Bazaar version... don't know that I updated this contrib.

atlas3650's picture
Offline
Bug Finder
Joined: 12/12/2007
Juice: 48
But bazaar version is dev, right?

Is there a release candidate with this fix that we can use instead of the bazaar/dev version?

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15459
Re: But bazaar version is dev, right?

Not quite... downloading the zip from the top of the Bazaar page is really the latest official code. All our releases move from their to the Drupal CVS server.

steveduffin's picture
Offline
Joined: 06/05/2008
Juice: 4
UK Payments

Anyone know if this will work if I'm based in the UK?

bjeavons's picture
Offline
Joined: 07/28/2008
Juice: 2
Hosted Order Pages

I'm looking to use Cybersource's Hosted Order Page solution because I don't want to take credit cards on my site. Can this be done with Ubercart 5.x-1.2? The problem is Credit Card module is required and wants a non-public directory to write to, I don't want to take credit cards at all. Thanks!

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15459
Re: Hosted Order Pages

Hmm... can't remember why it depends on the CC module, but you can simply go there and specify your files directory. It will write to it a .key file that just won't be used, though you can still add it to your exclusions list in your .htaccess if you want. I'll review the code to see why it specifies CC as a dependency. It's probably b/c the module was going to combine HOP with Silent Order POST (or Simple Order API... whatever they call it. I've done too many of these. Eye-wink)

jumpfightgo's picture
Offline
Joined: 12/03/2009
Juice: 24
Just Hosted Order Pages, not silent post?

I just posted a bounty for this. If anyone else would like to co-sponsor or be involved, please chime in.

Also, isn't cybersource integration part of ubercart 2, and this thread says ubercart 1 - is there somewhere else I should be posting about how to use HOP without silent post?

jfn99@hotmail.com's picture
Offline
Joined: 02/20/2010
Juice: 13
Not Working

I installed the Cybersource Silet Post, got the HOP file from cybersource, placed on the correct folder on my server.

Order is processed correctly on the site, even the completed order message comes up with no errors. however the order never shows up on cybersource gateway.

any ideas of what could be the cause?

any help much appreciated.

lliembo's picture
Offline
Joined: 09/29/2010
Juice: 6
Different versions of HOP.php generated?

I was provided a HOP.php from Cybersource that lacks getPublicKey() and getPrivateKey() functions but includes getSharedSecret() instead. I did not generate this HOP, my client did, so I am wondering if they generated the wrong file or selected the wrong option?

So, of course, checkout breaks with:

PHP Fatal error: Call to undefined function getPublicKey() in yaddayaddayadda/sites/all/modules/ubercart/payment/uc_cybersource/uc_cybersource.module on line 333

lliembo's picture
Offline
Joined: 09/29/2010
Juice: 6
Re: Different versions of HOP.php generated?

It looks like the getSharedSecret() function can replace getPublicKey() in uc_cybersource.module

druderman's picture
Offline
Joined: 10/05/2010
Juice: 31
Re: Hosted Order Pages

I too want to use Cybersource, but do not want to take credit cards on my site.

The customer would not be prompted for credit card information on my site. Instead when they submit the order to checkout, the customer would be sent to the Hosted Order Page at Cybersource's website to enter credit card information and then sent back to Ubercart when the transaction is complete. This is what the Cybersource HOP was intended to do.

Is there a way to do this today?

I'm using Ubercart 6.x.24

jumpfightgo's picture
Offline
Joined: 12/03/2009
Juice: 24
see patch for ubercart core

http://drupal.org/node/809972

Please test the latest patch to ubercart that provides this functionality.

Our company sponsored development for the patch and are using it on a live site, https://classifieds.harvardmagazine.com , and the patch just needs more people to test it before it's committed.

Thanks!

druderman's picture
Offline
Joined: 10/05/2010
Juice: 31
Re: Re: Hosted Order Pages

It appears that what I want is under development over here.
http://drupal.org/node/809972

jackocnr's picture
Offline
Joined: 12/12/2011
Juice: 25
CyberSource in UK

This question was asked earlier and went unanswered, and now I need to know: does the CyberSource module included with Ubercart 2 work for UK sellers?

CyberSource are based in the US, but seem to have a UK branch, so it would be great to just get a definitive answer to this question before I tell my client to sign up so I can try it out...

Cheers,
Jack