#!/usr/bin/perl
# File Permissions:  644  -rw-r--r--

# If applicable, inform Perl where user installed modules are located.
# 'use lib' declarations should be placed in WebStore's global setup file,
# ws_global.setup, so modules are always available to all applications.

# use lib '/Path/To/Perl/Modules';

use Net::SSLeay;              # SSL (https)
use Digest::MD5  qw(md5_hex); # MD5 checksum generation

############################################################################
#          WSAuthorizeNet.pl  -  WebStore Support Library  -  Perl5        #
############################################################################

# Copyright (c) 1996 - 2002, RDC Software
# Full copyright notice can be found in the following files for the
# listed license type:

#     Single User License:   /Docs/Copyright_SingleUser.html
#     Server License:        /Docs/Copyright_Server.html

# Use of any portion of the code in this file in any application other than
# RDC Software's WebStore applications (400, 400CS, 500, or 500CS) is
# forbidden without prior written consent from an officer of RDC Software.

# This copyright notification can not be altered or removed from this file.

#==========================================================================#

# Version:  4.15.00
# Created:  03/28/2000   Last Modified:  01/01/2002
# WebStore@ratite.com    http://www.ratite.com
# RDC Software, 16155 FM 2022 N, Grapeland, TX 75844, USA

#==========================================================================#

# The following Perl modules and OpenSSL are used by WSAuthorizeNet.pl:

#    Package/File    Download URL for latest version
#    ------------    -------------------------------

#    Digest::MD5     http://www.perl.com/cgi-bin/cpan_mod?module=Digest::MD5
#    OpenSSL         http://www.openssl.org/source/
#    Net::SSLeay     http://www.perl.com/cgi-bin/cpan_mod?module=Net::SSLeay

# OpenSSL must be installed before Net::SSLeay.

############################################################################
# DEFINE VARIABLES


# $merchant_log is the file used to store transaction status messages, located
# in WebStore's Log directory, $logs_directory

# Non-test values for credit card number and merchant login id stored in the
# log file are replaced with * (asterisks).

# Merchant password is always replaced with * (asterisks).

# Setting $merchant_log = '' disables the log file routine.

$merchant_log = 'AuthorizeNet.log';



# $merchant_log_size = maximum size of the $merchant_log file before overwrite
# occurs.

# Setting $merchant_log_size = '' disables overwrite of the merchant log file.
# You must manually delete the merchant log file ($merchant_log).

$merchant_log_size = '100000';  # 100000 = 100k



# Authorize.Net gateway system
# Transaction URL = https://secure.authorize.net/gateway/transact.dll

$pr_type = 'https';
$pr_host = 'secure.authorize.net';
$pr_path = '/gateway/transact.dll';
$pr_port = '443';



# Authorize.Net test login and password.

# The value of $pr_login_test is also used to determine when to hide the
# merchant's login ID present in the merchant configuration file.

$pr_login_test    = 'testing';
$pr_password_test = 'password';



# $merchant_file is Authorize.Net's merchant configuration file, located in
# WebStore's Library sub-directory, $libr_directory.
# The merchant file contains the merchant's Login ID, password, etc.

$merchant_file = 'merchant.authorizenet.cfg'
if !defined($merchant_file) || $merchant_file !~ /authorizenet/i;


# End DEFINE VARIABLES
############################################################################