Hey,
Someone had dropped me an e-mail asking if I had solved my cybercash headaches from a month ago. After writing an in-depth reply, I had decided to drop the e-mail in this form in case it is helpful to anyone else.
Hey,
Hope you are making some progress with your Cybercash stuff.
It took a while for me to get the Cyberlib and class.cyberclass.php working together. The difficult part is that the Cybercash infrastructure is not very clearly explained
anywhere, especially when it comes to integration with PHP. Today I have to go through the horrific process of setting up the Merchant Connect Kit on another Unix
box. First, let me explain how the system works.
The pieces I had used are as follows:
class.cyberclass.php - The functionality to encrypt, transmit, decrypt and verify the transaction.
cyberauth.php - A wrapper for cyberclass, which includes database logging. Works almost out of the box.
merchant.conf - This file is generated by the Cybercash Merchant Connect kit.
CYBERCLASS:
All Cyberlib is doing is taking an array of name:values, encrypting them and passing them to the PERL script on the cybercash server. The importance to understanding
the process is knowing that all it is doing is creating an SSL connection with a PERL script, dumping its data, and awaiting a response. If you look through the
comments in the code, you can see programmatically where this is done.
The key to getting everything to work was the location of the merchant.conf file, for me. My problem was that the site was being served on an NT box, where you will
need the full path (Unix: /etc/.../... - NT: c:/mck-3.3.1-NT/.../...). When the Merchant Connect Kit is set up, it GENERATES a merchant.conf file based on the
information you enter, including a unique key. The file is also updated with the most recent location of the PERL script that cyberclass needs to connect to. If
cyberclass cannot find the merchant.conf, it has no idea where to send the CC data.
CYBERAUTH:
The first thing Cyberauth does is greate a new Cyberclass with the following line (on my hosting system):
$transaction = new cyberclass('c:/mck-3.3.1-NT/tvpathcom-13/conf/merchant_conf');
The rest of the code is designed to parse the returned array and dump it into a database. Don't forget to set up the table structures before you run this.
OTHER NOTES:
I did have some problems with the array not containing all of the name:value pairs that the script was looking for. As a result, I had to write some additional code to
check for the existence of these pairs using something like:
if ( $return_result['error'])
{
echo("Error processing card: " . $return_result['error']);
}
Hope this helps. I am going to drop this back onto the PHP forum in case anybody else is having the same trouble that I was.
--
Tom Gerbe
Streaming Media Developer
Digital Planet
(631) 563-4157
bootzero@digital-planet.cc
We build streaming media websites:
http://digital-planet.tv/