LogoLogo
Connectors
Salesforce Lightning B2B Commerce App 1.2
Salesforce Lightning B2B Commerce App 1.2
  • Salesforce Lightning B2B Commerce App 1.2
  • Introduction
    • How it works
    • What's new in version 1.2
  • Upgrading to version 1.2
  • 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 util component
        • DR Terms component
        • Hide checkout summary component
        • Order Summary component
        • Place order component
        • Payment 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
  • Sending a request
  • Receiving a response
  • Calling the global method from a custom component
  1. Extend the Salesforce Lightning app
  2. Customer credit

getAmountRemainingforCheckout

Learn how to get the remaining amount available for checkout.

Use this global method to get the remaining customer credit amount that the shopper can contribute to the checkout.

Sending a request

This method accepts parameters in JSON string format. You need to pass the cartId with this method.

Parameter
Required/Optional
Description

cartId

Required

The Salesforce ID for the cart object.

Request body example
"{
    "cartId":CartId
}"

Receiving a response

You'll see the following parameters in the response.

Parameter
Description

isSuccess

This global method returns a Boolean value where:

  • true–indicates the call to Digital River to get the remaining amount was successful. This global method will also return the amount remaining to be be contributed and the currency code when successful.

  • false–indicates an error occurred while getting the remaining amount. The system returns an error message when an error occurs, and the Boolean value is false.

amountRemainingToBeContributed

The amount remaining to be contributed to the checkout. A customer credit source can be created for an amount less than or equal to this value.

currencyCode

The currency code of the checkout

errorMessage

If the system returns an error and the value for isSuccess is false, this parameter displays one of the following error messages:

  • Missing or invalid input parameters specified: One of the input parameters are missing or invalid.

Response body example
{
   "isSuccess":{{Boolean_Value}},
   "amountRemainingToBeContributed":{{Remaining_Amount_To_Be_Contributed}},
   "currencyCode": {{Currency_Code}},
   "errorMessage": {{Error_Message}} // In case of error
}

Calling the global method from a custom component

Import the getAmountRemainingforCheckout method into your custom component javascript file with digialriverv3 as the namespace as shown below.

Import example
import getRemainingAmount from 
"@salesforce/apex/digitalriverv3.DRB2B_CustomerCreditService.getAmountRemainingforCheckout";

Call the global method from a custom JavaScript file by passing the cartId as shown below.

getRemainingAmount(){
        let input = {
            cartId:this.recordId
        };
        getRemainingAmount({inputData:JSON.stringify(input)})
        .then((data)=>{
         // implement logic here in case of success
        })
        .catch((error)=>{
         // implement logic here in case of error
        })
    }
PreviousdeattachPaymentToCheckoutNextgetCartDetailsById

Last updated 2 years ago

Unable to retrieve Remaining Amount for checkout: An that comes from the Digital River API.

error message