*Replace texts in RED. SF/UC = Service Fee/Upcharge.
❖ When using a Single Product component, the following script should be used:
value = data.{SingleProductAPIname}.productSubtotal * {SF/UC rate in decimal form};
➔ For example, 5% is the rate for merchant’s service fee/upcharge and the Single Product component's API name is singleproduct. Calculated value script would be:
value = data.singleproduct.productSubtotal * 0.05;
❖ When using multiple Single Product component, the script should be:
value = (data.{SingleProductAPIname}.productSubtotal + data.{SingleProductAPIname}.productSubtotal + data.{SingleProductAPIname}.productSubtotal) * {SF/UC rate in decimal form};
➔ For example, 8% is the rate for merchant’s service fee/upcharge and the Single Product component's API name is singleproduct, singleproduct1 and singleproduct2 respectively, calculated value script would be:
value = (data.singleproduct.productSubtotal + data.singleproduct1.productSubtotal + data.singleproduct2.productSubtotal) * 0.08;
*To learn how to get the component's API name, click here.
DOUBLE CHECK: Input of API name on the script is CASE SENSITIVE. Please double check.