The Salesforce B2C Platform, formerly known as Demandware, provides a comprehensive commerce
solution for merchants, including seamless payment acceptance. Through the integration of Shift4's B2C
Cartridge, merchants utilizing B2C Storefronts can securely process all transactions, leveraging the core
capabilities of Shift4 for payment processing.
This cartridge provides support for both the SiteGenesis (SG)
and Storefront Reference Architecture (SFRA) integration types.
This document serves as a configuration guide for the Shift4 Salesforce B2C Commerce Cloud
app. The
following sections will walk you through the configuration of Cartridges to your B2C
Commerce Cloud
Platform and completing the Setup Assistant. This guide is meant to walk you
through configuring and
implementing Shift4 payments with SiteGenesis(SG) and Storefront
Reference Architecture(SFRA).
In order to access your B2C Commerce Cloud sandbox and/or your B2C Commerce Cloud
Account
Manager, Multi-Factor Authentication must be utilized to access your Sandbox. Session
timeouts will
occur frequently if the user does not do anything during their session on the
Business Manager Module.
You can use the Salesforce Authenticator app for access and can
download the app in the link below.
If you need to test the Shift4 integration in a sandbox, you will need to create a B2C sandbox,
and set up a
demo site. Once your sandbox is created, log into your sandbox, then navigate to
Administration > Site
Development > Site Import & Export
NOTE: If your project requires support for the legacy SiteGenesis architecture, you will need
to
follow the same steps listed above, except import the “SiteGenesis Demo Site”.
B2C cartridges are uploaded using a tool called dwupload, which is an NPM package. This tool is
installed
with the NPM program
NOTE: Before running this command in your terminal please ensure you have
access to your B2C
instance!
NOTE: Ensure that the code-version in your dw.json file matches the active code version in
Administration > Site Development > Code Deployment
This will prompt you for your B2C login information, and will auto-create the dw.json file. It will
also ask
you for the name of any Sites that you wish to activate this cartridge for. Use this if you
would like to
deploy to a different B2C Instance, a different code version, or a different
storefront site.
This will utilize the dwupload tool to re-upload all of the Shift4 cartridges to the B2C instance
specified in
your dw.json file. To confirm that this worked properly, your terminal output
should have a few lines that
look like this: “Successfully uploaded cartridge: int_shift4”.
NOTE:
These commands must be executed in a terminal from the Shift4 cartridge directory.
Your
file explorer should have an option to “open a terminal here” if you right click on the
folder.
All metadata files are found under the metadata/ folder, as XML files. These files will need to
be uploaded
and imported to your B2C instance in order for the Shift4 cartridges to function
properly.
Each storefront site in your B2C instance may have different payment processors and payment
methods.
The Shift4 cartridge includes metadata for Shift4 Payment Providers
(SHIFT4_CREDIT and SHIFT4_APM),/
as well as Payment Method overrides to set
SHIFT4_CREDIT and SHIFT4_APM as the active payment
processor for the CREDIT_CARD and DW_APPLE_PAY payment methods, respectively. When you run the
npm run configure
command, you may specify the storefront sites you would like to add the
Shift4 payment
providers to. Follow these steps to import this metadata:
The Payment Method overrides can be found in Merchant Tools > Ordering > Payment Methods:
The Shift4 integration needs to perform web-service callouts to api.shift4.com when processing
payments. In order to do that, B2C requires a configuration that whitelists api.shift4.com. Follow
these
steps to create that configuration:
The Shift4 cartridge utilizes a few custom fields that extend the following system object types:
Follow these steps to import these custom fields:
Now that we’ve successfully imported our metadata, we can move on to enabling our cartridges
to utilize
the Shift4 Setup for B2C.
Uploading the Shift4 cartridges with npm run uploadCartridge does not mean the cartridge is
active yet.
You need to enable specific cartridges for each site within your B2C instance in order
for the cartridges to
function properly.
The Business Manager cartridges give you access to the Shift4 Setup page. This is a streamlined
setup
assistant that allows you to connect to the Shift4 API and specify other preferences on a
storefront site
basis. Follow these steps to enable the Business Manager cartridges:
Once the Business Manager cartridges are enabled, you’ll need to grant permission to the
Shift4 Business
Manager modules on a per-role basis. The following steps show how to grant
permissions for the
Administrator role, but you can repeat these steps for any other role you
would like to allow Shift4 Setup
access.
Apple Pay is supported in this B2C integration with Shift4. In order to successfully process
payments using
Apple Pay, we have to configure our Apple Pay settings in the Business Manager
as well as register the
storefront domain with Apple Pay. The Shift4 cartridge includes an Apple
Pay domain registration
endpoint, which requires some configuration to set up.
The following steps will ensure that the root endpoint of your B2C domain points at the
storefront of your
choice. This will enable Apple Pay to find the domain verification file at the
/.well-known/apple-
developer-merchantid-domain-association endpoint.
{
"__version": "1",
"settings": {
"http-host": "my.storefront.com",
"https-host": "my.storefront.com",
"default": true,
"site-path": "/"
},
"my.storefront.com": [
{
"host": "my.storefront.com",
"path": "/",
"locale": "en_US",
"if-site-path": "/"
}
]
}
Now that we’ve set up our Hostname Alias for our storefront site, we can register our Apple Pay
domain in
our Shift4 account.
Now that we’ve created a Hostname Alias and added our Apple Pay domain in our Shift4
account, we can
now proceed to configuring our Apple Pay settings in our B2C Business
Manager.
NOTE: Apple Pay can only be used in Safari
The Shift4 Setup Assistant will need to be completed to allow your cartridges in your B2C
instance to make
outbound calls to Shift4 and customize the behavior of the application. To
access the Setup Assistant,
navigate to Merchant Tools < Shift4 < Setup:
In order for the cartridge to make outbound API calls to Shift4, the user will need to provide
their Shift4
Secret Keys. In the business manager, a section will be provided that allows the user
to input their Test and
Live Mode Secret Keys.
There will be two settings that the users can access in the Shift4 Setup to customize the
behavior of the
application. These include the Current Mode and Capture Immediately fields.
Users can choose between
the production or test mode for the storefront and can set the option to capture
funds immediately when
a charge is created with a toggle.
There are a few card types in Shift4 documentation https://dev.shift4.com/docs/testing that are
not
automatically included and enabled in the Business Manager. These include Maestro, JCB,
and Diners
Club International(not enabled). In order to add these cards as supported payment
methods, navigate to
Merchant Tools > Ordering > Payment Methods.