ICart and shipping gateways

Vote:
 

Hi,

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?

#195075
Jul 12, 2018 15:22
Vote:
 

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

#195094
Jul 13, 2018 9:57
Vote:
 

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.

#195100
Jul 13, 2018 10:17
Vote:
 

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

#195102
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.