Business::PayBox - OO wrapper for Paybox Java Localhost Listener (LHL)
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');
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.
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)
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:
...
Acts the same as dopayment-call, only as a test call...
#!/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});
http://www.paybox.net
Dirk Tostmann (tostmann@tosti.com)
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.
To install Business::PayBox, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Business::PayBox
CPAN shell
perl -MCPAN -e shell install Business::PayBox
For more information on module installation, please visit the detailed CPAN module installation guide.