[ic] Use not allowed error

Brent Mosley interchange-users@interchange.redhat.com
Mon May 27 22:47:01 2002


Kevin
Here's the entire linkpt.pl code:
********************Start of
linkpt.pl****************************************
GlobalSub <<EOS
use lib '/usr/local/cpanel/3rdpary/interchange/lib/LPERL';
#use lib '~_~INSTALLPRIVLIB~_~';
use lib '/usr/local/cpanel/3rdpary/interchange';
#use lib '~_~INSTALLARCHLIB~_~';
sub linkpt {
use LPERL::lperl;

###################################################
# create a new instance of LPERL ...
#
# The first parameter is the path and name of the
# binary executable that processes transactions.
#
# The second parameter is passed to the binary
# executable
#
# The third parameter is the path to the directory
# where temporary data files will be stored for the
# transaction data.
#
# PLEASE NOTE:  These data files contain transaction
# data such as credit card numbers and should only
# be stored in a directory that is secure.
###################################################

my $lperl = new
lperl("/usr/local/cpanel/3rdparty/interchange/lib/LPERL/lbin", "FILE",
"/usr/local/cpanel/3rdparty/interchange/lib/LPERL/temp/");

#######################################################
#
# These parameters must be modified to reflect the
# information provided to you for YOUR store
#
# $transacitonresult should be set to LIVE when doing
# live transactions on https://secure.linkpt.net
#
#######################################################

my $hostname           = "staging.linkpt.net";
my $port               = "1139";
my $storename          = "999999";
my $keyfile            =
"/usr/local/cpanel/3rdparty/interchange/lib/LPERL/571419.pem";
my $transactionresult  = "GOOD";
my $testip             = "127.0.0.1";


############################################################
#
#    BillOrders Test (capturepayment ... then billorders)
#
#      This function is used to bill all orders contained
#      within the included hash table.  To keep the example
#      simple, only one order is used.  CapturePayment is
#      called immediately before BillOrders in order to
#      create a transaction to bill against.
#
#############################################################

my %actual = Vend::Order::map_actual();
my $transaction_hash = {
                        hostname        => $hostname,
                        port            => $port,
                        storename       => $storename,
                        keyfile         => $keyfile,
                        # if this param is empty or missing
                        # a CSI order number will be assigned
                        orderID         => "",
                        amount          => Vend::Interpolate::total_cost(),
#$actual{'total-cost'},
                        result          => $transactionresult,
                        cardNumber      => $actual{mv_credit_card_number},
                        cardExpMonth    =>
$actual{mv_credit_card_exp_month},
                        cardExpYear     => $actual{mv_credit_card_exp_year},
                        name            => "$actual{fname} $actual{lname}",
                        email           => $actual{email},
                        phone           => $actual{phone_day},
                        address         => $actual{address},
                        city            => $actual{city},
                        state           => $actual{state},
                        zip             => $actual{zip},
                        country         => $actual{country},
                        ip              => $testip,
                };

my %ret = $lperl->CapturePayment($transaction_hash);
# ---------------------------------------------
# capture the order ID so we can bill the order
# ---------------------------------------------

my $neworderID = $ret{'neworderID'};
my %result;

print "CapturePayment: statusCode: $ret{'statusCode'}\n";

if ( $ret{'statusCode'} eq 0 ) {

    # the transaction failed.  print the reason.
     $result{MStatus} = 'failure';
     $result{MErrMsg} = "$ret{'statusMessage'} ";
print "CapturePayment: statusMessage: $ret{'statusMessage'}\n";
#print "CapturePayment: ChargeTotal: $actual{'total-cost'}\n";

}
else
{
    # the transaction succeeded.  print the results.

#print "CapturePayment: statusMessage: $ret{'statusMessage'}\n";
#print "CapturePayment: AVSCode: $ret{'AVSCode'}\n";
#print "CapturePayment: trackingID: $ret{'trackingID'}\n";
#print "CapturePayment: neworderID: $ret{'neworderID'}\n";
#print "CapturePayment: statusApproval: $ret{'statusApproval'}\n";
#print "CapturePayment: chargetotal: $ret{'chargetotal'}\n";
#print "CapturePayment: shipping: $ret{'shipping'}\n";
#print "CapturePayment: subtotal: $ret{'subtotal'}\n";
#print "CapturePayment: tax: $ret{'tax'}\n";
#print "CapturePayment: time : $ret{'time'}\n\n";

# ------------------
# now bill the order
# ------------------

     $transaction_hash = {
            hostname        => $hostname,
            port            => $port,
            storename       => $storename,
            keyfile         => $keyfile,
            result          => $transactionresult,
            orders          => ([
                          # multiple entries could be used for more orders
              {orderID      => $neworderID,
               amount       => $actual{'total-cost'},
               backOrdered  => '0',
              }
            ])
        };

%ret = $lperl->BillOrders($transaction_hash);

#print "Successfully billed $ret of 1 order\n";
#print "Order  statusMessage:
$transaction_hash->{'orders'}[0]->{'statusMessage'}\n";
$result{MStatus} = 'success';
$result{'order-id'} = $neworderID;

}
return %result;
}

EOS
********************************End of linkpt.pl
Code***************************

-----Original Message-----
From: interchange-users-admin@interchange.redhat.com
[mailto:interchange-users-admin@interchange.redhat.com]On Behalf Of
Kevin Walsh
Sent: Sunday, May 26, 2002 5:17 AM
To: interchange-users@interchange.redhat.com
Subject: RE: [ic] Use not allowed error


>
> Does anyone know what would cause the following error.  I am a Perl
novice.
> Please advise.
>
> perl linkpt.pl
> String found where operator expected at linkpt.pl line 2, near "use lib
> '/usr/local/cpanel/3rdparty/interchange/lib/LPERL/lbin'"
>         (Do you need to predeclare use?)
> "use" not allowed in expression at linkpt.pl line 2, at end of line
> syntax error at linkpt.pl line 2, near "EOS
> use lib "
> BEGIN not safe after errors--compilation aborted at linkpt.pl line 4.
>
You'll need to post the first few lines of the code before anybody
can take a guess at the problem.  Perhaps lines 1 through 5 will do.

--
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/

_______________________________________________
interchange-users mailing list
interchange-users@interchange.redhat.com
http://interchange.redhat.com/mailman/listinfo/interchange-users