O
Old Wolf
Justin Robbs said:I am writing a routine to send Credit Card transactions to the
authorizer. Obviously the biggest speed issue will be the
network speed, however, I was just trying to cut down the amount
of time I spend preparing the transactions. It is not just one
field that needs to be set to spaces. The authorizer sent me the
record layout for the authorization request. This layout is a
catch all that contains a number of fields that I won't need.
For example, there is approximately 100 char's dedicated to
shipping address that need to be set to spaces. This is being
developed for a convenience store so shipping address is not
really necessary. There are also fields for dealing with
reversals, PIN data, and various card specific fields that will
only be used in certain situations.
Your primary concern is application financial integrity.
You should write the simplest, clearest, most portable,
most maintainable code possible. For example:
char x[10] = " ";
is bad because you can't see at a glance whether it is correct
or not, and it doesn't hold up well to the dimensions of x changing.
This would be even worse if x were a member of a struct, and the
" " were part of a struct initialization.
I also suggest you learn basic things like the fact that string
literals are 0-terminated, and strcpy() works with 0-terminated strings.
It won't be a good look if your customer comes back to you saying
"Why did my card get charged twice", and you say "Dunno but the
terminal only took 14.999 seconds instead of 15 seconds to process
the transaction"