summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@php.net>2002-10-09 20:20:18 +0000
committerJan Lehnardt <jan@php.net>2002-10-09 20:20:18 +0000
commitd888b62eb2327fc4ca90621495618b71b42c3b70 (patch)
tree0afd3980044502cf2fc6466c8f6564232f859ed7
parentcfcfd094e947f16f9965cdecadb540d03a788aeb (diff)
downloadphp-git-d888b62eb2327fc4ca90621495618b71b42c3b70.tar.gz
- remove ext/cybercash
- http://www.verisign.com/support/cyberCash/dnsChangeNotification.html - The migration of CyberCash merchants to the VeriSign Payflow service is - scheduled for completion in mid-February. At that time we will begin the - shutdown of the CyberCash payment gateway and all related systems. This - final shutdown process requires us to change DNS for the VeriSign Payflow - service. The DNS change is scheduled at approximately 6PM ET on February 28, - 2002. @- removed ext/cybercash (jan)
-rw-r--r--ext/cybercash/CREDITS2
-rw-r--r--ext/cybercash/config.m429
-rw-r--r--ext/cybercash/cybercash.c230
-rw-r--r--ext/cybercash/cybercash.dsp110
-rw-r--r--ext/cybercash/cybercash.h40
-rw-r--r--ext/cybercash/cyberlib.php215
-rw-r--r--ext/cybercash/test.php26
7 files changed, 0 insertions, 652 deletions
diff --git a/ext/cybercash/CREDITS b/ext/cybercash/CREDITS
deleted file mode 100644
index d9f4491a66..0000000000
--- a/ext/cybercash/CREDITS
+++ /dev/null
@@ -1,2 +0,0 @@
-CyberCash
-Evan Klinger
diff --git a/ext/cybercash/config.m4 b/ext/cybercash/config.m4
deleted file mode 100644
index 3deaa368ef..0000000000
--- a/ext/cybercash/config.m4
+++ /dev/null
@@ -1,29 +0,0 @@
-dnl
-dnl $Id$
-dnl
-
-AC_MSG_CHECKING(for CyberCash support)
-AC_ARG_WITH(cybercash,
-[ --with-cybercash[=DIR] Include CyberCash support. DIR is the CyberCash MCK
- install directory.],
-[
- if test "$withval" != "no"; then
- test -f $withval/mckcrypt.h && MCK_DIR=$withval
- test -f $withval/c-api/mckcrypt.h && MCK_DIR=$withval/c-api
- if test -n "$MCK_DIR"; then
- AC_MSG_RESULT(yes)
- PHP_NEW_EXTENSION(cybercash, cybercash.c)
- old_LIBS=$LIBS
- LIBS="$LIBS -L$MCK_DIR/lib"
- AC_CHECK_LIB(mckcrypto,base64_encode,[AC_DEFINE(HAVE_MCK,1,[ ])],
- [AC_MSG_ERROR(Please reinstall the CyberCash MCK - cannot find mckcrypto lib)])
- LIBS=$old_LIBS
- PHP_ADD_LIBRARY_WITH_PATH(mckcrypto, $MCK_DIR/lib)
- PHP_ADD_INCLUDE($MCK_DIR)
- else
- AC_MSG_RESULT(no)
- fi
-fi
-],[
- AC_MSG_RESULT(no)
-])
diff --git a/ext/cybercash/cybercash.c b/ext/cybercash/cybercash.c
deleted file mode 100644
index 6778e6657f..0000000000
--- a/ext/cybercash/cybercash.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 4 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2002 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 2.02 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available at through the world-wide-web at |
- | http://www.php.net/license/2_02.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Authors: Evan Klinger <evan715@sirius.com> |
- | Timothy Whitfield <timothy@ametro.net> |
- +----------------------------------------------------------------------+
- */
-
-/* $Id$ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "php.h"
-#include "ext/standard/info.h"
-#include "cybercash.h"
-
-#if HAVE_MCK
-#include "mckcrypt.h"
-#include "base64.h"
-
-/* {{{ cybercash_functions[]
- */
-function_entry cybercash_functions[] = {
- PHP_FE(cybercash_encr, NULL)
- PHP_FE(cybercash_decr, NULL)
- PHP_FE(cybercash_base64_encode, NULL)
- PHP_FE(cybercash_base64_decode, NULL)
- {NULL, NULL, NULL}
-};
-/* }}} */
-
-/* {{{ cybercash_module_entry
- */
-zend_module_entry cybercash_module_entry = {
- STANDARD_MODULE_HEADER,
- "cybercash",
- cybercash_functions,
- NULL,
- NULL,
- NULL,
- NULL,
- PHP_MINFO(cybercash),
- NO_VERSION_YET,
- STANDARD_MODULE_PROPERTIES,
-};
-/* }}} */
-
-#ifdef COMPILE_DL_CYBERCASH
-ZEND_GET_MODULE(cybercash)
-#endif
-
-/* {{{ PHP_MINFO_FUNCTION
- */
-PHP_MINFO_FUNCTION(cybercash)
-{
- php_info_print_table_start();
- php_info_print_table_row(2, "Cybercash Support", "enabled");
- php_info_print_table_end();
-}
-/* }}} */
-
-/* {{{ proto array cybercash_encr(string wmk, string sk, string data)
- Cybercash encrypt */
-PHP_FUNCTION(cybercash_encr)
-{
- zval **wmk, **sk, **inbuff;
- unsigned char *outbuff, *macbuff;
- unsigned int outAlloc, outLth;
- long errcode;
-
- if (ZEND_NUM_ARGS() != 3 ||
- zend_get_parameters_ex(3, &wmk, &sk, &inbuff) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_string_ex(wmk);
- convert_to_string_ex(sk);
- convert_to_string_ex(inbuff);
-
- outAlloc = Z_STRLEN_PP(inbuff) + 10;
-
- outbuff = (unsigned char *)emalloc(sizeof(unsigned char) * outAlloc);
- macbuff = (unsigned char *)emalloc(sizeof(unsigned char) * 20);
-
- errcode = mck_encr(Z_STRVAL_PP(wmk),
- Z_STRVAL_PP(sk),
- Z_STRLEN_PP(inbuff) + 1,
- Z_STRVAL_PP(inbuff),
- outAlloc,
- outbuff,
- &outLth,
- macbuff);
-
- if (array_init(return_value) == FAILURE) {
- php_error(E_WARNING, "%s(): Return value could not be initialized", get_active_function_name(TSRMLS_C));
- RETURN_FALSE;
- }
-
- add_assoc_long(return_value, "errcode", errcode);
-
- if (!errcode) {
- add_assoc_stringl(return_value, "outbuff", outbuff, outLth, 0);
- add_assoc_long(return_value,"outLth", outLth);
- add_assoc_stringl(return_value,"macbuff", macbuff, 20, 0);
- } else {
- efree(outbuff);
- efree(macbuff);
- }
-}
-/* }}} */
-
-/* {{{ proto array cybercash_decr(string wmp, string sk, string data)
- Cybercash decrypt */
-PHP_FUNCTION(cybercash_decr)
-{
- zval **wmk, **sk, **inbuff;
- unsigned char *outbuff, *macbuff;
- unsigned int outAlloc, outLth;
- long errcode;
-
-
- if (ZEND_NUM_ARGS() != 3 ||
- zend_get_parameters_ex(3, &wmk, &sk, &inbuff) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
-
- convert_to_string_ex(wmk);
- convert_to_string_ex(sk);
- convert_to_string_ex(inbuff);
-
- outAlloc = Z_STRLEN_PP(inbuff);
-
- outbuff = (unsigned char *)emalloc(sizeof(unsigned char) * outAlloc);
- macbuff = (unsigned char *)emalloc(sizeof(unsigned char) * 20);
-
- errcode = mck_decr(Z_STRVAL_PP(wmk),
- Z_STRVAL_PP(sk),
- Z_STRLEN_PP(inbuff),
- Z_STRVAL_PP(inbuff),
- outAlloc,
- outbuff,
- &outLth,
- macbuff);
-
- if (array_init(return_value) == FAILURE) {
- php_error(E_WARNING, "%s(): Could not initialize return value", get_active_function_name(TSRMLS_C));
- RETURN_FALSE;
- }
-
- add_assoc_long(return_value, "errcode", errcode);
-
- if (!errcode) {
- add_assoc_stringl(return_value, "outbuff", outbuff, outLth, 0);
- add_assoc_long(return_value, "outLth", outLth);
- add_assoc_stringl(return_value, "macbuff", macbuff, 20, 0);
- } else {
- efree(outbuff);
- efree(macbuff);
- }
-}
-/* }}} */
-
-/* {{{ proto string cybercash_base64_encode(string data)
- base64 encode data for cybercash */
-PHP_FUNCTION(cybercash_base64_encode)
-{
- zval **inbuff;
- char *outbuff;
- long ret_length;
-
- if (ZEND_NUM_ARGS() != 1 ||
- zend_get_parameters_ex(1, &inbuff) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(inbuff);
-
- outbuff = (char *)emalloc(base64_enc_size((unsigned int)Z_STRLEN_PP(inbuff)));
-
- ret_length = base64_encode(outbuff,
- Z_STRVAL_PP(inbuff),
- Z_STRLEN_PP(inbuff));
-
- RETURN_STRINGL(outbuff, ret_length, 0);
-}
-/* }}} */
-
-/* {{{ proto string cybercash_base64_decode(string data)
- base64 decode data for cybercash */
-PHP_FUNCTION(cybercash_base64_decode)
-{
- zval **inbuff;
- char *outbuff;
- long ret_length;
-
- if (ZEND_NUM_ARGS() != 1 ||
- zend_get_parameters_ex(1, &inbuff) == FAILURE) {
- WRONG_PARAM_COUNT;
- }
- convert_to_string_ex(inbuff);
-
- outbuff = (char *)emalloc(base64_dec_size((unsigned int)Z_STRLEN_PP(inbuff)));
-
- ret_length = base64_decode(outbuff, Z_STRVAL_PP(inbuff), Z_STRLEN_PP(inbuff));
-
- RETURN_STRINGL(outbuff, ret_length, 0);
-}
-/* }}} */
-#endif
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: sw=4 ts=4 fdm=marker
- * vim<600: sw=4 ts=4
- */
diff --git a/ext/cybercash/cybercash.dsp b/ext/cybercash/cybercash.dsp
deleted file mode 100644
index 83c47e1913..0000000000
--- a/ext/cybercash/cybercash.dsp
+++ /dev/null
@@ -1,110 +0,0 @@
-# Microsoft Developer Studio Project File - Name="cybercash" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 6.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=cybercash - Win32 Release_TS
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "cybercash.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "cybercash.mak" CFG="cybercash - Win32 Release_TS"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "cybercash - Win32 Release_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "cybercash - Win32 Debug_TS" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP AllowPerConfigDependencies 0
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "cybercash - Win32 Release_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Release_TS"
-# PROP BASE Intermediate_Dir "Release_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Release_TS"
-# PROP Intermediate_Dir "Release_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\..\Zend" /I "..\..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CYBERCASH" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=0 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CYBERCASH_EXPORTS" /D "COMPILE_DL_CYBERCASH" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MCK=1 /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib cybercashi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts.lib /nologo /dll /machine:I386
-# ADD LINK32 php4ts.lib user32.lib winspool.lib mckcrypto.lib kernel32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /nodefaultlib:"libcmt.lib" /out:"..\..\Release_TS/php_cybercash.dll" /libpath:"..\..\Release_TS" /libpath:"..\..\Release_TS_Inline"
-# SUBTRACT LINK32 /pdb:none
-
-!ELSEIF "$(CFG)" == "cybercash - Win32 Debug_TS"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir "Debug_TS"
-# PROP BASE Intermediate_Dir "Debug_TS"
-# PROP BASE Ignore_Export_Lib 0
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir "Debug_TS"
-# PROP Intermediate_Dir "Debug_TS"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /I "..\.." /I "..\..\Zend" /I "..\..\TSRM" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "COMPILE_DL_CYBERCASH" /D ZTS=1 /YX /FD /c
-# ADD CPP /nologo /MDd /W3 /GX /ZI /Od /I "..\.." /I "..\..\main" /I "..\..\Zend" /I "..\..\TSRM" /D ZEND_DEBUG=1 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "CYBERCASH_EXPORTS" /D "COMPILE_DL_CYBERCASH" /D ZTS=1 /D "ZEND_WIN32" /D "PHP_WIN32" /D HAVE_MCK=1 /FR /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x406 /d "NDEBUG"
-# ADD RSC /l 0x406 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib cybercashi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib php4ts_debug.lib /nologo /dll /machine:I386
-# ADD LINK32 php4ts_debug.lib user32.lib winspool.lib mckcrypto.lib kernel32.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /debug /machine:I386 /nodefaultlib:"libcmt.lib" /out:"..\..\Debug_TS/php_cybercash.dll" /libpath:"..\..\Debug_TS"
-
-!ENDIF
-
-# Begin Target
-
-# Name "cybercash - Win32 Release_TS"
-# Name "cybercash - Win32 Debug_TS"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
-# Begin Source File
-
-SOURCE=.\cybercash.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl"
-# Begin Source File
-
-SOURCE=.\cybercash.h
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/ext/cybercash/cybercash.h b/ext/cybercash/cybercash.h
deleted file mode 100644
index 60e0d1bbcf..0000000000
--- a/ext/cybercash/cybercash.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- +----------------------------------------------------------------------+
- | PHP Version 4 |
- +----------------------------------------------------------------------+
- | Copyright (c) 1997-2002 The PHP Group |
- +----------------------------------------------------------------------+
- | This source file is subject to version 2.02 of the PHP license, |
- | that is bundled with this package in the file LICENSE, and is |
- | available at through the world-wide-web at |
- | http://www.php.net/license/2_02.txt. |
- | If you did not receive a copy of the PHP license and are unable to |
- | obtain it through the world-wide-web, please send a note to |
- | license@php.net so we can mail you a copy immediately. |
- +----------------------------------------------------------------------+
- | Author: Evan Klinger <evan715@sirius.com> |
- +----------------------------------------------------------------------+
- */
-
-#ifndef CYBERCASH_H
-#define CYBERCASH_H
-
-
-#if HAVE_MCK
-
-extern zend_module_entry cybercash_module_entry;
-#define cybercash_module_ptr &cybercash_module_entry
-
-PHP_MINFO_FUNCTION(cybercash);
-PHP_FUNCTION(cybercash_encr);
-PHP_FUNCTION(cybercash_decr);
-PHP_FUNCTION(cybercash_base64_encode);
-PHP_FUNCTION(cybercash_base64_decode);
-
-#else
-#define cybercash_module_ptr NULL
-#endif
-
-#define phpext_cybercash_ptr cybercash_module_ptr
-
-#endif
diff --git a/ext/cybercash/cyberlib.php b/ext/cybercash/cyberlib.php
deleted file mode 100644
index fa183ff93b..0000000000
--- a/ext/cybercash/cyberlib.php
+++ /dev/null
@@ -1,215 +0,0 @@
-<?php
-
-/*********************************************************************
- * Cyberlib - (C) American Metrocomm Internet Services *
- * by Timothy Whitfield <timothy@ametro.net> *
- * *
- * PHP Cybercash API - This requires that CyberCash support be *
- * compiled. *
- * *
- * *
- * This is an attempt to duplicate the cybercash API for PHP *
- * users. *
- *********************************************************************
- * This does not require merchant_conf for reasons that any file *
- * can be accessed by the web server can be accessed by any cgi. *
- *********************************************************************
- */
-
- function SendCC2_1Server($merchant,$merchant_key,
- $url,$operation,$CCNVList)
- {
- /* We need to make the url. */
- $url=$url."cr21api.cgi/".$operation;
-
- return SendCCServer($merchant,$merchant_key,$url,$CCNVList);
- }
-
- function SendCCServer($merchant,$merchant_key,$url,$CCNVList)
- {
- /* Break the url into parts. */
- $url=parse_url($url);
-
- /* Turn the name value pairs into a url encoded message. */
- $pairs="";
- $done=0;
- $more=list($key,$val)=each($CCNVList);
- while(!$done)
- {
- $pairs.=rtrim($key)."=".urlencode(rtrim($val));
-
- $more=list($key,$val)=each($CCNVList);
- if($more)
- {
- $pairs.="&";
- }
- else
- {
- $done=1;
- }
- }
-
- $encrypted_pairs=CCEncrypt($merchant_key,$pairs);
- $pairs_length=strlen($encrypted_pairs);
-
- $message=sprintf("POST %s/%s HTTP/1.0\r\n",$url["path"],$merchant);
- $message.=sprintf("User-Agent: CCMCK-%s\r\n","3.2.0.5");
- $message.="Content-type: application/x-www-form-urlencoded\r\n";
- $message.=sprintf("Content-length: %d\r\n",$pairs_length);
- $message.="\r\n";
- $message.=$encrypted_pairs."\r\n";
-
-$response=CCSocketSend($merchant_key,$url["host"],isset($url["port"])?$url["port"]:"",$message);
- return $response;
- }
-
- function CCEncrypt($merchant_key,$pairs)
- {
- $session_key=sprintf("%s #%ld",date("D M j H:i:s Y"),getmypid());
- $enc_msg=cybercash_encr($merchant_key,$session_key,$pairs);
- $pairs=cybercash_base64_encode($enc_msg["outbuff"]);
- $mac=cybercash_base64_encode($enc_msg["macbuff"]);
-
- /* This adds the information needed to decrypt. */
- $encrypted_pairs="message=".urlencode($pairs)."&";
- $encrypted_pairs.="session-key=".urlencode($session_key)."&";
- $encrypted_pairs.="mac=".urlencode($mac);
-
-
- return $encrypted_pairs;
- }
-
- function CCSocketSend($merchant_key,$host,$port,$message)
- {
-
- if(!$port)
- {
- $port="80";
- }
-
- /*This opens the port. */
- $fd=fsockopen($host,$port);
-
- /* Minor error checking. */
- if(!$fd)
- {
- $vars["MStatus"]="failure-hard";
- $vars["MErrMsg"]="Error contacting credit processor.";
-
- return $vars;
- }
-
- /*This sends the message. */
- fputs($fd,$message);
-
- /* We read the header in and parse at the same time. */
-
- /* Retrieve header. */
- $i=0;
- $response="";
- while(!feof($fd) && $response != "\n")
- {
- $response="";
- $more="";
- while(!feof($fd) && $more != "\n")
- {
- $more=fgetc($fd);
- if($more != "\n" || $response=="")
- {
- if($more != "\r")
- {
- $response.=$more;
- }
- }
- }
- $header[$i++]=$response;
- }
-
- /* We will now get the message. */
- $message="";
- while(!feof($fd))
- {
- $message.=fgets($fd,50);
- }
-
- /* It should be ok to close the socket now. */
- fclose($fd);
-
- /* This set of variables is encoded/encrypted. */
- $vars=CCGetVars($message);
- $vars["message"]=cybercash_base64_decode($vars["message"]);
- $vars["mac"]=cybercash_base64_decode($vars["mac"]);
-
- /* Check for errors with the request/decryption. */
- /* message is base64 and encrypted. */
- $dec_msg=cybercash_decr($merchant_key,$vars["session-key"],
- $vars["message"]);
-
- if($dec_msg["errcode"])
- {
- $vars["MStatus"]="failure-hard";
- $vars["MErrMsg"]="Response non-decodable.";
- return $vars;
- }
-
- if($dec_msg["macbuff"] != $vars["mac"])
- {
- $vars["MStatus"]="failure-hard";
- $vars["MErrMsg"]="Signitures do not match.";
- return $vars;
- }
-
- /* We will have to parse again to get more info. */
- $vars=CCGetVars($dec_msg["outbuff"]);
-
- return $vars;
- }
-
- function CCGetVars($message)
- {
- /* Retrieve variables.
- This function retrieves variables in var/value key pairs.
- So that $myvar["var"]==value
- */
-
- /* Need to find these variables too. */
- $cx=0;
- $response="";
- $more="";
- $message.="\n";
- $msg_len=strlen($message);
-
- while($cx<=$msg_len)
- {
- $more="";
- $varname="";
- $varval="";
- while($cx<=$msg_len && $more != "&" && $more != "\n")
- {
- $more=substr($message,$cx,1);
- $cx++;
- if($more != "&" && $more != "=" && $more != "\n")
- {
- $response=$response.$more;
- }
- if($more=="=")
- {
- $varname=$response;
- $response="";
- }
- if($more=="&" || $more=="\n")
- {
- $varval=$response;
- $response="";
- }
- }
-
- if($varname != "")
- {
- $cybervar[$varname]=urldecode($varval);
- }
- }
-
- return $cybervar;
- }
-?>
diff --git a/ext/cybercash/test.php b/ext/cybercash/test.php
deleted file mode 100644
index 2e5f3955ee..0000000000
--- a/ext/cybercash/test.php
+++ /dev/null
@@ -1,26 +0,0 @@
-<?php
- require "cyberlib.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."<br>";
- }
-
-?>