PhpDig.net

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




ccvs_add

Name

ccvs_add — Adds information to a transaction.

Synopsis

string ccvs_add(session, invoice, type, value);
string session: ID of session to use
string invoice: Invoice name of transaction to add to
string type: Type of data being added
string value: Value of data being added

Returns

'OK' on success; on error, 'bad invoice', 'data problem', 'syntax error', 'uninitialized', or 'unknown'

Description

After a transaction has been created but before it can be authorized or processed, information such as a credit card number, dollar amount, and so forth must be added to it. These bits of information are added one at a time using ccvs_add() . type must be set to the name of the type of data being added (from the following list), and value must be set to the value of that piece of data. session must be a valid session ID as returned by ccvs_init() , and invoice must be the name of an existing invoice that's in the new state.

These are the datatypes and meanings:

  • accountname: The name of the card holder for the account. May be required for receipt generation.

  • acode: An authorization code, if required. For instance, if a transaction is left in the review state after ccvs_auth() and requires an additional code such as that provided by voice authenticating software, you would use it at this point. Not available for all protocols.

  • address: Billing address of the cardholder; used with the clearing house's address verification system.

  • amount: The amount of money to transfer. The format is an optional dollar sign followed by at least one digit, optionally followed by a decimal point and two more digits. No other characters are allowed.

  • cardnum: The credit card number. Separators typical to credit card numbers (commas, hyphens, and spaces) are ignored.

  • comment: A comment about the transaction, up to 25 characters long. Not available for all protocols.

  • cvv2: The credit card's CVV2 (Credit Card Verification 2) code, consisting of a number of 1-4 digits, or one of notprinted (there is no code printed on the card), illegible (there appears to be a code but it's unreadable), or none (the code is not used). This isn't usually required, but some clearinghouses will lower your service charges if you use it.

  • encryption: Set to no if the communication link between the customer and merchant was not encrypted; otherwise set to yes or to a specific string for a given encryption type (for example, SET). Not usually required, but some clearinghouses will lower your service charges if you use it.

  • entrysource: The source of the data entered for this transaction; one of merchant or customer. Not usually required, but some clearinghouses will lower your service charges if you use it.

  • expdate: The expiration date of the card. The format is MM/YY; you can leave out the slash.

  • product: The name or ID of the product being purchased or returned. May be required for receipt generation.

  • purchaseorder: The purchase order number. May be required for purchase order support. For some protocols, this information will need to go into comment instead.

  • setcardholder: If the communication link between the customer and the merchant was SET-encrypted and the customer's certificate was used, set this to the customer's certificate value. Meaningless if setmerchant is not also given. Not usually required, but some clearinghouses will lower your service charges if you use it.

  • setmerchant: If the communication link between the customer and the merchant was SET-encrypted, set this to the merchant's certificate value. Not usually required, but some clearinghouses will lower your service charges if you use it.

  • shipzipcode: The ZIP code of the customer's shipping address. Optional.

  • tax: The tax amount for the transaction. The format is the same as for amount. Not usually required, but some clearinghouses will lower your service charges if you use it.

  • track1: Any data read from the first track of a card's magnetic strip. Must be verbatim.

  • track2: Any data read from the second track of a card's magnetic strip. Must be verbatim.

  • type: The transaction type. One of ecommerce, installment, mail, phone, recurring, retail, test, or unknown. Not usually required, but some clearinghouses will lower your service charges if you use it.

  • zipcode: The 5- or 9-digit ZIP or postal code of the customer. Used with the clearing house's address-verification system (see address).



Version

PHP 4 since 4.0.2

Example

Example 84. Set up a transaction for use

echo "Adding a credit card number to the invoice:\n";
$ret = ccvs_add($session, 'foo', 'cardnum', '1234 5678 9012 3456');
echo "Returned: '$ret'; Return type: " . gettype($ret) . "\n";
echo "Textvalue: " . ccvs_textvalue($session) . "\n\n";

echo "Adding a credit card expiration date to the invoice:\n";
$ret = ccvs_add($session, 'foo', 'expdate', '11/01');
echo "Returned: '$ret'; Return type: " . gettype($ret) . "\n";
echo "Textvalue: " . ccvs_textvalue($session) . "\n\n";

echo "Adding a dollar amount to the invoice:\n";
$ret = ccvs_add($session, 'foo', 'amount', '$23.50');
echo "Returned: '$ret'; Return type: " . gettype($ret) . "\n";
echo "Textvalue: " . ccvs_textvalue($session) . "\n\n";



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.