LogoLogo
Connectors
Salesforce B2B Commerce App 2.1.1
Salesforce B2B Commerce App 2.1.1
  • Salesforce B2B Commerce App 2.1.1
  • Introduction
    • How it works
    • What's new in version 2.1.1
    • Requirements
  • Integrating the Digital River Salesforce B2B Commerce App
    • Step 1: Install the Digital River App for Salesforce B2B
    • Step 2: Create page labels
    • Step 3: Configure the Salesforce B2B Commerce App
    • Step 4: Add custom Salesforce B2B Commerce App fields to page layouts
    • Step 5: Enable email deliverability
    • Step 6: Import ECCN codes, tax groups, and tax types
    • Step 7. Update the Product Sync settings
    • Step 8: Set up Digital River fulfillments
    • Step 9: Set up webhooks
    • Step 10: Configure CC Admin settings
    • Step 11: Configure landed cost
    • Step 12: Schedule backend jobs
    • Step 13: Manage permission sets
    • Step 14: Configure the Salesforce B2B Commerce app logs
    • Step 15: Test the Digital River Salesforce B2B Commerce app integration
  • Extending the Digital River Salesforce B2B Commerce App
    • Extend the Ship from address
    • Extend the App Webhook Framework
  • Support
  • Version number
  • Appendix
    • Fulfillment and cancellation flow
    • Issuing refunds
    • Managing regulatory fees
    • Managing subscriptions
    • Salesforce B2B Commerce App logs
    • Uploading tax certificates (US TEMS)
    • Global tax identifiers
    • VAT invoices
Powered by GitBook
On this page
  • Inputs (Required):
  • Output:
  • Example 1
  • Example 2
  1. Extending the Digital River Salesforce B2B Commerce App

Extend the Ship from address

Learn how to extend the Ship from address.

PreviousExtending the Digital River Salesforce B2B Commerce AppNextExtend the App Webhook Framework

Last updated 4 years ago

The current version of the App provides an extension point for setting the Ship From Address (Warehouse location) based on the client’s business requirement.

Extension for Ship from Address: The interface digitalriverv2.DRB2B_ShipFromAddressInterfaceV2 needs to be implemented to extend the App's ShipFromAddress functionality.

global Map <String, Object> getShipFromAddressInfo(Map<String, Object> inputData). This method is called when posting the user and cart information to Digital River to get the tax value. Out of the box, the App uses the Ship From Address values configured in the General Config tab of the Salesforce B2B Commerce App.

Inputs (Required):

Map <String, Object> that must include the following required key(s): cart: Specifies the CC Cart (ccrz__E_Cart__c) for which Ship From Address (warehouse location) needs to be evaluated.

Output:

Map<String, Object>: This should contain the following information addressLine1, addressLine2, city, stateCode, countryCode, and postalCodeof warehouse location.

Implementing an extension is a two-step process. To override the default App implementation:

  1. Extend the Salesforce B2B Commerce App extension point. That is, implement the interface digitalriverv2.DRB2B_ShipFromAddressInterfaceV2 and provide the implementation for the method getShipFromAddressInfo(Map<String, Object> inputData). Example 1 shows the method that should be used for writing the client-specific custom code for getting Ship From Address information. Example 2 shows an example of how the extension point can be used to populate the shipFrom address. Use this extension point to implement code to meet your business requirements.

  2. Configure the App to use this extension class as follows:

    • Go to the digitalriverv2__DR_Connector_Extension_Configuration__mdt metadata type.

    • Click Manage DR Connector Extension Configurations.

    • Open the Ship From Address metadata record.

    • Update the Extension Class field with the previously created Custom Class name.

Example 1

global class drb2b_myproj_shipFromAddress implements digitalriverv2.DRB2B_ShipFromAddressInterfaceV2 {
    global Map<String, Object> getShipFromAddressInfo(Map<String, Object> inputData) {
        //implementation specific code here
    }
}

Example 2

global class drb2b_myproj_shipFromAddress implements digitalriverv2.DRB2B_ShipFromAddressInterfaceV2 {
{
    global Map<String, Object> getShipFromAddressInfo(Map<String, Object> inputData) {
        // Get Cart from Input Data
        ccrz__E_Cart__c ccCart = (ccrz__E_Cart__c) inputData.get('cart');
        String cartId = ccCart.Id;

        // Populate Ship From Address
        Map<String, Object> outputData = new Map<String, Object>();
        outputData.put('addressLine1', '123 Main St');
        outputData.put('addressLine2', '');
        outputData.put('city', 'Plainsboro');
        outputData.put('stateCode', 'NJ');
        outputData.put('countryCode', 'US');
        outputData.put('postalCode', '08536');
        return outputData;
    }
}