# Step 15: Integrate the Digital River components into the checkout flow

The Salesforce Lightning application comes with a completely functional checkout flow out-of the-box (OOTB). However, many clients will choose to customize their checkout flow to suit their particular needs. This section describes how you can use the Salesforce Lightning components provided by the application in your storefront.&#x20;

## Custom components used in the checkout subflows

| Custom subflow name | Custom component(s) used                                                | Description                                                                                  |
| ------------------- | ----------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| DR Shipping Address | drb2b\_BuyerInfo                                                        | This custom subflow will be used in the place of OOTB subflow – Shipping Address.            |
| DR Delivery Method  | drb2b\_DRUtil                                                           | This custom subflow will be used in the place of OOTB subflow – Delivery Method.             |
| DR Checkout Summary | <p>drb2b\_DRUtil </p><p>drb2b\_DrTermsElement drb2b\_taxIdentifier</p>  | This custom subflow will be used in the place of OOTB subflow – Checkout Summary.            |
| DR Payments         | <p>drb2b\_Order Summary </p><p>drb2b\_DRUtil </p><p>drb2b\_Payments</p> | This custom subflow will be used in the place of OOTB subflow – Payment and Billing Address. |

## Subflow configuration

### Configure the shipping address subflow

This subflow will be used to capture buyer information such as `Bill To`, `Ship To`, and `Email`.

1. Go to **Setup** and search **flows** in the **Search** field.\ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FOyuQZPrKRssSxDFEEpuE%2FShipping%20address%20subflow%201.png?alt=media&#x26;token=5a1160e3-9b2e-4803-83ed-04947efba716" alt="" data-size="original">&#x20;
2. Click **Subflow - Shipping Address**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FosldSOKRLvtbcXDPBKRT%2FShipping%20address%20subflow%202.png?alt=media&#x26;token=b05974ca-15b5-44b7-b89e-4a80ede3a355" alt="" data-size="original">&#x20;
3. Click the **Shipping Address** screen. \
   &#x20;<img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FO0PyrgyozI004CAYiPOC%2FShipping%20address%20subflow%203.png?alt=media&#x26;token=aa91e82c-ef06-4b01-a16d-fcae1a59f19c" alt="" data-size="original">&#x20;
4. Click the screen in the flow and drag the **Buyer Info** component. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FBnb0UK6xtRthMxmuDEJO%2FShipping%20address%20subflow%204.png?alt=media&#x26;token=62717b70-c05f-4285-8c5a-3c3b131e32e7" alt="" data-size="original">&#x20;
5. Enter the **API Name**, **Cart Id**, **Enable Tax Certificate**, and **Shipping Address ID** (in the **Advanced** section and only visible by selecting **Manually assign variables** check box).
   * **API Name**: BuyerInfo or any other name with no restriction
   * **Cart Id** - ({!cartId})
   * **Enable Tax Certificates**: ({!$GlobalConstant.True}) OR ({!$GlobalConstant.False})
   * **Shipping Address ID**: ({!contactPointAddressId}) \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FfACDsOBE7h3nIQuWquwq%2FShipping%20address%20subflow%205.png?alt=media&#x26;token=b2b960a7-a26c-41f3-b24f-b5d386963a5f" alt="" data-size="original">&#x20;
6. Click **Done**.&#x20;
7. Click **Save As**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FQQYfkYdkjfIW9V9FqKvV%2FShipping%20address%20subflow%206.png?alt=media&#x26;token=2c0b6e8f-c9a8-44cc-87c7-64e2d5c9a4c8" alt="" data-size="original">&#x20;
8. Enter the name of the custom subflow (for example, DR Shipping Address) and click **Save**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FbCxWlKCctHYIqsHPWk2c%2FShipping%20address%20subflow%201.png?alt=media&#x26;token=4f66f4d0-b143-4f9c-9f88-535cf52fd4ea" alt="" data-size="original">&#x20;
9. Click **Activate**.

### Configure the delivery method subflow

To configure the Delivery Method subflow:

1. Go to **Setup** and search flows in the **Search** field.
2. Click **Subflow - Delivery Method**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F4XfTdP6HAKqXpl8md2iq%2FDelivery%20method%20subflow%201.png?alt=media&#x26;token=12a048f4-f49a-456b-ae11-d7bfe8057da0" alt="" data-size="original">&#x20;
3. Click the **Delivery Method** screen. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FQdAV6mmMDpyf1thZ0P2D%2FDelivery%20method%20subflow%202.png?alt=media&#x26;token=1d19345e-9ec0-4ab4-8aa7-866bef43d844" alt="" data-size="original">&#x20;
4. Add the `drb2b_DRUtil` component to the screen and enter the API name (drb2b\_Util or any name).
5. Click **Done**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FbJZdT7Kdu2J4nt85Wmxq%2FDelivery%20method%20subflow%203.png?alt=media&#x26;token=a26eb661-db06-4665-a285-32d6f2b84e7a" alt="" data-size="original">&#x20;
6. Click **Save As**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FZVMn8xHSeqE131Ws2ZeO%2FDelivery%20method%20subflow%204.png?alt=media&#x26;token=a5ec558e-9c85-41a9-9ec4-f0035ab28f9a" alt="" data-size="original">&#x20;
7. Enter the Delivery Method subflow name (for example, DR Delivery Method).
8. Click **Save**, then click **Activate**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FeF4cyhNzvp4OCfIOcRVX%2FDelivery%20method%20subflow%205.png?alt=media&#x26;token=ad89894b-b369-4a5b-9b20-25570b34e034" alt="" data-size="original">&#x20;

### Configure the checkout summary subflow

This subflow will be customized to add US Tax Certificate and Tax Identifier support.&#x20;

#### Create a variable

To create a variable:

1. Go to **Setup** and search flows in the **Search** field.
2. Click **Subflow - Checkout Summary**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FlNW2aKSrTNfStEgYRwYz%2FCheckout%20summary%20subflow%201.png?alt=media&#x26;token=cf047d1d-3f8f-4e07-aff4-8374961312f8" alt="" data-size="original">&#x20;
3. Click the **Manager** tab and then click **New Resource**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FOY0xUvi8U9OAMLBotlLH%2FCheckout%20summary%20subflow%202.png?alt=media&#x26;token=0b0dea28-a001-43fc-909f-4130c27ab41e" alt="" data-size="original">&#x20;
4. Complete the following fields:
   * **Resource Type**: Variable
   * **API Name**: Saved\_Tax\_Identifier (or other name as desired)
   * **Data Type**: Text
5. Check the **Available for input** and **Available for output** checkboxes.
6. Click **Done**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FaHtvafAM25GRh4dMq0co%2FCheckout%20summary%20subflow%203.png?alt=media&#x26;token=064b32a2-fe85-4959-9037-77b7948cfc8a" alt="" data-size="original">&#x20;

{% hint style="info" %}
This variable will be used to display payment information in a later step.
{% endhint %}

#### Add custom components to the checkout summary subflow

To add custom components for this subflow:

1. Click into the **Cart to Order Summary** screen. &#x20;
2. Remove all OOTB components from the subflow except the **Shipping Address** and **Delivery Method** components.
3. Add the `drb2b_DRutil` component and define the name. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FVeWziQDUrbpFhIam9aFy%2FAdd%20custom%20components%20to%20checkout%20summary%201.png?alt=media&#x26;token=9df5a715-8389-47ca-8446-5b8a14f4478e" alt="" data-size="original">&#x20;
4. Add the `drb2b_taxIdentifier` and enter the **API Name**, **Cart Id**, **Selected Tax Identifier**, and **Selected Tax Identifier**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2Fa9LYrtk40NaI4xtbS5KG%2FAdd%20custom%20components%20to%20checkout%20summary%202.png?alt=media&#x26;token=d8009f7f-6eed-4971-ac5b-aecdfa0e9ae5" alt="" data-size="original">&#x20;
   * **API Name**: (Tax\_Identifier or any name)
   * **Cart Id**: ({!cartId})
   * **Selected Tax Identifier**: ({!Saved\_Tax\_Identifier})
   * **Selected Tax Identifier in the Advanced section**: ({!Saved\_Tax\_Identifier})
5. Add the `drB2B_DrTermsElement` and enter the **API Name** and **Cart Id**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FmjVNEL2j2AQ46rIVS2HO%2FAdd%20custom%20components%20to%20checkout%20summary%203.png?alt=media&#x26;token=6906a399-2213-4ff2-9ae0-407791a4c2d2" alt="" data-size="original">&#x20;
   * **API Name**: `DR_Terms` or any name
   * **Cart Id**: ({!cartId})
6. Click **Done**.
7. Click **Save As**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F5e9rOo7592LG0ZGk09Dc%2FAdd%20custom%20components%20to%20checkout%20summary%204.png?alt=media&#x26;token=e82a70de-257f-4cc1-824a-aba67722f7ad" alt="" data-size="original">&#x20;
8. Enter the custom subflow name (for example, DR Checkout Summary) and click **Save**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FIWRLY1cXvXUe3VvLuFV9%2FAdd%20custom%20components%20to%20checkout%20summary%205.png?alt=media&#x26;token=00e5c1fb-71d1-4598-8c83-e40412d38d53" alt="" data-size="original">&#x20;
9. Click **Activate**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FeUXrAQ1dfqmzumkvGTle%2FAdd%20custom%20components%20to%20checkout%20summary%206.png?alt=media&#x26;token=25f52c37-1334-487c-98c3-7673f21ede43" alt="" data-size="original">&#x20;

### Configure the payment subflow

This subflow must be customized to add **My Wallet** and **Digital River Payment Details** support. To configure the payment subflow:

1. Go to **Setup** and search **flows** in the **Search** field. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FqYtoCDc10ONAMMXXscpN%2FPayment%20subflow%201.png?alt=media&#x26;token=9a042c0e-f71c-40df-8412-3d399d2de34f" alt="" data-size="original">&#x20;
2. Click **Subflow - Payment and Billing Address**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F4yLDY26Xhr3BZNSNLK4m%2FPayment%20subflow%202.png?alt=media&#x26;token=096acd5e-8b04-4b06-954e-19460d3ce3b0" alt="" data-size="original">&#x20;
3. Click the **Manager** tab, then click **New Resource**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F5T84qlntdu15hmK8JW0E%2FPayment%20subflow%203.png?alt=media&#x26;token=7472c9c6-22fc-453d-a2f9-11045443e3a2" alt="" data-size="original">&#x20;
4. Complete the following fields:
   * **Resource Type**: Variable
   * **API Name**: Payment\_Details (or other name as desired)
   * **Data Type**: Text\ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FOwFZbgAtB69ifv3OMJEm%2FPayment%20subflow%204.png?alt=media&#x26;token=88fc787f-5a62-4cf9-a884-6b8dcf4911d8" alt="" data-size="original">&#x20;
5. Click **Done**.

#### Add custom components to a screen

To add custom components to a screen:

1. Drag the screen element showing on the left panel to create a new screen and name the new screen (for example, **placeOrderConfirmation**).\
   &#x20;<img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F9Suf1qczFW5gxUF8njsb%2FNew%20screen%201.png?alt=media&#x26;token=f2fbe41b-5f18-41f8-8ec1-9fa47351f66f" alt="" data-size="original">&#x20;
2. Click the custom screen **placeOrderConfirmation**.  \
   **Note**: See [Link screen components](https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-api-1.0.1/integrate-the-salesforce-lightning-app/step-15-integrate-the-digital-river-components-into-the-checkout-flow) for instructions on linking the screen. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FuyswLIfj4JKT9yCAasMd%2FNew%20screen%202.png?alt=media&#x26;token=4a4d6c6e-d109-4ffd-85fd-bca63abf2712" alt="" data-size="original">&#x20;
3. Drag **Display Text** from the left panel to screen and enter the **API Name** (for example, **Payment\_Information**) and insert **Resource Payment\_Details**. This is the variable resource created in the previous section.\ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FWnUrswLFt2eInOjagfUZ%2FNew%20screen%203.png?alt=media&#x26;token=ee53bd95-9231-4520-bce6-3dae8ef0ffaf" alt="" data-size="original">&#x20;
4. Drag  the `drb2b_OrderSummary` component from the left panel and enter the **API Name**, **Record Id**, **Show Duty**,  **Show IOR tax**, **Show Regulatory Fee**, **Show Shipping**, and **Show Tax**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FrqpIjqSy5kyylYK5tOB9%2FNew%20screen%204.png?alt=media&#x26;token=0ee2c010-c2c8-4cdc-95ee-a1d9434dffab" alt="" data-size="original">&#x20;
   * **API Name**: OrderSummary or any name&#x20;
   * **Record Id**: ({!cartId})
   * **Show Duty**: ({!$GlobalConstant.True})
   * **Show IOR Tax**: ({!$GlobalConstant.True})
   * **Show Regulatory Fee**: ({!$GlobalConstant.True})
   * **Show Shipping**: ({!$GlobalConstant.True})
   * **Show Tax**: ({!$GlobalConstant.True})
5. Drag the `drb2b_DRUtil` component from the left panel and enter the **API Name** (`drb2b_Util` or other desired name).\ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F14K07UogBNiGQTPO9O5V%2FNew%20screen%205.png?alt=media&#x26;token=29ff4f14-9081-426b-ab2f-e1977e5c4977" alt="" data-size="original">&#x20;
6. Click **Done**.

#### Edit the paymentMethodScreen screen

To edit the **paymentMethodScreen** screen:

1. Click the **paymentMethodScreen** screen.
2. Delete the OOTB components and add the `drb2b_Payments` component. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2Famu5UJxyjydvMxJMTVMk%2FEdit%20payment%20method%20screen%201.png?alt=media&#x26;token=bd8ac44f-88f3-4385-b3ee-5198ee28a286" alt="" data-size="original">&#x20;
3. Enter the **API Name**, **Record Id**, **Payment Detail**, **Payment Type**, **Payment Detail**, and **Payment Type** that is under the **Advanced** section, which will be visible by selecting the **Manually assign variables** check box. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FQnEzULPcS6PH677eHpjJ%2FEdit%20payment%20method%20screen%202.png?alt=media&#x26;token=30ce99a4-f6db-42ce-b5f7-879662a36673" alt="" data-size="original">&#x20;
   * **API Name**: (DR\_Payments or any other name with no restriction)
   * **Record Id**: ({!cartId})
   * **Payment Detail**: ({!Payment\_Detail})
   * **Payment Type**: ({!paymentType})
4. Click **Done**.

#### Edit decision boxes

To edit decision boxes:

1. Click the **Decision** box (which payment type is selected). \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F58ldUYyl4lPumRd78sv5%2FDecision%20box%201.png?alt=media&#x26;token=c56d0156-6e1d-4b3a-bdd1-ebe8c931e14f" alt="" data-size="original">&#x20;
2. Add the new **Outcome** and enter the **Label**, **Outcome API Name**, and **Condition Requirements to Execute Outcome** (for example, **Resource** `paymentType` equals `DigitalRiver`). \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FabXVeaj1t70HkmIbi8JR%2FDecision%20box%202.png?alt=media&#x26;token=3274563b-67d6-4d33-92f4-5d74d5356060" alt="" data-size="original">&#x20;
3. Click **Done**, then click the **Update address if changed** decision box. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FFE3dp2GhXB0CdrqxSq5g%2FDecision%20box%203.png?alt=media&#x26;token=1c91f63b-1506-4bbf-bcbb-4f8d50d2f347" alt="" data-size="original">&#x20;
4. Add the new **Outcome** and enter the **Label**, **Outcome API Name**, and **Condition Requirements to Execute Outcome** (for example, **Resource** `paymentType` equals `DigitalRiver`).\
   &#x20;<img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F71vBPfWTagrDqQMvXUDD%2FDecision%20box%204.png?alt=media&#x26;token=9593b38f-a04f-4e1d-abb1-443f1e6ccafe" alt="" data-size="original">&#x20;
5. Click **Done**.

#### Link screen components

{% hint style="info" %}
To delete the existing link, click the link and press the **Delete** button on your keyboard.&#x20;
{% endhint %}

1. Link **PaymentMethodScreen** to the **placeOrderConfirmation** screen (custom screen).
2. Link **placeOrderConfirmation** (custom screen) to subflow (Validate Checkout State).
3. Link **Decision** box (which payment type is selected) element to **Assignment** (Assign PO to null) element when the paymentType is Digital River.
4. Link from **Decision** box (Update Address if changed) to Subflow (Set State).\
   &#x20;<img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2Ffuiriubnsp0EKk0zhYRQ%2FLink%20screen%20component%201.png?alt=media&#x26;token=cf7a1993-dd42-4419-ab58-446abd27a0a9" alt="" data-size="original">&#x20;
5. Click **Save** **As** and enter a name for the custom subflow (for example, DR payments). \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FPYA1oRpiwftsJy4BqzNd%2FLink%20screen%20component%202.png?alt=media&#x26;token=1379f01e-835f-4dfb-b798-76590dfa1ee0" alt="" data-size="original">&#x20;
6. Click **Activate**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F7TU5Qb3yqKiSYGzw1CIg%2FLink%20screen%20component%203.png?alt=media&#x26;token=e2c4b57f-f8c8-4233-8eac-2b96bce00d86" alt="" data-size="original">&#x20;

## Configure main checkout flow

To configure the main checkout flow:

1. Click the **Checkout Flow Template** (OOTB flow).&#x20;
2. Create the subflow element for all the custom subflows (for example, DR Shipping Address, DR Payment, DR Checkout Summary, DR Shipping Address, and DR Delivery Method) which were created in the above steps.

   * Drag the subflow from the left panel and enter the **Referenced Flow**, **Label**, **cardID**, **currentState**, and **nextState**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FAzP5Qhyzxyc3EW5ePMk9%2FNew%20subflow.png?alt=media&#x26;token=975b1b7e-ad4b-4124-8eb1-f58f6c53df47" alt="" data-size="original">&#x20;
   * Repeat the same steps for all custom subflows.

   | Subflow             | Cart Id   | Current state                | Next state     | Order Id                                  |
   | ------------------- | --------- | ---------------------------- | -------------- | ----------------------------------------- |
   | DR Shipping Address | {!cartId} | {!mainCheckoutSession.State} | Inventory      | NA                                        |
   | DR Delivery Method  | {!cartId} | {!mainCheckoutSession.State} | Taxes          | NA                                        |
   | DR Checkout Summary | {!cartId} | {!mainCheckoutSession.State} | Cart To Order  | NA                                        |
   | DR Payment          | {!cartId} | {!mainCheckoutSession.State} | Activate Order | <p>{!mainCheckout<br>Session.OrderId}</p> |
3. Replace the OOTB flows with custom flows. &#x20;
   * **Shipping Address**: DR Shipping Address
   * **Delivery Method**: DR Delivery Method
   * **CheckoutSummary**: DR Checkout Summary
   * **Payment and Billing Address**: DR Payment \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2Fqp4oL9o7GogdEBGxikb9%2FReplace%20OOTB%20flow%20with%20custom%20flow.png?alt=media&#x26;token=ea0ae0e5-8c36-4bdd-aa81-765fe4464abb" alt="" data-size="original">&#x20;
4. Click **Save As** and enter a name for the main checkout flow. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FtFspzHhYRsgnBoOWVP81%2FName%20for%20main%20checkout%20flow.png?alt=media&#x26;token=389772f8-12b4-449f-8179-6ccb79c95c36" alt="" data-size="original">&#x20;
5. Click **Save**, then click **Activate**.

## Add custom components to pages

Salesforce Lightning components can be quickly and easily added to a record page to have an immediate view of information.

To use the custom Lightning component in your pages, you must assign your component to a theme layout in the Experience Builder.

After completion, drag and drop a custom component onto a particular page based on the business requirements.

### List of custom components

The custom components listed here are either available in the Experience Builder or used in various flows.

If an optional custom component is NOT dropped onto relevant standard Salesforce UI pages, the downside is that custom fields (for example, Digital River custom fields) will not be visible on those UI pages.

Additionally, a given custom component can be dropped on one or more UI pages based on what the custom component does (for example, the Compliance footer custom component can be placed on multiple pages that require compliance footers).

The custom components listed in this section are provided as part of the app installation. However, they must be placed on the page(s) within the flows and subflows as described in the table below.&#x20;

Some of the custom components are used on pages such as **Tax Certificates**, **Tax Identifiers**, **My Wallet**, and **Stored Payments**. Separate tabs are available for these pages. You can directly drag and drop the following custom components onto a particular page based on the user’s needs.

| Custom Component         | Page/Flow     | Description                                                                                                                                                                               |
| ------------------------ | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| B2B Sample Cart Contents | Checkout Page | <p>This component is used to display cart item details such as item name, SKU, price per unit. and total price. </p><p></p><p>This component is configured in the Experience Builder.</p> |
| dRB2B\_AddressDetails    | Checkout Page | <p>This component is used to display address details such as Bill To and Ship To. <br><br>                                                                                                |

</p><p></p><p>This component is configured in the Experience Builder.</p>                                                                                                                                                                                                     |
| dRB2B\_DrCompliance                   | <p>All Checkout Pages</p><ul><li>Checkout</li><li>Order Confirmation</li><li>My Wallet</li><li>My Tax Certificates</li><li>My Tax Identifiers</li></ul> | <p>This component is used to show the DR compliance link.<br><br></p><p></p><p>This component is configured in the Experience Builder.</p>                                                                                                                                                                                                                              |
| dRB2B\_DrTermsElement                 | <p>Sub Flow<br>DR Checkout Summary</p>                                                                                                                  | <p>The checkbox in this component is used for the active acceptance of terms and conditions by the user.</p><p></p><p></p><p></p><p>This component is configured in the flow.</p>                                                                                                                                                                                       |
| dRB2B\_MyWallet                       | My Wallet                                                                                                                                               | <p>This component is used for showing and adding new payment sources in the wallet. </p><p></p><p><code>dRB2B_MyWallet</code> is a wrapper component. </p><p></p><p>Its constituent components are <code>drb2b_StoredPayments</code> and <code>drb2bNewPayments</code></p><p></p><p>This component is configured in the Experience Builder.</p>                        |
| drb2b\_PaymentDetails                 | <p>Order Summary Detail,</p><p>Order Confirmation</p>                                                                                                   | This component is used to show payment details and is configured in the Experience Builder.                                                                                                                                                                                                                                                                                |
| dRB2B\_VatCreditMemo                  | Order Summary Detail                                                                                                                                    | <p>This component is used to show invoices and credit memos to the user and should be dropped on the Order Summary Detail page two times: one refers to the invoice and the other refers to the credit memo (type = Invoices or type = Credit Memos). </p><p></p><p>This component is configured in the Experience Builder.</p>                                           |
| drb2b\_ProductDetail                  | Order Confirmation                                                                                                                                      | <p>This component is used to show product details. </p><p></p><p></p><p>This component is configured in Experience Builder.</p>                                                                                                                                                                                                                                         |
| drb2b\_BuyerInfo                      | Sub Flow-DR Shipping Address                                                                                                                            | <p>This component is used to display user information such as Name, Email, Bill to and Ship to, etc. </p><p></p><p></p><p></p><p><code>drb2b_Buyer Info</code> is a wrapper component. </p><p></p><p>Its constituent component is <code>drb2bUsersTaxCertificates</code>.<br></p><p></p><p></p><p>This component is configured in the flow.</p>                     |
| DRB2B User Tax Certificates           | My Tax Certificates                                                                                                                                     | <p>This component is used to upload tax certificates. </p><p></p><p>DRB2B User Tax Certificates is a wrapper component.<br>  <br></p><p></p><p>Its constituent component is <code>drb2bAddTaxCertificate</code>.<br><br></p><p></p><p>This component is configured in the Experience Builder.</p>                                                                   |
| drb2b\_OrderSummary                   | Order Confirmation                                                                                                                                      | <p>This component is used to display Sub Total, Shipping, Tax, and Grand Total, etc. </p><p></p><p><br><code>drb2b_OrderSummary</code> is a wrapper component. </p><p></p><p>Its constituent component is <code>drb2b_CheckoutSummary</code>.<br><br></p><p></p><p>This component is configured in the Experience Builder and in the flow.</p>                      |
| drb2b\_CheckoutSummary                | Checkout Page                                                                                                                                           | <p>This component is used to display Sub Total, Shipping, Tax, and Grand Total, IOR Tax Regulatory Fee, and so on. </p><p></p><p></p><p>This component is configured in the Experience Builder.</p>                                                                                                                                                                     |
| drb2b\_DRUtil                         | Sub Flow-DR Checkout Summary and Delivery Method subflow                                                                                                | <p>This component tells the Order Summary to get taxes and the subtotal from the cart.</p><p></p><p></p><p>This component is configured in the flow.</p>                                                                                                                                                                                                                 |
| drb2b\_taxIdentifier                  | Sub Flow-DR Checkout Summary                                                                                                                            | <p>This component is used to add a tax identifier in the checkout flow. <br><br></p><p></p><p><code>drb2b_taxIdentifier</code> is a wrapper component</p><p></p><p>Its constituent component is <code>drb2b_MyTaxIdentifier</code>.<br><br></p><p></p><p>This component is configured in the checkout flow.</p>                                                    |
| drb2b\_MyTaxIdentifier                | My Tax Identifiers                                                                                                                                      | <p>This component is used for Tax Identifier functionality. </p><p></p><p></p><p></p><p><code>drb2b_MyTaxIdentifier</code>is a wrapper component.</p><p></p><p><br>Its constituent component is <code>drb2b_CountryPicklist.</code> </p><p></p><p>This component is configured in the Experience Builder.</p>                                                         |
| <p>drb2b_Payments</p><p></p><p></p> | Sub Flow-DR Payments                                                                                                                                    | <p>This component is used for payment sources (for example, Drop-in and Stored Payments).<br><br></p><p></p><p><code>drb2b_Payments</code> is a wrapper component.<br><br></p><p></p><p>Its constituent components are <code>drb2b_Dropin</code> and </p><p><code>drb2b_MyWalletpayment</code>. </p><p></p><p></p><p>This component is configured in the flow.</p> |
| drb2b\_HideCheckoutSummary            | As required                                                                                                                                             | <p>This component is added inside the screens of the flow and allows the client to conditionally show and hide the drb2b_CheckoutSummary component.<br><br>This component is configured in the flow.</p>                                                                                                                                                                   |

The screenshots below show a mocked-up version of each of the pages mentioned in the table above. The screenshots demonstrate the components that are recommended to be added to each page in the Experience Builder.

#### Checkout&#x20;

<div align="left"><img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FtTvLKmlYu76JjOTwxdAh%2FCheckout%20flow_installation.png?alt=media&#x26;token=afdd6346-5c39-4243-b1af-b32dce071428" alt=""></div>

#### Order confirmation &#x20;

<div align="left"><img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FEoVKqu1rrOYU76LPcK8k%2FOrder%20confirmation_1.png?alt=media&#x26;token=9df7b6ce-99f6-4478-8c16-b14d595bafc1" alt=""></div>

#### Order summary detail&#x20;

<div align="left"><img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FceC26Gh9sOAfWus9ZZjJ%2FOrder%20summary%20detail_installation.png?alt=media&#x26;token=4581b4f2-45f9-443c-b4ac-8f3cd61909b5" alt=""></div>

#### My Wallet (custom page)

<div align="left"><img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FHBSnu0Xsin4rWqAUy5Yg%2FMy%20Wallet_custom%20page.png?alt=media&#x26;token=73818abf-94ab-41bf-a411-881090a4d853" alt=""></div>

#### My Tax Certificates (custom page)

<div align="left"><img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FqhQUL0CHSF2Eb2QACoxJ%2FMy%20Tax%20Certificates_custom%20page.png?alt=media&#x26;token=90ba854d-5212-4ee8-9b65-ca20128afb0b" alt=""></div>

#### My Tax Identifiers (custom page)&#x20;

<div align="left"><img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FxjUHxRcPi6fikrvzIQtD%2FMy%20Tax%20Identifiers_custom%20page.png?alt=media&#x26;token=4ab09037-03f6-41ff-835d-3fca1e18d5b0" alt=""></div>

## Drag and drop (custom) components &#x20;

After the custom component is added into the Experience Builder, drag and drop the custom component on the page.

### Custom pages and menu items

The app provides custom components for three custom pages: My Wallet, My Tax Certificates, and My Tax Identifiers. It is recommended that you create these custom pages as required.

To customize a page:

1. Go to **Setup** in the Experience Builder.
2. Search **All Sites** in the **Search** field. &#x20;
3. Click **Builder**.&#x20;
4. Click **Home** at the top left corner. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FrG4HYtrrSI595GcELsFL%2FCustomize%20a%20page_Home.png?alt=media&#x26;token=398329ed-b085-4e30-a977-1c1087c12364" alt="" data-size="original">&#x20;
5. Scroll down at the bottom and the **+New Page** option will be available to create the custom page. Once the page has been created, it will appear in the **Pages** section. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F4OKiTf0FSTkEC74g4hvy%2FPages%20section.png?alt=media&#x26;token=a3545953-16d3-48df-beb6-e9ca05782138" alt="" data-size="original"> \
   The page will also appear on the **Menu Item**.\
   &#x20;<img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F1qtp2WNdQGWfcc6ywEL1%2FMenu%20item.png?alt=media&#x26;token=97efc17c-dc25-4caf-818b-49973a70fda8" alt="" data-size="original">&#x20;

{% hint style="info" %}
If you want to add any page for the **Menu Item**, select the particular page from the page picklist under the **Menu Item**.
{% endhint %}

### Create a custom menu

To add a menu:

1. Go to **Setup**.
2. Search **All Sites** in the **Search** field.&#x20;
3. Click **Builder**.
4. Click the user profile dropdown at the top right.\
   &#x20;<img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FqEFI8YLRxV2fOwdqHohS%2FCustom%20menu%201.png?alt=media&#x26;token=8f2cd006-1cb8-4ad4-80cb-d3deb2af9b5a" alt="" data-size="original">&#x20;
5. Click **Authenticated User Options**. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FHspSimPaXTmGnBvPpxVr%2FCustom%20menu%202.png?alt=media&#x26;token=2e1e0240-e61c-4c7d-abb5-bff3cb3e4f4b" alt="" data-size="original">&#x20;
6. Click the **Edit Default User** profile menu. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2F6UTzcYSV9Hms8T3kMtNE%2FCustom%20menu%203.png?alt=media&#x26;token=87f42fd1-802f-4a8a-bad2-9452fb61ad97" alt="" data-size="original">&#x20;
7. Click **+Add Menu item**.\
   &#x20;<img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FZmoFaQ3vMFrUNeMrpWFP%2FCustom%20menu%204.png?alt=media&#x26;token=9707e5e3-0a87-4045-a7ec-6c9b9961cc80" alt="" data-size="original">&#x20;
8. Select **Site Page** as the **Type**. The **Name** field will appear.&#x20;
   * Enter the desired name for the **Menu Item**.
   * Select the desired custom page as the **Page**.\ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FijzCOrttcrAQYuOvIyrH%2FSite%20Page_type.png?alt=media&#x26;token=e33362d7-a90e-474a-8e1a-16af2b59933e" alt="" data-size="original">&#x20;
9. Click **Save Menu**.
10. Click **Publish**.

### Add a custom component to a page

To add a custom component to a page:

1. Go to **Setup**.&#x20;
2. Search **All Sites** in the **Search** field.&#x20;
3. Click **Builder**.
4. Click **Home** at the top left corner and select the desired page. The custom components will appear at the bottom of the dropdown.
5. Drag and drop the custom component on the page.
6. Click **Publish**.

### Add a custom component to a custom page

To add a custom component to a custom page:

1. Go to **Setup**.&#x20;
2. Search **All Sites** in the **Search** field.&#x20;
3. Click **Builder**.
4. Click **Home** at the top left corner.
5. Type the name for the custom page in the **Search** field.
6. Click the selected page.
7. Click the lightning icon on the upper left side to add the custom component. The custom component will appear at the bottom of the dropdown.&#x20;
8. Drag and drop the custom component on the custom page.
9. Click **Publish**.
10. Repeat the above steps for other custom components you want to add to various pages.

{% hint style="info" %}
This custom component can be placed on other UI pages.&#x20;
{% endhint %}

### Add Tax Certificates component on the My Account page

As an example of how to add a custom component to a page, here are the steps to place the Tax Certificates component on the **My Account** page.

To add a tax certificate component on the **My Account** page:

1. Go to **Setup**.
2. Search **All Sites** in the **Search** field.&#x20;
3. Click **Builder**.
4. Click **Home** at the top left corner.

   <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FCFaMJ9Whzs5aTgznVo3O%2FMy%20Account%20page%201.png?alt=media&#x26;token=ab0dd0ef-ee7f-425b-9b6d-92721564e164" alt="" data-size="original">&#x20;
5. Type **My Account** in the **Search** field. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FS4Ls8ClNY9fbj3jiZKWE%2FMy%20Account%20page%202.png?alt=media&#x26;token=9a17b2cd-4068-4327-9384-54347f4f70b3" alt="" data-size="original">&#x20;
6. Click the selected page and click the lightning icon to add the custom component. The custom component will appear at the bottom of the dropdown. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FjA8k1YFacqZE791U5Lon%2FMy%20Account%20page%203.png?alt=media&#x26;token=87833864-4cf5-4ee1-b44a-aca15b2cf1e6" alt="" data-size="original">&#x20;
7. Drag and drop the custom component on the **My Account** page. \ <img src="https://3825059470-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FE4mQlr6JaI21hIMVilNW%2Fuploads%2FxcOQhCl6uzp2U7AhZOmc%2FMy%20Account%20page%204.png?alt=media&#x26;token=89bb6c78-2e7e-47c2-b0d5-10819b82e86d" alt="" data-size="original">&#x20;
8. Click **Publish**.\
   &#x20;&#x20;
