SFCC Cartridge
...
Checkout
Phone Orders
7 min
phone orders for sfcc for orders placed by customers over the phone, we offer a proprietary webid phone solution the overview and steps for integrating are listed below overview the forter customer web id phone solution allows forter to provide a fraud decision on orders that your customer support team may place on behalf of a customer over the phone when a customer calls into your support center to place an order, your customer support rep should instruct the customer to visit your site and read the 9 digit customer web id that appears at the bottom of your website's screen your customer support representative should then enter this number into a dedicated customerwebid field in your sfcc admin so that it is included with the rest of the order data this 9 digit customer web id is unique to each end user and will help forter's models in connecting certain cyber and behavioral data points to the order being placed over the phone integration steps step 1 add the javascript to the front end of your site in the case of sfcc, the javascript should automatically get injected into your site's front end via the checkout isml and the page isml templates however, you may need to manually add the js by pasting the script from the portal into the relevant closing \</html> body tags step 2 render the customer web id on the website's frontend forter's javascript will automatically render a 9 digit code that needs to be exposed to the customer on the site when they view the page you can control where on the page this customer web id is exposed and how it is styled it should be visible to the customer so that that they can read it to your customer support rep when they place an order over the phone step 3 handle input of the customer web id in our sfcc admin, you'll need to create a field for your customer support team to enter the customer web id that the customer reads when placing an order over the phone this field should only be visible or accessible to dedicated customer support staff if you already have a dedicated interface in your sfcc business manager for placing customer orders, we recommend adding the customer web id input field there step 4 send the customer web id to forter in your forterorder js file of the cartridge, add logic to update the ordertype, set the connectioninformation object fields to empty strings, and include the forter customer web id in the api call that is made to forter for a decision for example, in the forterorder(args, request, authorizationstep) function, you can include logic to determine ordertype , include the phoneorderinformation customerwebid , phoneorderinformation callerid , and modify the connectioninformation object based on whether the webid field is populated and the order is a phone order the example code below shows where this logic is recommended but it should be further modified based on your exact checkout flow and accepted order types function forterorder(args, request, authorizationstep) { var forterlogger = require(' /cartridge/scripts/lib/forter/forterlogger'); var log = new forterlogger('forterorder ds'); var order = args order; var paymentinstruments = order getpaymentinstruments(); var payment = null; var authresponse = null; var shipment = null; var i; for (i = 0; i < paymentinstruments length; i++) { var paymentinstrument = paymentinstruments\[i]; if (paymentinstrument paymentmethod === 'credit card') { // adjust to the existing payment instruments payment = paymentinstrument; authresponse = json parse(paymentinstrument custom authorize net authorization json); } else if (paymentinstrument paymentmethod === 'paypal' || paymentinstrument paymentmethod === 'bml') { // adjust to the existing payment instruments payment = paymentinstrument; authresponse = paymentinstrument custom paypal transaction details response; } } function determineordertype(order) { // example function to determine ordertype if (order webid && order webid length === 9) { return 'phone'; } return 'web'; } function connectioninformationrenderer(order, request) { //example function for webid if (order webid) { this customerip = ''; this useragent = ''; this fortertokencookie = ''; } this customerip = request httpremoteaddress; // required this useragent = request httpuseragent; this fortertokencookie = ''; for (var i = 0; i < request httpcookies cookiecount; i++) { if (request httpcookies\[i] name === 'fortertoken') { this fortertokencookie = request httpcookies\[i] value; // required } } } this phoneorderinformation = { 	 customerwebid = order webid trim(); // webid field for phone orders callerid = order callerphone; // phone number used when customer called to place an order callerfirstname = order phonefirstname\[0] || ''; // modify to pass first name of caller callerlastname = order phonelastname\[1] || ''; // modify to pass last name of caller 	}; this orderid = order originalorderno; this ordertype = determineordertype(order); this timesenttoforter = (new date()) gettime(); this checkouttime = number((order creationdate gettime() / 1000) tofixed()); // required //must be seconds, not milliseconds this connectioninformation = connectioninformationrenderer(order, request); // required this authorizationstep = authorizationstep; } step 5 test the flow in your sandbox environment, add a 9 digit code that is rendered by the js on the front end of your site to the dedicated customer web id field that you've created in your sfcc business manager submit the rest of the order with the current phone order placement flow and then check the formatting of the api request in your forter api request viewer https //portal forter com/app/developer/integration tools/all requests/all in the request viewer, the "connectioninformation" object should have primarily empty strings, the "ordertype" should be "phone" and the customerwebid and callerfirstname , callerlastname , and callerid , should be visible in a dedicated "phoneorderinformation" object