Summary

This page contains two guides that outline the technical instructions for using the Sift Salesforce Commerce Cloud (SFCC) Cartridge to integrate Sift risk assessments into an SFCC storefront.

JS Controllers Version

Component Overview

Functional Overview

The Sift SFCC Cartridge enables merchants to easily integrate Sift services to evaluate risk, preventing fraud and abuse in their SFCC storefronts. The Cartridge provides the following features for merchants on the SFCC platform:

  • Generate a Sift Score to measure the risk of transactions and orders during checkout.
  • Update the order status automatically based on a Sift Score.
  • Update the order status automatically by applying a decision using a Sift Workflow for a fully automated flow.
  • Cancel orders on the SFCC platform.

All integration work can be performed within the Sift sandbox environment. If the Sift service is down, the SFCC storefront will continue to operate. Any errors are saved in the log file.

Limitations, Constraints

Use of the Sift SFCC Cartridge requires credentials and keys from Sift. Implementation and verification have been done for EN-US locale and USD currency.

Compatibility

The Cartridge is designed for Salesforce Commerce Cloud API version 20.1 (Compatibility Mode: 19.10) with SiteGenesis controllers version 104.1.4.

Privacy and Payment

The Cartridge can collect and process user profile information or billing information. For additional privacy information, please contact your Sift Account Manager.

General Implementation

Installing Cartridge on Sandbox
  1. Download the zip file for the Cartridge to your local machine and extract it.
  2. Open UX Studio.
  3. Import the downloaded Cartridge. Select on import screen:
  4. Link cartridge to the sandbox. Select sandbox connection and select Properties. Select Project Reference and check in.
Set Up Business Manager
  1. Go to Business Manager -> Site -> Manage Sites. Select the correct site, then select Settings tab. In the cartridge path add “int_sift” and “int_sift_controllers” cartridges:
  2. Go to Administration -> Site Development -> Site Import & Export.
  3. Upload sift.zip from the metadata folder.
  4. Make import sift.zip.
Example of Configuring Cartridge via Site Preferences

Go to Business Manager: Sites -> Your Site -> Site Preferences -> Custom Site Preferences -> Sift

Below is an example of how to complete the fields in the administration area:

  • Enable Sift cartridge — Turns onoff Sift integration.
  • Sift API Beacon key — API key for authorization service for JS components (key can be found within the Sift Console).
  • Sift API key — API key for authorization service (key can be found within the Sift Console).
  • Sift API Signature key — Key for authenticating Sift Webhooks (can be found within the Sift Console).
  • Enable Sift synchronous Score decision — Enable/Disable Sift processing synchronous decision using Sift Score.
  • Enable Sift synchronous Workflow decision — Enable/Disable Sift synchronous Workflow decision processing.

When workflow decision is enabled, score decision is ignored.

Use next suffixes in decision IDs for decision settings on Sift Dashboard (Automate — Decisions)

Approve: '_ok_'

Reject: '_bad_'

Review: '_review_'

Example of Decision ID: order_looks_bad_payment_abuse

  • Sift Score limit value — Sift Score limit value for synchronous decision flow.
  • Enable Sift asynchronous decision — Enable/Disable processing Sift asynchronous decision.

Custom Code

Perform Changes in Templates
  1. YOUR_CARTRIDGE_core/cartridge/templates/ default/checkout/pt_checkout.isml

    Put the following rows in line 27:
    <!-- Sift section -->
    <isinclude url="${URLUtils.url('Sift-RenderSnippet')}"/>
Perform Changes in Controllers
  1. YOUR_CARTRIDGE_controllers/cartridge/controllers/ Account.js

    Put the following rows in line 430:
    <!-- Sift section -->
    <isinclude url="${URLUtils.url('Sift-RenderSnippet')}"/>
    // sift integration require('*/cartridge/scripts/sift/eventsHelper').createAccount(profileValidation);
    // /sift integration
  2. YOUR_CARTRIDGE_controllers/cartridge/controllers/ COBilling.js

    Put the following row in line 434:
    require('*/cartridge/scripts/sift/models/modelsHelper').saveFirst6InPaymentInstrument();
  3. YOUR_CARTRIDGE_controllers/cartridge/controllers/ COPlaceOrder.js

    Put the following rows in line 28:
    var siftEventsHelper = require('*/cartridge/scripts/sift/ eventsHelper');
    var siftDecisionHelper = require('*/cartridge/scripts/sift/ decisionHelper');
    Put the following rows in line 152:
    var siftCheck = siftEventsHelper.placeOrder(order. orderNo);
    // SIFT_REJECT: Do not charge the credit card and block the order.
    if (siftCheck && siftCheck == siftDecisionHelper.SIFT_ REJECT) {    
      return Transaction.wrap(function () {
        OrderMgr.failOrder(order, true);
        return {
          error: true,
          PlaceOrderError: new Status(Status.ERROR, 'confirm.error.technical')
        };
      });
    }
Perform Changes in Payment Processor
  1. YOUR_CARTRIDGE_controllers/cartridge/scripts/ payment/processor/BASIC_CREDIT.js

    Put the following rows to Handle() function in line 37:
    // Sift integration
    var cartInfo = {
      cardNumber: cardNumber, expirationMonth: expirationMonth, expirationYear: expirationYear
    };
    require('*/cartridge/scripts/sift/models/modelsHelper').saveFirst6InSession(cartInfo);
    // End of Sift integration
    Put the following rows to Authorize() function in line 74:
    var siftCheck = siftEventsHelper.billingStep(orderNo, true, orderNo);
    if (siftCheck && siftCheck == siftDecisionHelper.SIFT_ REJECT) {
      return {error: true}; 
    }
    Argument “true” used in function “billingStep” indicates authorisation success. For authorisation decline, change this argument with value “false”.

Webhooks

For Webhooks settings you need to set up the correct URL for callback, with a route to SiftHook controller. There are 3 options:

Approve: SiftHook-Approve

Decline: SiftHook-Decline

Review: SiftHook-Review

Use next structure for URLs: https://domain.net/SiftHook-{decision type}

For example:

https://siftscience01-tech-prtnr-na08-dw.demandware.net/on/demandware.store/Sites-SiteGenesis-Site/default/ SiftHook-Decline

Customizations

In case you have custom specifications for users profile — account type, you can update attribute $account_types for object “customer model” in int_sift/cartridge/scripts/sift/ models/customerModel.js, line 27, as it is described on Sift documentation portal https://developers.sift.com/docs/curl/events-api/reserved-events/create-account

SFRA Version

Component Overview

Functional Overview

The Sift SFCC Cartridge enables merchants to easily integrate Sift services to evaluate risk, preventing fraud and abuse in their SFCC storefronts. The Cartridge provides the following features for merchants on the SFCC platform:

  • Generate a Sift Score to measure the risk of transactions and orders during checkout.
  • Update the order status automatically based on a Sift Score.
  • Update the order status automatically by applying a decision using a Sift Workflow for a fully automated flow.
  • Cancel orders on the SFCC platform.

All integration work can be performed within the Sift sandbox environment. If the Sift service is down, the SFCC storefront will continue to operate. Any errors are saved in the log file.

Limitations, Constraints

Use of the Sift SFCC Cartridge requires credentials and keys from Sift. Implementation and verification have been done for EN-US locale and USD currency.

Compatibility

The Cartridge is designed for Salesforce Commerce Cloud API version 20.1 (Compatibility Mode: 19.10) with SiteGenesis controllers version 104.1.4.

Privacy and Payment

The Cartridge can collect and process user profile information or billing information. For additional privacy information, please contact your Sift Account Manager.

General Implementation

Installing Cartridge on Sandbox
  1. Download the zip file for the Cartridge to your local machine and extract it.
  2. Open UX Studio.
  3. Import the downloaded Cartridge. Select on import screen:
  4. Link cartridge to the sandbox. Select sandbox connection and select Properties. Select Project Reference and check in.
Set Up Business Manager
  1. Go to Business Manager -> Site -> Manage Sites. Select the correct site, then select Settings tab. In the cartridge path add “int_sift” and “int_sift_controllers” cartridges:
  2. Go to Administration -> Site Development -> Site Import & Export.
  3. Upload sift.zip from the metadata folder.
  4. Make import sift.zip.
Example of Configuring Cartridge via Site Preferences

Go to Business Manager: Sites -> Your Site -> Site Preferences -> Custom Site Preferences -> Sift

Below is an example of how to complete the fields in the administration area:

  • Enable Sift cartridge — Turns onoff Sift integration.
  • Sift API Beacon key — API key for authorization service for JS components (key can be found within the Sift Console).
  • Sift API key — API key for authorization service (key can be found within the Sift Console).
  • Sift API Signature key — Key for authenticating Sift Webhooks (can be found within the Sift Console).
  • Enable Sift synchronous Score decision — Enable/Disable Sift processing synchronous decision using Sift Score.
  • Enable Sift synchronous Workflow decision — Enable/Disable Sift synchronous Workflow decision processing.

When workflow decision is enabled, score decision is ignored.

Use next suffixes in decistion IDs for decision settings on Sift Dashboard (Automate — Decisions)

Approve: '_ok_'

Reject: '_bad_'

Review: '_review_'

Example of Decision ID: order_looks_bad_payment_abuse

  • Sift Score limit value — Sift Score limit value for synchronous decision flow.
  • Enable Sift asynchronous decision — Enable/Disable processing Sift asynchronous decision.

Custom Code

Perform Changes in Templates

Note: all changes are already made in int_sift_sfra cartridge.

  1. int_sift_sfra/cartridge/templates/default/common/ layout/checkout.isml Put the following rows in line 15:
    <!-- Sift section -->
    <isinclude url="${URLUtils.url('Sift-RenderSnippet')}"/>
  2. int_sift_sfra/cartridge/scripts/hooks/payment/ processor/basic_credit.js On line 131 is a function billingStep:
    var siftCheck = siftEventsHelper. 
    billingStep(orderNumber, true, orderNumber);
    Argument “true” used in function “billingStep” indicates authorisation success. For authorisation decline, change this argument with value “false”.

Webhooks

For Webhooks settings you need to set up the correct URL for callback, with a route to SiftHook controller. There are 3 options:

Approve: SiftHook-Approve

Decline: SiftHook-Decline

Review: SiftHook-Review

Use next structure for URLs: https://domain.net/SiftHook-{decision type}

For example:

https://siftscience01-tech-prtnr-na08-dw.demandware.net/on/demandware.store/Sites-SiteGenesis-Site/default/ SiftHook-Decline

Customizations

In case you have custom specifications for users profile — account type, you can update attribute $account_types for object “customer model” in int_sift/cartridge/scripts/sift/ models/customerModel.js, line 27, as it is described on Sift documentation portal https://developers.sift.com/docs/curl/events-api/reserved-events/create-account

Any questions? We're happy to talk it through.