magento2 icon indicating copy to clipboard operation
magento2 copied to clipboard

UPS API Change Request

Open ntmhung opened this issue 1 year ago • 91 comments

Description

My client has informed me that starting from June 5, 2023, UPS no longer issues new access keys. UPS is going to change to use Oauth 2.0. image

I think the magento/module-ups module should be updated to meet the requirement. It needed to be done before June 5, 2023. This is the API document https://developer.ups.com/api/reference#operation/GenerateToken.

Expected behavior

The magento/module-ups supports using the OAuth security model from UPS.

Benefits

It will help new users planning to use the UPS shipping method connect to the UPS API after June 5, 2023.

Additional information

No response

Release note

No response

ntmhung avatar May 24 '23 10:05 ntmhung

Hi @ntmhung. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:


Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

m2-assistant[bot] avatar May 24 '23 10:05 m2-assistant[bot]

@magento give me 2.4-develop

chernenm avatar May 25 '23 20:05 chernenm

HI, Please provide patch to us so we continue to use UPS as shipping method

techguysourav avatar Jun 02 '23 08:06 techguysourav

This is a major S0 issue that Adobe will need to address in the immediate future.

The immediate impact is that starting this coming Monday, June 5 2023, merchants will no longer be able to add UPS rates to Magento. UPS will no longer generate any XML API keys, which Magento requires.

The long-term impact is that as of June 2024, every merchant that uses Magento's native UPS rate connector will no longer get rates from UPS. This has a high probability of breaking checkout, as most US merchants do not offer multiple parcel shipment providers.

Until this is resolved in Magento core, Merchants have the option of switching to a third party provider for their UPS rates, but that involves additional costs and setup. That's not an acceptable solution in the broad picture. See eg. https://twitter.com/saas_boss/status/1664354635346243585

rhoerr avatar Jun 02 '23 17:06 rhoerr

Hello @rhoerr,

Adobe team is working on a solution for new 2.4.6 customers. All the current 2.4.4, 2.4.5 and 2.4.6 customers who are currently using the XML API gateway to get shipping rates from UPS are not affected and can continue utilize this API till its EOL in June 2024. Adobe Commerce 2.4.7 will come with upgraded UPS REST API instead.

chernenm avatar Jun 02 '23 18:06 chernenm

Great, thank you for the info @chernenm . Will look forward to that in the 2.4.7 release coming up soon.

rhoerr avatar Jun 02 '23 18:06 rhoerr

Plz give link of any 3rd party that giving ups with Magento

On Fri, 2 Jun 2023, 23:08 Ryan Hoerr, @.***> wrote:

This is a major S0 issue that Adobe will need to address in the immediate future.

The immediate impact is that starting this coming Monday, June 5 2023, merchants will no longer be able to add UPS rates to Magento. UPS will no longer generate any XML API keys, which Magento requires.

The long-term impact is that as of June 2024, every merchant that uses Magento's native UPS rate connector will no longer get rates from UPS. This has a high probability of breaking checkout, as most US merchants do not offer multiple parcel shipment providers.

Until this is resolved in Magento core, Merchants have the option of switching to a third party provider for their UPS rates, but that involves additional costs and setup. That's not an acceptable solution in the broad picture.

— Reply to this email directly, view it on GitHub https://github.com/magento/magento2/issues/37534#issuecomment-1574089907, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3VJ3B53BUYX7O5MM5DJALXJIQK7ANCNFSM6AAAAAAYNFKIWY . You are receiving this because you commented.Message ID: @.***>

techguysourav avatar Jun 03 '23 02:06 techguysourav

Seriously, this is not a joke! Something needs to be done about this, now. There is no point in using Magento if it can't calculate shipping. If this doesn't get fixed soon, I foresee a mass exodus from Magento.

ihaveathumb avatar Jun 07 '23 12:06 ihaveathumb

hello @ihaveathumb, @techguysourav, Please check the official UPS extension at Magento marketplace https://marketplace.magento.com/ups-shipping.html while Adobe is working on a solution for out of the box integration.

chernenm avatar Jun 09 '23 14:06 chernenm

@chernenm Is the message at the top of that extension listing still applicable?

IMPORTANT NOTE: This extension is currently available for merchants in POLAND, FRANCE, UNITED KINGDOM, GERMANY, ITALY, SPAIN, NETHERLANDS and BELGIUM ONLY. It will be available for merchants in other countries soon. At this time, please only install this extension if you are in the above-mentioned countries.

Also, when will 2.4.7 with the UPS REST API be released? There's not currently any published release date for 2.4.7, which suggests it won't be until sometime in 2024. That's cutting it close for the many merchants that will need to update.

Thanks

rhoerr avatar Jun 09 '23 14:06 rhoerr

hi @rhoerr,

The API update is planed to be included into 2.4.7-beta2 version which scheduled for October 2023. In addition we are working on a hotfix for new 2.4.6 customers and ensuring that UPS extension documentation is up to date at Magento marketplace.

chernenm avatar Jun 09 '23 14:06 chernenm

hello @ihaveathumb, @techguysourav, Please check the official UPS extension at Magento marketplace https://marketplace.magento.com/ups-shipping.html while Adobe is working on a solution for out of the box integration.

That doesn't work for me, because I'm not in the very few countries that it supports.

ihaveathumb avatar Jun 19 '23 14:06 ihaveathumb

This is an issue as UPS will no longer generate keys and the extension on marketplace isn't for the USA! So if you don't have keys then no UPS on your Magento site. Not good at all.

maxq avatar Aug 03 '23 15:08 maxq

Can you still generate keys on UPS as I have not been able to?

maxq avatar Aug 03 '23 15:08 maxq

Hello, @maxq,

Adobe is currently working on the solution for this issue, we will be releasing a hotfix for 2.4.4, 2.4.5 and 2.4.6 customers.

chernenm avatar Aug 03 '23 21:08 chernenm

When, though? This is taking way too long for an issue that you knew far ahead of time was going to happen!!!

On Thu, Aug 3, 2023, 5:29 PM chernenm @.***> wrote:

Hello, @maxq https://github.com/maxq,

Adobe is currently working on the solution for this issue, we will be releasing a hotfix for 2.4.4, 2.4.5 and 2.4.6 customers.

— Reply to this email directly, view it on GitHub https://github.com/magento/magento2/issues/37534#issuecomment-1664670248, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQJYIRNP2OENNRYNMIDBOTXTQJ35ANCNFSM6AAAAAAYNFKIWY . You are receiving this because you were mentioned.Message ID: @.***>

ihaveathumb avatar Aug 03 '23 23:08 ihaveathumb

Is there any update on this?

joemstar avatar Sep 12 '23 14:09 joemstar

Hello @joemstar,

The fix will be published tomorrow, September 14 around noon CST at https://experienceleague.adobe.com/docs/commerce-knowledge-base/kb/overview.html?lang=en

chernenm avatar Sep 13 '23 22:09 chernenm

The fix is available here https://experienceleague.adobe.com/docs/commerce-knowledge-base/kb/troubleshooting/known-issues-patches-attached/ups-shipping-method-integration-migration-from-soap-to-restful-api.html

chernenm avatar Sep 14 '23 16:09 chernenm

Thank you @chernenm! That's good to see.

rhoerr avatar Sep 14 '23 19:09 rhoerr

@chernenm for 2.4.3-p1 patch is applying?

laconica-vasilij avatar Sep 15 '23 15:09 laconica-vasilij

hello @laconica-vasilij, the patch is only applicable for supported versions of Adobe Commerce and Magento Open Source which are 2.4.4+

chernenm avatar Sep 15 '23 15:09 chernenm

Applied the patch, anyone know how to get credentials from UPS?

maxq avatar Sep 19 '23 18:09 maxq

Applied the patch, anyone know how to get credentials from UPS?

Look at the instructions https://developer.ups.com/get-started. You need to create an application to receive API keys

laconica-vasilij avatar Sep 26 '23 11:09 laconica-vasilij

Their API signup is so bad you go through all the steps then get this. There is a non-technical issue with your request, in order to resolve it you will need to complete and submit the requested information. [Click Here to Resolve] so you click on it and get HTTP 400 bad request.

See this stuff so much nowadays wonder who's coding this stuff.

Also love this little gem. ups-logic

maxq avatar Sep 26 '23 13:09 maxq

Did this work for anyone? I applied patch to 2.4.5 but getting an error

image

I pin pointed the issue and it looks like its related to the fact that response is not sending any shipping codes like the following.

image

Instead response from UPS is coming back as this

image

Which does not match up with anything that we have in Magento

timur-gafarov-acadaca avatar Sep 27 '23 19:09 timur-gafarov-acadaca

@timur-gafarov-acadaca I have tried to reproduced this on 2.4.5 on both local and cloud instance to be sure, but the issue is not there . I see the UPS methods with shipping rates.
 Screenshot 2023-09-28 at 12 24 03 PM

The codes that you are seeing are the UPS Rating API response that we get back after the rating request, here is a chunked sample from response:
 "RatedShipment": [ { "Disclaimer": { "Code": "05", "Description": "Rate excludes VAT. Rate includes a fuel surcharge, but excludes taxes, duties and other charges that may apply to the shipment." }, "Service": { **"Code": "01",** "Description": "" }, "RatedShipmentAlert": [ { "Code": "119001", "Description": "Additional Handling has automatically been set on Package 1." }, { "Code": "110971", "Description": "Your invoice may vary from the displayed reference rates" } ], "BillingWeight": { "UnitOfMeasurement": { "Code": "LBS", "Description": "Pounds" }, "Weight": "100.0" }, "TransportationCharges": { "CurrencyCode": "USD", "MonetaryValue": "321.11" }, "ServiceOptionsCharges": { "CurrencyCode": "USD", "MonetaryValue": "32.50" }, "TotalCharges": { "CurrencyCode": "USD", "MonetaryValue": "353.61" }, "NegotiatedRateCharges": { "TotalCharge": { "CurrencyCode": "USD", "MonetaryValue": "181.75" } }, "GuaranteedDelivery": { "BusinessDaysInTransit": "1", "DeliveryByTime": "10:30 A.M." }, "RatedPackage": { "TransportationCharges": { "CurrencyCode": "USD", "MonetaryValue": "321.11" }, "ServiceOptionsCharges": { "CurrencyCode": "USD", "MonetaryValue": "32.50" }, "TotalCharges": { "CurrencyCode": "USD", "MonetaryValue": "353.61" }, "Weight": "100.0", "BillingWeight": { "UnitOfMeasurement": { "Code": "LBS", "Description": "Pounds" }, "Weight": "100.0" } } }]

The Allowed methods are the methods that are mapped with the response codes under the UPS module using a helper configuration.
Please explain your concern if any regarding the codes and give us the steps on how the issue is coming for you.

glo05363 avatar Sep 28 '23 09:09 glo05363

@glo05363 I was doing testing in admin, so possibly only admin is broken. Can you pls also try placing order via Admin?

timur-gafarov-acadaca avatar Sep 28 '23 12:09 timur-gafarov-acadaca

@timur-gafarov-acadaca I have checked using admin interface and i can see the Rates data, Please check your configuration settings . Screenshot 2023-09-28 at 6 51 46 PM

glo05363 avatar Sep 28 '23 13:09 glo05363

@glo05363 I double checked the code and pretty sure there is a bug somewhere. Via XDEBUG I found the place where UPS codes are being compared with local Magento codes.

image

vendor/magento/module-ups/Model/Carrier.php:1346

Here its looking for 01 code in the list of Magento codes that don't map to this format. In this screenshot you can see values of allowed methods array which stores codes differently in alphanumeric format.

Configuration settings look fine as I am able to get a similar response from UPS like you pasted before. The problem is that its not getting processed correctly and possibly skipping process that you mentioned related to Helper mapper. Please make sure that your patch is applied and that settings are in fact using the new REST authentication method.

image

timur-gafarov-acadaca avatar Sep 28 '23 14:09 timur-gafarov-acadaca