[ic] Trying to make new Payment Module for Card Services perl wrapper.

Boyd Lynn Gerber interchange-users@interchange.redhat.com
Tue Apr 16 11:08:01 2002


On Tue, 16 Apr 2002, Rick Eicher II wrote:
> > In creating a payment module for Card Services (Linkpoint), must
> > we use the perl wrapper??
>
> In working with Linkpoint I believe you would have to buy there wrapper. I
> could be wrong. :/

Saddly currently you have top buy their wrapper and I have done that.  I
am now trying to create a linkpt.pm file model'd after the ones in
Vend/Payment.  Once I get that working I will then try and figure out a
way to use SSL or what ever so that will not be needed.

I can not seem to get passed the error where I have to import the
function.

What I have to figure out is exactly how lperl qw(...) should be. Maybe I
am just to tired to think right now.

$LPERLExe = "";
$TMPDir = "";
$RUNMethod = "";

BEGIN {
        my $selected;
        package Vend::Payment;
        eval {
                package LPERL::lperl;
                require LPERL::lperl;
                import LPERL::lperl qw($LPERLExe,$RUNMethod,$TMPDir);
                $selected = "lperl";
         };

        $Vend::Payment::Have_LPERL_lperl = 1 unless $@;
        unless ($Vend::Payment::Have_LPERL_lperl) {
                die __PACKAGE__ . " requires lperl";
        }

        ::logGlobal("%s payment module initialized, using %s",
__PACKAGE__, $sel
ected)
                unless $Vend::Quiet;

}

package Vend::Payment;
sub linkpt {
use LPERL::lperl;

...


my $lperl = new lperl("/linux/usr/lib/interchange/lib/LPERL/lbin", "FILE",
"/linux/usr/lib/interchange/lib/LPERL/temp/");


...

}

package Vend::Payment::linkpt;

1;

It does not like the above.


*** import LPERL::lperl qw($LPERLExe $RUNMethod $TMPDir); gives...
*** import LPERL::lperl qw($LPERLExe, $RUNMethod, $TMPDir); gives...

(linkpt): Charge failed, reason: payment routine 'linkpt' returned error:
Undefined subroutine &lperl::new called at
/linux/usr/local/interchange.new/lib/Vend/Payment/linkpt.pm line XXX.


**** and import LPERL::lperl qw() gives...

(linkpt): Charge failed, reason: payment routine 'linkpt' returned error:
Can't locate object method "new" via package "lperl" (perhaps you forgot
to load "lperl"?) at
/linux/usr/local/interchange.new/lib/Vend/Payment/linkpt.pm line XXX.

Any ideas on what I am doing wrong?

--
Boyd Gerber <gerberb@zenez.com>
ZENEZ	3748 Valley Forge Road, Magna Utah  84044