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]);

# 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 a easy api to the allopass.com system. It automatically handles user sessions.

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 0.

$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
$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();

PROPERTIES

ttl - Session time to live property.
Set it to the session expiration time, in minutes.
os - Operating system property.
You need to set it to 1 only if your OS doesn't support flock (windoze ???).

AUTHOR

Bernard Nauwelaerts <bpn@it-development.be>

LICENSE

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

3 POD Errors

The following errors were encountered while parsing the POD:

Around line 159:

You forgot a '=back' before '=head1'

Around line 161:

'=item' outside of any '=over'

Around line 330:

You forgot a '=back' before '=head1'