News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Changing Auth.net to work for Cybersource

Started by Shelly Haffly, September 09, 2005, 20:53:57 PM

Previous topic - Next topic

Shelly Haffly

The systems work virtually the same, but how/where do you begin to start changing the files to work? Cybersource has several options available to work. Some send the user to their system, one permits you to do it all on your site.

Which is easiest and what built in module to you modify to make it work?

I'm sorry, I know these are very broad questions, but I just don't understand the documentation provided by Cybersource.

My customer is willing to use 2checkout, however I would like to test that system first before I commit and I don't see a way to do that without putting down the $49 set up fee.

mrosile

For anyone who has read my post back in August of 2006, sorry its taken me this long to get this done, but I've finally completed a CyberSource Payment module for VirtueMart!

I've attached a zip file containing the module and a README.txt file with installation instructions.  I hope there are still people out there that can use it!

If anyone has any problems using this module, I will do my best to fix any bugs and improve on the existing module, but please understand that I'm only working on this project in my spare time, so please have patience.

[attachment cleanup by admin]

digical

#2
Hi,

This is exactly what I need.  It's amazing that I looked at this post today and you finished the module yesterday.  Cool!

However, I'm having problems with it.

When I try to add the payment method to the VM, I get "CyberSource config file does not exist! Your configuration was not saved."

I installed the library and configured the ini file.
I installed the 2 gateway files in the right place in the administration directory

Here is the contents of my ps_cybersource.cfg.php file:

<?php
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');

define ('CS_MERCHANT_ID', 'my-merchant-id');
define ('CS_CONFIG_FILE', '/var/www/vhosts/mydomain.com/httpdocs/cybersource/simapi-php-5.0.1/samples/cybs.ini');
define ('CS_CHECK_CARD_CODE', 'YES');
define ('CS_VERIFIED_STATUS', 'P');
define ('CS_INVALID_STATUS', 'P');
?>

Here is the contents of cybs.ini file:

merchantID=[my.merchant.id]
keysDirectory=/var/www/vhosts/mydomain.com/httpdocs/cybersource/simapi-php-5.0.1/keys
targetAPIVersion=1.21
sendToProduction=false

# logging should normally be disabled in production as it would slow down the
# processing.  Enable it only when troubleshooting an issue.
enableLog=false
logDirectory=/var/www/vhosts/mydomain.com/httpdocs/cybersource/simapi-php-5.0.1/logs

I'm glad to see that the samples included in the SDK are working.  So I guess I installed the library properly.  :)

What am I missing?

- rg

mrosile

digical,
     Let me make sure that I understand you're problem correctly.  You get an error message when creating a new payment module and specifing 'ps_cybersource' as the module.  Does 'ps_cybersource' even show up in the list of payment modules?  You should only see the error "CyberSource config file does not exist! Your configuration was not saved." when saving the ps_cybersource config AFTER the module was added to VirtueMart.
     It could be a permissions issue?  The cybs.ini file (and the path leading up to it) should be readable by the same user that is running your webserver.  In most cases, when using the Apache web server, this user is either 'apache' or 'nobody' or something similar.  Perhaps when you ran the samples from the CyberSource SDK you were running them as a 'root' user?
     Let me know what you find out!  I really want to make this payment module a big success, and thanks for downloading it!  :-D

digical

Yes, when I install the payment module the first time, I get this message.  However, it still saves but when I run a test order, it still says that config file can't be found.  Anyway, I had some techs work on it all night and they seem to get past this error.  I will ask them what they did to fix it.

Now I have a new error -> Error: The request is missing one or more required fields.

I can't find any log files to determine which fields are missing.

Do you have any ideas on how to troubleshoot this?

- rg



mrosile

Rg,
     Best thing to do to troubleshoot this problem is change the value in cybs.ini that says "enableLog=false" to "enableLog=true".   Also change logDirectory if you want the log to be saved someplace else.

- Mike

digical

OH - GREAT!  It's now logging.  THANKS!

Here is the tail of the log:

missingField_=bixxxxxxxxte
decision=REJECT
missingField_0=billTo_state
requestID=1619594470680169609486
2006-10-27 09:30:48 3086280384 TRANSTATUS > CYBS_S_OK


digical

OK - I got it working!   I turned on "Customers can select a state/region?" and it's now working! 

There were 3 other hacks that you say are required.  I only added the "english.php" hack.  I got it working without adding the other 2.  I will add them anyway per your recommendations.

- rg


mrosile

rg,
     One of the other hacks was to facilitate the processing of a VISA test account number, which really isn't necessary if you're gone live with CyberSource.

     The other hack is partially implemented.  All transactions done with this CyberSource module will ONLY be authorized and not captured.  The second hack is recommended so that when you change your order status from "Pending" to "Confirmed", the funds will then be captured.  I have yet to make this feature a 'choice' for the store admin as to capture the payment at the same time as the authorization or to capture the funds later.  Capturing the funds later is the recommend solution for products that are being shipped.

     Thanks for taking the time to test the module as well as providing feedback!  I will be sure to include your findings in my next revision and README file.

- Mike

digical

#9
I will definitely add the "pending/confirm" hack.  My client is providing a service and therefore we want "confirmed".  We are not shipping anything. 

On the readme, I recommend removing the line numbers.  On your readme, I can't just merely copy/paste the hack.  I have to remove the line numbers.  If you didn't have the line numbers there, I could just copy & paste at the line number you suggest within the php file. 

- rg




digical

I also recommend mentioning something about "Customers can select a state/region?".  On my installation, it was required for the orders to go through.

digical

Two more things:

THANK YOU - THANK YOU for the module!  KUDOS TO YOU!

second, on one of your hacks, you mention "(usually starts with a v)".  my merchant account starts with a "c".

- rg


mrosile

rg,
     Yeah I kinda realized the thing about the line numbers... they also may not be entirely accurate depending on any other hacks or modifications that somebody else could have added to their VirtueMart.
     I will definitely mention that the "state/region" option needs to be enabled in my next revision, which should be out sometime soon.
     I currently am working with two seperate CyberSource accounts and both of my account numbers started with a 'v', so I just assumed most of them did.  I'm glad you pointed out that your merchant number starts with a 'c'!

And THANK YOU for providing so much excellant feedback!

- Mike

digical

you are welcome.  I'm looking forward to your next version.

you mention in your readme (Best to be absolute and outside of your document root).  I suggest:

(IMPORTANT: MAKE SURE YOUR PATH IS OUTSIDE YOUR WEB DOCUMENT ROOT).