Step 8: Set up Digital River fulfillments
Learn how to set up Digital River fulfillments.
Last updated
Learn how to set up Digital River fulfillments.
Last updated
The following sequence diagrams show the interaction between Shopper, Salesforce B2B Commerce, the Digital River Salesforce B2B Commerce App, and Global Commerce.
Salesforce kicks off the fulfillment process after it creates a CC Order. The following sequence diagram outlines the flow before fulfillment.
When the shopper reaches the payment methods page, Salesforce B2B Commerce creates a CC cart and sends an update order event to the Salesforce B2B Commerce App. The App uses Global Commerce (Commerce API) to create the shopper, get a full access token, update the shopper, and get the cart details. The App updates Salesforce with the tax details and the selling entity assigned to the order.
The following sequence diagram outlines the flow during fulfillment.
When a cart is successfully submitted, Salesforce renders an Order Confirmation page and creates a CC Order. The CC Order triggers the fulfillment steps.
ERP/Fulfillment receives the order. When they fulfill the order, they update the Order Item Status to Shipped. Salesforce updates the order status to Complete and sends it to the App. The Salesforce B2B Commerce App sends a WebService EFN to Global Commerce. Global Commerce updates the status to Complete, updates funds to Settled, and Sends a WebService OCN. The App sends a response code when it receives the OCN.
The sequence diagram above outlines the flow of API fulfillment messages, URLs, and content during fulfillment.
Global Commerce sends a Digital River Order Fulfillment Information (OFI) notification to the App. The App creates a Digital River Fulfillment object with an order identifier and other order information to the shopper and then sends an OFI response code to Global Commerce.
Salesforce updates the order's Line Item status to Shipped. The App sends an Electronic Fulfillment Notification (EFN) for each line item, and Global Commerce sends a response. Once the App sends an EFN status for all line items, Global Commerce moves the order to the Completed state and captures the funds. Global Commerce then sends an Order Complete Notification (OCN) for the order to the App. The App updates the invoice as Paid and creates a new transaction for the capture to the shopper and then sends an OCN response code to Global Commerce.
To create a connected app for Digital River Fulfillments, complete the following steps:
Sign in to Salesforce B2B Commerce.
Type app manager
in the Quick Find field and press Enter.
Click New Connected App.
Provide your API name and your email address.
Select Enable OAuth Settings.
Select the Require Secret for Web Server Flow check box.
Click Save. Allow 2-10 minutes for your changes to take effect on the server before using the connected app.
To create a profile and assign it to a Fulfillment Integration User, complete the following steps:
Create a new profile:
To add the new user to the Digital River Salesforce B2B Commerce App Permission Set:
Click Permission Sets. The Permission Sets page appears.
Your Digital River Project Manager needs your OAuth information to set up your OAuth Fulfillment flow. To collect and send the required information, complete the following steps:
Click App Manager in the Quick Find field.
Collect the following information from this page:
Consumer Key–This is your Digital River client ID.
Consumer Secret–This is your Digital River client secret.
Click My Domain. The My Domain page appears.
Send the following information to your Digital River Project Manager:
Your salesforce domain name, for example:
https://<custom>.my.salesforce.com
Where <custom
> is the custom portion of your domain name where you will send the OFI or OCN notification.
Your Digital River client ID
Your Digital River client secret
Your grant_type
is password
Your password. Your password is a combination of the Salesforce user name for your Fulfillment Integration User followed by their security token using the following format: <password><securitytoken> Note that there is no space between the password and the security token.
Digital River will set up the Digital River B2B Commerce Fulfillment App under Manage Connected Apps.
Digital River uses the following resources for fulfillments:
Order-level Electronic Fulfillment Information (OFI) Notification–You need to wait for the OFI message from Digital River before you fulfill an order.
<instance_url>/services/apexrest/digitalriverb2b/DROFINotification/
Order Completion Notification (OCN)–Digital River triggers an OCN once Digital River has received an EFN with a Shipped
or Cancel
status for every line item in the order. This message tells Salesforce that Digital River has settled the order.
When Salesforce receives a successful response, it will create the Digital River Fulfillment object. The object includes the CC Order ID, DR Order ID, Status, and so on. This object is important for ElectronicFulfillment Notification.
If you look at the CC Order Item Detail, you will see the Order Item Status:
When you set the Order Item Status to Shipped, it creates a new DR (Digital River) Line Item Fulfillment Detail object.
A scheduler job that looks for Open or Pending statuses in the EFN Order Item Status field for this object runs every five minutes.
These line items are then sent in the EFN job to Digital River with a status of Shipped
. When Digital River receives the Shipped
status, we will capture the funds (submit the request for payment for the payment method).
The following statuses drive the Digital River payment processing:
Order Status
Expected Next Step
Shipped / Partial Shipped
Payment auth will settle
Cancelled
Payment auth will reverse/void
Digital River has to set up the Digital River Salesforce B2B Commerce App under Manage Connected Apps before you can perform this step.
Read this section if you want to set up OAuth programmatically for fulfillment.
To initiate a session and get an access token, send a Token call to one of the following environments:
Test environment URL: https://test.salesforce.com/services/oauth2/token
Production environment URL: https://login.salesforce.com/services/oauth2/token
When you request a token, you'll need to provide the required parameters listed in the following table.
Parameter
Required/Optional
Description
grant_type
Required
The enumerator is password
.
client_id
Required
The Salesforce consumer key for the connected App.
client_secret
Required
The Salesforce consumer secret for the connected App.
username
Required
The Fulfillment Integration User's Salesforce email address.
password
Required
The password format is a combination of the Fulfillment Integration User's Salesforce password and security token, for example: <Fulfillment Integration User's password><Fulfillment Integration User's security token>
Note that there is no space between the password and the security token.
To access or reset the security token:
Click Reset My Security Token.
Click Reset Security Token. You will receive an email with your security token.
Expand the collection that contains your fulfillment APIs and open the Get Access Token request.
In the body of the request, provide the values for the required Token parameters, and click Send.
A successful response returns the token information:
The access_token
is the Bearer code. The fulfiller uses this Bearer code when sending subsequent fulfillment API calls.
You must wait for the OFI message from Digital River before you fulfill an order.
To send a POST OFI, use the following URL format:
/services/apexrest/digitalriverb2b/DROFINotification/
Example:
https://acme.my.salesforce.com/services/apexrest/digitalriverb2b/DROFINotification/
Parameter
Required/Optional
Value
Description
Authorization
Required
Bearer <access_token>
This is a dynamic value. It changes each time you get a token.
Content_Type
Required
application/JSON
This is a static value.
Accept
Required
application/JSON
This is a static value.
Expand the collection that contains your fulfillment APIs and open the POST DROFINotification request.
Ensure the POST URL includes the instance_url
from the Get Access Token response. and include the following suffix: /services/apexrest/digitalriverb2b/DROFINotification/
For example:https://tbdclient--docqa.my.salesforce.com/services/apexrest/digitalriverb2b/DROFINotification/
Click Send.
Create a new access token before sending the OCN.
Digital River triggers an OCN once Digital River has received an EFN with a Shipped
or Cancel
status for every line item in the order. This message tells Salesforce that Digital River has settled the order.
To send the OCN, use the following URL format:
<
Instance_url
>/services/apexrest/digitalriverb2b/DROrderCompleteNotification/
Example:
https:// acme.my.salesforce.com/services/apexrest/digitalriverb2b/DROrderCompleteNotification/
Parameter
Required/Optional
Value
Description
Authorization
Required
Bearer <access_token>
This is a dynamic value. It changes each time you get a token.
Content_Type
Required
application/json
This is a static value.
Accept
Required
application/json
This is a static value.
Expand the collection that contains your fulfillment APIs and open the POST DROrderCompleteNotification request.
Ensure the POST URL includes the instance_url
from the Get Access Token response and include the following suffix: /services/apexrest/digitalriverb2b/DROrderCompleteNotification/
For example: https://tbdclient--docqa.my.salesforce.com/services/apexrest/digitalriverb2b/DROFINotification/
Click Send.
Click Setup and select Setup from the dropdown list.
Click App Manager in the search results.
Under Basic Information, type DigitalRiver B2B Fulfillment Connector
in the Connected App Name field.
Under API (Enable OAuth Settings), type https://
in the Callback URL field.
Add Access and manage your data (api) to Selected OAuth Scopes.
a. Click Setup and select Setup from the dropdown list.
b. Under Administration, expand Users, and click Profiles.
c. From the Profiles page, click New to create a new profile.
d. Select Standard User from the Existing Profile dropdown list.
e. Type DRB2B Connector API User Profile
in the Profile Name field. You're essentially cloning the Standard User profile to this new profile.
f. Click Save.
Set the password policy for this profile to never expire: a. Under Administration, expand Users, and click Profiles. b. Click the DRB2B Connector API User Profile link under the Name column on the Profiles page. c. Under System on the Profiles page, click the Password Policies link. d. Click Edit. e. Select Never expires from the User passwords expire in dropdown list. f. Click Save.
Create a Fulfillment Integration User and assign the user to this profile. a. Under Administration, expand Users, and click Profiles. b. Click the DRB2B Connector API User Profile link under the Name column on the Profiles page. c. Click Assigned Users. d. Click New User. e. Assign a Fulfillment Integration User to this profile, complete the required fields, and click Save. Note: You will need the username and password for the Fulfillment Integration User in Step 8d: Send OAuth information to Digital River.
Type permission sets
in the Quick Find field and press Enter.
From the Permission Sets page, click the DRB2B Connect App Permission Set link.
Click Manage Assignments.
Click Add Assignments.
Select one or more users who you want to assign to this permission set and click Assign. The assigned users now appear in the DRB2B Connect App Permission Set.
Click Setup and select Setup from the dropdown list.
Type app manager
in the Quick Find field and press Enter.
Locate the Digital River B2B Fulfillment App row, click Show more actions , and select View from the dropdown list. The Digital River B2B Fulfillment App page appears.
Type My Domain
in the Quick Find field and press Enter.
Collect your Salesforce domain name from Your domain name is.
Click View Profile and then click Settings.
Use the access_token
value from your for your <token>
Click Headers, replace the Bearer code with the access_token
from Get an access token, and provide the values for the remaining required DROFINotification parameters.
Click Body, replace the value for requisitionID
with the DR Order ID value from the CC Order:
Note that you only need to modify the requisitionID
. Do not modify the remaining request body content.
Use the access_token
value from your for your <token>
Click Headers, replace the Bearer code with the access_token
from Get an access token, and provide the values for the remaining required DROrderCompleteNotification parameters.
Click Body, replace the value for orderID
with the DR Order ID value from the CC Order:
Note that you only need to modify the orderId
. Do not modify the remaining request body content.