# Upgrading to version 2.0

Use the following instructions to upgrade from a previous version of the Digital River app for Salesforce Lightning to version 2.0. If installing a new version of this app, see [Install the Digital River app](https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-app-2.0/integrate-the-salesforce-lightning-app/step-1-install-the-digital-river-app) for instructions.

{% hint style="info" %}
**Note:** If you previously used the Digital River app with an Aura storefront and are implementing the LWR storefront, we recommend you perform all steps in Integrating the Digital River app as you would for a new environment.

If you use the Digital River app with an Aura storefront and will still have an Aura storefront after the upgrade, continue with the steps below.
{% endhint %}

{% hint style="info" %}
**Note:** If upgrading from version 1.1 or later, you only need to perform Steps 1, 7, and 8.
{% endhint %}

1. Install the latest version of the Salesforce Lightning app as described in [Step 1](https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-app-2.0/integrate-the-salesforce-lightning-app/step-1-install-the-digital-river-app).\
   **Note:** A known Salesforce bug exists for setting default values on designer attributes. You can work around this by clicking through all designer attributes and Saving whenever you add a new component to a screen. You should do this when upgrading to a new connector version, especially if a particular component is not rendering.
2. Update the Shipping Address subflow described in [Configure the shipping address subflow](https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-app-2.0/integrate-the-salesforce-lightning-app/step-17-integrate-the-digital-river-components-into-the-checkout-flow/integrate-the-digital-river-components-into-an-asynchronous-checkout-flow/subflow-configuration/configure-the-shipping-address-subflow).\
   **Note**: We added some additional actions and components to this app version.
3. Update the Payments and Billing subflow described in [Configure the Payment and Billing Address subflow](https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-app-2.0/integrate-the-salesforce-lightning-app/step-17-integrate-the-digital-river-components-into-the-checkout-flow/integrate-the-digital-river-components-into-an-asynchronous-checkout-flow/subflow-configuration/configure-the-payment-and-billing-address-subflow) as follows:
   1. Remove the `Payment_Details` resource. You can leave it as is, but it will no longer be used.
   2. Add the `db2b_paymentDetails` component to the `placeOrder` screen.
4. [Enable the order.cancelled event](https://docs.digitalriver.com/digital-river-api/administration/dashboard/developers/webhooks/creating-a-webhook#step-3-create-webhooks) from the Webhooks page on the [Digital River Dashboard](https://dashboard.digitalriver.com/login). See [Step 11](https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-app-2.0/integrate-the-salesforce-lightning-app/step-11-set-up-webhooks) for complete instructions.\
   ![](https://content.gitbook.com/content/cMse5dnAKvo2qT6VvSWW/blobs/oUWmEEw0QSGiwoyRjcTj/enable%20order%20cancelled%20event.png)
5. Add a new picklist value called `partially_cancelled` to the `DR_Order_Item_State__c` field on the `OrderItem` object.
6. Add the following new picklist values to the `DR_Order_State__c` field on the `Order` object:
   1. `cancelled_by_dr`
   2. `cancelled_by_sf`
   3. `salesforce_failure`
7. Update the **Key** value for the **Connector Version** to version `2.0/3.58.` Use the following instructions:
   1. Click **Setup** ![](https://content.gitbook.com/content/cMse5dnAKvo2qT6VvSWW/blobs/ugAkYdnhfyrtrCqBkpBl/Setup.png) and select **Setup** from the drop-down list.
   2. Type `Custom Metadata Types` in the **Quick Find** field and then click **Custom Metadata Types**. The **Custom Metadata Types** page appears with the **All Metadata Types** list.
   3. Locate the **DR Connector Configuration** metadata type from the lists (Label) and click the **Manage Records** action next to that type selection. \
      ![](https://content.gitbook.com/content/cMse5dnAKvo2qT6VvSWW/blobs/YnlWO6rWS8aDOQ7dbwQC/CMDT_list_1.jpg)
   4. Find the **Connector Version** setting (Label) on the DR Connector Configurations page. Click **Edit** next to the **Connector Version** setting.\
      &#x20;![](https://content.gitbook.com/content/cMse5dnAKvo2qT6VvSWW/blobs/vlQSdUPEtXC2y3J9eOmR/CMDT_version_2.jpg)
   5. Update the **Key** value for the **Connector Version** to the version mentioned at the beginning of this step or as instructed by your project manager.\
      ![](https://content.gitbook.com/content/cMse5dnAKvo2qT6VvSWW/blobs/YwvEPTqMY8ax2iB5nfAB/CMDT_key_3.jpg)
   6. Click **Save** after updating the version number and making all other listed changes. Return to the Home page.
8. If you sell to businesses, you must collect the Organization Name of the business in your UI. If you sell to individuals, skip this step. Add the Buyer Organization Name to your user interface. This component's API Name is `Buyer_OrganizationName__c` on the [WebCart object](https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-app-2.0/appendix/custom-fields-and-objects#cart-standard-object). Collect this field's information on the user interface screen where you collect the Purchase Type from the shopper. This is typically done on the Shipping Address screen. If you use the `drb2b_buyerInfo` component, this field has already been added. If you do not use that component, add a new field to your user interface to collect the Organization name. See the  [Buyer info component](https://docs.digitalriver.com/salesforce-lightning/salesforce-lightning-b2b-commerce-app-2.0/extend-the-salesforce-lightning-app/customizing-the-lightning-web-components/components/buyer-info-component) for more details.
