PhpDig.net

What is PhpDig?
PhpDig is a PHP MySQL based
Web Spider & Search Engine.




ccvs_textvalue

Name

ccvs_textvalue — Queries a CCVS session for information about the previous operation.

Synopsis

string ccvs_textvalue(session);
string session: ID of session to use

Returns

String containing information about the previous CCVS operation

Description

ccvs_textvalue() queries a CCVS session for information about the previous operation and returns that information in a consistently-formatted string. session must be a valid session ID as returned by ccvs_init() .

The format of the returned string is key {value} key {value}., where key is the name of the particular type of information being returned, and value is the value of that piece of information. Some of the possible key names are shown in the following list, along with the type of information each key name contains. Note that these are returned only in contexts within which they make sense. Any of the CCVS status strings can serve as a key name; for instance, ccvs_count() uses the status strings as key names.

  • acode: Once authorization has succeeded for a transaction, this gives its authorization code.

  • amount: Monetary value of the transaction. For pending return transactions, this is a negative value.

  • authchar: Authorization characteristics for a transaction.

  • authtime: The time and date that ccvs_auth() was called to request authorization for a transaction.

  • avs: The address verification status of a transaction. If the verification was successful this is 'ok'; otherwise, 'fail' or a more descriptive error string. (The strings are processor-specific, so a complete list is impossible.)

  • avs_addr: Whether the address portion of address verification succeeded ('ok') or failed('fail').

  • avs_zip: Whether the ZIP code portion of the address verification succeeded or failed. One of 'ok', 'fail', or 'partial'. If 'partial' is returned, it means that there was a partial match, as would happen if a five-digit ZIP code was given and it matched against part of an extended nine-digit ZIP code.

  • current: The item currently being processed by ccvs_report() .

  • cvv2: CVV2 verification status for a transaction. If the verification was successful, 'ok'; otherwise, 'fail' or a more descriptive error string. (The strings are processor-specific, so a complete list is impossible.)

  • donetime: Time and date that a transaction was processed by the clearinghouse on a call to ccvs_sale() or ccvs_return() . Not valid when using the ETC+ protocol.

  • invoice: Invoice name of a transaction.

  • newtime: Time and date that ccvs_new() was called to create the transaction.

  • result_text: Processor-specific result string, suitable for display on an LCD screen, for example. Can often contain information outside the scope of other keys, which can be useful.

  • readytime: Time and date that ccvs_sale() or ccvs_return() was applied to a transaction.

  • status: Status string of a transaction. This can be any of the strings from the list at the beginning of this chapter, or 'none' to indicate that the transaction doesn't exist.

  • task: The task currently being performed by ccvs_report() .

  • text: Any text returned by a clearinghouse server.

  • time: Time an action was reported for ccvs_report() .



Version

PHP 4 since 4.0.2

Example

Example 98. Get additional information from a session

/* The output from this script using the CCVS demo installation:
 *
 * Adding an invoice to the session:
 * Looking up the transaction's status:
 * Returned: 'new'; Return type: string
 * Textvalue: status {new} invoice {FOOXXXXX} amount {0.00} newtime {Fri Apr 27 15:18:29 2001}
 */
 
$session = ccvs_init('ccvs');

echo "Adding an invoice to the session:\n";
if (!ccvs_new($session, 'foo') === 'OK') {
    echo "Could not create invoice; reason: " . ccvs_textvalue($session) . "\n";
}

echo "Looking up the transaction's status:\n";
$ret = ccvs_status($session, 'foo');
echo "Returned: '$ret'; Return type: " . gettype($ret) . "\n";
echo "Textvalue: " . ccvs_textvalue($session) . "\n\n";

/* Just close the session since we're only testing. */
ccvs_done($session);



PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing (Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch). This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). The authors of this book have elected not to choose any options under the OPL. This online book was obtained from http://www.fooassociates.com/phpfer/ and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4 for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All persons and entities shall have neither liability nor responsibility to any person or entity with respect to any loss or damage arising from the information contained in this book.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Copyright © 2001 - 2005, ThinkDing LLC. All Rights Reserved.