Newer Version Available
B2BCheckoutController Class
Communicate with simple checkout Apex methods to work with data
related to B2B Commerce checkout. Currently, the only data obtained is for Delivery
Methods.
Namespace
Usage
You must specify the sfdc_checkout namespace when creating an instance of this class.
B2BCheckoutController Methods
The following are methods for B2BCheckoutController.
getDeliveryMethods(activeOrCartId)
Get a list of delivery methods for the provided cartId and the
associated cost that are obtained from an external shipping gateway.
Signature
public static List<Map<String,ANY>> getDeliveryMethods(String activeOrCartId)
Parameters
- activeOrCartId
- Type: String
- The current webCartId for which a list of delivery methods is needed.
Return Value
Type: List<Map<String,ANY>>
The getDeliveryMethods method returns a list of delivery methods. Each delivery method is a map
of key-value pairs. We receive the following keys for each delivery method:
- carrier: The name of the shipping carrier. Examples: Fedex and UPS
- name: The label of the delivery method. Examples: Ground Shipping and Air Shipping
- deliveryMethodId: The unique Id for the deliveryMethod. Example: 2Dmxx000004C92CAF
- shippingFee: The cost of the delivery method as provided by the shipping gateway.
- currencyIsoCode: The currency in which the cost is calculated. Examples: USD and EUR