1012410;
#---------------------------------------------------------------
#
# Generated by OCCControlOCCConfigCtrl
#
#---------------------------------------------------------------
#
my $bCompleteOnTechnicalFailures = $::FALSE;
my $bCompleteOnFinancialFailures = $::FALSE;
my $bAuthorize = $::TRUE;
my $bTestMode = $::FALSE;
my $sProcessScriptURL = 'https://secure.wp3.rbsworldpay.com/wcc/purchase/';
my $sMerchantName = '';
my $sMerchantID = '130923';
#
#---------------------------------------------------------------
#
# OCCWorldPayScriptTemplate.pl - code part of OCC script
#
# Copyright (c) Actinic Software Ltd 2001 All rights reserved
#
# *** Do not change this code unless you know what you are doing ***
#
# Written by Mike Purnell
#
# This script is called by an eval() function and it will already
# have the following variables set up:
#
# Expects: $::sOrderNumber - the alphanumeric order number for this order
# $::nOrderTotal - the total for this order (stored in based currency format e.g. 1000 = $10.00)
# %::PriceFormatBlob - the price format data
# %::InvoiceContact - the customer invoice contact information
# $::sCallBackURLAuth - the URL of the authorization callback script
# $::sCallBackURLBack - the URL of the backup script
# $::sCallBackURLUser - the URL of the receipt script
# $::sPath - the path to the Catalog directory
# $::sWebSiteUrl - the Catalog web site URL
# $::sContentUrl - the content URL
#
# Affects: $::eStatus - the status of the transaction:
# $::FAILURE - Failure
# $::ACCEPTED - Accepted
# $::REJECTED - Rejected
# $::PENDING - Pending
# $::sErrorMessage - error message if any
# $::sHTML - the HTML to display
#
# $Revision: 18819 $
#
#---------------------------------------------------------------
use strict;
$::eStatus = $::PENDING; # The OCC plug-in runs in pending mode. This script does not
# perform the transaction. Rather, it forwards the customer to
# the OCC site for completion.
my (%VarTable);
$VarTable{$::VARPREFIX . 'OCC_URL'} = # insert the OCC web site URL into the HTML template
$sProcessScriptURL;
#
# Supported ISO country codes if the GetISOInvoiceCountryCode would fail
#
my %Countries =
(
'afghanistan' => 'AF',
'albania' => 'AL',
'algeria' => 'DZ',
'american samoa' => 'AS',
'andorra' => 'AD',
'angola' => 'AO',
'anguilla' => 'AI',
'antarctica' => 'AQ',
'antigua and barbuda' => 'AG',
'argentina' => 'AR',
'armenia' => 'AM',
'aruba' => 'AW',
'australia' => 'AU',
'austria' => 'AT',
'azerbaijan' => 'AZ',
'bahamas' => 'BS',
'bahrain' => 'BH',
'bangladesh' => 'BD',
'barbados' => 'BB',
'belarus' => 'BY',
'belgium' => 'BE',
'belize' => 'BZ',
'benin' => 'BJ',
'bermuda' => 'BM',
'bhutan' => 'BT',
'bolivia' => 'BO',
'bosnia and herzegovina' => 'BA',
'botswana' => 'BW',
'bouvet island' => 'BV',
'brazil' => 'BR',
'british indian ocean territory' => 'IO',
'brunei darussalam' => 'BN',
'bulgaria' => 'BG',
'burkina faso' => 'BF',
'burundi' => 'BI',
'cambodia' => 'KH',
'cameroon' => 'CM',
'canada' => 'CA',
'cape verde' => 'CV',
'cayman islands' => 'KY',
'central african republic' => 'CF',
'chad' => 'TD',
'chile' => 'CL',
'china' => 'CN',
'christmas island' => 'CX',
'cocos (keeling) islands' => 'CC',
'colombia' => 'CO',
'comoros' => 'KM',
'congo' => 'CG',
'cook islands' => 'CK',
'costa rica' => 'CR',
'croatia' => 'HR',
'cuba' => 'CU',
'cyprus' => 'CY',
'czech republic' => 'CZ',
'côte d\'ivoire' => 'CI',
'denmark' => 'DK',
'djibouti' => 'DJ',
'dominica' => 'DM',
'dominican republic' => 'DO',
'east timor' => 'TP',
'ecuador' => 'EC',
'egypt' => 'EG',
'el salvador' => 'SV',
'equatorial guinea' => 'GQ',
'eritrea' => 'ER',
'estonia' => 'EE',
'ethiopia' => 'ET',
'falkland islands' => 'FK',
'faroe islands' => 'FO',
'fiji' => 'FJ',
'finland' => 'FI',
'france' => 'FR',
'french guiana' => 'GF',
'french polynesia' => 'PF',
'french southern territories' => 'TF',
'gabon' => 'GA',
'gambia' => 'GM',
'georgia' => 'GE',
'germany' => 'DE',
'ghana' => 'GH',
'gibraltar' => 'GI',
'greece' => 'GR',
'greenland' => 'GL',
'grenada' => 'GD',
'guadeloupe' => 'GP',
'guam' => 'GU',
'guatemala' => 'GT',
'guinea' => 'GN',
'guinea-bissau' => 'GW',
'guyana' => 'GY',
'haiti' => 'HT',
'heard island and mcdonald islands' => 'HM',
'holy see (vatican city state)' => 'VA',
'honduras' => 'HN',
'hong kong' => 'HK',
'hungary' => 'HU',
'iceland' => 'IS',
'india' => 'IN',
'indonesia' => 'ID',
'iran' => 'IR',
'iraq' => 'IQ',
'ireland' => 'IE',
'israel' => 'IL',
'italy' => 'IT',
'jamaica' => 'JM',
'japan' => 'JP',
'jordan' => 'JO',
'kazakstan' => 'KZ',
'kenya' => 'KE',
'kiribati' => 'KI',
'kuwait' => 'KW',
'kyrgystan' => 'KG',
'lao' => 'LA',
'latvia' => 'LV',
'lebanon' => 'LB',
'lesotho' => 'LS',
'liberia' => 'LR',
'libyan arab jamahiriya' => 'LY',
'liechtenstein' => 'LI',
'lithuania' => 'LT',
'luxembourg' => 'LU',
'macau' => 'MO',
'macedonia (fyr)' => 'MK',
'madagascar' => 'MG',
'malawi' => 'MW',
'malaysia' => 'MY',
'maldives' => 'MV',
'mali' => 'ML',
'malta' => 'MT',
'marshall islands' => 'MH',
'martinique' => 'MQ',
'mauritania' => 'MR',
'mauritius' => 'MU',
'mayotte' => 'YT',
'mexico' => 'MX',
'micronesia' => 'FM',
'moldova' => 'MD',
'monaco' => 'MC',
'mongolia' => 'MN',
'montserrat' => 'MS',
'morocco' => 'MA',
'mozambique' => 'MZ',
'myanmar' => 'MM',
'namibia' => 'NA',
'nauru' => 'NR',
'nepal' => 'NP',
'netherlands' => 'NL',
'netherlands antilles' => 'AN',
'new caledonia' => 'NC',
'new zealand' => 'NZ',
'nicaragua' => 'NI',
'niger' => 'NE',
'nigeria' => 'NG',
'niue' => 'NU',
'norfolk island' => 'NF',
'north korea' => 'KP',
'northern mariana islands' => 'MP',
'norway' => 'NO',
'oman' => 'OM',
'pakistan' => 'PK',
'palau' => 'PW',
'panama' => 'PA',
'papua new guinea' => 'PG',
'paraguay' => 'PY',
'peru' => 'PE',
'philippines' => 'PH',
'pitcairn' => 'PN',
'poland' => 'PL',
'portugal' => 'PT',
'puerto rico' => 'PR',
'qatar' => 'QA',
'reunion' => 'RE',
'romania' => 'RO',
'russian federation' => 'RU',
'rwanda' => 'RW',
'saint helena' => 'SH',
'saint kitts and nevis' => 'KN',
'saint lucia' => 'LC',
'saint pierre and miquelon' => 'PM',
'saint vincent and the grenadines' => 'VC',
'samoa' => 'WS',
'san marino' => 'SM',
'sao tome and principe' => 'ST',
'saudi arabia' => 'SA',
'senegal' => 'SN',
'seychelles' => 'SC',
'sierra leone' => 'SL',
'singapore' => 'SG',
'slovakia' => 'SK',
'slovenia' => 'SI',
'solomon islands' => 'SB',
'somalia' => 'SO',
'south africa' => 'ZA',
'south georgia' => 'GS',
'south korea' => 'KR',
'spain' => 'ES',
'sri lanka' => 'LK',
'sudan' => 'SD',
'suriname' => 'SR',
'svalbard and jan mayen islands' => 'SJ',
'swaziland' => 'SZ',
'sweden' => 'SE',
'switzerland' => 'CH',
'syria' => 'SY',
'taiwan' => 'TW',
'tajikistan' => 'TJ',
'tanzania' => 'TZ',
'thailand' => 'TH',
'togo' => 'TG',
'tokelau' => 'TK',
'tonga' => 'TO',
'trinidad and tobago' => 'TT',
'tunisia' => 'TN',
'turkey' => 'TR',
'turkmenistan' => 'TM',
'turks and caicos islands' => 'TC',
'tuvalu' => 'TV',
'uganda' => 'UG',
'ukraine' => 'UA',
'united arab emirates' => 'AE',
'united kingdom' => 'GB',
'united states minor outlying islands' => 'UM',
'united states' => 'US',
'uruguay' => 'UY',
'uzbekistan' => 'UZ',
'vanuatu' => 'VU',
'venezuela' => 'VE',
'viet nam' => 'VN',
'virgin islands (british)' => 'VG',
'virgin islands (u.s.)' => 'VI',
'wallis and futuna islands' => 'WF',
'western sahara' => 'EH',
'yemen' => 'YE',
'yugoslavia' => 'YU',
'zaire' => 'ZR',
'zambia' => 'ZM',
'zimbabwe' => 'ZW'
);
#
# build up a string of all of the values that must be passed to OCC
#
my $sHiddenValues;
#
# supply the cardholder's adddress details
#
# salutation
#
$sHiddenValues .= "\n";
#
# name
#
$sHiddenValues .= "\n";
#
# job title
#
$sHiddenValues .= "\n";
#
# company
#
$sHiddenValues .= "\n";
#
# address line 1
#
$sHiddenValues .= "\n";
#
# address line 2
#
$sHiddenValues .= "\n";
#
# address line 3
#
$sHiddenValues .= "\n";
#
# address line 4
#
$sHiddenValues .= "\n";
#
# limit the buyer's postcode to 12 charcters
#
$sHiddenValues .= "\n";
#
# country
#
$sHiddenValues .= "\n";
#
# Convert country name, if used, to ISO code
#
my $sCountry = '';
my $sCountryCode = '';
if($$::g_pSetupBlob{LOCATION_INTERFACE} >= 1)
{
$sCountryCode = ActinicLocations::GetISOInvoiceCountryCode();
}
if($sCountryCode eq '' ||
$sCountryCode =~ /undefined/i)
{
# try country code from the shipping location if present (v3 method)
#
if ($::s_Ship_sOpaqueLocationData =~ /LocationCountry;(.*?);/i)
{
$sCountryCode = $1;
}
else
{
$sCountry = lc($::InvoiceContact{COUNTRY});
#
# lookup in country -> ISO hash
#
if (exists $Countries{$sCountry})
{
$sCountryCode = $Countries{$sCountry};
}
}
}
#
# If we got a country code add to the hidden data
#
if($sCountryCode ne '')
{
$sHiddenValues .= "\n";
}
#
# phone
#
$sHiddenValues .= "\n";
#
# fax
#
$sHiddenValues .= "\n";
#
# email address
#
$sHiddenValues .= "\n";
#
# are they moving in the next month?
#
$sHiddenValues .= "\n";
#
# user defined invoice field
#
$sHiddenValues .= "\n";
#
# end of the invoice address details
#
#
# set up the transaction specific details
#
# order number
#
$sHiddenValues .= "\n";
#
# currency
#
$sHiddenValues .= "\n";
#
# amount as an integral number
#
$sHiddenValues .= "\n";
#
# end of the transaction specific details
#
#
# set up the merchant specific details
#
$sHiddenValues .= "\n";
my $sCBAuth = $::sCallBackURLAuth;
if (!$bAuthorize) # if in pre-authorize mode, set the flag
{
$sHiddenValues .= "\n";
$sCBAuth .= "PA=1"; # append PA=1 to authcallbackurl to get this parameter back during the auth callback
}
if ($bTestMode) # only include the test mode flag if it is on
{
$sHiddenValues .= "\n";
}
#
# URLs:
#
# AUTH - the URL to create the authorization blob
# BACK - the URL to return to the Catalog checkout process
# USER - the URL to the receipt script
#
my @Response = ACTINIC::EncodeText($sCBAuth);
$sHiddenValues .= "\n";
@Response = ACTINIC::EncodeText($::sCallBackURLBack);
$sHiddenValues .= "\n";
@Response = ACTINIC::EncodeText($::sCallBackURLUser);
$sHiddenValues .= "\n";
#
# end of the merchant specific details
#
### ACTINIC::RecordErrors ("Debug: $sHiddenValues", $::sPath);
$VarTable{$::VARPREFIX . 'OCC_VALUES'} = # add the OCC values to the template
$sHiddenValues;
my $sLinkHTML = 'occlink.html';
if(defined $::g_pPaymentList)
{
$sLinkHTML = $$::g_pPaymentList{ActinicOrder::PaymentStringToEnum($::g_PaymentInfo{'METHOD'})}{BOUNCE_HTML};
}
@Response = ACTINIC::TemplateFile($::sPath . $sLinkHTML, \%VarTable); # build the file
if ($Response[0] != $::SUCCESS)
{
$::eStatus = $::FAILURE; # return a plug-in error
$::sErrorMessage = $Response[1];
return ($::SUCCESS); # always return success if the script runs
}
@Response = ACTINIC::MakeLinksAbsolute($Response[2], $::sWebSiteUrl, $::sContentUrl);
if ($Response[0] != $::SUCCESS)
{
$::eStatus = $::FAILURE; # return a plug-in error
$::sErrorMessage = $Response[1];
return ($::SUCCESS); # always return success if the script runs
}
$::sHTML = $Response[2]; # grab the resulting HTML
#
# process the test mode warning
#
my ($sDelimiter) = $::DELPREFIX . 'TESTMODE';
if ($bTestMode) # only include the test mode block if we are in test mode
{
$::sHTML =~ s/$sDelimiter//g; # remove the delimiter text
}
else # not in test mode - remove the block
{
$::sHTML =~ s/$sDelimiter(.*?)$sDelimiter//gs; # remove the test mode warning blob (/s removes the \n limitation of .)
}
return ($::SUCCESS);
#
# End of OCCScriptTemplate.pl
#
#
# End of File