Originally posted by Widdy
yes they need our feedback which is another reason I suggested they email us.
<!-- Template for Netbanx OCC HTML template -->
</FORM><!-- Terminate the parent template form -->
<form name="formOCC" method="POST" action="https://checkout.google.com/cws/v2/Merchant/132490985518263/checkoutForm" accept-charset="utf-8">
NETQUOTEVAR:OCC_VALUES
</form>
<FORM METHOD=POST ACTION="NETQUOTEVAR:OCC_URL"><!-- Create a bogus form to keep the parent template happy -->
<!-- End of template for Netbanx OCC -->
#---------------------------------------------------------------
#
# OCCScriptTemplate.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 George Menyhert
#
# 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: 1 $
#
#---------------------------------------------------------------
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);
## Shared Script, different HTML templates;
$VarTable{$::VARPREFIX . 'OCC_URL'} = # insert the OCC web site URL into the HTML template
$sProcessScriptURL;
#
# build up a string of all of the values that must be passed to OCC
#
#
# amount is translated to decimal places
#
my $nNumDigits = $::PriceFormatBlob{"ICURRDIGITS"}; # read the currency format values
my ($nAmount, $nFactor, $sAmount);
if(defined $nNumDigits)
{
$nFactor = (10 ** $nNumDigits);
}
else
{
$nFactor = 100;
}
$sAmount = sprintf("%d.%02d", $::nOrderTotal / $nFactor, $::nOrderTotal % $nFactor);
my $sHiddenValues;
$sHiddenValues .= "<input type=\"hidden\" name=\"ordernumber\" value=\"" . $::sOrderNumber . "\">\n";
$sHiddenValues .= "<input type=\"hidden\" name=\"item_name_1\" value=\"TV Wall Brackets\">\n";
$sHiddenValues .= "<input type=\"hidden\" name=\"item_description_1\" value=\"Your goods purchased from TV Wall Brackets\">\n";
$sHiddenValues .= "<input type=\"hidden\" name=\"item_quantity_1\" value=\"1\">\n";
$sHiddenValues .= "<input type=\"hidden\" name=\"item_price_1\" value=\"" . $sAmount . "\">\n";
$sHiddenValues .= "<input type=\"hidden\" name=\"item_currency_1\" value=\"GBP\">\n";
$sHiddenValues .= "<input type=\"hidden\" name=\"_charset_\">\n";
$sHiddenValues .= "<input type=\"hidden\" name=\"checkout-flow-support.merchant-checkout-flow-support.continue-shopping-url\" value=\"https://www.tv-wall-brackets.co.uk/cgi-bin/os000003.pl?SEQUENCE=3&ACTION=Finish&ORDERNUMBER=$::sOrderNumber\">\n";
#
if (!$bAuthorize) # if in pre-authorize mode, set the flag
{
}
if ($bTestMode) # only include the test mode flag if it is on
{
$sHiddenValues .= "<input type=HIDDEN NAME=\"TESTMODE\" value=\"1\">\n";
}
#
$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
#
Comment