Quan Mai
Jan 3, 2017
  3252
(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
Creating an Optimizely CMS Addon - Adding an Editor Interface Gadget

In   Part One   of this series, I covered getting started with creating your own AddOn for Optimizely CMS 12. This covered what I consider to be an...

Mark Stott | Aug 30, 2024

Configure your own Search & Navigation timeouts

The main blog Configure your own Search & Navigation timeouts was posted for years but you need copy the code to your application. We now bring tho...

Manh Nguyen | Aug 30, 2024

Joining the Optimizely MVP Program

Andy Blyth has been honoured as an Optimizely MVP, recognising his contributions to the Optimizely community. Learn how this achievement will enhan...

Andy Blyth | Aug 29, 2024 | Syndicated blog

Welcome 2024 Summer OMVPs

Hello, Optimizely community! We are thrilled to announce and welcome the newest members to the Optimizely Most Valuable Professionals (OMVP) progra...

Patrick Lam | Aug 29, 2024

Create custom folder type in Edit Mode

Content Folders, which are located in assets pane gadget or multichannel content gadget, allow you to add any type of block or folders. But...

Grzegorz Wiecheć | Aug 28, 2024 | Syndicated blog

Creating an Optimizely AddOn - Getting Started

When Optimizely CMS 12 was launched in the summer of 2021, I created my first AddOn for Optimizely CMS and talked about some of the lessons I learn...

Mark Stott | Aug 28, 2024