meanbee / magento2-royalmail

[No Longer Supported] A Royal Mail shipping integration for Magento 2.
Open Software License 3.0
5 stars 4 forks source link

"We can't place the order" at PayPal Review Step #1

Closed bobbyshaw closed 7 years ago

bobbyshaw commented 8 years ago

We've had a report of this error on PayPal review step when clicking place order.

It's been identified as related to https://github.com/magento/magento2/issues/5021

It appears that checkout doesn't complete if the carrier and method code are too long when concatenated. We see this because the code is truncated:

Royal Mail Method: meanbee_royalmail_secondclasssmallparcel {"is_exception":false} []
Royal Mail Method: meanbee_royalmail_firstclasssignedforsma {"is_exception":false} []
punkstar commented 8 years ago

So it looks like there's a 40 character limit being imposed somewhere? I propose we add a test to ensure that our codes are no longer than 40 characters, and trim them down if they are.

bobbyshaw commented 8 years ago

Renamed the carrier code from "meanbee_royalmail" to "rm" to save some characters in the short term. Unlikely but still more likely this will then conflict with another shipping extension. There is also a risk that with the method the string is still too long. We should spend some time creating shorter method codes. It may mean we have to may every method code from the Royal Mail library to a shorter version within the Magento extension. This is bad for future updates with new methods. But we don't want to lose the clarity that the full code provides in the library.

@punkstar There is a risk that the first 40 characters may not be unique between different methods. All of the meanbee_royalmail_parcelforceworldwideexpress* methods would experience this problem. some of these methods will still break even with the carrier being rm. By doing rm & truncating the code though we might make it under the limit.

2

This pull request only does RM for now but I can't spend any more time on it today.