Upgrade 3CX to v18 and get it hosted free!

Asterisk Credit Card Validation

Author image

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

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.