Configure Salesforce Payments for Storefront Next

Salesforce Payments streamlines the checkout experience for shoppers in Storefront Next for B2C Commerce. Salesforce Payments is a native solution that supports multiple payment methods and payment gateways, such as Adyen, Stripe, and PayPal.

  • Purchase a Salesforce Payments license by contacting your Salesforce account executive.
  1. Configure your payment gateway in Business Manager. Salesforce Payments behavior on your storefront depends on the gateway configuration. To configure:

  2. In src/types/config.ts, under AppConfig, add the type definition for the Salesforce Payments configuration.

  1. In config.server.ts, set sdkUrl and metadataUrl to point to your B2C Commerce instance host by replacing [bm_or_vanity_host] with your Business Manager or vanity URL host.
  1. (Optional) In config.server.ts, switch to a private client. Salesforce Payments doesn’t require a private client. By default, privateKeyEnabled is set to false. Only change this setting if another feature in your storefront requires it. If another feature depends on a private client to function, make that feature optional or turn it off.

    a. Set commerce.api.privateKeyEnabled to true.

    b. Set COMMERCE_API_SLAS_SECRET in your environment.

  2. In config.server.ts, configure Content Security Policy (CSP) directives.

    a. To support the CSP directives that Salesforce Payments requires, import the default CSP directives object.

    b. Expand the CSP directives object to include the directives that Salesforce Payments requires.

  3. (Optional) To use Salesforce Payments outside of the US and Canada, configure Salesforce Payments for other countries.

    a. In src/components/customer-address-form/constants.ts, add the country code to the COUNTRY_CODES constant.

    b. In the locale translations file for that country, for example src/locales/en-GB/translations.json, add the provinces or states for the locale.

Storefront Next doesn’t require eCDN setup for Salesforce Payments. The eCDN routing rules for Storefront Next include /resource/* by default, alongside other Storefront Next infrastructure paths, such as /action/*, /mobify/*, and *.data. This setup applies even if you configure a vanity domain for Business Manager within the eCDN zone.