[ic] Required Perl module Vend::Payment::processnet not present

David Davideth at charter.net
Tue Oct 3 14:12:19 EDT 2006


I am receiving the following error message when installing processnet.pm
___________________________________________
- - - [03/October/2006:13:59:21 -0400] - - Vend::Payment::processnet payment 
module initialized, using Net::SSLeay
- - - [03/October/2006:13:59:21 -0400] - - Required Perl module 
Vend::Payment::processnet not present. Aborting catalog.
> In line 0 of the configuration file 'interchange.cfg':
>
>
- - - [03/October/2006:13:59:21 -0400] - - Required Perl module 
Vend::Payment::processnet not present. Aborting catalog.
> In line 0 of the configuration file 'interchange.cfg':
>
__________________________________________________
In interchange.cfg:

Require module Vend::Payment::processnet
__________________________________________________
The module appears to initialize but fails for some reason.
processnet.pm code follows:
____________________________________________
# Vend::Payment::processnet - Interchange processnet Support
#
# $Id: processnet.pm,v 2.0 2001/07/18 02:23:16 jon Exp $
#
# Copyright (C) 1999-2001 Red Hat, Inc. <interchange at redhat.com>
#
# Written by David Etheredge <Davideth at charter.net>
# based on code by Mike Heins <mheins at redhat.com>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public
# License along with this program; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA.
package Vend::Payment::processnet;
=head1 Interchange processnet Support
Vend::Payment::processnet $Revision: 2.0 $
=head1 SYNOPSIS
&charge=processnet
or
[charge mode=processnet param1=value1 param2=value2]
=head1 PREREQUISITES
Net::SSLeay
or
LWP::UserAgent and Crypt::SSLeay
Only one of these need be present and working.
=head1 DESCRIPTION
The Vend::Payment::processnet module implements the processnet() routine
for use with Interchange. It is compatible on a call level with the other
Interchange payment modules -- in theory (and even usually in practice) you
could switch from CyberCash to processnet with a few configuration
file changes.
To enable this module, place this directive in C<interchange.cfg>:
Require module Vend::Payment::processnet
This I<must> be in interchange.cfg or a file included from it.
Make sure CreditCardAuto is off (default in Interchange demos).
The mode can be named anything, but the C<gateway> parameter must be set
to C<processnet>. To make it the default payment gateway for all credit
card transactions in a specific catalog, you can set in C<catalog.cfg>:
Variable MV_PAYMENT_MODE processnet
It uses several of the standard settings from Interchange payment. Any time
we speak of a setting, it is obtained either first from the tag/call 
options,
then from an Interchange order Route named for the mode, then finally a
default global payment variable, For example, the C<id> parameter would
be specified by:
[charge mode=processnet id=Yourprocessnet]
or
Route processnet id YourprocessnetID
or
Variable MV_PAYMENT_ID YourprocessnetID
The active settings are:
=over 4
=item id
Your processnet account ID, supplied by processnet when you sign up.
Global parameter is MV_PAYMENT_ID.
=item home_page
The internet address of your site. Defaults to C<http://__SERVER_NAME__> if
not set. Global parameter is MV_PAYMENT_HOME_PAGE.
=item remap
This remaps the form variable names to the ones needed by processnet. See
the C<Payment Settings> heading in the Interchange documentation for use.
=back
=head2 Troubleshooting
Try the instructions above, then enable test mode. A test order should 
complete.
Then move to live mode and try a sale with the card number C<4111 1111 1111 
1111>
and a valid expiration date. The sale should be denied, and the reason 
should
be in [data session payment_error].
If nothing works:
=over 4
=item *
Make sure you "Require"d the module in interchange.cfg:
Require module Vend::Payment::processnet
=item *
Make sure either Net::SSLeay or Crypt::SSLeay and LWP::UserAgent are 
installed
and working. You can test to see whether your Perl thinks they are:
perl -MNet::SSLeay -e 'print "It works\n"'
or
perl -MLWP::UserAgent -MCrypt::SSLeay -e 'print "It works\n"'
If either one prints "It works." and returns to the prompt you should be OK
(presuming they are in working order otherwise).
=item *
Check the error logs, both catalog and global.
=item *
Make sure you set your account ID properly.
=item *
Try an order, then put this code in a page:
<XMP>
[calc]
my $string = $Tag->uneval( { ref => $Session->{payment_result} });
$string =~ s/{/{\n/;
$string =~ s/,/,\n/g;
return $string;
[/calc]
</XMP>
That should show what happened.
=item *
If all else fails, Red Hat and other consultants are available to help
with integration for a fee.
=back
=head1 BUGS
There is actually nothing *in* Vend::Payment::processnet. It changes 
packages
to Vend::Payment and places things there.
=head1 AUTHORS
Mark Johnson <markj at redhat.com> and Cameron Prince <cprince at redhat.com>, 
based
on original code by Mike Heins <mheins at redhat.com>.
=cut
BEGIN {
my $selected;
eval {
package Vend::Payment;
require Net::SSLeay;
import Net::SSLeay qw(post_https make_form make_headers);
$selected = "Net::SSLeay";
};
$Vend::Payment::Have_Net_SSLeay = 1 unless $@;
unless ($Vend::Payment::Have_Net_SSLeay) {
eval {
package Vend::Payment;
require LWP::UserAgent;
require HTTP::Request::Common;
require Crypt::SSLeay;
import HTTP::Request::Common qw(POST);
$selected = "LWP and Crypt::SSLeay";
};
$Vend::Payment::Have_LWP = 1 unless $@;
}
unless ($Vend::Payment::Have_Net_SSLeay or $Vend::Payment::Have_LWP) {
die __PACKAGE__ . " requires Net::SSLeay or Crypt::SSLeay";
}
::logGlobal("%s payment module initialized, using %s", __PACKAGE__, 
$selected)
unless $Vend::Quiet;
}
package Vend::Payment;
sub processnet {
my ($opt, $amount) = @_;
my $user = $opt->{id} || charge_param('id');
my $company = $opt->{company} || "$::Variable->{COMPANY} Order";
my %actual;
if($opt->{actual}) {
%actual = %{$opt->{actual}};
}
else {
%actual = map_actual();
}
$actual{mv_credit_card_exp_month} =~ s/\D//g;
$actual{mv_credit_card_exp_month} =~ s/^0+//;
$actual{mv_credit_card_exp_year} =~ s/\D//g;
my $exp_year = $actual{mv_credit_card_exp_year};
$exp_year += 2000 unless $exp_year =~ /\d{4}/;
$actual{mv_credit_card_number} =~ s/\D//g;
my @month = (qw/January
Febuary
March
April
May
June
July
August
September
October
November
December/);
my $exp_month = @month[$actual{mv_credit_card_exp_month} - 1];
my $precision = $opt->{precision} || charge_param('precision') || 2;
$amount = "$opt->{total_cost}" || undef;
if(! $amount) {
$amount = Vend::Interpolate::total_cost();
$amount = Vend::Util::round_to_frac_digits($amount,$precision);
}
my $gen;
if($opt->{test} and $gen = charge_param('generate_error') ) {
::logDebug("trying to generate error");
$actual{mv_credit_card_number} = '4111111111111112'
if $gen =~ /number/;
$exp_year = '2000'
if $gen =~ /date/;
}
my %values = (
vendor_id => $user,
orderid => $order_id
pass_thru => 1,
price => $amount,
name => $actual{b_fname}+" "+$actual{b_lname},
address => 
$actual{b_address}+","+$actual{b_city}+","+$actual{b_state}+","+$actual{b_zip},
card => $actual{mv_credit_card_number},
expr => $exp_month+$exp_year,
);
my $hp = $opt->{home_page}
|| charge_param('home_page')
|| $::Variable->{SERVER_NAME};
$hp = "http://$hp" unless $hp =~ /^\w+:/;
$values{home_page} = $hp;
$opt->{submit_url} ||= 'https://lestat.processing.net/cgi-bin/nph-charge';
my %result;
::logGlobal("sending query: " . ::uneval(\%values));
::logDebug("sending query: " . ::uneval(\%values));
my $thing = post_data($opt, \%values);
my $header_string = $thing->{header_string};
my $result_page = $thing->{result_page};
## check for errors
my $error;
::logGlobal("request returned: $result_page");
::logDebug("request returned: $result_page");
if ($header_string =~ m/^Location: success/mi) {
$result{MStatus} = 'success';
$result{'order-id'} = $opt->{order_id};
}
else {
if ($result_page =~ m/BEGIN ERROR DESCRIPTION --\>(.*)\<\!-- END ERROR 
DESCRIPTION/s) {
$error = $1;
$error =~ s/\<.*?\>//g;
$error =~ s/[^-A-Za-z_0-9 ]//g;
}
elsif($result_page =~ m{<title>\s*error\s*</title>}i) {
$error = $result_page;
$error =~ s/.*?<body.*?>//is;
$error =~ s/<.*?>//g;
$error =~ s/\s+/ /g;
$error =~ s/\s+$//;
$error =~ s/^\s+$//;
}
else {
## something very bad happened
$error = ::errmsg("Unknown error");
}
::logGlobal("processnet Error: " . $error);
::logDebug("processnet Error: " . $error);
$result{MStatus} = 'denied';
$result{MErrMsg} = $error;
}
return %result;
}
package Vend::Payment::processnet;
1;
____________________________________________ 


More information about the interchange-users mailing list