Asterisk Credit Card Validation

This simple AGI Perl script allows you to validate a credit card number entered by a caller.

It uses Asterisk Perl AGI and a CCVS Perl module http://www.analysisandsolutions.com/software/ccvs/.


use Asterisk::AGI;
use ccvs;

$AGI = new Asterisk::AGI;

my %input = $AGI->ReadParse();

my $Form = new CreditCardValidationSolution();
my @Accepted = ('Visa', 'JCB');

$AGI->stream_file('other/please-enter-the');
$card_number = $AGI->get_data('card-number', 15000, 16);

if ($Form->validateCreditCard($card_number, 'en', \@Accepted, 'N')) {
$AGI->stream_file('auth-thankyou');
}
else {
$AGI->stream_file('your');
$AGI->stream_file('card-is-invalid');
}


See Also
Credit Card Dialplan for Asterisk
This simple AGI Perl script allows you to validate a credit card number entered by a caller.

It uses Asterisk Perl AGI and a CCVS Perl module http://www.analysisandsolutions.com/software/ccvs/.


use Asterisk::AGI;
use ccvs;

$AGI = new Asterisk::AGI;

my %input = $AGI->ReadParse();

my $Form = new CreditCardValidationSolution();
my @Accepted = ('Visa', 'JCB');

$AGI->stream_file('other/please-enter-the');
$card_number = $AGI->get_data('card-number', 15000, 16);

if ($Form->validateCreditCard($card_number, 'en', \@Accepted, 'N')) {
$AGI->stream_file('auth-thankyou');
}
else {
$AGI->stream_file('your');
$AGI->stream_file('card-is-invalid');
}


See Also
Credit Card Dialplan for Asterisk
Created by: murias, Last modification: Tue 29 of Apr, 2008 (20:09 UTC) by schapman
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+