cqpbert Posted September 2, 2023 Share Posted September 2, 2023 It seems my UPS module quietly stopped working. I guess now I need to have some sort of app over at my UPS account. So I have done that I think. I have copied my Client ID and Client secret into the module. I have picked all the services and saved. Cleared the Cache. Logged in as one of my Canadian customers, added something to the cart but at checkout it says no suitable shipping method. Does anybody have experience with this newer module? It used to work great for USA and Canada. Quote Link to comment Share on other sites More sharing options...
bsmither Posted September 2, 2023 Share Posted September 2, 2023 I see in the code that the UPS module should log the rate request and response in the admin, Request Log. Please review the response to see if there was a fault in the request. Quote Link to comment Share on other sites More sharing options...
cqpbert Posted September 2, 2023 Author Share Posted September 2, 2023 That helps some. The auth seems to work, but the rate request does not. I don't want to post the entire error here since it has addresses in it. here is the error: Response received (401 - Unauthorized) {"response":{"errors":[{"code":"250002","message":"Invalid Authentication Information."}]}} Maybe I have too many apps in UPS? Am I supposed to only get the auth or am I supposed to get shipping as well? seems it is the rate request. here is the heading of the error: Request Sent (cURL) - https://wwwcie.ups.com/api/rating/v1/Shop I tried adding the rating app and it says its approved. Quote Link to comment Share on other sites More sharing options...
cqpbert Posted September 2, 2023 Author Share Posted September 2, 2023 But still the same error Quote Link to comment Share on other sites More sharing options...
cqpbert Posted September 24, 2023 Author Share Posted September 24, 2023 I am still having issues with this. I am trying to upload a screen shot from my request log but that is not working. Maybe this will work: "NumOfPieces":1,"Package":[{"PackagingType":{"Code":"00","Description":"Packaging"},"Dimensions":{"UnitOfMeasurement":{"Code":"IN","Description":"Inches"},"Length":"6.0000","Width":"20.0000","Height":"12.0000"},"PackageWeight":{"UnitOfMeasurement":{"Code":"LBS","Description":"Pounds"},"Weight":32}}]}}} Response received (400 - Bad Request) {"response":{"errors":[{"code":"110601","message":"Missing or invalid package weight for package 1."}]}} that is the end of the response code for the request, as well as the response. According to the response there is no package weight, but as you can see a weight has been passed to them. I hope we can get this sorted out soon. Quote Link to comment Share on other sites More sharing options...
cqpbert Posted October 6, 2023 Author Share Posted October 6, 2023 No ideas anybody? Anyone know where else I can look? I really need this to work correctly. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 6, 2023 Share Posted October 6, 2023 It seems that PHP is encoding the weight value as a numerical data type, whereas UPS requires a string data type. In the UPS module, shipping.class.php, line 315, make this change: From: "Weight" => $item['product_weight'] To: "Weight" => (string)$item['product_weight'] There are also the item's dimensions, but I think CubeCart handles those as strings anyway. Quote Link to comment Share on other sites More sharing options...
cqpbert Posted October 7, 2023 Author Share Posted October 7, 2023 Thanks as always Brian. I think we are getting closer. Now the error is this: "NumOfPieces":1,"Package":[{"PackagingType":{"Code":"00","Description":"Packaging"},"Dimensions":{"UnitOfMeasurement":{"Code":"IN","Description":"Inches"},"Length":"6.0000","Width":"20.0000","Height":"12.0000"},"PackageWeight":{"UnitOfMeasurement":{"Code":"LBS","Description":"Pounds"},"Weight":"32"}}]}}} Response received (400 - Bad Request) {"response":{"errors":[{"code":"110609","message":"All package dimensions are required and each must be greater than 0 for package 1."}]}} I added string in front of the dimensions as you did on the weight hoping it would help and that I had learned something. But it did not. BTW, to me it seems like this is an error with the UPS module? Maybe the dimensions need to be numbers and not strings? Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 7, 2023 Share Posted October 7, 2023 The UPS API specs say that the dimensions are to be text strings -- 6 digits in length with 2 digits of significance after the decimal point. How have you specified these weights in the UPS module? There is a choice to use individual item dimensions or a global set of dimensions. Either way, check to see if the dimensions are stated as having four places after the decimal point. If so, make it to two places. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 7, 2023 Share Posted October 7, 2023 Let's look at this another way. Instead of making sure the source data conforms to the needs of UPS, use a formatter in the module to make the passed in data be presented according to the needs of UPS. So, for the code handling dimensions: From: "Length" => $item['product_depth'], "Width" => $item['product_width'], "Height" => $item['product_height'] To: "Length" => sprintf("%01.2F",$item['product_depth']), "Width" => sprintf("%01.2F",$item['product_width']), "Height" => sprintf("%01.2F",$item['product_height']) Quote Link to comment Share on other sites More sharing options...
cqpbert Posted October 7, 2023 Author Share Posted October 7, 2023 YOU DID IT!!!!!!!!!!!!!!! To be sure, I entered in 20,16,4 for the dimensions and cube cart has converted them to 20.000,16.000,4.000. Thank You again. Now to get my other stuff going - I see you gave it some thought. where did you locate the UPS API specs so quickly? Seems like I should have been able to do that and not been such a PIA Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 7, 2023 Share Posted October 7, 2023 Three decimal places? Using sprintf() as coded should get only two decimal places. See: https://developer.ups.com/catalog?loc=en_US The 'Rating' documentation. Quote Link to comment Share on other sites More sharing options...
cqpbert Posted October 8, 2023 Author Share Posted October 8, 2023 well actually it was a typo above, but not in the correct way. It should have been 4 places not three. here is a product where I did not fill in anything (which will be an issue for sure) Here is my numbers I have entered: And here is after save and reload: Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 8, 2023 Share Posted October 8, 2023 Ok. Please let us know what you get when you make the edit in shipping.class.php, using sprintf(). Quote Link to comment Share on other sites More sharing options...
cqpbert Posted October 8, 2023 Author Share Posted October 8, 2023 Sorry I think it was missed. Yes it works great now with the sprintf() in the UPS module. Quote Link to comment Share on other sites More sharing options...
BrettLee6 Posted March 30 Share Posted March 30 (edited) On 9/2/2023 at 8:31 AM, cqpbert said: It seems my UPS module quietly stopped working. I guess now I need to have some sort of app over at my UPS account. So I have done that I think. I have copied my Client ID and Client secret into the module. I have picked all the services and saved. Cleared the Cache. Logged in as one of my Canadian customers, added something to the cart but at compare solar checkout it says no suitable shipping method. Does anybody have experience with this newer module? It used to work great for USA and Canada. Ensure your UPS module settings are correctly configured, including Client ID and secret. Double-check shipping services selection and clear cache Edited March 30 by BrettLee6 rectify mistake Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.