What MIVA Says
Modules including this feature provide MIVA Merchant the ability to collect the appropriate information and charge the appropriate sales taxes.
Parameters:
Return Type:bool
<MvFUNCTION NAME="TaxModule_Order_Hide_Fields" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
What MIVA Says
The UI calls this function when displaying the OSEL screen.
The purpose of this function is to insert hidden fields on checkout screens, so as to carry data through, as form variables, from earlier screens, e.g. OINF, through later ones, e.g. OSEL, until the shopper is able to submit a form with Action = CTAX.
Default Return: 1
Parameters:
Return Type:cslist
<MvFUNCTION NAME="TaxModule_Order_Fields" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="">
</MvFUNCTION>
What MIVA Says
The UI calls this function at each checkout screen to determine what, if any tax fields to display.
The function should return a comma-separated list of field ids of the form id[,id,id,id-].
Default Return: NULL
Example 1:
<MvFUNCTION NAME="TaxModule_Order_Fields" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="test1,test2">
</MvFUNCTION>
Parameters:
Return Type:string
<MvFUNCTION NAME="TaxModule_Order_Prompt" PARAMETERS="module var,field_id" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="">
</MvFUNCTION>
What MIVA Says
This function returns a text string for display beside the tax field identified by the field_id parameter (set in TaxModule_Order_Fields).
Default Return: NULL
Example 1:
<MvFUNCTION NAME="TaxModule_Order_Prompt" PARAMETERS="module var,field_id" STANDARDOUTPUTLEVEL="">
<MvIF EXPR="{ l.field eq 'test1'}">
<MvFUNCTIONRETURN VALUE = "First Test Field:">
<MvELSEIF EXPR="{ l.field eq 'test2'}">
<MvFUNCTIONRETURN VALUE = "Second Test Field:">
</MvIF>
</MvFUNCTION>
Parameters:
<MvFUNCTION NAME="TaxModule_Order_Required" PARAMETERS="module var,field_id" STANDARDOUTPUTLEVEL="">
</MvFUNCTION>
What MIVA Says
The UI consults this function to know whether or not a field needs validation, such as would be necessary to make sure the shopper made a selection on a field.
The function should return 1 to indicate that yes, the field does need validation. Otherwise, the function returns a zero (i.e. not a required field).
Default Return: NULL
Parameters:
Return Type:boolinv
<MvFUNCTION NAME="TaxModule_Order_Invalid" PARAMETERS="module var,field_id" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="0">
</MvFUNCTION>
What MIVA Says
The UI consults this function to determine whether to highlight a given field so as to indicate that the last information the shopper entered in that field was invalid. The function itself may make that determination based on an invalidity flag set in TaxModule_Order_Validate. The strategy is the same as used for PaymentModule_Payment_Invalid and PaymentModule_Payment_Validate.
The function should return a 1 to indicate that the field submission is invalid. If there is no problem with the field submission, then the function should return 0.
Default Return: NULL
Example 1:
<MvFUNCTION NAME="TaxModule_Order_Invalid" PARAMETERS="module var,field_id" STANDARDOUTPUTLEVEL="">
<MvIF EXPR="{ miva_variable_value( 'g.apitest_taxfield_' $ l.field $ '_invalid' ) }">
<MvFUNCTIONRETURN VALUE="1">
</MvIF>
<MvFUNCTIONRETURN VALUE="">
</MvFUNCTION>
Parameters:
<MvFUNCTION NAME="TaxModule_Order_Field" PARAMETERS="module var,field_id" STANDARDOUTPUTLEVEL="">
</MvFUNCTION>
What MIVA Says
This function creates the HTML code needed to display the tax field identified by the field_id parameter (set in TaxModule_Order_Fields).
Default Return: NULL
Example 1:
<MvFUNCTION NAME="TaxModule_Order_Field" PARAMETERS="module var,field_id" STANDARDOUTPUTLEVEL="">
<MvIF EXPR="{ l.field eq 'test1'}">
<MvEVAL EXPR = "{ '<input type="text" name="apitest_taxfield_test1" value="'$ encodeattribute(g.apitest_taxfield_test1) $'" size="25">
' }">
<MvELSEIF EXPR="{ l.field eq 'test2'}">
<MvEVAL EXPR = "{ '<input type="text" name="apitest_taxfield_test2" value="'$ encodeattribute(g.apitest_taxfield_test2) $'" size="25">
' }">
</MvIF>
</MvFUNCTION>
Parameters:
Return Type:bool
<MvFUNCTION NAME="TaxModule_Order_Validate" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
What MIVA Says
MIVA Merchant calls Action_Save_OrderInformation in response to form submission containing Action=ORDR, as is the case with the form shoppers submit from the OINF page. The function provides an opportunity to check if the tax information is acceptable.
One use is to set invalidity flags for consultation by TaxModule_Order_Invalid. TaxModule_Order_Invalid can check the status of a given flag, perhaps an id number, and decide whether to declare the submission invalid on that basis. (For another implementation of the same strategy, see PaymentModule_Payment_Validate and PaymentModule_Payment_Invalid.
If the function returns 0, i.e. failure, the UI will return to the previous page. The UI will know, from the invalidity flags, that the previous submissions were invalid and will highlight the relevant input fields appropriately.
The function should return 1 to indicate success or 0 to indicate failure.
Default Return: 1
Example 1:
<MvFUNCTION NAME="TaxModule_Order_Validate" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
<MvIF EXPR="{ NOT g.apitest_taxfield_test1 }">
<MvASSIGN NAME="g.apitest_taxfield_test1_invalid" VALUE="1">
<MvASSIGN NAME="l.invalid" VALUE="1">
</MvIF>
<MvIF EXPR="{ NOT g.apitest_taxfield_test2 }">
<MvASSIGN NAME="g.apitest_taxfield_test2_invalid" VALUE="1">
<MvASSIGN NAME="l.invalid" VALUE="1">
</MvIF>
<MvIF EXPR="{ l.invalid }">
<MvFUNCTIONRETURN VALUE = "0">
</MvIF>
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
Parameters:
Return Type:bool
<MvFUNCTION NAME="TaxModule_Calculate_Basket" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
What MIVA Says
MIVA Merchant calls this function when responding to a form submission from the shopper containing Action = CTAX.
This function should contain the instructions necessary to insert a ‘TAX’ basket charge in the basket.
Return 1 on success, 0 on failure.
Default Return: 1
Example 1:
<MvFUNCTION NAME="TaxModule_Calculate_Basket" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
<MvASSIGN NAME = "l.basket_charge:basket_id" VALUE = "{ g.Basket:basket_id }">
<MvASSIGN NAME = "l.basket_charge:module_id" VALUE = 0>
<MvASSIGN NAME = "l.basket_charge:type" VALUE = "TAX">
<MvASSIGN NAME = "l.basket_charge:descrip" VALUE = "Forced Test Tax">
<MvASSIGN NAME = "l.basket_charge:amount" VALUE = "1.23">
<MvASSIGN NAME = "l.basket_charge:disp_amt" VALUE = "1.23">
<MvASSIGN NAME = "l.basket_charge:tax_exempt" VALUE = 0>
<MvFUNCTIONRETURN VALUE = "{ [ g.Module_Library_DB ].BasketCharge_Insert( l.basket_charge ) }">
</MvFUNCTION>
Parameters:
Return Type:bool
<MvFUNCTION NAME="TaxModule_ProcessOrder" PARAMETERS="module var" STANDARDOUTPUTLEVEL="">
<MvFUNCTIONRETURN VALUE="1">
</MvFUNCTION>
What MIVA Says
MIVA Merchant calls this function after creating an order, but before calling FulfillmentModule_Process_Order.
The function provides an opportunity to perform operations at the time the shopper places the order, such as calculating taxes real time.
Default Return: 1
Return Types are expressed in the document by the following codes:
For information and function requirements for the various MIVA Merchant 5 Module API Feature Codes see the following:
batchreport,
component,
component_prov,
currency,
custrt,
data_domain,
data_store,
export,
externalreq,
fields_cust,
fields_prod,
fulfill,
import,
log,
not_fields,
payment,
provision_store,
shipping,
storeselui,
storewizard,
system,
tax,
upload,
util,
wizard,
vis_affil,
vis_affilbe,
vis_category,
vis_categorybe,
vis_cust,
vis_custbe,
vis_domain,
vis_fulfill,
vis_log,
vis_order,
vis_payment,
vis_product,
vis_productbe,
vis_shipping,
vis_store,
vis_system,
vis_util,
vis_wizard
This document is copyright 2005-2006 4TheBest eCommerce Solutions and was last generated using Serade on 01/13/2006 23:04:54. It is permissible to place a copy of this document in it's current or altered form on your website as long as you leave the copyright notice along with the links to the websites referenced intact.