The
cvbatch
program lets you integrate CCVS with other software systems, without
doing any development work. It reads in batch request files, and
writes out batch response files. The system uses comma-separated text
files, with a highly configurable field selection mechanism.
To use
cvbatch,
you must specify a particular CCVS configuration when you start it,
either via the -c command-line option or the
CCVS_CONFIG_NAME
environment variable. If you have installed CCVS with all the default
settings, there should be a configuration named "demo" that you can
use to make sure the system is installed correctly and to learn how to
use it.
OVERVIEW
For an introductory overview of the CCVS system as a whole, you can
refer to the cvcli(1) man page.
It should be installed at the same
location as this page.
The
cvbatch
program can perform five basic functions. It can issue a
preauthorization (or "auth"), a postauthorization (or "sale"), a
combination of those two (or "both"), a return, and a status query.
Each transaction corresponds to one line of the input file and one
line of the output file. The function to be performed is always the
first column of the input data, and the transaction identifier (or
"invoice") is always the second column of the input data and the first
column of the output data. All of the other columns of input and
output are configurable.
OPTIONS
-i infile
Specify the input file name. If there's no -i switch, the standard
input will be used.
-o outfile
Specify the output file name. If there's no -o switch, the standard
output will be used.
-I infmt
Specify the input format string. This lets you select the columns to
be used in your input data. The first two columns are always
"command" and "invoice", which should not be specified here. If you
wanted the 3rd, 4th and 5th columns to be "card number", "expiration
date" and "amount", you would set the format string to
"cardnum,expdate,amount". If you wanted to have the AVS zip code and
address be the 6th and 7th columns, you would set it to
"cardnum,expdate,amount,zipcode,address". This can also be set by the
CCVS_FORMAT_IN
environment variable.
-O outfmt
Specify the output format string. This lets you specify the columns
to be used in your output. The first column is always "invoice",
which should not be specified here. If you want the 2nd and 3rd
columns to be status, time of authorization and amount, you would
specify "status,authtime,amount". This can also be set by the
CCVS_FORMAT_OUT
environment variable.
-c configname
Set the name of the configuration to be used. The configuration name
must be set in order for
cvbatch
to run. It can be set either with this option, or with the
CCVS_CONFIG_NAME
environment variable.
SYNTAX
The commands that
cvbatch
accepts are:
auth
Run a pre-authorization. Required fields are invoice amount, cardnum
and expdate, but just about every optional field also makes sense
here.
sale
Run a post-authorization. This must correspond to a previous "auth".
All fields other than invoice are ignored.
both
This works exactly like doing an "auth" and "sale" together. The
required fields are the same as for an "auth". Once the transaction
has been processed, if the "auth" was succesful, it's marked as ready
for settlement.
return
This issues a credit, moving money from the merchant to the
cardholder. Required fields are "cardnum", "expdate" and "amount".
This is not a live transaction; it's processed the next time
settlement is done.
status
This just looks up a transaction and reports its status. All input
fields other than "invoice" are ignored.