Bernard Nauwelaerts
and 1 contributors


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


  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


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


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

See for more informations on their system and how it basically works.


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 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.
get_last_error - Returns last recorded error
check_code - Checks if a client have access to this document
    $ok=$allopass->check_code($document_id, $code, [$datas], [$ap_ca]);


ttl - Session time to live property.

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 ???).

Other documentation

Jetez un oeil sur pour la documentation en français.


Bernard Nauwelaerts <bpn#it-development%be>


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