Jump to content
Sign in to follow this  
macki

CyberSource payment module

Recommended Posts

I developed a CyberSource payment module. It's available

here.

 

This module was tested using test transactions and test cc numbers. Because of the way the CyberSource gateway works (proprietary communication protocol), I had to use an external C interface application. Because of this, the module is not very easy to install if you don't have SSH access and some basic knowlegde of linux.

 

I included a doc.html file with the instructions and I'm available for any questions regarding this module. If you experience problems with it, please let me know. This thread is the best place to post questions.

 

Piotr Kaminski

Share this post


Link to post
Share on other sites

I am having some trouble with this module. Compiling worked great and I tested the icscard program and it worked fine. Generated the keys and all. But when I tried to run it through oscommerce it give me an unexpected error on the confirmation page.

 

I checked the paths and they are right. I also modified the module to give the error code along with the error message. If I specify the wrong path to the icscard file it gives me a 127 error code and if I specify the right path it gives me 255 error code. It looks like it is a php issue and not cybersource. Thats how I am relatively sure it is the right path. However I don't know what this error is from.

 

Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites

Ok I figured out the problem. The error is acutally in the documentation where it gives the example paths for the keys files, so the author may want to revise those doc files.

 

When you specify the path for the keys, the external app assumes you are putting them into a directory called "keys". So if you have your key files in the following directory

/home/site_home/keys/

 

Make sure that in OScommerce, where it asks you for the directory path to your keys files, that you specify

 

/home/site_home

 

DO NOT PUT

 

/home/site_home/keys

 

If you do then the program will look in /home/site_home/keys/keys and give you an error

Also do not put a trailing / or it will error as well. Hope this saves some other people some time and headache.

 

 

Thanks for the contrib though, other then this problem it works great!!

Share this post


Link to post
Share on other sites

wow u might just b the luckiest guy on this planet......i have banged my headed over this for over 6 months now with no luck...i get the "unexpected error" on confirmation page, i did change the paths as u has mentioned

 

Merchant Keys Path (ICSPATH)

/var/www/html

 

ICS Client Application Path

/var/www/html/keys

 

I have both the client n keys in the same folder, but still no luck...

any ideas?


The late twentieth century has witnessed a remarkable growth in scientific interest in the subject of extinction

----------------------------------------------------

Arpit

Share this post


Link to post
Share on other sites

if this helps, the $return_value from catalog/includes/modules/payment/cybersource.php is 126


The late twentieth century has witnessed a remarkable growth in scientific interest in the subject of extinction

----------------------------------------------------

Arpit

Share this post


Link to post
Share on other sites

YES I HAVE THE ANSWER:

1) compiled my own version of executable file (win32), made it accept command line arguments for first name, last name, etc.

2) modify the cybersource.php to call the .exe via cmd command and pass the command line arguments (has been few weeks now, but i cannot get the pipes to work and hence command line)

3) modify the validation in cybersource.php, as you will had to read the command line agruments.

4) and there ya go, cybersource and oscommerce living in harmony


The late twentieth century has witnessed a remarkable growth in scientific interest in the subject of extinction

----------------------------------------------------

Arpit

Share this post


Link to post
Share on other sites

Would someone mind explaining in a bit of detail how the keys are generated?

I am usually fairly good at this stuff, but I seem to be missing something with this contrib.

I've got the CyberSource logon and pass and see where to go to generate the keys. However, the download that they provide is confusing me.

 

I appreciate any help.

 

Thanks,

Floridaguy

Share this post


Link to post
Share on other sites

IMPORTANT

---------------------------------------------------------------

Hi All, I wasn't monitoring this thread that's why i haven't answered earlier.

 

You're right with the key path -

the key path (ICSPATH) should point to one directory up

so i keys are in /var/www/html/keys it should point to /var/www/html

 

the ICS application path should point TO THE EXECUTABLE file for example /var/www/html/bin/icscard

 

generating keys - download cybersource SDK and run ecert application included with it

this goes like below

 

./ecert merchant_id -path /var/www/html/keys

 

this will put generated keys in the directory specified on the command line

or similar

 

Hope this helps!

 

Thanks

Piotr Kaminski

Share this post


Link to post
Share on other sites

I am getting following error when compiling C file. PLease help

 

--------------------------------------------------------------

[root sample]# gcc -o icscard icscard.c /tmp/ics-2.0/lib/libics.a -ldl -I/tmp/ics-2.0/include/ -lnsl -lresolv -lpthread

icscard.c: In function `main':

icscard.c:20: `ics_msg' undeclared (first use in this function)

icscard.c:20: (Each undeclared identifier is reported only once

icscard.c:20: for each function it appears in.)

icscard.c:20: `icsorder' undeclared (first use in this function)

icscard.c:21: `res' undeclared (first use in this function)

icscard.c:22: parse error before `char'

icscard.c:33: `line' undeclared (first use in this function)

icscard.c:34: `pos' undeclared (first use in this function)

icscard.c:46: `rcode' undeclared (first use in this function)

icscard.c:48: `status' undeclared (first use in this function)

 

 

-----------------------------------------------------------

 

Thanks in Advance

 

Jacob

Share this post


Link to post
Share on other sites

it's really strange as i can compile it without problems.

Which version of ics sdk do you have?

What i use is something called sdk_c_linux_ics3.4.12 with libics2.a not libics.a

and below i see ics-2.0 in your path. Please check the SDK version and try to compile SDK test programs. (for example /sample/icstest/) by running make in that directory

 

Thanks

Peter

 

 

I am getting following error when compiling C file. PLease help

 

--------------------------------------------------------------

[root sample]# gcc -o icscard icscard.c /tmp/ics-2.0/lib/libics.a -ldl -I/tmp/ics-2.0/include/ -lnsl -lresolv -lpthread

icscard.c: In function `main':

icscard.c:20: `ics_msg' undeclared (first use in this function)

icscard.c:20: (Each undeclared identifier is reported only once

icscard.c:20: for each function it appears in.)

icscard.c:20: `icsorder' undeclared (first use in this function)

icscard.c:21: `res' undeclared (first use in this function)

icscard.c:22: parse error before `char'

icscard.c:33: `line' undeclared (first use in this function)

icscard.c:34: `pos' undeclared (first use in this function)

icscard.c:46: `rcode' undeclared (first use in this function)

icscard.c:48: `status' undeclared (first use in this function)

-----------------------------------------------------------

 

Thanks in Advance

 

Jacob

Share this post


Link to post
Share on other sites

Has anyone tried to use their PHP API?

 

Seems like it wouldn't be too much work to modify one of the existing payment modules to use this... I don't like the fact it loads PHP modules though, which basically require root access to the web server, or using jails. I also will be uneasy loading a module that I have no source code for.

 

Anyway, I've searched the forums over and over again and doesn't seem like any of the CyberSafe contribs use their PHP API. Piotr's contrib uses the C SDK.

 

I'm trying to decide which route to go, I can try this mod first, or go this route, disadvantage there is that the order page is not hosted on my own server. Or I could cook up my own module by modifying an existing one and publish the contrib later...

 

--Andrew


--AYN

Share this post


Link to post
Share on other sites

Just got this working in testing mode, I had to make a few changes to get it working, here are what I had to do:

 

- had to download latest public key file (CyberSource_SJC_US.crt)
- in addition to the 3 files listed in the readme of this mod, CyberSource_SJC_US.crt is needed in the same "keys" directory
- had to use ip address for test server (icscard didn't know how to look up IP address for some odd reasons)
- transactions got denied, after some PHP debugging, found out "X_Amount" is zero, solution: add global declarations:

function process_button() {
         global $HTTP_POST_VARS, $HTTP_SERVER_VARS, $CardNumber, $order, $customer_id;


--AYN

Share this post


Link to post
Share on other sites

did u get your cybersource payment module to work? if so, can you please help me set mine up? any help would be greatly appreciated!!!!!!!!!

Share this post


Link to post
Share on other sites

We have been using the Link Point Modules for almost 3 years, granted we did some major rewrites to them to get everything out of them we needed.

 

It seems odd that after all this time there is still not a working Cybersource module.

 

Most ppl do not have root access to the server, alot of sites are hosted on windows boxes.

 

Yet in all this time and after several ppl have stated that they have gotten it working on win32, not one contrib post.

 

I agree with the poster from another forum about this, run clear of CyberSource it is a night mare.

 

One of the things that we need to do is post a compiled win32 version, we also need to set up the admin email functions, most all CC modules return an email to the admin on processing with at least the AVS information.

 

suggestions...


If you choose not to decide you still have made a choice, I will choose a purpose clear, I will choose Free Will. --Neal Peart - Rush

Share this post


Link to post
Share on other sites

I think we have a winner.

 

Bank of America has been pushing clients towards the cybersource gateway as they are the tranistion partner for the Estores.

 

Call them, ask to be moved to the Virtual Net Platform, Most BoA clients are using Vital as the processor, if you are, then you are not stuck with cybersource,

 

Vital supports almost 650 gateways, Authorize.net being just one.

Authorize.net also has implemented the Verified by Visa and MC secure code for use by shopping carts, although we are still investigating the implementation.

 

Good Luck


If you choose not to decide you still have made a choice, I will choose a purpose clear, I will choose Free Will. --Neal Peart - Rush

Share this post


Link to post
Share on other sites
yup, got it working just fine.

 

Great to hear that! I've been traipsing along in everyone's footsteps it seems, and am at a bit of a loss.

 

I've done the basic fixes mentioned in this thread. I'm assuming there's something specific to my setup that's getting me screwed, and I think it has to do with environment variables. I can set the environment variable ICSPATH to the correct directory, and see it when I run 'set', but when I test run either icstest from the SDK or icscard with some test info, it says it can't find the key in the default /opt/CyberSource/SDK/keys directory.

 

Any idea why? Did you run into this?

 

Thanks for any suggestions. Ideas about debugging?

 

Craig

Share this post


Link to post
Share on other sites

OK! Found the solution, and it's possible this may be one of the major concerns for a lot of folk that have trouble with this module.

 

Apparently having PHP in safe_mode prevents it from setting environment variables. Unless you're using the default path for the keys (/opt/CyberSource/SDK), the module code has to be able to set the environment variable to the right place.

 

Turning safe_mode off should fix the problem.

Be well, all!

Craig

 

Great to hear that! I've been traipsing along in everyone's footsteps it seems, and am at a bit of a loss.

 

I've done the basic fixes mentioned in this thread. I'm assuming there's something specific to my setup that's getting me screwed, and I think it has to do with environment variables. I can set the environment variable ICSPATH to the correct directory, and see it when I run 'set', but when I test run either icstest from the SDK or icscard with some test info, it says it can't find the key in the default /opt/CyberSource/SDK/keys directory.

 

Any idea why? Did you run into this?

 

Thanks for any suggestions. Ideas about debugging?

 

Craig

Share this post


Link to post
Share on other sites

I am having the same problem. I was able to installed your contribution in 2005. Now i moved to a new server and I am having trouble compiling the code. I got this error. I am using a newer version...do you think that's my problem? do you have sdk_c_linux_ics3.4.12? or know where i can download it?

 

burnim% gcc -o icscard icscard.c ../lib/libcs2.a -ldl -I../include/ -lnsl -lresolv -lpthread

icscard.c: In function `main':

icscard.c:20: `ics_msg' undeclared (first use in this function)

icscard.c:20: (Each undeclared identifier is reported only once

icscard.c:20: for each function it appears in.)

icscard.c:20: `icsorder' undeclared (first use in this function)

icscard.c:21: `res' undeclared (first use in this function)

icscard.c:22: syntax error before `char'

icscard.c:33: `line' undeclared (first use in this function)

icscard.c:34: `pos' undeclared (first use in this function)

icscard.c:46: `rcode' undeclared (first use in this function)

icscard.c:48: `status' undeclared (first use in this function)

 

 

 

I installed the simapi-c-linux5.0.0.tar.gz on my linux server and here are the files i got

 

burnim% tar zxvf simapi-c-linux5.0.0.tar.gz

simapi-c-5.0.0/

simapi-c-5.0.0/samples/

simapi-c-5.0.0/samples/cybs.ini

simapi-c-5.0.0/samples/nvp/

simapi-c-5.0.0/samples/nvp/compile.sh

simapi-c-5.0.0/samples/nvp/authCaptureSample.c

simapi-c-5.0.0/samples/nvp/authCaptureSample

simapi-c-5.0.0/samples/xml/

simapi-c-5.0.0/samples/xml/compile.sh

simapi-c-5.0.0/samples/xml/auth.xml

simapi-c-5.0.0/samples/xml/authSample.c

simapi-c-5.0.0/samples/xml/authSample

simapi-c-5.0.0/include/

simapi-c-5.0.0/include/cybersource.h

simapi-c-5.0.0/lib/

simapi-c-5.0.0/lib/libcybersource.a

simapi-c-5.0.0/lib/libctype.so.0.0

simapi-c-5.0.0/lib/libctype.so.0

simapi-c-5.0.0/lib/libctype.so

simapi-c-5.0.0/lib/libstdc++.so.4.0.1

simapi-c-5.0.0/lib/libstdc++.so.4

simapi-c-5.0.0/lib/libspapache.so

simapi-c-5.0.0/lib/libxalan-c1_5_0.so

simapi-c-5.0.0/lib/libxerces-c.so.21

simapi-c-5.0.0/lib/libxerces-c.so

simapi-c-5.0.0/CHANGES

simapi-c-5.0.0/README

simapi-c-5.0.0/LICENSE

simapi-c-5.0.0/NOTICE

simapi-c-5.0.0/CyberSourceLicense.txt

simapi-c-5.0.0/keys/

simapi-c-5.0.0/keys/ca-bundle.crt

simapi-c-5.0.0/logs/

 

 

 

i put icscard.c under simapi-c-5.0.0/samples

 

I could not find libics2.a, i assume it's libcybersource.a in this version so i made a copy called libcs2.a

same thing with ics.h, so i copy cybersource.h to ics.h

 

can you tell me what i am doing wrong?

 

 

also i was not able to find ecert program in the linux CyberSource C SDK to generate the 3 files i need

 

 

*.crt

*.pvt

*.pwd

can you guide me where i can get the ecert program?

 

 

 

thanks you so much for your help!

Share this post


Link to post
Share on other sites

Anyone tried to use Cybersource with AVS matching?

 

Cybersource do what they call a "soft" decline which means they put a hold on the card so the customer looks like they will get charged but the cybersource module is returning a code that makes the site report an error message saying card declined and so of course we don't get an Order.


Kym

Projects Director @ ozEworks.com

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×