diff options
author | Brad House <bradmssw@php.net> | 2003-07-08 02:59:51 +0000 |
---|---|---|
committer | Brad House <bradmssw@php.net> | 2003-07-08 02:59:51 +0000 |
commit | 61b47cdaf021d08a6443d89f4f09150ad583459c (patch) | |
tree | 4386cabfdd441db34a329d08e30dd7405067bd66 | |
parent | 0bef1de44890fc847a9d984e03a53f30ef8e1975 (diff) | |
download | php-git-61b47cdaf021d08a6443d89f4f09150ad583459c.tar.gz |
sync functionality with libmcve 3.2
-rw-r--r-- | ext/mcve/mcve.c | 128 | ||||
-rw-r--r-- | ext/mcve/php_mcve.h | 3 |
2 files changed, 130 insertions, 1 deletions
diff --git a/ext/mcve/mcve.c b/ext/mcve/mcve.c index fbe9be21a3..d570dd2250 100644 --- a/ext/mcve/mcve.c +++ b/ext/mcve/mcve.c @@ -49,6 +49,7 @@ function_entry mcve_functions[] = { PHP_FE(mcve_setdropfile, NULL) PHP_FE(mcve_setip, NULL) PHP_FE(mcve_setssl, NULL) + PHP_FE(mcve_setssl_files, NULL) PHP_FE(mcve_settimeout, NULL) PHP_FE(mcve_setblocking, NULL) PHP_FE(mcve_verifyconnection, NULL) @@ -190,6 +191,33 @@ PHP_MINIT_FUNCTION(mcve) REGISTER_LONG_CONSTANT("MC_ADMIN", MC_ADMIN, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_AUDITTYPE", MC_AUDITTYPE, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_CUSTOM", MC_CUSTOM, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_EXAMOUNT", MC_EXAMOUNT, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_EXCHARGES", MC_EXCHARGES, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_RATE", MC_RATE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_RENTERNAME", MC_RENTERNAME, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_RETURNCITY", MC_RETURNCITY, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_RETURNSTATE", MC_RETURNSTATE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_RETURNLOCATION", MC_RETURNLOCATION, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_PRIORITY", MC_PRIORITY, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_INQUIRY", MC_INQUIRY, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_CARDTYPES", MC_CARDTYPES, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_SUB", MC_SUB, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_MARKER", MC_MARKER, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_DEVICETYPE", MC_DEVICETYPE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_ERRORCODE", MC_ERRORCODE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_NEWBATCH", MC_NEWBATCH, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_CURR", MC_CURR, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_DESCMERCH", MC_DESCMERCH, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_DESCLOC", MC_DESCLOC, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_ORIGTYPE", MC_ORIGTYPE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_PIN", MC_PIN, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_VOIDORIGTYPE", MC_VOIDORIGTYPE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TIMESTAMP", MC_TIMESTAMP, MCVE_CONST); + + /* Args for priorities */ + REGISTER_LONG_CONSTANT("MC_PRIO_HIGH", MC_PRIO_HIGH, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_PRIO_NORMAL", MC_PRIO_NORMAL, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_PRIO_LOW", MC_PRIO_LOW, MCVE_CONST); /* Args for adding a user */ REGISTER_LONG_CONSTANT("MC_USER_PROC", MC_USER_PROC, MCVE_CONST); @@ -210,16 +238,87 @@ PHP_MINIT_FUNCTION(mcve) REGISTER_LONG_CONSTANT("MC_USER_MERCHLOC", MC_USER_MERCHLOC, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_USER_STATECODE", MC_USER_STATECODE, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_USER_PHONE", MC_USER_PHONE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_SUB", MC_USER_SUB, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_CARDTYPES", MC_USER_CARDTYPES, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_MODE", MC_USER_MODE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_VNUMBER", MC_USER_VNUMBER, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_ROUTINGID", MC_USER_ROUTINGID, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_PPROPERTY", MC_USER_PPROPERTY, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_PID", MC_USER_PID, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_PIDPWD", MC_USER_PIDPWD, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_SMID", MC_USER_SMID, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_SMIDPWD", MC_USER_SMIDPWD, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_USDDIV", MC_USER_USDDIV, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_AUDDIV", MC_USER_AUDDIV, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_DKKDIV", MC_USER_DKKDIV, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_GBPDIV", MC_USER_GBPDIV, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_HKDDIV", MC_USER_HKDDIV, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_JPYDIV", MC_USER_JPYDIV, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_NZDDIV", MC_USER_NZDDIV, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_NOKDIV", MC_USER_NOKDIV, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_SGDDIV", MC_USER_SGDDIV, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_ZARDIV", MC_USER_ZARDIV, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_SEKDIV", MC_USER_SEKDIV, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_CHFDIV", MC_USER_CHFDIV, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_CADDIV", MC_USER_CADDIV, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_USER_DIVNUM", MC_USER_DIVNUM, MCVE_CONST); + + /* Values for cardtypes */ + REGISTER_LONG_CONSTANT("MC_CARD_VISA", MC_CARD_VISA, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_CARD_MC", MC_CARD_MC, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_CARD_AMEX", MC_CARD_AMEX, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_CARD_DISC", MC_CARD_DISC, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_CARD_JCB", MC_CARD_JCB, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_CARD_CB", MC_CARD_CB, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_CARD_DC", MC_CARD_DC, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_CARD_GIFT", MC_CARD_GIFT, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_CARD_OTHER", MC_CARD_OTHER, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_CARD_ALL", MC_CARD_ALL, MCVE_CONST); + + /* Values for modes */ + REGISTER_LONG_CONSTANT("MC_MODE_AUTH", MC_MODE_AUTH, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_MODE_SETTLE", MC_MODE_SETTLE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_MODE_BOTH", MC_MODE_BOTH, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_MODE_ALL", MC_MODE_ALL, MCVE_CONST); + + /* Values for EXCHARGES */ + REGISTER_LONG_CONSTANT("MC_EXCHARGES_REST", MC_EXCHARGES_REST, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_EXCHARGES_GIFT", MC_EXCHARGES_GIFT, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_EXCHARGES_MINI", MC_EXCHARGES_MINI, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_EXCHARGES_TELE", MC_EXCHARGES_TELE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_EXCHARGES_OTHER", MC_EXCHARGES_OTHER, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_EXCHARGES_LAUND", MC_EXCHARGES_LAUND, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_EXCHARGES_NONE", MC_EXCHARGES_NONE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_EXCHARGES_GAS", MC_EXCHARGES_GAS, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_EXCHARGES_MILE", MC_EXCHARGES_MILE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_EXCHARGES_LATE", MC_EXCHARGES_LATE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_EXCHARGES_1WAY", MC_EXCHARGES_1WAY, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_EXCHARGES_VIOL", MC_EXCHARGES_VIOL, MCVE_CONST); /* Value definitions for Transaction Types */ REGISTER_LONG_CONSTANT("MC_TRAN_SALE", MC_TRAN_SALE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_REDEMPTION", MC_TRAN_REDEMPTION, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_TRAN_PREAUTH", MC_TRAN_PREAUTH, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_TRAN_VOID", MC_TRAN_VOID, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_TRAN_PREAUTHCOMPLETE", MC_TRAN_PREAUTHCOMPLETE, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_TRAN_FORCE", MC_TRAN_FORCE, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_TRAN_OVERRIDE", MC_TRAN_OVERRIDE, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_TRAN_RETURN", MC_TRAN_RETURN, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_RELOAD", MC_TRAN_RELOAD, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_CREDIT", MC_TRAN_CREDIT, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_TRAN_SETTLE", MC_TRAN_SETTLE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_INCREMENTAL", MC_TRAN_INCREMENTAL, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_REVERSAL", MC_TRAN_REVERSAL, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_ACTIVATE", MC_TRAN_ACTIVATE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_BALANCEINQ", MC_TRAN_BALANCEINQ, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_CASHOUT", MC_TRAN_CASHOUT, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_TOREVERSAL", MC_TRAN_TOREVERSAL, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_SETTLERFR", MC_TRAN_SETTLERFR, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_ISSUE", MC_TRAN_ISSUE, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_TIP", MC_TRAN_TIP, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_MERCHRETURN", MC_TRAN_MERCHRETURN, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_IVRREQ", MC_TRAN_IVRREQ, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_IVRRESP", MC_TRAN_IVRRESP, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_TRAN_ADMIN", MC_TRAN_ADMIN, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_TRAN_PING", MC_TRAN_PING, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_TRAN_CHKPWD", MC_TRAN_CHKPWD, MCVE_CONST); @@ -236,6 +335,9 @@ PHP_MINIT_FUNCTION(mcve) REGISTER_LONG_CONSTANT("MC_TRAN_DISABLEUSER", MC_TRAN_DISABLEUSER, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_TRAN_IMPORT", MC_TRAN_IMPORT, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_TRAN_EXPORT", MC_TRAN_EXPORT, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_ERRORLOG", MC_TRAN_ERRORLOG, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_CLEARERRORLOG", MC_TRAN_CLEARERRORLOG, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_TRAN_GETSUBACCTS", MC_TRAN_GETSUBACCTS, MCVE_CONST); /* Value definitions for Admin Types */ REGISTER_LONG_CONSTANT("MC_ADMIN_GUT", MC_ADMIN_GUT, MCVE_CONST); @@ -249,6 +351,9 @@ PHP_MINIT_FUNCTION(mcve) REGISTER_LONG_CONSTANT("MC_ADMIN_CFH", MC_ADMIN_CFH, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_ADMIN_FORCESETTLE", MC_ADMIN_FORCESETTLE, MCVE_CONST); REGISTER_LONG_CONSTANT("MC_ADMIN_SETBATCHNUM", MC_ADMIN_SETBATCHNUM, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_ADMIN_RENUMBERBATCH", MC_ADMIN_RENUMBERBATCH, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_ADMIN_FIELDEDIT", MC_ADMIN_FIELDEDIT, MCVE_CONST); + REGISTER_LONG_CONSTANT("MC_ADMIN_CLOSEBATCH", MC_ADMIN_CLOSEBATCH, MCVE_CONST); /* set up the mcve defines */ REGISTER_LONG_CONSTANT("MCVE_UNUSED", MCVE_UNUSED, MCVE_CONST); @@ -272,6 +377,7 @@ PHP_MINIT_FUNCTION(mcve) REGISTER_LONG_CONSTANT("MCVE_PKUP", MCVE_PKUP, MCVE_CONST); REGISTER_LONG_CONSTANT("MCVE_RETRY", MCVE_RETRY, MCVE_CONST); REGISTER_LONG_CONSTANT("MCVE_SETUP", MCVE_SETUP, MCVE_CONST); + REGISTER_LONG_CONSTANT("MCVE_TIMEOUT", MCVE_TIMEOUT, MCVE_CONST); REGISTER_LONG_CONSTANT("MCVE_SALE", MCVE_SALE, MCVE_CONST); REGISTER_LONG_CONSTANT("MCVE_PREAUTH", MCVE_PREAUTH, MCVE_CONST); @@ -476,6 +582,28 @@ PHP_FUNCTION(mcve_setssl) } /* }}} */ +/* {{{ proto int mcve_setssl_files(string sslkeyfile, string sslcertfile) + Set certificate key files and certificates if server requires client certificate + verification +*/ +PHP_FUNCTION(mcve_setssl_files) +{ + MCVE_CONN *conn; + int retval; + zval **arg1, **arg2; + + if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &arg1, &arg2) == FAILURE) + WRONG_PARAM_COUNT; + + convert_to_string_ex(arg1); + convert_to_string_ex(arg2); + + retval = MCVE_SetSSL_Files(Z_STRVAL_PP(arg1), Z_STRVAL_PP(arg2)); + + RETURN_LONG(retval); +} +/* }}} */ + /* {{{ proto int mcve_settimeout(resource conn, int seconds) Set maximum transaction time (per trans) */ diff --git a/ext/mcve/php_mcve.h b/ext/mcve/php_mcve.h index bad723662b..81f4cd979e 100644 --- a/ext/mcve/php_mcve.h +++ b/ext/mcve/php_mcve.h @@ -26,7 +26,7 @@ extern zend_module_entry mcve_module_entry; #define mcve_module_ptr &mcve_module_entry #define phpext_mcve_ptr mcve_module_ptr -#define PHP_MCVE_VERSION "3.0" +#define PHP_MCVE_VERSION "3.2" #define MCVE_CONST (CONST_CS | CONST_PERSISTENT) @@ -40,6 +40,7 @@ PHP_FUNCTION(mcve_destroyconn); PHP_FUNCTION(mcve_setdropfile); PHP_FUNCTION(mcve_setip); PHP_FUNCTION(mcve_setssl); +PHP_FUNCTION(mcve_setssl_files); PHP_FUNCTION(mcve_setblocking); PHP_FUNCTION(mcve_settimeout); PHP_FUNCTION(mcve_verifyconnection); |