I've run into an error with a custom shipping module that's causing errors with the PayPal Commerce Platform checkout flow. When my shipping module runs ShippingModule_Basket_Methods, it calculates rates from several LTL carriers, then saves that to the basketinfo table. Then, on ShippingModule_Calculate_Basket, it reads those back to save the selected method to the basket charges.
However, PayPal resets a lot of basket data when it tries to create the order, wiping out my shipping rates in the process, which causes an error when my module is asked to run ShippingModule_Calculate_Basket and save the rate to the basket. I'm trying to figure out the best way to avoid this error. By this point in the process, PayPal will have already asked my module for rates, which were calculated and selected by the customer in the PayPal checkout window, so I'd like to make sure we always use that selected rate instead of recalculating again. Partly for performance reasons, and partly just to ensure the rate doesn't change for some unexpected reason.
Is there a way to do that, or is my only option to recalculate at that point?
However, PayPal resets a lot of basket data when it tries to create the order, wiping out my shipping rates in the process, which causes an error when my module is asked to run ShippingModule_Calculate_Basket and save the rate to the basket. I'm trying to figure out the best way to avoid this error. By this point in the process, PayPal will have already asked my module for rates, which were calculated and selected by the customer in the PayPal checkout window, so I'd like to make sure we always use that selected rate instead of recalculating again. Partly for performance reasons, and partly just to ensure the rate doesn't change for some unexpected reason.
Is there a way to do that, or is my only option to recalculate at that point?