SFCC Cartridge
...
Pre-Auth Credit Card
Controllers
2 min
controllers pre auth integration the code and diagrams below outline the necessary updates needed in order to integrate the forter cartridge into a pre auth flow for a controllers based sfcc storefront update the coplaceorder js add the following code to your existing handlepayments (order) function within your coplaceorder js file var argordervalidate = { order order, ordervalidateattemptinput 1 }, fortercontroller = require('int forter/cartridge/controllers/fortervalidate'), forterdecision = fortercontroller validateorder(argordervalidate); // in case if no response from forter, try the call one more time if (forterdecision result === false && forterdecision ordervalidateattemptinput == 2) { var argordervalidate = { order order, ordervalidateattemptinput 2 }, fortercontroller = require('int forter/cartridge/controllers/fortervalidate'), forterdecision = fortercontroller validateorder(argordervalidate); } if (forterdecision jsonresponseoutput processoraction == 'void') { if (!empty(forterdecision placeordererror)) { return {error true, fortererrorcode forterdecision placeordererror}; } else { return {error true}; } } placement of argordervalidate the below screenshot and commented code below illustrate the recommended placement of the code within the handlepaymenttransaction function