Home arrow Site Administration arrow Page 4 - Script-Based Credit Card Interfaces

PHP and CyberCash - Administration

To meet the demand for greater, more flexible access to real-time electronic transaction processing, transaction processing providers are lowering the barriers of entry, and opening the interfaces to their systems, allowing developers an opportunity to create custom interfaces for electronic commerce systems. In this article we show how easy it can be to connect your website to these systems and add real-time credit card processing to your programming arsenal.

TABLE OF CONTENTS:
  1. Script-Based Credit Card Interfaces
  2. A Word About Security
  3. Testing
  4. PHP and CyberCash
  5. Summary
By: Stephen Junker
Rating: starstarstarstarstar / 8
March 14, 2001

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
While the focus of this article is on connecting to the Authorize.net system through a request / response interface, a discussion of eCommerce connections with PHP would not be complete without discussing CyberCash, given that there is a PHP module devoted to it. However, one of the major differences between the CyberCash system and the Authorize.net system is that the latter does not require anything to be setup or installed -- it’s a completely script-based interface.

To connect with the CyberCash system, you will have to register at their website and download and install a copy of their Merchant Connection Kit (MCK) at your web host. Then, you will have to recompile PHP with the embedded CyberCash support to be able to access PHP’s API for CyberCash. If you’re not hosting your own site, this means being dependent on your ISP for this functionality, though more and more providers are offering it in a standard package.

After compiling PHP with the CyberCash extensions installed, you will be able to access 'CyberLib', a set of functions for use with the CyberCash system. However, research has shown these functions to be poorly documented and even less poorly understood by the PHP development community. The main method of integration with CyberCash is through the direct socket interface, and the purpose of CyberLib is to provide a convenient programming interface so you don't have to get your hands dirty with socket programming. A sample transaction using the CyberLib interface to CyberCash's CashRegister (taken straight from the PHP source code documentation) is shown below.

<?php
$merchant=""; /* Your merchant ID goes here. */
$merchant_key=""; /* Your merchant key goes here. */
$payment_url="http://cr.cybercash.com/cgi-bin/";
$auth_type="mauthonly";
$response=SendCC2_1Server($merchant,$merchant_key,$payment_url, $auth_type,array(
"Order-ID" => "2342322",
"Amount" => "usd 11.50",
"Card-Number" => "4111111111111111",
"Card-Address" => "1600 Pennsylvania Avenue",
"Card-City" => "Washington",
"Card-State" => "DC",
"Card-Zip" => "20500",
"Card-Country" => "USA",
"Card-Exp" => "12/99",
"Card-Name" => "Bill Clinton"));
while(list($key,$val)=each($response)) {
echo $key ."=" .$val ." ";
}
?>

As stated earlier, these built-in functions are poorly documented and difficult to use, and this sentiment is echoed in the user commentary with the online PHP manual at www.php.net. In an attempt to de-mystify the process of connecting to the CyberCash CashRegister, PHP developer Nathan Cassano has written an excellent article on connecting with his 'CyberClass', an adaptation of the standard CyberLib. The article, and other information about connecting to CyberCash, can be found at http://www.phpbuilder.com/columns/nathan20001225.php3.



 
 
>>> More Site Administration Articles          >>> More By Stephen Junker
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: