NAME

Business::PhoneBill::Allopass - A class for micro-payment system from Allopass

SYNOPSIS

use Business::PhoneBill::Allopass;

my $allopass=Business::PhoneBill::Allopass->new($session_file, [$ttl]);
die "Cann't create class: ".$allopass unless ref $allopass;

# Check access
if ($allopass->check($document_id, [$RECALL])){
      print "OK\n";
} else {
      print $allopass->get_last_error;
}

# No further access for this user
$allopass->end_session($document_id);

DESCRIPTION

This class provides you an easy api to the allopass.com system. It automatically handles user sessions.

SEE ALSO

Please consider using Business::PhoneBill::Allopass::Simple if you don't need session management.

See http://www.allopass.com/index.php4?ADV=1508058 for more informations on their system and how it basically works.

METHODS

new Class constructor. Provides session-based access check.
$allopass=Billing::Allopass->new($session_file, [$ttl]);

$session_file is the physical location for the session file. The webserver must have write access to it. If not, this constructor returns a text error message.

$ttl is the number of minutes of inactivity for automatically removing sessions. Default : 60.

You have to test if the returned value is a reference.

check - Checks if a client have access to this document
$ok=$allopass->check($document_id, [$RECALL]);

The RECALL parameter is provided by Allopass.com when it redirects the visitor to your website, after the secret code verification. Returns 1 if authorization is successfull. Next accesses to the script will be protected by the session-based system, and you no longer need to provide the $RECALL argument..

end_session - Ends user session for specified document.
$allopass->end_session($document_id);
get_last_error - Returns last recorded error
$allopass->get_last_error();
check_code - Checks if a client have access to this document
$ok=$allopass->check_code($document_id, $code, [$datas], [$ap_ca]);

PROPERTIES

ttl - Session time to live property.
$ttl=$allopass->ttl([$ttl]);

Session expiration time, in minutes.

os - Operating system property.
$allopass->os(1);

You need to set it to 1 only if your OS doesn't support flock (windoze ???).

Other documentation

Jetez un oeil sur http://www.it-development.be/software/PERL/Business-PhoneBill-Allopass/ pour la documentation en français.

AUTHOR

Bernard Nauwelaerts <bpn#it-development%be>

LICENSE

GPL. Enjoy! See COPYING for further informations on the GPL.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 380:

Non-ASCII character seen before =encoding in 'français.'. Assuming UTF-8