Try our conversational search powered by Generative AI!

ICart and shipping gateways



I'm currently in a project where we try to switch over to using ICart. I'm stuck trying to get the shipping rates from a shipping gateway.

Getting the rates from a shipping gateway requires a Shipment object, not IShipment as ICart use. But according to docs it should be a list of LineItem (not ILineItem) as input.

Any suggestions?

Jul 12, 2018 15:22

You should implement IShippingPlugin instead of IShippingGateway (you can implement both, however)

Jul 13, 2018 9:57

We're already using IShippingGateway.

var shippingGateway = (IShippingGateway)Activator.CreateInstance(type, ServiceLocator.Current.GetInstance<ICurrentMarket>().GetCurrentMarket());

shippingGateway.GetRate() expects Guid methodId, Shipment shipment, ref string message

We're on Commerce 11.8.3 if that makes a difference. Documentation says this is valid for 10 and up.

Jul 13, 2018 10:17

If you want to use the abstraction, you should implement IShippingPlugin which use IShipment instead

Jul 13, 2018 10:38
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.