
Business::OnlinePayment::Vanco - Vanco Services backend for Business::OnlinePayment

use Business::OnlinePayment;
####
# One step transaction, the simple case.
####
my $tx = new Business::OnlinePayment( "Vanco",
ClientID => 'CL1234',
ProductID => 'EFT',
);
$tx->content(
type => 'VISA',
login => 'testdrive',
password => '', #password
action => 'Normal Authorization',
description => 'Business::OnlinePayment test',
amount => '49.95',
customer_id => 'tfb',
name => 'Tofu Beast',
address => '123 Anystreet',
city => 'Anywhere',
state => 'UT',
zip => '84058',
card_number => '4007000000027',
expiration => '09/02',
cvv2 => '1234', #optional
);
$tx->submit();
if($tx->is_success()) {
print "Card processed successfully: ".$tx->authorization."\n";
} else {
print "Card was rejected: ".$tx->error_message."\n";
}
####
# One step subscription, the simple case.
####
my $tx = new Business::OnlinePayment( "Vanco",
ClientID => 'CL1234',
ProductID => 'EFT',
);
$tx->content(
type => 'CC',
login => 'testdrive',
password => 'testpass',
action => 'Recurring Authorization',
interval => '7 days',
start => '2008-3-10',
periods => '16',
amount => '99.95',
description => 'Business::OnlinePayment test',
customer_id => 'vip',
name => 'Tofu Beast',
address => '123 Anystreet',
city => 'Anywhere',
state => 'GA',
zip => '84058',
card_number => '4111111111111111',
expiration => '09/02',
);
$tx->submit();
if($tx->is_success()) {
print "Card processed successfully: ".$tx->order_number."\n";
} else {
print "Card was rejected: ".$tx->error_message."\n";
}
my $subscription = $tx->order_number
####
# Subscription cancellation. It happens.
####
$tx->content(
subscription => '99W2D',
login => 'testdrive',
password => 'testpass',
action => 'Cancel Recurring Authorization',
);
$tx->submit();
if($tx->is_success()) {
print "Cancellation processed successfully."\n";
} else {
print "Cancellation was rejected: ".$tx->error_message."\n";
}

Content required: type, login, password, action, amount, name, card_number, expiration.
Content required: type, login, password, action, amount, name, account_number, routing_code, account_type.
Additional content required: interval, start, periods.

For detailed information see Business::OnlinePayment.

See Business::OnlinePayment for the complete list. The following methods either override the methods in Business::OnlinePayment or provide additional functions.
Returns the response error code.
Returns the response error description text.
Returns the complete response from the server.

The following actions are valid
normal authorization recurring authorization cancel recurring authorization
Interval contains a number of digits, whitespace, and the units of days or months in either singular or plural form.

The following rules are applied to map data to AuthorizeNet ARB parameters from content(%content):
# param => $content{<key>}
Auth
UserId => 'login',
Password => 'password',
Request
RequestVars
CustomerID => 'customer_id',
CustomerName => 'ship_name',
CustomerAddress1 => 'ship_address',
CustomerCity => 'ship_city',
CustomerState => 'ship_state',
CustomerZip => 'ship_zip',
CustomerPhone => 'phone',
AccountType => 'account_type', # C, S, or CC
AccountNumber => 'account_number' # or card_number
RoutingNumber => 'routing_code',
CardBillingName => 'name',
CardExpMonth => \( $month ), # YYYY-MM from 'expiration'
CardExpYear => \( $year ), # YYYY-MM from 'expiration'
CardCVV2 => 'cvv2',
CardBillingAddr1 => 'address',
CardBillingCity => 'city',
CardBillingState => 'state',
CardBillingZip => 'zip',
Amount => 'amount',
StartDate => 'start',
EndDate => calculated_from start, periods, interval,
FrequencyCode => [O,M,W,BW,Q, or A determined from interval],
TransactionTypeCode => 'check_type', # (or PPD by default)

To cancel a recurring authorization transaction, submit the TransactionRef in the field "subscription" with the action set to "Cancel Recurring Authorization". You can get the TransactionRef from the authorization by calling the order_number method on the object returned from the authorization.

Business::OnlinePayment::Vanco uses Vanco Services' "Standard Web Services XML API" as described on February 29, 2008. The describing documents are protected by a non-disclosure agreement.
See http://www.vancoservices.com/ for more information.

Jeff Finucane, vanco@weasellips.com

perl(1). Business::OnlinePayment.