Digital River App for Salesforce B2B Commerce

Use the Digital River App for Salesforce B2B Commerce to integrate your frontend purchasing experience in Salesforce Commerce with Digital River.

The Salesforce B2B Commerce platform expertly solves B2B complexities and provides a smooth self-service shopping experience, while Digital River excels in providing solid ecommerce backend functionality. Rather than trying to handle all of these difficult issues, Digital River integrates with Salesforce to combine these best-of-breed strategies: Salesforce crafts a beautiful front-end purchasing experience, including product details, checkout, and payment information, while Digital River handles behind-the-scenes tax compliance, payment processing, and risk mitigation.

Using the Salesforce B2B Commerce Connector provides a host of benefits:

Seamless connectivity with Digital River's financial backend

  • Easy platform to install and configure

  • No micromanagement of the front-end shopper experience

  • Alleviates the burden of tax and fraud risk

  • Unites best-in-class front-end and back-end solutions

This guide describes how the Salesforce B2B Commerce Connector works, how to install the connector, and how to customize it for your specific needs.

How it works

  1. Use the Salesforce B2B Commerce Connector to enable Digital River to be the merchant of record for storefronts hosted in Salesforce B2B Commerce.

  2. Salesforce B2B Commerce maintains all pricing and product data.

  3. Digital River maintains minimal product data to fulfill the requirements as a merchant of record for tax calculations, tax collections, tax payments, and payment processing.

  4. The CC Product in Salesforce B2B Commerce is automatically synced to Digital River with minimal information needed to calculate taxes and enable the merchant of record functions.

  5. Digital River maintains a copy of the cart, customer, and order.

Integration points

1. Tax Estimations

a. The app extends the global extension point ccrz.cc_hk_TaxCalculation. b. The extension creates a Digital River cart based on the Salesforce B2B Commerce cart with product information, prices, and quantity. This cart is serialized as a JSON object, encrypted, and posted to a Digital River web service. c. The response contains the cart tax amount.

2. Payment Processing

You can integrate payment in multiple locations and flows.

During checkout

In the standard checkout flow, you can apply the payment against the order using one of the following methods:

  • Credit Card

  • PayPal

  • Purchase Order

  • Previously stored payment method

My Wallet Page

  • You can add new payment methods and update existing payment methods.

  • Only credit card payment methods support saved payment options.

Installation requirements

  • You can install the Salesforce B2B Commerce Connector only on the Enterprise and Unlimited versions of Salesforce.

  • B2B Commerce should be already installed on the system.

  • Communities should be enabled in the Salesforce version before you install this application.

  • You should assign a role to the community users (Customers).

  • Before you click Install, you must map your B2B Customer profile to provide the appropriate access and permissions.‌

Step 1: Install the Digital River App

To install:

  1. Run the installation from the AppExchange.

  2. Go to the installation to open the Installation page of the application.

  3. Click Install for Specific Profiles. Important: Before you click Install, you must map your B2B Customer profile to provide the appropriate access and permissions.

  4. Click the Install button. The Approve Third-Party Access page appears.

  5. Select the Grant Access check box and click the Continue button to start the installation process.

The installation process will take approximately 5-10 minutes. When the installation completes, the user who initiated the install will receive an email.

Step 2: Enable the Config page

After you have received the Successful Installation confirmation via email, you need to configure the application.

To enable the digitalriverb2b.DRConnectorConfig page:

  1. Go to Salesforce Setup, select Customize, select Communities, and then click All Communities.

  2. Open the Community Management page of the B2B Commerce Cloud in your organization.

  3. On the Community Management screen, click the Administration box to open the Administration Management of the Community.

  4. Click Pages in the navigation menu on the left and then click the Go to Force.com link.

  5. On the Site Details page, scroll down to the Site Visualforce Pages and click the Edit button.

  6. Add the digitalriverb2b.DRConnectorConfig page to the Enabled Visualforce Pages and click the Save button.

Step 3: Configure the Digital River App

To configure the Salesforce B2B Commerce Connector from the All Tabs Menu, click the DR Connector Configure tab and complete the following steps. To complete the configurations, you will need information about API keys and other details that Digital River will provide to you in the DR B2B Configurations Template spreadsheet. The following image shows a sample of the template.

General configuration

The General Config tab provides information that is used by the connector to establish secure connections between the Salesforce B2B Commerce platform and Digital River. This tab also includes general information about the Digital River site and catalogs linked to the storefront. To complete this step, you will need the following information from Digital River to configure your account.

  • The encryption algorithm and encryption key

  • API key

  • User ID and password

  • The default locale

  • Default currency

  • Company ID

Update the named credentials

The managed package installs the following Named credentials that the Salesforce B2B Commerce Connector uses to communicate with the Digital River web services.

  • Full Access Token Named Credential

  • DR EFN URL Named Credential

  • DR URL Named Credential

  • Refunds Token Named Credential

  • Refunds Named Credential

You can update the named credentials with the details provided in the spreadsheet, or create your own named credentials and use them in the configuration tabs.

Note: Click the Test DR Connection button to verify whether you can successfully connect with the configured Digital River site.

Taxation configuration

As of version 1.9 of the Connector, the Taxation Config tab is no longer used. The Product Sync tab replaces this functionality and automatically synchronizes the Commerce Connector Products in Salesforce to Digital River along with applicable tax codes and ECCNs. The setting on this tab does not affect the functioning of the connector. The tab deprecated will be removed in a future version.

Payment configuration

Use the Payment Config tab to enter the payment details from the Digital River API.

  1. Set the following Payment Test modes under the Payment Config tab to True in the development and test environments and False in the production environment:

    • Credit Cart Test Mode

    • PO Test Mode

    • PayPal Test Mode

    • PO Test Mode Note: When you set these modes to True, the Cart is marked as in Test while sending calls to Digital River and prevents the charging of credit cards and other payment methods.

  2. Set the EFN Complete Status to Completed. The Digital River App sends an Electronic Fulfillment Notification (EFN) to Digital River when the order is fulfilled to begin the capture of the funds. Since the status of the order on fulfillment is implementation-dependent, this property allows the implementation to override the default status that triggers the notification.

  3. Set the EFN Cancel Status to Cancelled. The Digital River App sends an Electronic Fulfillment Notification (EFN) to Digital River when the order is cancelled to begin a refund of the funds. Since the status of the order cancellation is implementation-dependent, this property allows the implementation to override the default status that triggers the notification.

  4. Click Save.

Step 4: Configure Product Sync

The Product Sync page allows you to configure the behavior of the automated product synchronization. A Batch job performs the synchronization, and you can schedule it to run periodically.

  1. Under the Product Sync tab, configure the following attributes:

    • Size: This is the number of CC product records that will be pushed to Digital River in each run of the job.

    • Filter By Status: By default, all products with a status of ‘Released’ are synced. Add a comma-separated list of CC Product statuses to override this behavior.

    • Batch Schedule Time: Defines the frequency of the batch job run in minutes.

  2. Click Save.

Step 5: Create page labels

The Page Labels are required to show and make the payments via Credit Card, PayPal, and Purchase Orders using Digital River App.

Open the CC Labels tab from the All Tabs menu and create the following Global Page Labels:

Sr. no.

Page Name

Page Label ID

Page Label Name

ValueRT

Storefront Name

1

All

PaymentDisplay_ccGlobalAll

PaymentDisplay_cc

Credit Card: ending with {1}

Global

2

All

MyWallet_AcctType_ccGlobalAll

MyWallet_AcctType_cc

Credit Card

Global

3

All

PaymentProcessorTab_ccGlobalAll

PaymentProcessorTab_cc

Credit Card

Global

4

All

MyWallet_AcctNum_ccGlobalAll

MyWallet_AcctNum_cc

PayPal

Global

5

MyAccount

PaymentDisplay_ppGlobalMyAccount

PaymentDisplay_pp

PayPal

Global

6

OrderView

PaymentDisplay_ppGlobalOrderView

PaymentDisplay_pp

PayPal

Global

7

CheckOutNew

PaymentDisplay_ppGlobalCheckOutNew

PaymentDisplay_pp

PayPal

Global

8

OrderConfirmation

PaymentDisplay_ppGlobalOrderConfirmation

PaymentDisplay_pp

PayPal

Global

9

All

MyWallet_AcctNum_ppGlobalAll

MyWallet_AcctNum_pp

PayPal

Global

10

All

MyWallet_AcctType_ppGlobalAll

MyWallet_AcctType_pp

11

All

PaymentProcessorTab_ppGlobalAll

PaymentProcessorTab_pp

Step 6: Configure CC Admin settings

You need to override several settings to enable the custom payment methods and tax calculations. The various settings are detailed in the spreadsheet accompanying this document. The appropriate tabs are referenced in the following sections. Select CCAdmin and then click Configuration Settings.

Step 6a: Create new Configuration Modules for Payment types

  1. Select CC Admin and then select Configuration Modules as shown below.

  2. Create a module for Credit Cards. a. Click New in the Configuration Module pane. The Configuration Module dialog appears. b. Enter Payment CC in the Name field and pmt_cc in the API Name field.

  3. Create a module for PayPal. a. Click New in the Configuration Module pane. b. Enter Payment PP in the Name field and pmt_pp in the API Name field. The new payment modules will appear under Configuration Modules.

Step 6b: Create new configuration metadata for the Payment modules

  1. Create new configuration metadata for the Payment CC module. a. Under Configuration Modules, click Payment CC. b. Click New (highlighted in the image below) to create new configuration metadata for the Payment CC module. The Configuration Metadata dialog appears. c. Complete the fields to create configuration metadata for the Edit Page. The following image shows an example of the configuration metadata for the Edit Page. d. Repeat steps b and c to create configuration metadata for Pay Page, New Page, and Proc.

  2. Create new configuration metadata for the Payment PP module. a. Under Configuration Modules, click Payment PP. b. In step 4, repeat steps c through d for the Payment PP module.

After adding the configuration metadata to both of the Payment Modules, the Configuration Module for both modules should look like:

Step 6c: Create or update configuration settings

  1. To create or update the configuration settings: a. From CC Admin, select the storefront you want to configure and then select Configuration Settings. b. Select Payment CC from the Module dropdown list. c. To create a new Page Setting for the module, click New. d. Complete the fields to create or update the page settings. The following image shows an example of the page settings for the Edit Page for the Payment CC module. e. Repeat step b through d for New Page, Pay Page, and Proc. After creating or updating the configuration settings for the Payment CC module, the Payment CC Module should look like: f. Repeat steps b through e for each additional payment module.

Step 7: Schedule backend jobs

For the connector to continuously synchronize data between Salesforce and Digital River, you need to schedule several backend jobs. To schedule the backend jobs.

  1. Open an Execute Anonymous window in the Developer Console or the salesforce workbench.

  2. Copy the script in each row in the table into the window and execute the scripts one after another to schedule all the jobs.

The following table lists the jobs that you need to schedule and the apex code that you can run to set up the jobs.

Job Name

Script for Scheduled Job

Order Level Electronic Fulfillment Job

// EFN To run every 5 minute for(Integer i=0; i<60; i=i+5){ String cronTrigger = '0 ' + i + ' * ?'; String jobID = System.schedule('Job Send EFN every 5 minutes' + i, cronTrigger, new digitalriverb2b.DRB2B_ScheduleOrderLevelEFN()); System.debug('Scheduled Job ID: ' + jobID); }

Line Item Electronic Fulfillment Job

// Line Item EFN every 5 minutes for(Integer i=0; i<60; i=i+5){ String cronTrigger = '0 ' + i + ' * ?'; String jobID = System.schedule('Job Send Line Item EFN every 5 minutes' + i, cronTrigger, new digitalriverb2b.DRB2B_ScheduleLineItemEFN()); System.debug('Scheduled Job ID: ' + jobID); }

Merge Duplicate Fulfillment Records

// Merge Duplicate Fulfillments to run every minute for(Integer i=0; i<60; i=i+1){ String cronTrigger = '0 ' + i + ' * ?'; String jobID = System.schedule('Merge Duplicate Fulfillment every minute' + i, cronTrigger, new digitalriverb2b.DRB2B_MergeDuplicateFulfillment()); System.debug('Scheduled Job ID: ' + jobID); }

Merge Duplicate Fulfillment Records

// Schedule CC Subscription Processor Job System.schedule('CC Subscription Procesor Job Hourly', '0 0 * ?', new digitalriverb2b.DRB2B_ScheduledSubscriptionProcess());

DR Installment Subscription Processor Job

//Schedule Installment Subscription Processor Job every hour System.schedule('DR Installment Subscription Processor Job Hourly', '0 0 * ?', new digitalriverb2b.DRB2B_InstallmentSubscriptionProcessor());