LogoLogo
Connectors
Salesforce Lightning B2B Commerce App 1.1
Salesforce Lightning B2B Commerce App 1.1
  • Salesforce Lightning B2B Commerce App 1.1
  • Introduction
    • How it works
    • What's new in version 1.1
  • Upgrading to version 1.1
  • Integrate the Salesforce Lightning app
    • Step 1: Install the Digital River app
    • Step 2: Configure the Digital River app
    • Step 3: Register external services
    • Step 4: Configure DCM logs
    • Step 5: Add custom fields to the page layouts
    • Step 6: Enable email deliverability
    • Step 7: Import ECCN codes, tax groups, and tax types
    • Step 8: Configure and synchronize the products
    • Step 9: Schedule backend jobs
    • Step 10: Set up integration between Salesforce and Digital River
    • Step 11: Set up webhooks
    • Step 12: Configure landed cost
    • Step 13: Manage permission sets
    • Step 14: Configure shipping integration
    • Step 15: Integrating refunds
    • Step 16: Configure the From email address
    • Step 17: Integrate the Digital River components into the checkout flow
      • Custom components used in the checkout subflows
      • Subflow configuration
        • Starter subflows
        • Configure the shipping address subflow
          • Configure the shipping address screen
        • Configure the delivery method subflow
        • Configure the Checkout Summary subflow
        • Configure the Payment and Billing Address subflow
          • Edit the Payment Method screen
          • Edit the decision elements
          • Link screen components
      • Configure the main checkout flow
      • Add custom components to pages
        • Drag and drop (custom) components
    • Step 18: Test the Salesforce Lightning app integration
  • Extend the Salesforce Lightning app
    • Extend the ship from address
    • Extend the webhook framework
    • Configure subscriptions
    • Shipping choice extension point
    • Customer credit
      • addCustomerCreditSourceToCheckout
      • deattachPaymentToCheckout
      • getAmountRemainingforCheckout
      • getCartDetailsById
      • Publishing connector events
    • Overriding Digital River CSS
    • Customizing the Lightning web components
      • Designer attributes
      • Components
        • Buyer info component
        • Tax certificate component
        • DR terms component
        • DR util component
        • Hide checkout summary component
        • Place order component
  • User guide
    • Regulatory fees
    • Tax certificates
    • Tax identifiers
    • My wallet
    • Customer credit
    • Checkout and order creation
    • Fulfillment/cancellation flow
    • Refunds
    • Invoices and credit memos
  • Support
  • Appendix
    • Custom fields and objects
    • Contact point address
    • Multi-currency support
Powered by GitBook
On this page
  • Reloading Drop-In
  • Publishing an event to reload the Drop-in component
  • Reloading the checkout summary component
  1. Extend the Salesforce Lightning app
  2. Customer credit

Publishing connector events

Learn how to trigger connector events for the customer credit feature.

PreviousgetCartDetailsByIdNextOverriding Digital River CSS

Last updated 3 years ago

To implement the customer credit feature, in addition to calling the methods described above, you must publish the events that interact with the components included in the connector. This section describes those events.

Reloading Drop-In

You should publish the event to reload Drop-in after applying or removing a partial amount from customer credit.

Publishing an event to reload the Drop-in component

Prerequisite: Publish this event after calling or methods.

To publish the event to reload the Drop-in (drb2b_dropin) component, import the DigitalRiverMessageChannel__c message channel and message service into the customer credit javascript file.

Import example
import {publish, MessageContext } from 'lightning/messageService';
import dr_lms from '@salesforce/messageChannel/ digitalriverv3__ DigitalRiverMessageChannel__c';

Declare the messageContext variable as shown in below.

messageContext example
@wire(MessageContext) messageContext; 

Publish the event. When publishing the event, use the reloadDropin value for the purpose parameter as shown in the following example:

Publish example
publish(this.messageContext, dr_lms, {
  purpose: 'reloadDropin' 
  });

Reloading the checkout summary component

Prerequisite: Publish this event after calling or methods.

Reload the checkout summary component to reflect the latest values whenever a shopper adds or removes a source from the checkout. This will update the UI with the latest values, including the amount contributed and the amount remaining to be contributed.

To publish an event to reload the checkout summary (drb2b_checkoutSummary) component, import the DigitalRiverMessageChannel__c message channel and message service into the customer credit javascript file.

If you already imported the DigitalRiverMessageChannel__c message channel and message service into the customer credit JavaScript file, you can skip this step.

Import example
import {publish, MessageContext } from 'lightning/messageService';
import dr_lms from '@salesforce/messageChannel/ digitalriverv3__ DigitalRiverMessageChannel__c';

Declare the messageContext variable as shown below.

messageContext example
 @wire(MessageContext) messageContext;

If you already declared the messageContext variable, you can skip this step.

Publish the event. When publishing the event, use the reloadCheckoutSummary value for the purpose parameter as shown in the following example:

Publish example
publish(this.messageContext, dr_lms, {
            purpose: 'reloadCheckoutSummary' 
        });

addCustomerCreditSourceToCheckout
deattachPaymentToCheckout
addCustomerCreditSourceToCheckout
deattachPaymentToCheckout