--------------------------------------------------------------

Tax Cloud - Realtime US Tax Rates

--------------------------------------------------------------

Last Modified : 26 April 2018
***********************************************************************************
Contents:

A. SUMMARY
B. FILE STRUCTURE
C. INSTALLATION INSTRUCTION
D. HOW IT WORKS
E. FILE NEED TO BE MODIFIED
F. CONFIGURATION SETTINGS CHANGED
G. DATABASE TABLES MODIFIED
H. LANGUAGE SETTINGS CHANGED
I. CHANGE LOGS
J.
TROUBLESHOOTING
K. COPYRIGHT NOTICE
L. TERMS AND CONDITIONS

***********************************************************************************

A. SUMMARY
==========
Allow US based merchants to retrieve Tax rate from TaxCloud during checkout.
For more details about TaxCloud, please visit http://taxcloud.net/guide.pdf

NOTE : This addon is not compatible with onepage checkout. It will only works with normal checkout.

***********************************************************************************

B. FILE STRUCTURE
===================

Files included in the zip are:
- $taxcloud900_readme.html
- shoptaxcloudsub.asp
- Instructions for Cart sign-ups-with samples.pdf
- shoptaxcloudremovecert.asp
- shoptaxcloudgetcert.asp
- shoptaxcloudsetcert.asp
- shoptaxcloudsaveCert.asp
- shoptaxcloudretrievecert.asp
- shoptaxcloudconfig.asp
- shoptaxcloudverifyaddress.asp
- shoptaxcloudmdhash.asp
- admin/uspostal_setup.asp
- admin/uspostal_setup_config.asp
- admin/uspostal_setup_process.asp
- admin/sqlscripts/$taxcloud-access.txt
- admin/sqlscripts/$taxcloud-mysql.txt
- admin/sqlscripts/$taxcloud-sqlserver.txt
- images/taxcloud_certificate.gif

***********************************************************************************

C. INSTALLATION INSTRUCTION
============================
1. Upload the below files to VPCart root folder.
    - shoptaxcloudsub.asp
    - shoptaxcloudremovecert.asp
    - shoptaxcloudgetcert.asp
    - shoptaxcloudsetcert.asp
    - shoptaxcloudsaveCert.asp
    - shoptaxcloudretrievecert.asp
    - shoptaxcloudconfig.asp
    - shoptaxcloudverifyaddress.asp
    - shoptaxcloudmdhash.asp
    - images/taxcloud_certificate.gif
    - images/taxcloudload.gif

1a. Upload the below files to your ADMIN folder. If you have renamed your ADMIN folder, then this must be placed in the       renamed folder.
    - admin/sqlscripts/$taxcloud-access.txt
    - admin/sqlscripts/$taxcloud-mysql.txt
    - admin/sqlscripts/$taxcloud-sqlserver.txt
    - admin/shopa_taxcloud_subs.asp
    - admin/uspostal_setup.asp
    - admin/uspostal_setup_config.asp
    - admin/uspostal_setup_process.asp

2. Download the files below from your server via FTP and follow the instructions below to modify the files.
    - shopcustomerdesign.asp
    - shopcartformat.asp
    - shopthanks.asp
    - shopcustomer.asp
    - shopmysqlsubs.asp
    - shop$db.asp
    - admin/help/shoph_producthelp.asp
    - admin/shopa_addproduct.asp
    - admin/shopa_displayorders.asp

2.1 Open the file shopcustomerdesign.asp with your favorite editor and
2.1a. Locate below lines, estimate line 43 - 51,

ShopCustomerForm displayshoppingform, displayotherform

if displayshoppingform then
AddShippingForm
end if

if GetConfig("xshippingundercustomer")<>"Yes" then
HtmlWrite "<div class=""cb"">&nbsp;</div>" & vbCrLf
end if

2.1b. Below these codes, please insert :

'TaxCloud
AddTaxCloudExemptionCert

2.1c. Save the file


2.2 Open the file shopcartformat.asp with your favorite editor and
2.2a. Locate below lines, estimate line 5,

<!--#include file="shopcartformatdesign.asp"-->

2.2b. Below these codes, please insert :

<!--#include file="shoptaxcloudsub.asp"-->

2.2c. Locate below lines in the sub cartformatpricingsection routine, estimate line 494,

CartFormatTax

2.2d. Replace with below codes :

'TaxCloud
if instr(lcase(request.ServerVariables("SCRIPT_NAME")),"shopcreateorder.asp") > 0 and    getconfig("xtaxcloudenable") ="Yes" then
   CartFormatTaxTaxCloud
else
   CartFormatTax
end if

2.2e. Save the file

2.3 Open the file shopthanks.asp with your favorite editor and
2.3a. Locate below lines, estimate line 24,

<!--#include file="shopcheckoutindicator.asp"-->

2.3b. Below these codes, please insert :

<!--#include file="shoptaxcloudsub.asp"-->

2.3c. Locate below lines , estimate line 149,

ShopGiftControl

2.3d. Above these codes, please insert:

'TaxCloud
TaxCloudSendAuthorized

2.3e. Save the file

2.4 Open the file shopcustomer.asp with your favorite editor and
2.4a. Locate below lines, estimate line 21,

<!--#include file="shopcheckoutindicator.asp"-->

2.4b. Below these codes, please insert :

<!--#include file="shoptaxcloudsub.asp"-->

2.4c. Locate below lines in the sub ValidateData routine, estimate line 382,

strshipAddress2 = CleanChars(Request.Form("shipAddress2"))

2.4d. Below these codes, please insert:

'TaxCloud
getTaxCloudCertForm

2.4e. Locate below lines in the sub ValidateData routine, estimate line 426,

GetAffInfo

2.4f. Below these codes, please insert:

'TaxCloud
TaxCloudGetDestinationInfo("form")
TaxCloudVerifyAddress dest_address_taxcloud,dest_address2_taxcloud,dest_city_taxcloud,dest_state_taxcloud,dest_zipcode_taxcloud

2.4g. Save the file


2.5 Open the file shopmysqlsubs.asp with your favorite editor and
2.5a. Locate below lines in the sub MYSQLUpdateProduct routine , estimate line 1021,

mysqlnumbfield sqlo, "taxfree", strtaxfree

2.5b. Below these codes, please insert :

'TaxCloud
UpdateMySQLTaxCloudFields sqlo

2.5c. Save the file


2.6 Open the file admin/shopa_addproduct.asp with your favorite editor and
2.6a. Locate below lines , estimate line 8,

<!--#include file="shopa_googleproductfeedsvariant.asp"-->

2.6b. Below these codes, please insert :

<!-- #include file="shopa_taxcloud_subs.asp" -->

2.6c. Locate below lines in the sub GetFormData routine, estimate line 390,

strtaxfree = request("strtaxfree")

2.6d. Below these codes, please insert :

'TaxCloud
GetRequestTaxCloud

2.6e. Locate below lines in the sub DisplayForm routine, estimate line 776,

FormateditrowBoolean GetLang("LangTaxfree"), "strtaxfree", strtaxfree, yesnos, yesnocount, "document.all.help_taxfree"

2.6f. Below these codes, please insert :

'TaxCloud
GenerateTaxCloudForm

2.6g. Locate below lines in the sub GetExistingProduct routine, estimate line 1358,

CorrectBooleanProgram strtaxfree

2.6h. Below these codes, please insert :

'TaxCloud
GetTaxCloudFromDB getobjrs

2.6i. Locate below lines in the sub UpdateProduct routine, estimate line 2454,

pUpdateField "taxfree", strtaxfree

2.6j. Below these codes, please insert :

'TaxCloud
UpdateTaxCloudFields

2.6k. Save the file


2.7 Open the file admin/shopa_displayorders.asp with your favorite editor and
2.7a. Locate below lines , estimate line 17,

dyninclude xmysite2 & "/shopthankslinks.asp"

2.7b. Below these codes, please insert :

'TaxCloud
dyninclude xmysite2 & "/shoptaxcloudsub.asp"

2.7c. Locate below lines in the sub MarkProcessed (item) routine, estimate line 651,

updatestock item

2.7d. Above these codes, please insert :

'TaxCloud
if getconfig("xtaxcloudadminautocapture") = "Yes" then
   if lcase(getTaxcloudfieldvalue("orders","TaxCloudSendStatus",item,"orderid",1)) = "ok" then
      TaxCloudSendCapture(item)
   end if
end if

2.7e. Save the file


2.8 Open the file admin/help/shoph_producthelp.asp with your favorite editor and
2.8a. Locate below lines , estimate line 86,

<%
GenerateDisplayBodyFooter
end sub
%>

2.8b. Above these codes, please insert :

<!--TaxCloud-->
<span name='help_taxcouldtaxclass' id='help_taxcouldtaxclass'><p><strong>Tax Class(TaxCloud): </strong>Please enter the tax class for this product. For more info about tax class, please visit <a href="http://taxcloud.net/tic/" target="_blank">http://taxcloud.net/tic/</a></p></span>

2.8c. Save the file

2.9 Open the file shop$db.asp with your favorite editor and
2.9a. Locate below lines, estimate line 2847,

UpdateField "ocurrencyrate", GetSess("Conversionvalue")

2.9b. Below this code, please insert :

'TaxCloud
if lcase(GetConfig("xtaxcloudenable")) = "yes" then
UpdateField "other1", GetSess("TaxCloudCartID")
end if

2.9c. Save the file

3. Upload all amended files above to your server.

4. Log into Super Admin.

5. Execute setup file, eg: http://www.yourdomain.com/yourshoppingcartfolder/youradminfolder/taxcloud_setup.asp.

6. After setup the module, would be redirected to Module configuration page to configure the module:
              
               Enable? - Set to Yes to enable Tax Cloud or No to disable.

               API Login - API login provided by TaxCloud

               API Key - API Key provided by TaxCloud

               USPostal ID - Your UPSP's ID. Used for address verification function.

               Origin Address - Enter your origin address

               Origin Address 2 - Enter your origin address 2 (if exist)

               Origin City - Enter your origin city

               Origin State - Enter your origin state

               Origin Zip/ Post code - Enter your origin zip code

               Tax Class ID for shipping cost - Default is 11010. Please refer to http://taxcloud.net/tic/

               Tax for shipping - Set to Yes if you apply tax for shipping. If this is Yes, then you need to also enter Tax Class ID for                shipping cost in the above field.

               Auto send a Capture request - set to Yes if you want to system to auto send a Capture request to TaxCloud
                
               Default Tax Class - Default Tax Class used on Tax Cloud Module. Used when the field "TaxCloudTaxClass" at                Products table is empty.

               Tax for handling - Set to Yes if you apply tax for handling. If this is Yes, then you need to also enter Tax Class ID for                handling charge in the below field.

               Tax Class ID for handling charge - Default is 11000. Please refer to http://taxcloud.net/tic/

7. Create & configure TaxCloud account at https://taxcloud.net/account/register?ref=F26C8C0 , please refer to "Instructions     for Cart sign-ups-with samples.pdf" for more detail.
7a. Once the account is created successfully, you will receive an email from Taxcloud.net & you need to click on a link in the       email to create a password & activate your account.
7c. Once your account has activated. Please login to to Taxcloud.net & follow the steps below to "Add a Website" & get the       API login detail
      1. After log in to your account, Click on the "Websites" button at the left
      2. Click on the "Add Website" button & fill in a value in the fields below:
         Website Name Or Description: can be any name you like.
         Website URL: The full URL of your website which has TaxClould installed e.g. http://www.mysite.com/shopping
         [ - Select Commerce Platform - ]: select "VP-ASP"
7e. Once a "Website" record has added successfully, you will see the "API ID:" & "API Key:" display at the bottom on the
      page. (You need to enter this info to VPCart's TaxCloud module.)

8. You need to define a Tax Class for each product or else system will get the global setting from the config: xtaxcloudtaxclass
    Step 1. Login to Admin and go to Store > Products
    Step 2. Locate the product that you want to define a Tax Class then click on the icon under Edit column.
    Step 3. At Product Setup page, locate a field "Tax Class(TaxCloud)" under section "Pricing and Stock Control"
    Step 4. Enter a Tax Class ID. e.g. 20010
                For Tax Class ID please refer to http://taxcloud.net/tic/
    Step 5. Click on the Update record button to save.


***********************************************************************************

D. HOW IT WORKS
===============
1. Tax Cloud at the front end.
    Step 1. Visit the front store & add item to shopping cart as normal
    Step 2. At page shopcustomer.asp, fill up all the customer and shipping information & click "Continue" button
    Step 3. At this point, system will send all the order information to TaxCloud's server then the server will returned a Tax rate                 & display at shopcreateorder.asp
    Step 4. At page shopcreateorder.asp, click on Order Now button to process to payment.
    Step 5. At page shopcheckout.asp, select a payment method to pay for this order & system will redirects your to                 Shopthanks.asp page.
    Step 6. At page Shopthanks.asp, system will send a "Authorized" request to TaxCloud to authorize the transaction.

2. "Capture" the transaction in the admin when Process Order:
If the config "xtaxcloudadminautocapture" is set to Yes, system will send a "capture" request to TaxCloud when you set the order to "Processed" in the admin
Once this transaction has captured. you will see there is a date under "Completed" column in the at Your Sales Tax Transactions at TaxClould.net

***********************************************************************************

E. FILE NEED TO BE MODIFIED
=================
    - shopcustomerdesign.asp
    - shopcartformat.asp
    - shopthanks.asp
    - shopcustomer.asp
    - shopmysqlsubs.asp
    - shop$db.asp
    - admin/help/shoph_producthelp.asp
    - admin/shopa_addproduct.asp
    - admin/shopa_displayorders.asp

***********************************************************************************

F. CONFIGURATION SETTINGS CHANGED
New configs :
xtaxcloudenable
xTaxCloudAPIlogin
xTaxCloudAPIkey
xTaxCloudUspsId
xTaxCloudOriginAddress
xTaxCloudOriginAddress2
xTaxCloudOriginCity
xTaxCloudOriginState
xTaxCloudOriginZipcode
xTaxCloudShippingTaxClassID
xTaxCloudTaxforshipping
xtaxcloudadminautocapture
xtaxcloudtaxclass
xTaxCloudTaxforhandling
xTaxCloudHandlingTaxClassID

***********************************************************************************

G. DATABASE TABLES MODIFIED
===========================
1. Products table :
New field: TaxCloudTaxClass

2. Orders table :
New field: TaxCloudSendStatus

***********************************************************************************

H. LANGUAGE SETTINGS CHANGED
============================
New Languages:
langTaxCloudTaxClass - Tax Class(TaxCloud)
langTaxCloudclicklink - Please click on the link below to retrieve your Exemption Certificate<br />
langTaxClouddisplayCert - Display my Tax Exemption Certificate
langTaxCloudTaxcertid - Exemption certificate ID
langTaxCloudenterTaxcert - Please enter your Exemption Certificate ID below

***********************************************************************************

I. CHANGE LOGS
============================
2012.08.24 - Bugs : execute TaxCloud routine when destination country is equal to US
2012.09.05 - Enhancement - Add new config xTaxCloudTaxforshipping.
2013.03.27 - fixes : destination country does not save to session
2013.05.01 - fixes : not sending order info to Taxcould if xcountryrequired = No
2013.05.17 - fixes : enable zip4 for destination address
2015.06.19 - Compatible with VPCart 8.00
2016.02.25 - XML: To support TLS1.2
To make routine TestObject on TaxCloud declare variable properly
2017.02.07 - fixes : Add tax for handling. New config xTaxCloudTaxforhandling and xTaxCloudHandlingTaxClassID
2017.02.24 - Bug Fix: Not insert correct value if from PayPal transaction
2018.04.26 - Compatible with v9

J. TROUBLESHOOTING
============================
If you found no transactions are showing up in TaxCloud, you maybe have incorrect configuration in your VPCart administration that causing it.
To fix such case, please check if your config xdefaultcountry is blank or not. If it is blank, you should fill in with value.
If config xdefaultcountry value is blank, the system will not send customers order details properly to TaxCloud.

K. COPYRIGHT NOTICE
============================

Copyright (c) 1999-2019 Rocksalt International Pty. Ltd.
All rights reserved.

This software and documentation constitute a published work and
contains valuable trade secrets and proprietary information
belonging to Rocksalt International Pty. Ltd. .
None of the foregoing material may be copied,
duplicated or disclosed without the express written permission
of Rocksalt International Pty. Ltd. .

LICENSEE ACCEPTS VP-ASP Shopping Cart "AS IS" "WITH ALL FAULTS",
Rocksalt International Pty. Ltd. accepts no responsibility for the
operation or performance of the VP-ASP Shopping Cart.
The entire risk of use and consequences of use of the
VP-ASP Shopping Cart falls completely on the Licensee
and Rocksalt International Pty. Ltd. shall not be liable in any respect
for any claims, loss or injury alleged to have resulted
from use of or in reliance on VP-ASP Shopping Cart.

Licensee acknowledges that it has read the foregoing
disclaimers of warranty and limitation of liability
and understands that Licensee assumes
the entire risk of using VP-ASP Shopping Cart.


***********************************************************************************

L. TERMS AND CONDITIONS
============================
ROCKSALT INTERNATIONAL GRANTS TO THE LICENSEE A NON-EXCLUSIVE,
NON-SUB LICENSABLE, NONTRANSFERABLE LICENSE
TO INSTALL AND USE THIS APPLICATION ON A SINGLE DOMAIN FOR
A SINGLE SHOP.

THE CODE IN THE APPLICATION MAY BE MODIFIED FOR USE IN
SETTING UP A SINGLE SHOPPING SITE ON THE WORLD WIDE WEB.

LICENSEE MAY MAKE A COPY OF THE APPLICATION FOR
BACK-UP AND ARCHIVAL PURPOSES, PROVIDED THAT ANY COPY
MUST CONTAIN ALL PROPRIETARY NOTICES INCLUDED
WITH THE APPLICATION.

LICENSEE IS PROHIBITED FROM SELLING OR DISTRIBUTING
THE APPLICATION IN ANY MANNER.

LIMITATION OF LIABILITY.

ROCKSALT INTERNATIONAL AND ITS LICENSORS SHALL
NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE OR ANY
THIRD PARTY AS A RESULT OF USING OR DISTRIBUTING THIS
APPLICATION.

IN NO EVENT WILL ROCKSALT INTERNATIONAL OR ITS LICENSORS
BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA,
OR FOR DIRECT, INDIRECT, SPECIAL,
CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES,
HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LI
ARISING OUT OF THE USE OF OR INABILITY TO USE THE SOFTWARE,
EVEN IF ROCKSALT INTERNATIONAL HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.