In a B2B Commercestore, which three tasks must a developer complete to implement the use of a third-party service for either tax, shipping, or pricing calculation?
A.
Register an Apex class as the integration in the store administration
B.
Create a flow to call the external service directly
C.
Create an Apex class implementing the appropriate interface.
D.
Create a named credential for authentication with an external service
To implement the use of athird-party service for either tax, shipping, or pricing calculation in a B2B Commerce store, a developer must complete these three tasks:
Create an Apex class that implements the appropriate interface for the calculation type. For example, for tax calculation, the developer must implement the sfdc_checkout.CartTax interface and define the getTax method. This method takes a Cart object as an input parameter and returns a list of CartTax objects with the calculated tax amounts.
Create a named credential forauthentication with the external service. A named credential specifies the URL of a callout endpoint and its required authentication parameters. The developer can use the named credential in the Apex class to make the callout to the external service and handle the response.
Register the Apex class as the integration in the store administration. The developer must specify the Apex class name in the corresponding field for the calculation type. For example, for tax calculation, the developer must enter the Apex class name in the Tax Calculation Integration field. This way, the store can invoke the Apex class to perform the calculation for each cart.
The other options are not valid tasks for implementing the use of a third-party service. Creating a flow to callthe external service directly is not supported for B2B Commerce, and creating an Apex class with an invocable method is not required for the calculation integration. References:
Integrate with External Services
CartTax Interface
Named Credentials
[Store Administration]
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit