SiteMinder / Webhosting
The Computer Merchant, Ltd
US-MA-North Quincy

Justtechjobs.com Post A Job | Post A Resume

CyberCash
Setting up CyberCash
The next step is to setup your CyberCash merchant server by installing software from CyberCash and compiling CyberCash support into PHP.
CyberCash provides the Merchant Connection Kit (MCK). This is used to connect you (the merchant) to the CyberCash servers (found here). You will need to download and install this package onto your server. When you install the MCK package it will create a mck-3.2.* directory. Change into this directory and run it's ./configure script. MCK will then prompt you for your configuration information. Most of the script inputs are unused by CyberClass. The prompts important to CyberClass for you to input are your CyberCash ID (Merchant ID), your Merchant Key and whether the configured files should be installed; you can enter 'no'. When the script is finished it will have created a merchant configuration file located in /path_to/mck-3.2.*/your_merchant_id/conf/merchant_conf. This will be used by CyberClass later.
Next comes task of compiling CyberCash library support into PHP. This requires that you download and compile the PHP source code. If you are not familiar with compiling PHP from the source, get more information at the Getting Started - Installation section in the PHP Manual. To include CyberCash support, add '--with-cybercash=/path_to/mck-3.2.*' to the list of ./configure arguments. Make sure as the script is running you see the status line 'checking for CyberCash support... yes'. Finally, do the standard make, make install and any other external configuration.
CashRegister comes with plenty of documentation which you will need to get most of. Go to the CashRegister Documentation page and begin downloading. At least get the Command API Developer's Guide, the Message Block API Developer's Guide and the Error Message Guide to aid you in development.
Lastly, download CyberClass, the PHP library interface to CashRegister.
Developing with CyberCash
The focus of this next section is to introduction you to the CyberCash development model. This is not a complete development guide but a means to understand how CyberCash development in done with PHP and CyberClass. At this stage your account should be in testing mode. Testing mode is used to simulate the processing environment. This allows you to test and develop your CyberCash enabled web site while billing remains inactive. Later, when you are ready go live with your site, go to the Merchant Control Panel, click on the "Go Live" option and your site will be financially activated (given all the necessary step are completed).
The CyberCash SendCC2_1Server() function is the primary method for sending requests to the CyberCash servers. Through this function you can send API Commands. API Commands are a set of commands used for executing financial transactions and functions; they require a specific list of key/values and return a list of key/values. I find it is easiest to learn from example so lets get down to business and make an authorization with CyberClass.

<?php

/*
CyberCash PHP CyberClass authorization example
*/

/* Include the CyberClass module */
include("class.cyberclass.php");

/* A CyberClass instance is created with the first
argument pointing to your 'merchant_conf' file */
$transaction = new cyberclass("/path_to/merchant_conf");

/* The SendCC2_1Server() member function is called */
$response = $transaction->SendCC2_1Server(

/* The Command API 'mauthonly' is called to
perform an authorization */
'mauthonly',

/* mauthonly's array of key/value argument pairs */
array(
'order-id' => '11223344',
'amount' => 'usd 12.50',
'card-number' => '4111111111111111',
/* The credit card number '4111111111111111' is the VISA testing number */
'card-exp' => '12/05', /* MM/YY date format */
'card-name' => 'Bill Clinton',
'card-address' => '1600 Pennsylvania Avenue',
'card-city' => 'Washington',
'card-state' => 'DC',
'card-zip' => '20500',
'card-country' => 'USA'
);

/* Print the result */
foreach($response as $key => $val){
    echo
"response['$key'] = $val<br>\n";
}
?>
The script should produce something like the following output.

<?php

response
['cust-txn'] = 404909166
response
['merch-txn'] = 404909166
response
['avs-code'] = z
response
['ref-code'] = 009600123491
response
['auth-code'] = AC7435
response
['action-code'] = 000
response
['MStatus'] = success
response
['paid-amount'] = usd 12.50
response
['card-number'] = 411111
response
['card-type'] = vs
response
['order-id'] = 11223344
response
['card-exp'] = 12/05
response
['aux-msg'] = Financial Institution Response: authorization approved.

?>
This example is fairly straight forward and should give you a taste of CyberCash development. You send your request to CyberCash and receive a response. The MStatus variable is present in all responses and returns the status of the issued command. This is the first variable you should consider in determining the success of a command.
There are many CyberCash API commands besides mauthonly. However in most cases it is not necessary to develop with them. CyberCash provides the Merchant Manager, a web based merchant administration interface. It pretty much does everything possible in CyberCash, with the exception of integration with your web site. So most of your CyberCash tasks can be taken care of through the Merchant Manager. If you still need more and power develop your own CyberCash application. Examine the appropriate API command documentation, do some experimentation with it until you've figured it out and develop an application. For a complete list of the Command API check out the Command API Developer's Guide Chapter 2.
[ Next Page ]

[Page 1]  [Page 2]  


Comments:
RE: PHP & SSLvenkat02/26/04 03:27
paypal wrote php!!!ahmed wahsakkan04/18/03 14:20
RE: How about a PHP solution for PayPal?Erik01/13/03 20:43
PHP PAYPAL SOLUTIONWilliam09/09/02 02:00
RE: How about a PHP solution for PayPal?Mike09/06/02 15:01
RE: How about a PHP solution for PayPal?Goran08/29/02 05:27
RE: CyberCash doesn't exist any more!Tim07/19/02 13:04
RE: How about a PHP solution for PayPal?Gennadi07/09/02 06:16
RE: CyberCash doesn't exist any more!mike n sol06/01/02 03:49
RE: CyberCash doesn't exist any more!Jamin Roth05/30/02 12:52
RE: CyberCash doesn't exist any more!Michael Motherwell05/22/02 00:54
RE: PayPal Developer Network, scripts, etcDave McClure04/28/02 13:24
RE: How about a PHP solution for PayPal?Louis04/15/02 23:33
RE: How about a PHP solution for PayPal?Khris03/26/02 17:20
RE: How about a PHP solution for PayPal?JoseDM403/20/02 19:33
RE: CyberCash doesn't exist any more!Robert Marshall02/28/02 05:35
RE: How about a PHP solution for PayPal?netmastan02/28/02 01:56
RE: How about a PHP solution for PayPal?kokoboy02/26/02 08:14
RE: How about a PHP solution for PayPal?kokoboy02/26/02 08:11
RE: How about a PHP solution for PayPal?kadnan02/18/02 07:34
Are there other low cost card processors ?Alex01/28/02 11:14
Best Payment Processor option.Rick St Jean10/12/01 16:31
RE: Curiosity abut somethingRich09/30/01 10:28
RE: How about a PHP solution for PayPal?Mathieu09/12/01 13:26
RE: Pure Java Solutions for CashRegister 3.2Zahid06/21/01 21:43
Pure Java Solutions for CashRegister 3.2James Bressi05/24/01 08:52
RE: CyberCash doesn't exist any more!Nathan Cassano (Author)05/11/01 07:18
Configuring default currencyDanny Marandola04/01/01 16:17
RE: CyberCash doesn't exist any more!Bill03/10/01 23:51
CyberCash doesn't exist any more!Lopez03/06/01 11:15
RE: How about a PHP solution for PayPal?tyler03/02/01 04:30
RE: How about a PHP solution for PayPal?Marcel02/28/01 12:56
RE: How about a PHP solution for PayPal?Marcel02/28/01 12:24
RE: Curiosity about somethingMarcel02/28/01 12:01
Curiosity about somethingChris02/22/01 23:05
PHP/CyberCash Without CyberclassPaul Happ02/10/01 16:55
Orthodox Version Of The CodeNathan Cassano (author)02/05/01 05:17
Missing Close ParensLionel02/02/01 03:54
PHP and DataCashPaul Ingles01/21/01 14:01
PHP & SSLRon Donnelly01/06/01 01:40
RE: How about a PHP solution for PayPal?Patrick Kellum01/05/01 02:34
RE: How about a PHP solution for PayPal?Mark Hall12/31/00 19:53
How about a PHP solution for PayPal?Marc Fiuczynski12/29/00 01:44
Nice and useful article ;-)Po-yu Chien12/27/00 03:04
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.