#!/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)

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

# Copyright (c) 1996 - 2003, 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.

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

# Copyright (c) 1999 Excite@Home      PurePayments(tm) Perl SDK Toolkit
# PurePayments(tm) Perl SDK Version:  v 1.10 2000/05/05 20:59:14

# WSSurepay.pl includes software from Surepay's PurePayments(tm) Perl SDK
# Toolkit.  The PurePayments(tm) Perl SDK used in WSSurepay.pl has been
# modified for use with WebStore.

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

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

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

# The following Perl module and OpenSSL are used by WSSurepay.pl:

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

#    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.

# Before installing Net::SSLeay, change the following lines in SSLeay.pm:
#
#    LINE    Original Code                      Change To
#    ----    -------------                      ---------
#
#    1191    CTX_set_options($ctx, &OP_ALL);    CTX_set_options($ctx, &OP_NO_TLSv1);
#    1266    CTX_set_options($ctx, &OP_ALL);    CTX_set_options($ctx, &OP_NO_TLSv1);

############################################################################
# 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 = 'Surepay.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



# Surepay production gateway system
# Transaction URL = https://xml.surepay.com/xml

$pr_host_live = 'xml.surepay.com';
$pr_path_live = '/xml';
$pr_port_live = '443';



# Surepay test system
# Transaction URL = https://xml.test.surepay.com/xml

$pr_host_test = 'xml.test.surepay.com';
$pr_path_test = '/xml';
$pr_port_test = '443';



# Surepay 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    = '1001';
$pr_password_test = 'password';



# $merchant_file is Surepay's merchant configuration file, located in
# WebStore's Library sub-directory, $libr_directory.
# The merchant file contains the merchant's login ID, password, and
# gateway mode.

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


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