The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Business::PayBox - OO wrapper for Paybox Java Localhost Listener (LHL)

SYNOPSIS

To create object:

    use Business::PayBox;

    $PB = Business::PayBox->new(MRID => '+490001234567');
    or
    $PB = Business::PayBox->new(MRID => '+490001234567', server => '192.168.1.1', port => 61);

To do a payment:

    $result = $PB->do_test_payment(AMNT => 100, CURR => 'DEM', ORNM=>'TEST123', CPID => '+491773729269');
    or 
    $result = $PB->dopayment(AMNT => 100, CURR => 'DEM', ORNM=>'TEST123', CPID => '+491773729269');

DESCRIPTION

This is an OO wrapper for the PAYBOX - Integrated Solution. You must install Localhostlistener LHL (which comes as Java-Jar) to use this module. After you succeed with this you can process payments as described above.

CONSTRUCTOR

new($key => $value, ...)

Call to initialize object. Valid Parameters are:

 Mandatory:
   MRID   => Merchant ID

 Others:
   server => IP address or name of LHL server. (defaults to localhost)
   port   => Port of LHL server. (defaults to port 60)
 
   CMID   => Customer ID (defaults to 0)
   AUTT   => Transaction Type
   LANG   => Language (defaults to DE)
   PYMD   => Zahlungsziel (defaults to 1)
   LCMT   => Localtime stamp (defaults to localtime)

METHODS

dopayment($key => $value, ...)

Mandatory parameters are:

  AMNT => Amount (18.75 => 1875)
  CURR => Currency (ISO ie: DEM/EUR)
  ORNM => Order number/decr (max 40 char)
  CPID => PayBoxNumber (must match /^\+\d{12}$/)

This function will return undef on errors. In this case you can catch the error by accessing $PB->{ERROR} which will look like:

  $VAR1 = [
            45,
            'Undefinierter Fehler'
          ];

On success the return value will be a hash ref looking like:

  ...

do_test_payment($key => $value, ...)

Acts the same as dopayment-call, only as a test call...

EXAMPLE

  #!/usr/bin/perl

  use Business::PayBox;
  use Data::Dumper;

  $PB = Business::PayBox->new(MRID=>'+490001234567') || die "connecting to listener failed";

  $result = $PB->do_test_payment(AMNT=>100,CURR=>DEM,ORNM=>'TEST123',CPID=>'+491773729269');

  print Dumper($result ? $result : $PB->{ERROR});

SEE ALSO

http://www.paybox.net

AUTHOR

Dirk Tostmann (tostmann@tosti.com)

COPYRIGHT

Copyright (c) 2000 Dirk Tostmann. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.