Name
Business::CSI - Perl extension for Card Services International
Minimal Example
use strict; use Business::CSI qw/ :simple /;
my $max_tries = 5;
add_settings({ 'csi_config'=> '666999', 'csi_host' => 'secure.linkpt.net', 'csi_port' => '1139', 'csi_key' => '/etc/keyfile.pem', });
add_settings({ 'card_number' => '1234 5678 1234 5678', 'card_expr_m' => '07', 'card_expr_y' => '07', 'name_on_card' => 'Some Looser', 'email_addy' => 'looser@aol.com', });
add_settings({ 'grand_total' => 1, 'real' => 0, });
my $count = 0; my %result = (); { %result = simple_transaction;
if(not $result{connected}) {
print "$result{error_type} => $result{error}\n";
die "Your order fail'd $max_tries times ... I give up." if $max_tries <= ++$count;
redo;
}
}
foreach my $k (keys %result) { print "\$result{$k} = $result{$k}\n"; }
Settings
Settings:: The available settings
csi_config csi_key csi_host csi_port cust_id
order_id name_on_card email_addy card_number card_expr_m
card_expr_y sub_total tax_total ship_total grand_total real
Settings:: The defaults
'csi_host' => 'secure.linkpt.net',
'csi_port' => '1139',
'cust_id' => 'imcertainihavenoidea',
'order_id' => ('order' . '.'. time . '.' . $$),
'email_addy' => 'unknown@aol.com',
'real' => 0,
'ship_total' => 0,
'sub_total' => 0,
'tax_total' => 0,
Settings:: Extra Info
Unless otherwise listed, they all default to undef. Note that 'csi_config' and 'csi_key' are really really needed. 'csi_config' is your store number (or whatever they call it now). 'csi_key' is your keyfile.pem.
Another important setting is 'real'. 'real' should be set to 0 while you're practicing -- not $real, and 1 when you're ready to do it for real. ;)
To do
1. Billing Shipping info
2. Credit card number sanity checks using Business::CreditCard
3. ... I am accepting requests especially if you wanna throw me code snippits. ;)
4. More documentation. As people ask me questions, I make more and more less not clear. ;)
Known Bugs
None... they're fixed
Unknown Bugs
None AFAIK.
Credits
"David Deppner" <dave@psyber.com>:
1. The double/float bugfix mentioned in the Changes log.
2. Insisted on a README.
Author
Jettero Heller <jettero@voltar.org>
See Also
perl(1).