Try our conversational search powered by Generative AI!

Quan Mai
Jan 3, 2017
  3188
(8 votes)

Breaking change in Commerce 10.2

We at Episerver follow the sematic version rules strictly and we try really hard to avoid breaking changes in non-major releases. We have been doing that well, but there is exception to anything and we, unfortunately, introduced one breaking change in Commerce 10.2.

Previously, DefaultShippingCalculator.GetShippingCost will try to create an instance of IShippingGateway for the configured shipping gateway. In Commerce 10.2, it will try to create an instance of IShippingPlugin for that configured shipping gateway. If you are using the new abstraction APIs, this error might appear:

Unable to cast object of type 'YourWebsite.YourShippingGateway' to type 'Mediachase.Commerce.Orders.IShippingPlugin'.

This is an unintentional change and sadly, it slipped through our tests. The workaround is to change your implementation of IShippingGateway to IShippingPlugin (or implement both, if you are using workflows. If you don't call workflows explicitly, but you are using Commerce Manager to manage order, that still counts). Those two interfaces have very similar signature, the only difference is IShippingGateway.GetRate uses Shipment, while IShippingPlugin.GetRate uses IShipment.

We apologize for this issue - it's a hard lesson learned, and we are doing everything we can to reduce the impact of the issue, and avoid having the same problems in the future.

Thank you for your understanding, and if you have any questions or need further assistance, please feel free to contact our developer support service.

UPDATE: Commerce 10.2.2 which will be released later today (Jan 9th 2017) will fix the issues and you would not have to change your code to make the payment and shipping gateways work. However if you changed your code, you don't have to revert such changes.

Jan 03, 2017

Comments

Magnus Rahl
Magnus Rahl Jan 5, 2017 07:58 PM

We have bug COM-3626 to try to mitigate the effects of this breaking change by adding a fallback to use the old interfaces. It should go into the next release. Converting to use IShippingPlugin/IPaymenPlugin/ISplitPaymentPlugin over the corresponding *Gateway interfaces will still be the recommended way forward though.

Please login to comment.
Latest blogs
From Procrastination to Proficiency: Navigating Your Journey to Web Experimentation Certification

Hey there, Optimizely enthusiasts!   Join me in celebrating a milestone – I'm officially a certified web experimentation expert! It's an exhilarati...

Silvio Pacitto | May 17, 2024

GPT-4o Now Available for Optimizely via the AI-Assistant plugin!

I am excited to announce that GPT-4o is now available for Optimizely users through the Epicweb AI-Assistant integration. This means you can leverag...

Luc Gosso (MVP) | May 17, 2024 | Syndicated blog

The downside of being too fast

Today when I was tracking down some changes, I came across this commit comment Who wrote this? Me, almost 5 years ago. I did have a chuckle in my...

Quan Mai | May 17, 2024 | Syndicated blog

Optimizely Forms: Safeguarding Your Data

With the rise of cyber threats and privacy concerns, safeguarding sensitive information has become a top priority for businesses across all...

K Khan | May 16, 2024