I l@ve RuBoard Previous Section Next Section

ccvs_add

string ccvs_add(string session, string invoice, string type, string value) 

session

ID of session to use

invoice

Invoice name of transaction to add to

type

Type of data being added

value

Value of data being added

Adds information to a transaction.

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.

The following table describes the datatypes and meanings:

Datatype

Meaning

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 clearinghouse'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 from 1–4 digits in length, 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 communications 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 communications 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 communications 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 five-digit or nine-digit ZIP or postal code of the customer. Used with the clearinghouse's address-verification system (see address).

Version:

PHP 4 since 4.0.2

Example:

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";  
    I l@ve RuBoard Previous Section Next Section