It's been awhile since I have done any Perl work and I need to write a credit card processing module. The module will have several sub routines, but once I figure out how to do one, I can do the rest. The first subroutine is add customer info. The information that I need is customer number, first name, last name, address, city, state and zip. All of this information will be provided by the calling program, but some of the fields could be blank.
sub addCustomer()
{
my $tx = new Business::OnlinePayment("USAePay");
$tx->content(
login => LOGIN,
password => PASSWORD,
type => "CC",
action => 'Recurring Authorization',
description => 'Business::OnlinePayment test',
amount => '49.95',
invoice_number => '100100',
name => 'Tofu Beast',
card_number => '46464646464646',
expiration => '11/08',
address => '1234 Bean Curd Lane, San Francisco',
zip => '94102',
);
$tx->submit();
if($tx->is_success()) {
print "Card processed successfully: ".$tx->authorization."\n";
} else {
print "Card was rejected: ".$tx->error_message."\n";
}
}